/* Thiết lập Font chữ và Màu sắc cơ bản */
:root {
    --primary-color: #7d2a2a; /* Màu đỏ đậm/nâu đỏ cho chữ script */
    --background-color: #f7f3ee; /* Màu kem nhạt */
    --text-color: #362323;
    --font-script: 'Great Vibes', cursive;
    --font-serif: 'Playfair Display', serif; 
    --font-signature: 'Sacramento', cursive; 
}

html { overflow-x: hidden; }

body {
    font-family: var(--font-serif);
    margin: 0 auto; 
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; 
    
    max-width: 500px; 
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); 
}

/* Hide vertical scrollbar UI but keep page scrollable */
html { scrollbar-width: none; }            /* Firefox */
body { -ms-overflow-style: none; }         /* IE/Edge legacy */
body::-webkit-scrollbar { width: 0; height: 0; } /* Chrome/Edge/Safari */

/* Cấu trúc chung */
.section {
    width: 100%;
    min-height: auto;
    text-align: center;
    box-sizing: border-box;
}

.padded-section {
    padding: 30px 20px;
}

.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- */
/* PHẦN MỚI: WELCOME VÀ KHOẢNG TRẮNG CHUYỂN TIẾP */
/* ---------------------------------------------------------------- */
.cover-top-content {
    background-color: var(--background-color); 
    width: 100%;
    
    /* Chiều cao 60px + khoảng cách 30px */
    height: 60px; 
    padding-top: 30px; 
    
    text-align: center;
    position: relative;
    z-index: 10; 
}

.cover-top-content h1 {
    font-family: var(--font-serif);
    font-size: 1.2em; 
    font-weight: 400;
    letter-spacing: 2px; 
    color: var(--text-color);
    margin: 0;
    text-transform: uppercase;
    line-height: 1.2;
}

.cover-top-content .serif {
  /* display: block; */
  font-family: 'Playfair Display', 'Cinzel', serif;
  font-size: clamp(1.8em, 4vw, 2.6em);
  letter-spacing: 2px;
  color: #111;
  text-transform: uppercase;
}
.cover-top-content .serif.thin {
  font-weight: 300;
  font-style: italic;
}

/* Dòng script nhỏ mềm */
.cover-top-content .script {
  display: inline-block;
  font-family: 'Great Vibes', 'Sacramento', cursive;
  font-size: 1.5em;
  color: #7d2a2a;
  margin-top: 1px;
}

/* Accent đỏ mềm (tạo cảm giác nơ / gạch dưới) */
.cover-top-content .accent::after {
  content: '';
  display: block;
  width: 60%;
  height: 1px;
  margin: 1px auto 0;
  background: #7d2a2a;
  opacity: 0.4;
}

/* (tuỳ chọn) chèn icon nốt nhạc hoặc nơ nhỏ */
.cover-top-content .serif em {
  font-style: italic;
  color: #7d2a2a;
  font-weight: 400;
}

/* ---------------------------------------------------------------- */
/* PHẦN 1: COVER VÀ ẢNH NỀN (Full Width 500px + Chuyển tiếp mờ + Căn trên) */
/* ---------------------------------------------------------------- */
#cover {
    height: 500px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    position: relative;
    background-color: var(--background-color); 
    z-index: 1; 
}

/* Lớp ảnh nền chính và hiệu ứng mờ */
.cover-background {
    background-image: 
        /* 1. HIỆU ỨNG MỜ TỪ TRÊN XUỐNG: Chuyển từ màu nền (0% tại đỉnh) sang trong suốt. */
        linear-gradient(to bottom, var(--background-color) 0%, rgba(247, 243, 238, 0) 12%),
        
        /* 2. Gradient MỜ DẦN Ở ĐÁY: Chuyển từ màu nền lên trong suốt */
        linear-gradient(to top, var(--background-color) 0%, rgba(247, 243, 238, 0.5) 15%, rgba(0, 0, 0, 0) 40%),
        
        /* 3. Ảnh chính (FULL WIDTH 500PX) */
        url('images/anh-cuoi-chinh-dung.jpg'); 

    /* QUAN TRỌNG: Thiết lập kích thước/vị trí cho từng lớp ảnh */
    background-size: 
        100% 100%,  /* Gradient trên */
        100% 100%,  /* Gradient đáy */
        cover;      /* Ảnh: LẤP ĐẦY 500px CHIỀU NGANG */
        
    background-position: 
        center,         /* Gradient trên */
        center,         /* Gradient đáy */
        center top;     /* QUAN TRỌNG: CĂN CHỈNH ẢNH SÁT MÉP TRÊN ĐỂ KHÔNG BỊ MẤT PHẦN ĐỈNH */
        
    background-repeat: no-repeat;
    
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0; 
}


#cover h1, .date-cover {
    color: white; 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8); 
    z-index: 3; 
    
    transform: none; 
}

/* Chữ ngày tháng ở dưới ảnh */
.date-cover {
    font-size: 1.5em; 
    font-family: var(--font-serif);
    /* margin-top: 10px;  */
    font-weight: 700;
}

