/* LP Frontend Styles */

html {
    scroll-behavior: smooth;
}

/* Contact LP Page Specific Styles */
.contact-lp-page .lp-container {
    max-width: 450px;
    margin: 0 auto;
}

.contact-lp-page .contact-lp-content {
    width: 100%;
}

/* Fade-in Animation (Block-level) */
.lp-fade-element {
    opacity: 0 !important;
    transform: translate(var(--lp-fade-translate-x, 0px),
            var(--lp-fade-translate-y, 30px));
    transition-property: opacity, transform;
    transition-timing-function: ease-out;
    transition-duration: var(--lp-fade-duration, 1s);
    will-change: opacity, transform;
}

.lp-fade-element.lp-fade-vars-setting {
    transition-property: none;
    transition-duration: 0s;
}

.lp-fade-element.lp-fade-in-active {
    opacity: 1 !important;
    transform: translate(0px, 0px);
}

/* Fade-in Animation (Element-level inside FreeLayout canvas)
 * Canvas elements already have inline transform (translate + rotate).
 * We override transform on the wrapper and restore the original on active. */
.bks-freelayout-element.lp-fade-element {
    opacity: 0 !important;
    transition-property: opacity, transform;
    transition-timing-function: ease-out;
    transition-duration: var(--lp-fade-duration, 1s);
    will-change: opacity, transform;
}

.bks-freelayout-element.lp-fade-element.lp-fade-vars-setting {
    transition-property: none;
    transition-duration: 0s;
}

.bks-freelayout-element.lp-fade-element.lp-fade-in-active {
    opacity: 1 !important;
}

/* Pulse Animation
 * 心臓の鼓動のように要素が拡大・縮小するアニメーション。
 * IntersectionObserver で画面内に入ったときに再生開始。 */
@keyframes lp-pulse-beat {

    0%,
    100% {
        transform: var(--lp-pulse-base-transform, translate(0px, 0px)) scale(1);
    }

    50% {
        transform: var(--lp-pulse-base-transform, translate(0px, 0px)) scale(1.05);
    }
}

.lp-pulse-element.lp-pulse-active {
    animation-name: lp-pulse-beat;
    animation-duration: var(--lp-pulse-duration, 1s);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform;
    transform-origin: var(--lp-pulse-origin, center) !important;
}

/* Canvas 要素用パルス（inline transform を保持） */
.bks-freelayout-element.lp-pulse-element.lp-pulse-active {
    animation-name: lp-pulse-beat;
    animation-duration: var(--lp-pulse-duration, 1s);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform;
    transform-origin: var(--lp-pulse-origin, 50% 50%) !important;
}

/* Swing Animation
 * シーソーのように左右に揺れるアニメーション。
 * IntersectionObserver で画面内に入ったときに再生開始。 */
@keyframes lp-swing-sway {

    0%,
    100% {
        transform: var(--lp-swing-base-transform, translate(0px, 0px)) rotate(5deg);
    }

    50% {
        transform: var(--lp-swing-base-transform, translate(0px, 0px)) rotate(-5deg);
    }
}

.lp-swing-element.lp-swing-active {
    animation-name: lp-swing-sway;
    animation-duration: var(--lp-swing-duration, 1s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    transform-origin: var(--lp-swing-origin, center) !important;
}

/* Canvas 要素用スイング（inline transform を保持） */
.bks-freelayout-element.lp-swing-element.lp-swing-active {
    animation-name: lp-swing-sway;
    animation-duration: var(--lp-swing-duration, 1s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    transform-origin: var(--lp-swing-origin, 50% 50%) !important;
}

/* Shine Animation
 * 小さな白い光が回転しながら急速に拡大して消えるフラッシュ型アニメーション.
 * ::before 疑似要素で白い光源を作成し、scale + rotate(45deg) で拡大.
 * overflow: hidden で要素境界内にクリップ.
 * IntersectionObserver で画面内に入ったときに再生開始。 */
@keyframes lp-shine-sweep {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }

    80% {
        transform: scale(0) rotate(45deg);
        opacity: 0.5;
    }

    81% {
        transform: scale(4) rotate(45deg);
        opacity: 1;
    }

    100% {
        transform: scale(50) rotate(45deg);
        opacity: 0;
    }
}

.lp-shine-element {
    position: relative;
    overflow: hidden;
}

.lp-shine-element.lp-shine-active::before {
    content: '';
    position: absolute;
    display: inline-block;
    top: -180px;
    left: 0;
    width: 30px;
    height: 100%;
    background-color: rgba(255, 255, 255, 1);
    animation: lp-shine-sweep var(--lp-shine-duration, 2.5s) ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Echo Animation
 * 音が反響するように波紋（残像）が外側へ広がるアニメーション.
 * filter: drop-shadow() を使用し、要素の実際の形状（透明部分含む）に沿って光が広がる.
 * 範囲・カラーはユーザー設定可能。JS 側で Web Animations API を用いて動的にアニメーションを適用する.
 * (.lp-echo-active クラスは JS によるアニメーション開始のトリガーとして使用) */

/* Swing / Pulse / Echo: アニメーションで要素がはみ出すのを防ぐ */
.lp-freelayout-stage {
    overflow: hidden;
}

/* Base LP Page Styles (Shared logic with Contact LP but kept separate for safety) */
body.lp-page {
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    /* background-image handled via inline style */
    /* global padding handled via inline style on container or body? Currently container. */
}

body.lp-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    /* background-color handled via inline style */
}

body.lp-page .lp-main {
    position: relative;
    z-index: 2;
}

@media screen and (max-width: 450px) {
    body.lp-page::before {
        display: none;
    }
}

body.lp-page .lp-fixed-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 450px;
    width: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

body.lp-page .lp-fixed-footer.is-visible {
    opacity: 1;
    visibility: visible;
}

body.lp-page .lp-fixed-footer--one {
    width: 100%;
}

body.lp-page .lp-fixed-footer--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

body.lp-page .lp-fixed-footer--three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
}

