/* ==========================================================================
   Luz Coffee & Press - カスタムスタイル
   ========================================================================== */

/* ノイズテクスチャオーバーレイ（紙の質感） */

/* ==========================================================================
   手描きSVGデコレーション
   ========================================================================== */

.svg-deco {
    overflow: visible;
    fill: none;
    stroke: #D4AF37;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.35;
}

.svg-deco path,
.svg-deco circle,
.svg-deco line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: none;
}

/* スクロールで描画開始 */
.svg-deco.is-visible path,
.svg-deco.is-visible circle,
.svg-deco.is-visible line {
    animation: svg-draw 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes svg-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* 湯気の揺らめき */
.svg-deco .steam {
    stroke: #4A5D74;
    opacity: 0.4;
}

.svg-deco.is-visible .steam {
    animation: svg-draw 2s ease forwards, steam-sway 3s ease-in-out 2s infinite;
}

@keyframes steam-sway {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(1px) translateY(-1px);
    }

    75% {
        transform: translateX(-1px) translateY(-0.5px);
    }
}

/* 葉っぱの揺れ */
.svg-deco.is-visible .leaf {
    animation: svg-draw 2s ease forwards, leaf-sway 4s ease-in-out 2s infinite;
    transform-origin: center bottom;
}

@keyframes leaf-sway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

/* ページのふわっと */
.svg-deco.is-visible .page-line {
    animation: svg-draw 2.5s ease forwards;
}

/* コーヒー豆の回転 */
.svg-deco.is-visible .bean {
    animation: svg-draw 2s ease forwards, bean-bob 5s ease-in-out 2s infinite;
    transform-origin: center;
}

@keyframes bean-bob {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-2px) rotate(2deg);
    }
}

/* コンパスの揺れ */
.svg-deco.is-visible .compass-needle {
    animation: svg-draw 2s ease forwards, compass-sway 6s ease-in-out 2s infinite;
    transform-origin: center;
}

@keyframes compass-sway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    75% {
        transform: rotate(-5deg);
    }
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

/* ==========================================================================
   オープニングアニメーション
   ========================================================================== */

#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F9F9F7;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    /* フォールバック: JSが読み込めなくても5秒後に自動で消える */
    animation: overlay-fallback 0.8s ease 6s forwards;
}

#opening-overlay.fade-out {
    animation: overlay-fade 1.4s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

@keyframes overlay-fade {
    0% {
        clip-path: inset(0 0 0 0);
    }

    100% {
        clip-path: inset(0 0 100% 0);
    }
}

@keyframes overlay-fallback {
    0% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* SVGロゴ */
.opening-logo {
    width: 140px;
    max-width: 40vw;
    overflow: visible;
    fill: none;
    stroke: #D4AF37;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.opening-logo path,
.opening-logo circle {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

/* Step 1: カップ本体の描画 */
.opening-logo.draw .cup-body {
    animation: logo-draw 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Step 2: 文字「Luz」の描画（0.6s遅延） */
.opening-logo.draw .luz-letter {
    animation: logo-draw 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

/* Step 3: 湯気（1.2s遅延 → ループ） */
.opening-logo.draw .opening-steam {
    stroke: #4A5D74;
    opacity: 0.5;
    stroke-width: 0.8;
    animation: logo-draw 1.2s ease 1.2s forwards, steam-sway 3s ease-in-out 2.4s infinite;
}

@keyframes logo-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* サブテキスト */
.opening-sub {
    font-family: 'Cormorant Garamond', serif;
    font-size: 10px;
    color: #999;
    letter-spacing: 0.5em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
    margin-top: 16px;
}

.opening-sub.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   インクにじみテキストアニメーション
   ========================================================================== */

.ink-anim {
    opacity: 0;
}

.ink-anim.active {
    opacity: 1;
}

.ink-char {
    display: inline-block;
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.1);
    will-change: opacity, filter, transform;
}

@keyframes ink-print {
    0% {
        opacity: 0;
        filter: blur(12px);
        transform: scale(1.1);
    }

    50% {
        opacity: 0.8;
        filter: blur(4px);
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.ink-anim.active .ink-char {
    animation: ink-print 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ==========================================================================
   スクロールアニメーション
   ========================================================================== */

.fade-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 画像リビール（ズームアウト） */
.reveal-image {
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    will-change: opacity, transform;
    overflow: hidden;
}

.reveal-image.is-visible {
    opacity: 1;
    transform: scale(1.0);
}

/* パララックスエフェクト */
.parallax-wrapper {
    overflow: hidden;
    position: relative;
}

.parallax-img {
    will-change: transform;
    transition: transform 0.1s cubic-bezier(0, 0, 0.2, 1);
}

/* ==========================================================================
   メニューセクション
   ========================================================================== */

.menu-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    overflow: hidden;
}

.menu-item-name {
    flex-shrink: 0;
    max-width: 70%;
}

.menu-line {
    flex-grow: 1;
    border-bottom: 1px dotted #ccc;
    margin: 0 8px;
    opacity: 0.5;
    position: relative;
    top: -4px;
}

/* ==========================================================================
   ナビゲーション・ボタン
   ========================================================================== */

/* ナビホバーエフェクト */
nav a {
    transition: color 0.5s ease, letter-spacing 0.5s ease !important;
}

nav a:hover {
    letter-spacing: 0.25em !important;
}

/* モバイルメニュー */
#mobile-menu {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.open {
    transform: translateX(0);
}

/* ボタンホバー */
.btn-luz {
    transition: all 0.5s ease !important;
}

.btn-luz:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 93, 116, 0.1);
}

/* ==========================================================================
   トップに戻るボタン
   ========================================================================== */

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: #4A5D74;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#back-to-top:hover {
    background-color: #D4AF37;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    #back-to-top {
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
    }
}

/* ==========================================================================
   ライトボックス
   ========================================================================== */

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    padding: 20px;
}

#lightbox.active {
    opacity: 1;
    visibility: visible;
}

#lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* ==========================================================================
   記事本文（投稿ページ）
   ========================================================================== */

.post-content h2 {
    font-size: 1.3rem;
    color: #4A5D74;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-family: "Cormorant Garamond", serif;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.15rem;
    color: #4A5D74;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 2px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .post-content h2 {
        font-size: 1.5rem;
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
        margin-top: 2.5rem;
        margin-bottom: 1rem;
    }

    .post-content p {
        line-height: 2;
        font-size: 1rem;
    }

    .post-content img {
        margin: 2rem 0;
    }
}

.post-content blockquote {
    border-left: 4px solid #D4AF37;
    padding-left: 1rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
    background: #f0f0f0;
    padding: 1rem;
}

.post-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-content a {
    color: #4A5D74;
    text-decoration: underline;
}

.post-content a:hover {
    color: #D4AF37;
}