/* Các quy tắc CSS cho Made-by và các phần khác giữ nguyên như trước */
.made-by {
    font-size: 0.7em;
    position: absolute; 
    bottom: 10px;
    right: 10px;
    transform: rotate(-90deg);
    transform-origin: right bottom;
    padding: 0;
    white-space: nowrap;
    letter-spacing: 1px;
    z-index: 3;
    color: white;
}

/* ---------------------------------------------------------------- */
/* PHẦN 2 VÀ CÁC PHẦN KHÁC (Giữ nguyên) */
/* ---------------------------------------------------------------- */
.couple-info {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    margin-bottom: 40px;
}

.person-card {
    width: 45%;
    text-align: center;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    /* Viền hoà nền + vòng đỏ mảnh ngoài */
    box-shadow: 0 0 0 3px var(--background-color), 0 0 0 5px var(--primary-color);
    /* Mờ mép ảnh để blend vào nền */
    -webkit-mask-image: radial-gradient(circle at center, #000 85%, transparent 100%);
    mask-image: radial-gradient(circle at center, #000 85%, transparent 100%);
}

.role {
    font-size: 0.9em;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.name {
    font-size: 1.5em;
    margin-top: 0;
}

/* Đồng hồ Đếm ngược */
.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 26px;
    margin: 10px 0 18px;
    padding: 10px 0 0;
    position: relative;
    color: var(--primary-color); /* số và nhãn đều đỏ như ảnh */
    border: none; /* bỏ đường viền */
}

/* vệt mờ từ trên xuống như hình mẫu */
.countdown-timer::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.03), rgba(0,0,0,0.0));
    pointer-events: none;
}

.timer-box {
    font-size: 0.9em; /* nhãn nhỏ hơn số */
    line-height: 1.25;
    text-transform: none;
}

.timer-box span {
    display: block;
    font-size: 2.1em;
    font-weight: 700;
}

/* Hero ảnh nền trong section groom-bride (ảnh + mờ trên/dưới) */
#groom-bride { position: relative; padding-top: 360px; }
#groom-bride::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 360px; /* chiều cao vùng ảnh nền */
    background-image:
        linear-gradient(to bottom, var(--background-color) 0%, rgba(247,243,238,0) 45%), /* mờ từ trên xuống */
        linear-gradient(to top, var(--background-color) 0%, rgba(247,243,238,0) 55%),   /* mờ ở đáy ảnh */
        url('images/anh-cuoi-phu-1.jpg');
    background-size: 100% 100%, 100% 100%, cover;
    background-position: center top, center bottom, center top;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Đặt đồng hồ đếm ngược nổi lên trên ảnh nền */
#groom-bride .countdown-timer {
    position: absolute; top: 14px; left: 0; right: 0;
    margin: 0; padding: 0;
    gap: 28px;
    z-index: 2;
}
#groom-bride .countdown-timer::before { display: none; }

@media (max-width: 600px) {
  #groom-bride { padding-top: 320px; }
  #groom-bride::before { height: 320px; }
}

.intro-text {
    max-width: 80%;
    margin: 40px auto;
    font-style: italic;
    font-size: 1.1em;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .intro-text { max-width: 92%; margin: 24px auto; font-size: 1em; }
  .script-title { font-size: clamp(32px, 10vw, 44px); }
  .calendar-happiness { font-size: 34px; }
  .calendar-subtitle { font-size: .95em; }
  .calendar-grid { gap: 6px 8px; font-size: .95em; }
  .calendar-day--heart, .calendar-day--active { width: 28px; height: 28px; }
  .calendar-day--heart::before { inset: 3px; }
}

@media (max-width: 360px) {
  .padded-section .image-row,
  .padded-section .image-row.photo-2x2 { margin-left: -16px; margin-right: -16px; }
}

/* iPhone 14 Pro Max (~430px) giảm full-bleed để tránh dư mép */
@media (max-width: 430px) {
  .padded-section .image-row,
  .padded-section .image-row.photo-2x2 { margin-left: -18px; margin-right: -18px; }
}

/* ---------------------------------------------------------------- */
/* PHẦN 3: INVITATION (Giữ nguyên) */
/* ---------------------------------------------------------------- */
.script-title {
    font-family: var(--font-script);
    font-size: 4em;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.poem-text p {
    margin: 5px 0;
    font-size: 1.1em;
}

.red-text {
    color: var(--primary-color);
    font-style: italic;
    font-weight: bold;
    margin-top: 20px !important;
}

.full-width-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-top: 30px;
}

/* Mờ dần đầu và cuối ảnh để hòa với nền (Invitation) */
section#invitation .full-width-image {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 12%, #000 88%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 12%, #000 88%, rgba(0,0,0,0) 100%);
}

.fall-in-love {
    font-size: 1.2em;
    letter-spacing: 4px;
    color: var(--primary-color);
    margin-top: 40px;
    text-transform: uppercase;
}

/* Accent đỏ dạng script cho phần intro */
.intro-accent {
    font-family: var(--font-script);
    font-size: clamp(36px, 9vw, 56px);
    color: var(--primary-color);
    margin: 10px 0 6px;
}