body.lp-page .lp-fixed-footer__button {
    display: block;
    line-height: 0;
    flex: 1;
    max-width: 225px;
}

body.lp-page .lp-fixed-footer--one .lp-fixed-footer__button {
    max-width: 450px;
}

body.lp-page .lp-fixed-footer__button img {
    width: 100%;
    height: auto;
    display: block;
}

body.lp-page .lp-marquee {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: transparent;
    z-index: 1;
    pointer-events: none;
}

body.lp-page .lp-marquee__track {
    display: flex;
    white-space: nowrap;
    animation: lp-marquee-scroll var(--marquee-speed, 60s) linear infinite;
}

body.lp-page .lp-marquee__text {
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-transform: uppercase;
}

@keyframes lp-marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

body.lp-page .lp-container {
    position: relative;
    z-index: 2;
}

@media screen and (max-width: 450px) {
    body.lp-page .lp-marquee {
        display: none;
    }
}

body.lp-page .lp-exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.lp-page .lp-exit-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

body.lp-page .lp-exit-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 99999;
    max-width: 90vw;
    max-height: 90vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

body.lp-page .lp-exit-popup.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

body.lp-page .lp-exit-popup__inner {
    position: relative;
    display: inline-block;
}

body.lp-page .lp-exit-popup__close {
    top: 0px;
    right: 0px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    position: absolute;
    background-color: #ffffff00;
    border: 2px solid #ffffff00;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 1;
}



body.lp-page .lp-exit-popup__close:active {
    transform: scale(0.95);
}

body.lp-page .lp-exit-popup__link {
    display: block;
    line-height: 0;
}

body.lp-page .lp-exit-popup__image {
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media screen and (max-width: 768px) {
    body.lp-page .lp-exit-popup__image {
        max-width: 85vw;
    }

}

/* --- Breadcrumbs --- */
.lp-breadcrumbs-wrapper {
    padding: 8px 16px;
    border-radius: 4px;
}

.lp-breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    font-size: 13px;
    line-height: 1.4;
    color: #999999;
    overflow-x: auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.lp-breadcrumbs__list::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.lp-breadcrumbs__item {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.lp-breadcrumbs__link {
    color: #999999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lp-breadcrumbs__link:hover {
    color: #666;
    text-decoration: underline;
}

.lp-breadcrumbs__separator {
    margin: 0 8px;
    color: #999999;
    font-size: 10px;
}

.lp-breadcrumbs__current {
    color: #313131;
    white-space: nowrap;
    font-weight: 500;
}

@media screen and (max-width: 480px) {
    .lp-breadcrumbs-wrapper {
        padding: 6px 12px;
    }

    .lp-breadcrumbs__current {
        max-width: 120px;
    }
}

/* --- Archive & Post Grid --- */
.archive-header {
    margin-bottom: 24px;
    padding: 0 16px;
}

.archive-title {
    font-size: 22px;
    color: #313131;
    margin: 0;
    text-align: center;
}

.lp-post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 16px;
    margin-bottom: 40px;
}

.lp-post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f7f7f7;
}

.lp-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lp-post-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.lp-post-card__thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}

.lp-post-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-post-card__content {
    padding: 12px 8px;
}

.lp-post-card__title {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 8px;
    color: #313131;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lp-post-card__date {
    font-size: 11px;
    color: #999;
    display: block;
}

/* Load More Button */
.lp-load-more-container {
    text-align: center;
    margin-bottom: 60px;
}

.lp-load-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    border: 1px solid #313131;
    background: #fff;
    color: #313131;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.lp-load-more-button:hover {
    background: #313131;
    color: #fff;
}

.lp-load-more-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loader Animation */
.lp-loader {
    width: 18px;
    height: 18px;
    border: 2px solid #313131;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: lp-spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes lp-spin {
    to {
        transform: rotate(360deg);
    }
}

@media screen and (max-width: 480px) {
    .lp-post-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Single Post Styling --- */
.entry-body {
    padding: 0 16px 16px;
}

.entry-title {
    font-size: var(--lp-post-h1-size, 22px);
    line-height: 1.3;
    color: var(--lp-post-h1-color, #313131);
    margin-bottom: 16px;
}

.entry-date {
    font-size: var(--lp-post-date-size, 12px);
    color: var(--lp-post-date-color, #666);
    text-align: right;
    margin-bottom: 14px;
}

.entry-content {
    font-size: var(--lp-post-content-size, 16px);
    line-height: 1.5;
    color: var(--lp-post-content-color, #313131);
}

.entry-content p {
    margin: 0;
}

/* 空の段落や空行（1行あけた改行）を維持するための設定 */
.entry-content p:empty::before {
    content: "\00a0";
}

.entry-content p:empty,
.entry-content p:has(> br:only-child) {
    min-height: 1.5em;
}