/* 基本設定 */
/* style.css の基本設定を修正 */
:root {
    --gold: #8d7d66;
    --bg-color: #fcfaf8; /* 温かみのあるベージュに戻す */
    --text-color: #333;
    --white: #ffffff;
}
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Shippori Mincho', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 2;
    text-align: center;
}

/* メインビジュアル */
/* --- スライドショーの設定 --- */

.hero {
    position: relative; /* 子要素の基準にする */
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
}

.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* コンテンツの後ろに配置 */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* 最初は透明 */
    animation: slideAnimation 15s infinite; /* 15秒かけてループ */
}

/* 1枚目：すぐ開始 */
.slide:nth-child(1) {
    animation-delay: 0s;
}
/* 2枚目：5秒遅れて開始 */
.slide:nth-child(2) {
    animation-delay: 5s;
}
/* 3枚目：10秒遅れて開始 */
.slide:nth-child(3) {
    animation-delay: 10s;
}

/* アニメーションの内容（ふわっと消えて次が出る） */
@keyframes slideAnimation {
    0% {
        opacity: 0;
        transform: scale(1.0); /* 最初は等倍 */
    }
    10% {
        opacity: 1; /* 10%の地点で完全表示 */
    }
    33% {
        opacity: 1; /* 33%まで表示を維持 */
    }
    43% {
        opacity: 0; /* 43%で透明に */
    }
    100% {
        opacity: 0;
        transform: scale(1.1); /* じわじわ拡大して奥行きを出す */
    }
}

/* 重なりを調整するためのオーバーレイ（画像の上に薄い膜を張って文字を読みやすくする） */
.slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 黒い半透明の膜 */
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin: 10px 0;
    font-weight: 400;
    letter-spacing: 0.3rem;
}

.hero-content .subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
}

.hero-content .date {
    font-size: 1.5rem;
    border-top: 1px solid var(--white);
    display: inline-block;
    padding-top: 10px;
}

/* コンテンツレイアウト */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px;
    background-color: rgba(255, 255, 255, 0.9); /* 薄い白背景 */
    border-radius: 10px;
}

.section-title {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 0.2rem;
}

.message-body {
    margin-bottom: 80px;
}

.signature {
    margin-top: 30px;
    text-align: right;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* 区切り線 */
.divider {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 60px auto;
    width: 50%;
}

/* 情報カード */
.info-card {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: left;
}

.info-card dl {
    margin: 0;
}

.info-card dt {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 5px;
}

.info-card dd {
    margin-left: 0;
    margin-bottom: 25px;
}

.map-link {
    color: var(--gold);
    text-decoration: underline;
    font-size: 0.9rem;
}

/* ボタン */
.rsvp-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 18px 50px;
    background-color: var(--gold);
    color: var(--white);
    text-decoration: none;
    border-radius: 40px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.rsvp-btn:hover {
    background-color: #6e614f;
    transform: translateY(-2px);
}

.footer {
    padding-bottom: 50px;
    font-size: 0.8rem;
    color: #999;
}

/* --- プロフィール全体（左右50%・互い違い改修版） --- */
.profile-section {
    padding: 80px 0;
    background-color: #fff;
}

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 60px; /* 新郎と新婦のブロックの間の余白 */
}

/* 左右50%に分割する共通の行スタイル */
.profile-row {
    display: flex;
    align-items: center; /* 縦方向の中央揃え */
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border-radius: 8px;
    overflow: hidden; /* 写真の角丸を適用するため */
    width: 100%;
}

/* ★新婦のみ左右を反転させて互い違いにする設定 */
.profile-row.bride-reverse {
    flex-direction: row-reverse;
}