/* Hàng chữ đỏ sau cụm ảnh: FALL IN — LOVE — WITH YOU */
.red-sep-words {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    letter-spacing: 3px;
    margin: 8px 0 16px;
    text-transform: uppercase;
    font-family: var(--font-serif);
}
.red-sep-words span { flex: 1; text-align: center; }
.red-sep-words span:nth-child(2){ flex: 0.8; }

/* --------------------------------------------------------------- */
/* Calendar overlay on invitation image */
/* --------------------------------------------------------------- */
#invitation .image-row { position: relative; }
.image-row { overflow: hidden; }
#invitation .calendar-overlay {
    margin-top: 10px;
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%);
    width: min(82%, 520px);
    background: rgba(255,255,255,0.60);
    border-radius: 60% 60% 16px 16px / 48% 48% 16px 16px; /* vòm cong như nửa hình tròn */
    box-shadow: 0 8px 26px rgba(0,0,0,0.12);
    padding: 18px 22px 20px;
    backdrop-filter: blur(4px);
}

.calendar-happiness {
    font-size: 40px;
    line-height: 1;
    color: var(--primary-color);
    text-align: center;
}

.calendar-subtitle { 
    text-align: center; 
    font-family: var(--font-serif); 
    margin: 6px 0 10px; 
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px 12px;
    text-align: center;
}

.calendar-day {
    color: var(--primary-color);
    font-weight: 500;
}

.calendar-day--muted { opacity: 0.45; }

.calendar-day--active {
    /* giữ style cũ (vòng tròn) nếu cần dùng nơi khác */
    color: #fff;
    background: var(--primary-color);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto;
}

/* Heart-highlighted days (ví dụ: 6 & 7) */
.calendar-day { position: relative; }
.calendar-day--heart {
  color: var(--primary-color);
  width: 32px; height: 32px;
  display: inline-flex; align-items:center; justify-content:center;
  margin: 0 auto; position: relative;
}
.calendar-day--heart::before{
  content: '';
  position: absolute; inset: 2px; /* viền không chạm mép */
  background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-8-6.5-8-11a5 5 0 0 1 9-3 5 5 0 0 1 9 3c0 4.5-8 11-8 11z' fill='none' stroke='%237d2a2a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  pointer-events: none; z-index: 0;
}

@media (max-width: 600px) {
  #invitation .calendar-overlay { width: 90%; padding: 1px 16px 16px; }
  .calendar-grid { gap: 8px 10px; }
}

/* ---------------------------------------------------------------- */
/* PHẦN 4: ADDRESS (Giữ nguyên) */
/* ---------------------------------------------------------------- */
.section-title {
    font-family: var(--font-serif);
    font-size: 2em;
    letter-spacing: 5px;
    margin-bottom: 10px;
}

.date-details {
    margin-bottom: 30px;
    font-size: 1.1em;
}

.map-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.map-address {
    padding: 10px 0;
    font-size: 0.9em;
}

/* ---------------------------------------------------------------- */
/* PHẦN 5: RSVP VÀ CHÂN TRANG (Giữ nguyên) */
/* ---------------------------------------------------------------- */
.thanks-text {
    max-width: 85%;
    margin: 0 auto 40px auto;
    font-size: 1.1em;
}

.rsvp-form-container {
    background: transparent;
    padding: 10px 12px 24px;
    border-radius: 6px;
    max-width: 520px;
    margin: 0 auto;
}

.rsvp-title {
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 2em;
    color: #5a3b2d;
    margin: 0 0 10px;
}

.rsvp-desc {
    max-width: 95%;
    margin: 0 auto 14px;
    color: #6e5a4e;
}

#attendance-form label, #attendance-form p {
    text-align: left;
    display: block;
    margin-bottom: 5px;
}

.rsvp-input {
    width: 100%;
    padding: 12px 16px;
    margin: 10px 0;
    border: 2px solid #6b4a39;
    border-radius: 999px;
    background: transparent;
    box-sizing: border-box;
}

.radio-group {
    text-align: left;
    margin: 14px 0 18px;
}

.radio-group label {
    display: block;
    margin: 8px 12px;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
}

.radio-box {
    border: 2px solid #6b4a39;
    border-radius: 18px;
    padding: 10px 6px;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1em;
    transition: all .2s ease;
}

.btn-outline { background: transparent; border: 2px solid #6b4a39; color: #6b4a39; }
.btn-outline:hover { background: #6b4a39; color: #fff; }

.donate-btn {
    display: block;
    text-decoration: none;
    background: #6b4a39;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    margin: 12px auto 0;
    max-width: 90%;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.donate-btn.bride { background: #5a3b2d; }
.form-message { margin-top: 12px; color: green; }

/* -------------------- Modal QR -------------------- */
.qr-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10000; }
.qr-modal.open { display: flex; }
.qr-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.qr-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: min(92vw, 420px);
    padding: 14px 14px 10px;
    box-shadow: 0 18px 48px rgba(0,0,0,.35);
    z-index: 1;
}
.qr-dialog img { display:block; width:100%; height:auto; border-radius: 6px; }
.qr-caption { text-align:center; margin: 8px 0 0; color:#5a3b2d; font-weight:600; }
.qr-close {
    position: absolute; top: -10px; right: -10px;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid #333; background:#fff; color:#333; cursor:pointer;
    display:flex; align-items:center; justify-content:center; font-size: 18px; line-height:1;
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

/* -------------------- Mobile tweaks -------------------- */
@media (max-width: 480px) {
  /* Schedule ribbons and boxes */
  .wedding-schedule .ribbon { padding: 10px 16px; font-size: 0.95em; }
  .wedding-schedule .ribbon-left { margin-left: 5%; }
  .wedding-schedule .ribbon-right { margin-right: 5%; }
  .wedding-schedule .event-box { max-width: 86%; padding: 8px 12px 10px 16px; }
  .wedding-schedule .event-box.shift-left { margin-left: 5%; }
  .wedding-schedule .event-box.shift-right { margin-right: 5%; }
  .wedding-schedule .event-time { font-size: 16px; }
  .wedding-schedule .event-date { font-size: 15px; }
  .wedding-schedule .addr-left, .wedding-schedule .addr-right { max-width: 92%; margin-left: auto; margin-right: auto; }

  /* RSVP */
  .rsvp-form-container { max-width: 520px; padding: 6px 8px 20px; }
  .rsvp-input { padding: 12px 14px; }
  .radio-box { padding: 10px; }
  .donate-btn { max-width: 100%; }

  /* Modal */
  .qr-dialog { width: 92vw; }
  .qr-close { top: -8px; right: -8px; width: 30px; height: 30px; }
}

@media (max-width: 360px) {
  .wedding-schedule .ribbon { font-size: 0.9em; }
  .wedding-schedule .event-time { font-size: 15px; }
  .wedding-schedule .event-date { font-size: 14px; }
}

.footer-text h2 {
    font-family: var(--font-serif);
    font-size: 2em;
    letter-spacing: 5px;
    margin-top: 50px;
}

.footer-text p {
    font-size: 1.5em;
    color: var(--primary-color);
}


/* --------------------------------------------------------------- */
/* Album Ảnh: Polaroid Collage (tilt, viền, bóng, tape)          */
/* + Biến thể Film Strip (thước phim)                            */
/* --------------------------------------------------------------- */
#album { position: relative; }
#album .script-title { margin-bottom: 16px; }
#album .film-wrap{ display: grid; gap: 22px; position: relative; overflow: visible; }

.album-collage {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 ảnh mỗi hàng */
    gap: 16px;
    max-width: 620px;
    margin: 0 auto;
}

/* Film strip layout: một hàng ngang cuộn, có lỗ thước phim trên/dưới */
.album-collage.film-strip {
  --film: #6c3b22;                        /* nâu thước phim */
  grid-template-columns: none;            /* bỏ lưới 3 cột */
  grid-auto-flow: column;                 /* xếp theo cột ngang */
  grid-auto-columns: 58%;                 /* mỗi khung nhỏ lại một chút */
  gap: 6px;                               /* khoảng cách khung nhỏ lại */
  overflow-x: auto;
  padding: 24px 12px;                     /* ray mỏng hơn, sát nội dung */
  border-radius: 10px;
  background: var(--film);
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
  position: relative;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  transform: rotate(-6deg); /* tilt base */
}
.album-collage.film-strip::before,
.album-collage.film-strip::after{
  content: '';
  position: absolute; left: 10px; right: 10px; height: 18px;
  background:
    /* lỗ nhỏ chữ nhật đều nhau */
    repeating-linear-gradient(to right, var(--background-color) 0 7px, transparent 7px 19px),
    var(--film);
  background-repeat: repeat, no-repeat;
  background-position: 12px 0, 0 0; /* dịch các lỗ khỏi sát mép để không hở viền */
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2) inset, 0 -1px 0 rgba(0,0,0,.2) inset;
  pointer-events: none;
}
.album-collage.film-strip::before{ top: 6px; }
.album-collage.film-strip::after { bottom: 6px; }

.album-collage.film-strip .polaroid{
  scroll-snap-align: start;
  background: #fff;                       /* nền sáng cho khung */
  border: 0;
  border-radius: 10px;
  padding: 6px;                            /* sát hơn */
  margin: 0;                               /* bỏ khoảng thừa */
  box-shadow: 0 10px 18px rgba(0,0,0,.14);
  transform: none;                        /* bỏ nghiêng từng khung */
}
.album-collage.film-strip .polaroid:hover{ transform: translateY(-2px); }
.album-collage.film-strip .polaroid img{
  height: 260px;                           /* khung to hơn trong film */
  border-radius: 8px;
}
.album-collage.film-strip .polaroid figcaption{ display: none; }
/* tắt tape trang trí trong biến thể film */
.album-collage.film-strip .polaroid::before { content: none !important; }

/* viền mờ 2 mép khi cuộn */
.album-collage.film-strip > *:first-child { margin-left: 2px; }
.album-collage.film-strip > *:last-child  { margin-right: 2px; }

.polaroid {
    --pad: 10px;         /* khoảng trắng khung */
    --foot: 28px;        /* mép dưới dày hơn như polaroid */
    --bg: #fff;          /* nền khung */
    --bd: #e9e4de;       /* viền nhạt */
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: 8px;
    padding: var(--pad) var(--pad) calc(var(--pad) + var(--foot));
    box-shadow: 0 10px 18px rgba(0,0,0,0.10), 0 1px 0 rgba(0,0,0,0.05) inset;
    transform-origin: center top;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    position: relative;
}

.polaroid img {
    width: 100%;
    height: 210px; /* to hơn một chút */
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.polaroid figcaption {
    position: absolute;
    left: 0; right: 0;
    bottom: 8px;
    text-align: center;
    font-size: .95em; /* chữ lớn hơn nhẹ */
    color: #6b5549;
    letter-spacing: .2px;
}

/* Nghiêng ngả nhẹ theo vị trí để tạo cảm giác ngẫu nhiên */
.album-collage .polaroid:nth-child(6n+1) { transform: rotate(-2.8deg); }
.album-collage .polaroid:nth-child(6n+2) { transform: rotate(2.2deg); }
.album-collage .polaroid:nth-child(6n+3) { transform: rotate(-1.2deg); }
.album-collage .polaroid:nth-child(6n+4) { transform: rotate(3.2deg); }
.album-collage .polaroid:nth-child(6n+5) { transform: rotate(-3.6deg); }
.album-collage .polaroid:nth-child(6n)   { transform: rotate(1.6deg); }

/* Bố cục “lộn xộn” nhẹ: lệch hàng theo chu kỳ */
/* Căn đều hàng: bỏ lệch hàng để đủ 3 ảnh/row */
.album-collage .polaroid { margin-top: 0; }

/* Hover: thẳng lại một chút + nổi khối hơn */
.polaroid:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.02);
    box-shadow: 0 14px 26px rgba(0,0,0,0.16), 0 1px 0 rgba(0,0,0,0.06) inset;
    filter: saturate(1.05);
}

/* Trang trí “băng dán” giấy mờ ở một vài tấm */
.album-collage .polaroid:nth-child(3n)::before,
.album-collage .polaroid:nth-child(5n)::before {
    content: '';
    position: absolute;
    top: -8px; left: 50%; transform: translateX(-50%) rotate(-6deg);
    width: 64px; height: 16px;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,255,255,.85) 6px, rgba(0,0,0,.04) 6px, rgba(0,0,0,.04) 12px);
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    border-radius: 3px;
    opacity: .9;
}