/* 左右半分の画像ブロック */
.profile-img-block {
    width: 50%;
    height: 400px; /* PCでの写真の高さ。お好みに応じて調整してください */
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* 左右半分のテキストブロック */
.profile-text-block {
    width: 50%;
    padding: 40px 50px;
    text-align: left; /* 文字を左揃えにして読みやすく */
    box-sizing: border-box;
}

.profile-text-block h3 {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.15rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.profile-text-block .name {
    font-size: 1.6rem;
    margin: 0 0 20px 0;
    font-weight: bold;
    color: #222;
}

.profile-text-block .bio {
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0;
}

/* --- スマホ・タブレット用のレスポンシブ対応 --- */
@media (max-width: 768px) {
    .profile-row, 
    .profile-row.bride-reverse {
        flex-direction: column; /* スマホでは上画像・下文字の縦並びに統一 */
    }
    
    .profile-img-block {
        width: 100%;
        height: 300px; /* スマホでの写真の高さ */
    }
    
    .profile-text-block {
        width: 100%;
        padding: 30px 20px;
        text-align: center; /* スマホではセンター寄せが見栄え良いため */
    }
}

/* --- スクロールアニメーションの設定 --- */

/* 初期状態：透明で少し下に配置 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.2s ease;
}

/* 表示された時：不透明にして元の位置へ */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- 4. 光の粒のアニメーション --- */
/* --- 4. シャボン玉（バブル）のアニメーション --- */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999; /* メインコンテンツの手前、メニューなどの邪魔をしない重なり */
    overflow: hidden;
    pointer-events: none; /* マウス操作を透過させる */
    background: transparent;
}

/* シャボン玉の基本デザイン */
.particle.bubble {
    position: absolute;
    bottom: -100px; /* 画面の下（外側）からスタート */
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    
    /* シャボン玉の虹色の光の反射をグラデーションで表現 */
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.6),
        inset -5px -5px 15px rgba(141, 125, 102, 0.2), /* テーマ色のゴールドをほのかにブレンド */
        inset 5px 5px 15px rgba(100, 181, 82, 0.2),    /* 封筒のグリーンをほのかにブレンド */
        0 4px 10px rgba(0, 0, 0, 0.05);
        
    animation: bubbleRise 12s infinite ease-in-out;
    opacity: 0;
}

/* 写真入りのシャボン玉専用の追加スタイル */
.particle.bubble.has-photo {
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay; /* 写真とシャボン玉の質感を融合させる */
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* style.css の最下部付近にあるアニメーションを修正 */

@keyframes bubbleRise {
    0% {
        /* スタート位置（画面外の下側） */
        transform: translateY(100px) scale(0.8);
        opacity: 0;
    }
    5% {
        opacity: 0.85;
    }
    90% {
        opacity: 0.85;
    }
    100% {
        /* 上昇距離（マイナス方向）を指定。
           .particles 自体の height: 3500px の頂点までしっかり登りきるように設定 */
        transform: translateY(-3550px) scale(1.1);
        opacity: 0;
    }
}

/* 十字の光の土台 */
.particle.star {
    background: #fff;
    box-shadow: 0 0 15px 3px rgba(255, 255, 255, 0.9);
}

/* 十字の横線・縦線を作成 */
.particle.star::before,
.particle.star::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

/* 縦棒 */
.particle.star::before {
    width: 2px;
    height: 200%; /* 粒の2倍の長さ */
}

/* 横棒 */
.particle.star::after {
    width: 200%;
    height: 2px;
}

/* --- 3. 時間差フェードイン --- */
/* 2番目のカードだけ表示を0.5秒遅らせる */
.profile-card:nth-child(2).active {
    transition-delay: 0.5s;
}

/* カウントダウンの見た目 */
#timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.time-unit {
    background: var(--white);
    padding: 15px;
    min-width: 80px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.time-unit span {
    display: block;
    font-size: 2rem;
    color: var(--gold);
    font-weight: bold;
}
.time-unit p {
    font-size: 0.7rem;
    margin: 0;
    text-transform: uppercase;
}

/* --- 封筒アニメーション（コリス参考バージョンアップ版） --- */

#opening-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #f5f5f5; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.envelope-wrapper {
    position: relative;
    perspective: 800px; /* 蓋が開く時の3D立体感を出すための設定 */
}

/* 封筒本体（ベースサイズ） */
.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background-color: #e1ead1; /* 封筒の背面の壁（緑） */
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);
}

/* 1. 封筒の蓋（パカっと上に180度回転する） */
/* ==========================================================================
   封筒の蓋（flap）とシールの修正（上から下に閉じる一般的な封筒用）
   ========================================================================== */

/* 1. 封筒の蓋（逆三角形パーツ） */
.flap {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 110px solid #cbd9ad; /* 蓋の色（少し濃い緑） */
    transform-origin: top center;
    transition: transform 2.0s ease-in-out; /* 動き確認用のスロー */
    z-index: 4; /* 前面パーツや手紙より上に配置 */
    backface-visibility: visible;
    
    /* 【重要】子要素（シール）を平面的に埋没させず、立体的に手前へ配置する設定 */
    transform-style: preserve-3d;
}

/* 2. ミッキー風シール：蓋の先端（一番下）の手前にジャストフィット */
.mickey-seal {
    position: absolute;
    
    /* 【解説】
        border-topで作った蓋の逆三角形の先端は、上から「110px」下にあります。
        そのため「top: -110px;」と指定することで、ちょうど先端の位置に重なります。
        ここから数値を微調整（例: -105px や -115px）することで上下にずらせます。
    */
    top: -30px; 
    left: -22px; /* 自身の幅(44px)の半分マイナスして中央寄せ */
    
    width: 44px;
    height: 44px;
    background: #64b552; /* シールの濃い緑 */
    border-radius: 50%;
    
    /* 【最重要】蓋(z-index:4)の「面」よりも手前に強制配置 */
    z-index: 10; 
    transform: translateZ(1px); /* 3D空間上で1ピクセル手前に浮かせます */
    
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
}