@media (max-width: 500px) {
  .polaroid img { height: 180px; }
}

/* Màn hình rất nhỏ: về 2 cột cho dễ nhìn */
@media (max-width: 420px) {
  .album-collage { grid-template-columns: repeat(2, 1fr); }
  .album-collage.film-strip { grid-auto-columns: 85%; transform: rotate(-4deg); }
}

/* -------------------- Photo Lightbox -------------------- */
.photo-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10010; }
.photo-modal.open { display: flex; }
.photo-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.photo-dialog {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: min(96vw, 900px);
  max-height: 90vh;
  padding: 10px 10px 14px;
  box-shadow: 0 20px 54px rgba(0,0,0,.4);
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.photo-dialog img { display:block; width:100%; height:auto; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.photo-caption { text-align:center; margin: 8px 0 0; color:#5a3b2d; font-weight:600; }
.photo-close {
  position: absolute; top: -12px; right: -12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #333; background:#fff; color:#333; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size: 20px; line-height:1;
  box-shadow: 0 8px 18px rgba(0,0,0,.3);
}

@media (max-width: 480px) {
  .photo-dialog { width: 94vw; }
  .photo-close { top: -8px; right: -8px; width: 32px; height: 32px; }
}

/* ---- Film strip enhancements (override) ---- */
.album-collage.film-strip { scrollbar-width: none; -ms-overflow-style: none; cursor: grab; }
.album-collage.film-strip:active { cursor: grabbing; }
.album-collage.film-strip::-webkit-scrollbar { display: none; height: 0; }
.album-collage.film-strip::before,
.album-collage.film-strip::after{ left: 0; right: 0; }

/* ---- Smaller photo modal (override) ---- */
.photo-dialog { width: min(90vw, 760px); max-height: 86vh; }
.photo-dialog img { max-height: 74vh; }

/* ---- Film nav arrows ---- */
#album { position: relative; }
.film-nav {
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  display: flex; justify-content: space-between;
  padding: 0 6px;
  pointer-events: none;
}
.film-nav button{
  pointer-events: auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  color: #5a3b2d;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
}
.film-nav button:active{ transform: scale(.98); }


/* ---------------------------------------------------------------- */
/* CSS cho BỐ CỤC ẢNH PHỤ (2x2) (Giữ nguyên) */
/* ---------------------------------------------------------------- */
.photo-2x2 {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    max-width: 600px;
    margin: 40px auto;
}

.photo-2x2 img {
    width: 48%; 
    height: auto;
    object-fit: cover;
    border-radius: 5px; 
}

/* ---- Full-width override for single image rows ---- */
.image-row.photo-2x2 { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.image-row.photo-2x2 img:only-child { width: 100%; display: block; }

/* Keep full-bleed inside padded section (share with hero) */
.padded-section .image-row.photo-2x2 { margin-left: -22px; margin-right: -22px; }

/* Khi hàng chỉ có 1 ảnh: bỏ flex để ảnh thật sự full */
.image-row.photo-2x2:has(img:only-child) { display: block; }

.margin-bottom-30 {
    margin-bottom: 30px;
}

/* ---------------------------------------------------------------- */
/* RESPONSIVE DESIGN (Điều chỉnh cho màn hình nhỏ) (Giữ nguyên) */
/* ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .cover-top-content h1 {
        font-size: 1em;
    }
    
    .made-by {
        position: static;
        transform: none;
        margin: 10px auto;
        display: block;
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
    }

    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .script-title {
        font-size: 3em;
    }
    
    .photo-2x2 {
        flex-direction: column;
        gap: 20px;
        padding: 0 10px;
    }
    
    .photo-2x2 img {
        width: 100%;
    }
}

/* --------------------------------------------------------------- */
/* Groom-bride: ảnh 2x2 + chữ giữa + mờ mép ảnh */
/* --------------------------------------------------------------- */
#groom-bride .photo-2x2 {
    position: relative;
}

#groom-bride .photo-2x2.with-center-words {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

#groom-bride .photo-2x2.with-center-words::before,
#groom-bride .photo-2x2.with-center-words::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 40px;
    pointer-events: none;
}
#groom-bride .photo-2x2.with-center-words::before {
    top: -10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.04), rgba(0,0,0,0));
}
#groom-bride .photo-2x2.with-center-words::after {
    bottom: -10px;
    background: linear-gradient(to top, rgba(0,0,0,0.04), rgba(0,0,0,0));
}

#groom-bride .photo-2x2.with-center-words img { width: 100%; display:block; }

/* Khung mềm mờ mép cho mỗi ảnh */
#groom-bride .photo-soft {
    position: relative;
    height: 280px; /* cắt ảnh cho đồng nhất chiều cao; bạn có thể đổi */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
#groom-bride .photo-soft img { width:100%; height:100%; object-fit: cover; }
#groom-bride .photo-soft::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to bottom, var(--background-color) 0%, rgba(247,243,238,0) 12%, rgba(247,243,238,0) 88%, var(--background-color) 100%),
      linear-gradient(to right, var(--background-color) 0%, rgba(247,243,238,0) 10%, rgba(247,243,238,0) 90%, var(--background-color) 100%);
    pointer-events: none;
}

#groom-bride .center-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 8px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: var(--font-serif);
    font-size: 0.95em;
}
#groom-bride .center-words span { display: block; text-align: center; }

@media (max-width: 600px) {
  #groom-bride .photo-2x2.with-center-words { grid-template-columns: 1fr; }
  #groom-bride .center-words { flex-direction: row; justify-content: space-between; }
}

/* --------------------------------------------------------------- */
/* Intro: Save the Date block (new) */
/* --------------------------------------------------------------- */
.gb-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.gb-title {
    font-family: var(--font-serif);
    color: var(--primary-color);
    font-size: clamp(34px, 7.5vw, 58px); /* giảm cỡ chữ */
    line-height: 0.92;
    letter-spacing: 2px;
    text-align: left;
}

/* Overlapped outline rings for the two O letters */
.gb-rings { position: relative; display: inline-block; }
.gb-rings .ring {
    color: transparent;
    -webkit-text-stroke: 1.6px var(--primary-color); /* mảnh hơn, tinh tế */
    text-stroke: 1.6px var(--primary-color);
    display: inline-block;
}
.gb-rings .ring + .ring { margin-left: -12px; opacity: 0.9; }

.gb-right { text-align: left; }
.gb-name {
    font-family: 'Gilda Display', var(--font-serif);
    font-size: clamp(20px, 4.5vw, 32px);
    margin: 10px 0;
}
.gb-name + .gb-name { padding-left: 12px; } /* lùi tên thứ 2 vào trong */
.invitation-block .invitation-text p {
    margin: 6px 0;
    font-size: 1.05em;
}

.double-happiness {
    font-size: 68px;
    line-height: 1;
    color: var(--primary-color);
    margin: 18px 0 8px;
}

.subnote {
    margin-top: 16px;
    font-style: italic;
}

.save-the-date {
    font-family: var(--font-script);
    color: var(--primary-color);
    font-size: 44px;
    margin: 6px 0 18px;
}

.padded-section .image-row { /* cho ảnh hero full-bleed theo phần padding */
    margin-left: -20px;
    margin-right: -20px;
}

.hero-photo {
    width: 100%;
    max-width: none; /* cho phép full theo container */
    height: auto;
    display: block; /* tránh bị ảnh hưởng bởi text-align */
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Decorative swooshes around the photo */
.photo-frame {
    position: relative;
    display: block;   /* block để bao full chiều ngang */
    width: 100%;
}
.photo-frame::before,
.photo-frame::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 60px;
    border-top: 2px solid var(--primary-color);
    border-radius: 160px 160px 0 0;
    opacity: 0.6;
}
.photo-frame::before { left: -70px; top: 40%; transform: rotate(-8deg); }
.photo-frame::after  { right: -70px; top: 46%; transform: rotate(8deg); }

.forever-love {
    margin: 26px 0 8px;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(18px, 3.6vw, 24px);
    letter-spacing: 8px;    /* khoảng cách tổng thể */
    word-spacing: 12px;     /* tách từng chữ cái như mẫu */
    text-transform: uppercase;
}