/* シールの耳パーツも同様に手前へ */
.mickey-seal::before,
.mickey-seal::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: #64b552;
    border-radius: 50%;
    z-index: 10;
}
.mickey-seal::before { top: -8px; left: -12px; } /* 左耳 */
.mickey-seal::after { top: -8px; right: -12px; } /* 右耳 */

/* 2. 封筒の前面パーツ（これのおかげで手紙が「中から」出てくるように見えます） */
.envelope-base {
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-bottom: 110px solid #e1ead1; /* 前面のV字ライン（緑） */
    z-index: 3; /* 手紙（z-index: 2）より手前 */
}

/* 【新規追加】封筒の前面パーツ：左の三角 */
.envelope-left {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
    border-left: 160px solid #e1ead1; /* 本体の緑 */
    z-index: 3;
}

/* 【新規追加】封筒の前面パーツ：右の三角 */
.envelope-right {
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
    border-right: 160px solid #e1ead1; /* 本体の緑 */
    z-index: 3;
}

/* 3. 中の便箋（純白・ロゴなし） */
.letter {
    position: absolute;
    bottom: 10px; /* 封筒の内側に収まる初期位置 */
    left: 15px;
    width: 290px;
    height: 190px;
    background: #ffffff;
    z-index: 2; /* 蓋(4)や前面(3)の後ろ、封筒背面(1)の前 */
    /* transition の最後に z-index の変化ルールを追加します */
    transition: transform 3.0s cubic-bezier(0.25, 1, 0.5, 1) 2.5s, 
                z-index 3.0s step-end 2.5s; /* 3秒間の待機（蓋が開くのを待つ間）は 0 を維持し、その後 2 に切り替える */
    box-shadow: 0px 0px 10px rgba(0,0,0,0.05);
}

/* --- アニメーション実行時の動き --- */

/* 蓋がシールごと上にパカっと開く（裏返る） */
.envelope.open .flap {
    transform: rotateX(180deg) ;
    z-index: 1; /* 回転した後は手紙の「後ろ」に隠れるようにz-indexを下げる */
    transition: transform 1.4s ease-in-out, 
                z-index 1.4s step-end 1.4s;
}

/* 手紙（便箋）が上にせり上がる */
.envelope.open .letter {
    transform: translateY(-100px); /* 上にスライド */
    z-index: 2;
}

/* 画面が光る演出（変更なし） */
.flash-white {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 10001;
    transition: opacity 6.0s ease;
}
.flash-active { opacity: 1 !important; }
/* スマホ対応 */
@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .info-card {
        padding: 30px 20px;
    }
}
/* --- アルバムセクション（スライダー版）のスタイル --- */
.album-section {
    padding: 60px 0 30px 0;
    width: 100%;
    position: relative;
}

/* カルーセル全体のラッパー（矢印とスライダーを並べる） */
.carousel-wrapper {
    position: relative;
    max-width: 500px; /* PCでの最大表示サイズ */
    width: 90%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* スライダーの表示窓（1枚分だけ見せる） */
.carousel-container {
    width: 100%;
    height: 450px; /* 写真を表示する高さ（お好みに合わせて調整してください） */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    background-color: #f5f2ed; /* 写真の縦横比が異なる場合の余白背景色（薄いベージュ） */
    position: relative;
}

/* スライドが横に並ぶトラック */
.carousel-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.4s ease-in-out; /* スライドが切り替わるスピード */
}

/* 各スライドの枠 */
.carousel-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ★超重要：写真の比率を維持する設定 */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 縦横比を完全に維持し、枠内に全体を収める */
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
}

/* 左右の矢印ボタン共通スタイル */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e0dcd5;
    color: var(--gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: var(--gold);
    color: #fff;
}

.prev-btn { left: -22px; } /* 枠から少しはみ出させて上品に配置 */
.next-btn { right: -22px; }

/* ページネーション（ドット）のスタイル */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dcd7cd;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: var(--gold); /* 現在表示中のドットをゴールドに */
}

/* スマホ用のサイズ微調整 */
@media (max-width: 600px) {
    .carousel-container {
        height: 350px; /* スマホでは少し高さを低くしてバランスを取る */
    }
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .prev-btn { left: -10px; }
    .next-btn { right: -10px; }
}