.forever-love .fl-star {
    color: var(--primary-color);
    font-style: normal;
    display: inline-block;
    transform: translateY(-4px) rotate(12deg);
    margin: 0 4px;
}

.announce {
    color: var(--primary-color);
    font-weight: 600;
    margin: 6px 0 12px;
}

.details-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    max-width: 90%;
    margin: 8px auto 0;
}

.details-col {
    flex: 1;
}

.details-col--right {
    border-left: 1px solid #caa;
    padding-left: 16px;
}

@media (max-width: 600px) {
    .details-row { flex-direction: column; gap: 10px; }
    .details-col--right { border-left: 0; padding-left: 0; border-top: 1px solid #caa; padding-top: 10px; }
    .gb-hero { grid-template-columns: 1fr; text-align: center; }
    .gb-title { text-align: center; }
    .gb-right { text-align: center; }
    .photo-frame::before { left: -30px; width: 120px; }
    .photo-frame::after  { right: -30px; width: 120px; }
}

/* Keep hero in two columns for save-date-intro on mobile */
@media (max-width: 600px) {
#save-date-intro .gb-hero { grid-template-columns: 0.95fr 1.05fr; gap: 8px; align-items: center; }
#save-date-intro .gb-title { text-align: left; font-size: clamp(26px, 7.8vw, 38px); }
#save-date-intro .gb-right { text-align: left; }
#save-date-intro .gb-name { font-size: clamp(18px, 4.9vw, 24px); margin: 4px 0; }
}

/* --------------------------------------------------------------- */
/* Invitation banner after #groom-bride                            */
/* --------------------------------------------------------------- */
.invite-banner { position: relative; }
.invite-banner .families {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 18px;
    max-width: 92%;
    margin: 0 auto 14px;
    color: #6a4a3a;
}
.invite-banner .family { font-size: 14px; line-height: 1.4; }
.invite-banner .family-title {
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: #6a4a3a;
}
.invite-banner .divider {
    width: 1px;
    background: rgba(122, 78, 52, 0.4);
    height: 56px;
    margin: 4px auto 0;
}
.invite-banner .couple-names {
    margin: 10px 0 8px;
    font-family: var(--font-serif);
    font-size: clamp(28px, 7vw, 44px);
    letter-spacing: 2px;
    color: #4b3a2f;
}
.invite-banner .heart { color: var(--primary-color); font-size: 0.9em; }
.invite-banner .respect {
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 8px 0 4px;
    color: #6b4a39;
}
.invite-banner .guest {
    font-weight: 700;
    color: #6b4a39;
    font-size: 18px;
    margin: 6px 0;
}
.invite-banner .to-invite { margin-top: 6px; letter-spacing: 2px; }

/* Dual address cards (nhà gái / nhà trai) */
.addresses-dual {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.addr-card {
    border: 2px solid rgba(107, 74, 57, 0.4);
    border-radius: 14px;
    padding: 16px 14px 18px;
    max-width: 92%;
    margin: 0 auto;
    background: #fff8f3;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.addr-title {
    font-weight: 700;
    color: #5c3f2f;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.addr-text { color: #6b4a39; margin-bottom: 10px; }
.addr-btn {
    display: inline-block;
    background: #6b4a39;
    color: #fff;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

@media (min-width: 640px) {
    .addresses-dual { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .invite-banner .families { gap: 10px; }
    .invite-banner .family { font-size: 13px; }
    .invite-banner .couple-names { letter-spacing: 1px; }
}

/* --------------------------------------------------------------- */
/* Wedding schedule (ribbons + time blocks)                        */
/* --------------------------------------------------------------- */
.wedding-schedule { --ribbon: #6b4a39; --ink: #6b4a39; }
.wedding-schedule .event-group { margin: 26px auto 34px; max-width: 92%; }
.wedding-schedule .event-group.align-left { text-align: left; }
.wedding-schedule .event-group.align-right { text-align: right; }
.wedding-schedule .ribbon {
    display: inline-block;
    background: var(--ribbon);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .5px;
    margin: 8px 0 10px;
    position: relative;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.wedding-schedule .ribbon-right { display: inline-block; margin-top: 16px; }
.wedding-schedule .ribbon-left { margin-left: 8%; margin-right: auto; }
.wedding-schedule .ribbon-right { margin-left: auto; margin-right: 8%; }
/* bỏ 'đuôi' hình chữ nhật để giống mẫu */
.wedding-schedule .ribbon-left::after,
.wedding-schedule .ribbon-right::before { content: none; }
.wedding-schedule .event-group.align-left .ribbon { margin-left: 0; margin-right: auto; }
.wedding-schedule .event-group.align-right .ribbon { margin-left: auto; margin-right: 0; }
.wedding-schedule .event-box {
    text-align: left;
    color: var(--ink);
    margin: 8px 0 14px;
    padding: 8px 10px 10px 18px;
    position: relative;
    max-width: 78%;
}
.wedding-schedule .event-box.shift-left { margin-left: 8%; margin-right: auto; }
.wedding-schedule .event-box.shift-right { margin-right: 8%; margin-left: auto; }
.wedding-schedule .event-group.align-right .event-box {
    text-align: right;
    margin-left: auto;
    margin-right: 0;
}
.wedding-schedule .event-group.align-left .event-box {
    margin-right: auto;
}

/* Address card placed inside schedule */
.wedding-schedule .addr-card { max-width: 92%; margin: 12px auto 4px; }
.wedding-schedule .addr-left { max-width: 86%; margin-left: 8%; margin-right: auto; }
.wedding-schedule .addr-right { max-width: 86%; margin-right: 8%; margin-left: auto; }
.wedding-schedule .event-box.left-line::before,
.wedding-schedule .event-box.right-line::after{
    content: '';
    position: absolute;
    top: -2px; bottom: -2px;
    width: 2px; background: var(--ink);
    opacity: .55;
}
.wedding-schedule .event-box.left-line::before { left: 4px; }
.wedding-schedule .event-box.right-line { padding-left: 10px; padding-right: 18px; }
.wedding-schedule .event-box.right-line::after { right: 4px; }
.wedding-schedule .event-time {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .2px;
    color: #5a4235;
}
.wedding-schedule .event-date {
    font-weight: 700;
    font-size: 17px;
    margin-top: 6px;
}
.wedding-schedule .event-lunar {
    font-style: italic;
    opacity: .8;
    margin-top: 6px;
    color: #6e5a4e;
}

/* ---------------------------------------------- */
/* Music player (floating bottom center)          */
/* ---------------------------------------------- */
/* Legacy .music-box kept for reference but unused */
.music-box { display: none; }

/* Compact circular toggle button (bottom-left) */
.music-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #000;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 16px rgba(0,0,0,.25);
    cursor: pointer;
    z-index: 1000;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.music-toggle:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(0,0,0,.28); }
.music-toggle:active { transform: translateY(0); }
.music-toggle:focus-visible { outline: 3px solid rgba(255,255,255,.75); outline-offset: 3px; }
.music-toggle .icon { font-size: 22px; line-height: 1; }

/* Slash overlay when OFF */
.music-toggle.off::after{
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 48px;
    background: #fff;
    transform: translate(-50%, -50%) rotate(-45deg);
    border-radius: 2px;
    opacity: 0.9;
}

/* Subtle pulse when playing */
.music-toggle.playing::before{
    content: '';
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(255,255,255,.5);
    border-radius: 50%;
    animation: musicPulse 1.8s ease-out infinite;
}

@keyframes musicPulse {
    0%   { transform: scale(1);   opacity: .7; }
    70%  { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}


.album-collage.film-strip.film-strip--one{ transform: rotate(-7deg); }
.album-collage.film-strip.film-strip--two{ transform: rotate(-5deg); }


/* ---- Interleaved film frames (xen kẽ) ---- */
/* So le ảnh giữa hai dải film: strip 1 nâng ảnh chẵn, strip 2 nâng ảnh lẻ */
.album-collage.film-strip.film-strip--one .polaroid:nth-child(even) { margin-top: 32px; }
.album-collage.film-strip.film-strip--two .polaroid:nth-child(odd)  { margin-top: 32px; }

/* Nhẹ nhàng hơn trên màn hình nhỏ */
@media (max-width: 540px) {
  .album-collage.film-strip.film-strip--one .polaroid:nth-child(even),
  .album-collage.film-strip.film-strip--two .polaroid:nth-child(odd) {
    margin-top: 18px;
  }
}

/* Tránh lệch khi chỉ có 1 ảnh mỗi strip */
.album-collage.film-strip .polaroid:first-child:last-child { margin-top: 0; }

/* ---- Two-column stacked layout in album ---- */
/* Biến hai film-strip thành hai cột đứng, cột phải lệch xuống */
#album .film-wrap {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

#album .film-wrap .album-collage{
  width: 100%;
  max-width: none;
  margin: 0; /* bỏ căn giữa gây không full */
}

#album .film-wrap .album-collage.film-strip {
  /* tắt hiệu ứng cuộn ngang như film */
  grid-auto-flow: row;
  grid-auto-columns: initial;
  gap: 16px;
  overflow: visible;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  transform: none;          /* bỏ nghiêng toàn dải */
  scroll-snap-type: none;
}

#album .film-wrap .album-collage.film-strip::before,
#album .film-wrap .album-collage.film-strip::after{ content: none; }

/* Lệch cả cột phải để tạo cảm giác đan xen */
#album .film-wrap .film-strip--two{ margin-top: 40px; }

/* Mobile: về 1 cột, bỏ lệch */
@media (max-width: 540px) {
  /* Vẫn giữ bố cục 2 cột và xen kẽ trên mobile */
  #album .film-wrap { grid-template-columns: 1fr 1fr; }
  #album .film-wrap .film-strip--two{ margin-top: 24px; }
  .album-collage.film-strip.film-strip--one .polaroid:nth-child(even),
  .album-collage.film-strip.film-strip--two .polaroid:nth-child(odd) { margin-top: 14px; }
}

/* Rất nhỏ: fallback 1 cột để dễ nhìn */
@media (max-width: 360px) {
  #album .film-wrap { grid-template-columns: 1fr; }
  #album .film-wrap .film-strip--two{ margin-top: 0; }
}
