/* =====================================================================
   THIEPCUOI - CSS CHUNG CUA WEBSITE NEN TANG
   Dung boi app/Views/layouts/main.php va cac trang trong khung do
   (dang nhap, dang ky, quan ly...). KHONG dung cho trang thiep cong khai;
   moi mau thiep co CSS rieng.

   Phong cach: kem am, vang champagne dam (du tuong phan voi chu trang),
   hong phan lam diem nhan. Font he thong (khong tai font ben ngoai);
   tieu de dung font co chan he thong, deu hien thi dung tieng Viet.

   LOP CSS CO SAN CHO VIEW
     Khung:    .container .site-main
     Thong bao: .flash .flash-success .flash-error
     Nut:      .btn .btn-primary .btn-secondary .btn-small .btn-block
     Form:     .card .auth-card .form-field .form-hint .field-error
               .form-error (loi chung) .checkbox .form-actions .hp-field
     Tien ich: .muted .text-center .visually-hidden
     Chan trang: .footer-inner .footer-links .footer-contacts
     Trang thong tin: .page .page-title .page-lead .page-cta .prose .policy-links
               .faq-list .faq-item .faq-answer .price-card .price-label .price-figure .price-steps
     Trang chu: .home-hero .hero-actions .home-section .section-title .section-lead .steps .step
               .template-grid .template-card .template-thumb .template-swatch .template-body
               .template-price .price-summary .home-cta
      Tai khoan: .account .account-grid .account-meta
      Thiep cua toi: .wedding-page .wedding-list .wedding-item .wedding-actions .wedding-delete
      Chinh sua: .editor .editor-steps .editor-group .photo-slot .album-grid .album-item
   ===================================================================== */

:root {
    --gold: #80562f;
    --gold-dark: #603b29;
    --gold-soft: #b38b62;
    --blush: #f3e7e4;
    --cream: #f8f2e9;
    --ink: #302a27;
    --muted: #625852;
    --line: #ded0c4;
    --white: #fffaf4;
    --good: #285b43;
    --good-bg: #e8f2eb;
    --good-line: #b8d4c1;
    --bad: #912d3c;
    --bad-bg: #f8e9e9;
    --bad-line: #e5bfc2;
    --radius: 16px;
    --shadow: 0 14px 38px rgba(76, 48, 35, .09);
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: Iowan Old Style, "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --paper: #f4ede3;
    --rose: #a35458;
    --rose-dark: #783b43;
    --surface-raised: #fffdf9;
    --shadow-soft: 0 5px 18px rgba(76, 48, 35, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, var(--cream) 0%, var(--blush) 100%) fixed;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; color: var(--gold-dark); margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--gold-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }

/* Trinh doc man hinh va ban phim --------------------------------------- */

:focus-visible { outline: 3px solid rgba(143, 114, 61, .55); outline-offset: 2px; }

.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--ink);
    color: var(--white);
    border-radius: 8px;
    text-decoration: none;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* O bay bat bot: dua ra ngoai man hinh (khong dung display:none vi bot de nhan ra) */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Khung trang ------------------------------------------------------------ */

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-header { background: rgba(255, 255, 255, .85); border-bottom: 1px solid var(--line); }
.site-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding-top: 12px;
    padding-bottom: 12px;
}
.brand { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; color: var(--gold-dark); text-decoration: none; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.site-nav a { text-decoration: none; padding: 6px 2px; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a.btn { padding: 8px 16px; }
.inline-form { display: inline; margin: 0; }
.nav-button {
    padding: 6px 2px;
    background: none;
    border: 0;
    color: var(--gold-dark);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.nav-button:hover { color: var(--ink); text-decoration: underline; }

.site-main { flex: 1 0 auto; padding: 32px 0 48px; }

.site-footer { padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; background: rgba(255, 255, 255, .6); }
.site-footer p { margin: 0; }

/* Thong bao --------------------------------------------------------------- */

.flash { margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.flash-success { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.flash-error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

/* Nut --------------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-dark); color: var(--white); }
.btn-secondary { background: var(--white); border-color: var(--gold); color: var(--gold-dark); }
.btn-secondary:hover { background: var(--cream); }
.btn-small { padding: 8px 16px; font-size: .95rem; }
.btn-block { display: block; width: 100%; }
.btn[disabled], .btn:disabled { opacity: .6; cursor: not-allowed; }

/* The va form ------------------------------------------------------------- */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}
.auth-card { max-width: 460px; margin: 0 auto; }

.form-field { margin: 0 0 16px; }
.form-field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .95rem; }
.form-hint { display: block; margin-top: 4px; font-size: .86rem; font-weight: 400; color: var(--muted); }

.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=tel],
.form-field input[type=password],
.form-field input[type=url],
.form-field input[type=number],
.form-field input[type=date],
.form-field input[type=time],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: inherit;
    font: inherit;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible { border-color: var(--gold); }
.form-field [aria-invalid=true] { border-color: var(--bad); }

.field-error { margin: 4px 0 0; font-size: .88rem; color: var(--bad); }
.form-error { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }

.checkbox { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: .95rem; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--gold); }

.form-actions { margin-top: 8px; }

/* Menu va chan trang ---------------------------------------------------------- */

.site-nav a[aria-current=page] { font-weight: 700; color: var(--gold-dark); text-decoration: underline; }

.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-links,
.footer-contacts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.footer-links a,
.footer-contacts a { color: var(--gold-dark); }
.footer-contact { min-width: 0; max-width: 100%; }
.footer-contact-title { margin: 0 0 8px; color: var(--rose-dark); font-size: 1.08rem; line-height: 1.4; }
.footer-contacts li,
.footer-contacts a { min-width: 0; overflow-wrap: anywhere; }

/* Trang thong tin: hoi dap, bang gia, dieu khoan ------------------------------ */

.page { max-width: 760px; margin: 0 auto; }
.page-title { margin-bottom: .35em; }
.page-lead { font-size: 1.1rem; color: var(--muted); }
.page h2 { margin-top: 1.6em; }
.page-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 2.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.prose p { line-height: 1.75; }

.policy-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

.faq-list { margin: 1.2rem 0; }
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; }
.faq-item summary { padding: 14px 16px; font-weight: 600; cursor: pointer; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-answer { padding: 14px 16px 16px; line-height: 1.7; }

.price-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0 0 14px; box-shadow: var(--shadow); }
.price-label { margin: 0; font-size: .95rem; color: var(--muted); }
.price-figure { margin: 4px 0 0; font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--gold-dark); }
.price-steps { padding-left: 1.3em; }
.price-steps li { margin-bottom: .6em; }

/* Trang chu --------------------------------------------------------------------- */

.home-hero { padding: 24px 0 8px; text-align: center; }
.home-hero h1 { font-size: 2rem; max-width: 18em; margin-left: auto; margin-right: auto; }
.home-hero .page-lead { max-width: 36em; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 1.4rem; }

.home-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 720px; margin: 24px auto 0; }
.home-stat { min-width: 0; padding: 18px 14px; text-align: center; background: linear-gradient(145deg, var(--white), var(--cream)); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); }
.home-stat strong { display: block; color: var(--rose-dark); font-family: var(--font-heading); font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.15; overflow-wrap: anywhere; }
.home-stat span { display: block; margin-top: 6px; color: var(--muted); font-size: .95rem; }

.home-section { margin-top: 56px; }
.section-title { font-size: 1.5rem; margin-bottom: 1rem; }
.section-lead { color: var(--muted); }

.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 6px 64px; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--white);
    font-weight: 700;
    line-height: 34px;
    text-align: center;
}
.step h3 { font-size: 1.1rem; margin-bottom: .3em; }

.template-grid { display: grid; gap: 18px; }
.template-card { display: flex; flex-direction: column; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.template-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream); }
.template-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.template-swatch {
    display: grid;
    grid-template-rows: 2fr 1fr 1fr;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 18px;
    background: var(--tpl-bg, var(--cream));
}
.template-swatch span { border-radius: 8px; }
.template-swatch span:nth-child(1) { background: var(--tpl-primary, var(--gold)); }
.template-swatch span:nth-child(2) { background: var(--tpl-accent, var(--line)); }
.template-swatch span:nth-child(3) { border: 2px solid var(--tpl-primary, var(--gold)); }
.template-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 16px 18px 20px; }
.template-body h3 { margin-bottom: .3em; }
.template-body p { font-size: .95rem; }
.template-price { margin-top: auto; font-weight: 700; color: var(--gold-dark); }

.price-summary { font-size: 1.1rem; }

.home-cta { margin-top: 56px; padding: 32px 16px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }

/* Trang tai khoan ----------------------------------------------------------------- */

.account { max-width: 900px; margin: 0 auto; }
.account > .card { margin-bottom: 20px; }
.account-grid { display: grid; gap: 20px; }
.account-meta dl { margin: 0 0 8px; }
.account-meta dt { font-size: .86rem; color: var(--muted); }
.account-meta dd { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }

/* Danh sach thiep --------------------------------------------------------------- */

.wedding-page,
.editor { max-width: 940px; margin: 0 auto; }

.wedding-page > section { margin-top: 28px; }
.wedding-page .page-lead { margin-bottom: 24px; }
.wedding-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.wedding-item.card { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 20px; padding: 20px; }
.wedding-cover { overflow: hidden; align-self: start; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--cream); }
.wedding-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wedding-cover-empty { display: grid; width: 100%; height: 100%; min-height: 100px; place-items: center; padding: 12px; color: var(--muted); text-align: center; }
.wedding-info { min-width: 0; }
.wedding-info h3 { margin-bottom: 6px; overflow-wrap: anywhere; }
.wedding-meta { margin-bottom: 8px; }
.wedding-meta.muted { font-size: .92rem; }
.wedding-status { display: inline-block; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink); font-size: .84rem; font-weight: 700; }
.wedding-status-draft { border-color: #d8c7a7; background: #f8f2e8; color: #624c27; }
.wedding-status-published { border-color: var(--good-line); background: var(--good-bg); color: var(--good); }
.wedding-status-unpublished { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.wedding-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.wedding-delete { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.wedding-delete summary { width: fit-content; color: var(--bad); font-weight: 700; cursor: pointer; }
.wedding-delete-body { margin-top: 10px; padding: 12px; border: 1px solid var(--bad-line); border-radius: 10px; background: var(--bad-bg); }
.wedding-delete-body p { font-size: .92rem; }
.btn-danger { border-color: #8c1d2f; background: #8c1d2f; color: var(--white); }
.btn-danger:hover { border-color: #6e1726; background: #6e1726; color: var(--white); }

/* Chon mau ---------------------------------------------------------------------- */

.template-options { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.template-options > legend { padding: 0 8px; font-weight: 700; color: var(--gold-dark); }
.template-option { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.template-option:focus-within { outline: 2px solid rgba(143, 114, 61, .4); outline-offset: 2px; }
.template-option input[type=radio] { flex: none; width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--gold); }
.template-option label { display: flex; flex: 1; align-items: flex-start; gap: 14px; min-width: 0; cursor: pointer; }
.template-option-preview { display: block; flex: 0 0 112px; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 7px; background: var(--cream); }
.template-option-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.template-option-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.template-option-body strong { overflow-wrap: anywhere; }
.template-option-body .muted { font-size: .92rem; }
.template-price { font-weight: 700; color: var(--gold-dark); }
.template-options[aria-invalid=true] { border-color: var(--bad); }

/* Trinh soan thiep --------------------------------------------------------------- */

.editor { max-width: 860px; }
.editor-head { margin-bottom: 18px; }
.editor-head h1 { overflow-wrap: anywhere; }
.editor-back { margin-bottom: 8px; }
.editor-back a { font-weight: 600; text-decoration: none; }
.editor-back a:hover { text-decoration: underline; }
.editor > h2 { margin: 24px 0 16px; }
.editor-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.editor-step a { display: flex; align-items: center; min-height: 48px; height: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .82); color: var(--ink); font-size: .92rem; line-height: 1.35; text-decoration: none; }
.editor-step a:hover { border-color: var(--gold); background: var(--white); }
.editor-step a[aria-current=step] { border-color: var(--gold); background: var(--gold); color: var(--white); font-weight: 700; }
.editor-group.card { min-width: 0; margin: 0 0 20px; padding: 22px; }
.editor-group > legend { padding: 0 8px; color: var(--gold-dark); font-family: var(--font-heading); font-size: 1.12rem; font-weight: 700; }
.editor-group > h3 { margin-bottom: 8px; }
.editor .form-field { margin-bottom: 20px; }
.editor .form-field label { margin-bottom: 8px; line-height: 1.5; }
.editor .form-hint { margin-top: 7px; line-height: 1.55; }
.editor .field-error { margin-top: 7px; line-height: 1.5; }
.site-main .editor input[type=file] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--ink);
    font: inherit;
}
.site-main .editor input[type=file]::file-selector-button {
    margin-inline-end: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--blush);
    color: var(--rose-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.site-main .editor input[type=file]:focus-visible {
    outline: 3px solid rgba(120, 59, 67, .34);
    outline-offset: 2px;
}
.editor-group .form-field:last-child { margin-bottom: 0; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.editor-actions .btn { margin: 0; }
.editor-summary { padding: 14px 18px; }
.editor-summary p { font-weight: 700; }
.editor-summary ul { margin: 0; padding-left: 1.3em; }
.editor-summary li + li { margin-top: 4px; }
.editor-summary a { color: var(--bad); }

/* Anh va album ------------------------------------------------------------------ */

.photo-slot-image,
.album-item-image { display: grid; overflow: hidden; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--cream); }
.photo-slot-image { max-width: 360px; margin: 12px 0; }
.photo-slot-image img,
.album-item-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-slot-empty { padding: 16px; color: var(--muted); text-align: center; }
.photo-slot-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.photo-slot-actions form:first-child { flex: 1 1 250px; }
.photo-slot-actions form:not(:first-child) { margin-bottom: 16px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.album-item { display: flex; flex-direction: column; min-width: 0; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.album-item-image { width: 100%; }
.album-item .form-field { margin-bottom: 8px; }
.album-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.album-move { display: inline; }
.album-item-actions form { margin: 0; }

/* Tien ich ------------------------------------------------------------------ */

.muted { color: var(--muted); }
.text-center { text-align: center; }

/* Man hinh rong hon ----------------------------------------------------------- */

@media (min-width: 720px) {
    h1 { font-size: 2.1rem; }
    .container { padding: 0 24px; }
    .card { padding: 36px 36px; }
    .home-hero { padding-top: 48px; }
    .home-hero h1 { font-size: 2.6rem; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
    .template-thumb { aspect-ratio: 4 / 5; }
    .footer-inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
}

@media (max-width: 560px) {
    .wedding-item.card { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
    .wedding-cover { width: min(100%, 260px); }
    .template-options { padding: 12px; }
    .template-option { gap: 9px; padding: 10px; }
    .template-option label { flex-direction: column; gap: 8px; }
    .template-option-preview { flex-basis: auto; width: min(100%, 180px); }
    .editor-group.card { padding: 16px; }
    .editor-actions .btn { flex: 1 1 100%; }
    .photo-slot-actions form:not(:first-child) { margin-bottom: 0; }
}

@media (min-width: 900px) {
    .steps { grid-template-columns: repeat(4, 1fr); }
    .template-grid { grid-template-columns: repeat(3, 1fr); }
    .account-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Nguoi dung tat chuyen dong ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Nhac nen trong trinh soan va thiep cong khai */
.music-current audio,
.wedding-music-player audio {
    display: block;
    width: min(100%, 32rem);
    max-width: 100%;
}

.wedding-music-player {
    box-sizing: border-box;
    max-width: 36rem;
    margin: 1rem auto;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
}

.music-player-hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    text-align: center;
}

.gift-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gift-qr-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(128, 105, 76, 0.24);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.72);
    overflow-wrap: anywhere;
}

.gift-qr-card h3 { margin-top: 0; }

.gift-qr-image {
    display: block;
    width: min(100%, 280px);
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
    object-fit: contain;
    background: #fff;
}

.gift-qr-card p { margin: 0.5rem 0; }

.qr-current img {
    display: block;
    width: min(100%, 280px);
    max-width: 100%;
    height: auto;
    margin: 0 0 1rem;
    border: 1px solid rgba(128, 105, 76, 0.2);
    background: #fff;
}

.event-editor-heading p {
    margin: 0 0 16px;
    color: var(--muted);
}

.event-edit-form .form-row,
.milestone-edit-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 12px;
}

.event-edit-form .form-row > div,
.milestone-edit-form .form-row > div {
    min-width: 0;
}

.milestone-editor-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.milestone-editor-heading img {
    display: block;
    width: min(100%, 190px);
    max-height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.event-note {
    white-space: pre-line;
}

.event-map-link a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 14px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
}

/* -------------------------------------------------------------------------
   A warm, editorial system for the invitation studio
   Keeps the existing view hooks intact; this layer refines their shared skin.
   ------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
}

body {
    min-height: 100dvh;
    background:
        radial-gradient(ellipse at 8% 5%, rgba(225, 194, 177, .23), transparent 34rem),
        linear-gradient(155deg, #f9f4ed 0%, #f4eae6 54%, #f6efe5 100%) fixed;
    color: var(--ink);
    letter-spacing: .005em;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: radial-gradient(rgba(104, 68, 48, .045) .55px, transparent .55px);
    background-size: 7px 7px;
    content: "";
    pointer-events: none;
}

h1, h2, h3 {
    color: var(--gold-dark);
    letter-spacing: -.025em;
}

h1 { font-weight: 600; }
h2 { font-weight: 600; }
h3 { font-weight: 650; }

a {
    color: var(--rose-dark);
    text-decoration-thickness: .08em;
    text-underline-offset: .2em;
    transition: color .18s ease, text-decoration-color .18s ease;
}

a:hover { color: var(--gold-dark); }

:focus-visible {
    outline: 3px solid #9b5a4f;
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    background: var(--gold-dark);
    box-shadow: var(--shadow);
}

.container { max-width: 1160px; }

.site-header {
    position: relative;
    z-index: 2;
    background: rgba(250, 246, 239, .92);
    border-bottom: 1px solid rgba(126, 86, 57, .18);
    box-shadow: 0 5px 18px rgba(76, 48, 35, .035);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    min-height: 72px;
    gap: 10px 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.brand {
    color: var(--gold-dark);
    font-size: 1.42rem;
    letter-spacing: -.045em;
}

.site-nav {
    gap: 5px 20px;
    font-size: .94rem;
}

.site-nav > a:not(.btn) {
    position: relative;
    color: var(--ink);
}

.site-nav > a:not(.btn)::after {
    position: absolute;
    right: 2px;
    bottom: 1px;
    left: 2px;
    height: 1px;
    background: var(--rose);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}

.site-nav > a:not(.btn):hover::after,
.site-nav > a[aria-current=page]::after { transform: scaleX(1); }

.site-nav a[aria-current=page] {
    color: var(--rose-dark);
    text-decoration: none;
}

.nav-button {
    color: var(--rose-dark);
    font-size: .94rem;
}

.site-main { padding-top: clamp(28px, 5vw, 56px); }

.site-footer {
    margin-top: 40px;
    padding: 28px 0;
    background: rgba(242, 233, 223, .74);
    border-top-color: rgba(126, 86, 57, .2);
}

.footer-inner { gap: 14px 28px; }
.footer-links, .footer-contacts { gap: 8px 20px; }

.btn {
    min-height: 44px;
    padding: 12px 21px;
    border-radius: 999px;
    font-size: .96rem;
    letter-spacing: .005em;
    box-shadow: 0 2px 0 rgba(54, 31, 22, .04);
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(76, 48, 35, .13);
}

.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: var(--rose-dark); color: #fffaf4; }
.btn-primary:hover { background: #612f38; color: #fffaf4; }
.btn-secondary {
    border-color: rgba(128, 86, 47, .46);
    background: rgba(255, 250, 244, .76);
    color: var(--gold-dark);
}
.btn-secondary:hover { background: var(--surface-raised); border-color: var(--gold); }
.btn-small { min-height: 38px; padding: 9px 16px; }
.btn-danger { background: #7f2635; }
.btn-danger:hover { background: #631c29; }

.card, .price-card {
    border-color: rgba(126, 86, 57, .2);
    border-radius: 20px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
}

.card { padding: clamp(22px, 4vw, 36px); }
.auth-card { border-top: 3px solid var(--rose); }

.form-field label { color: #453832; }
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=tel],
.form-field input[type=password],
.form-field input[type=url],
.form-field input[type=number],
.form-field input[type=date],
.form-field input[type=time],
.form-field select,
.form-field textarea {
    min-height: 46px;
    border-color: #d6c7bb;
    border-radius: 10px;
    background: #fffdf9;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.form-field textarea { min-height: 120px; }
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
    border-color: var(--rose);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(163, 84, 88, .14);
    outline: none;
}

.form-field [aria-invalid=true] {
    border-color: var(--bad);
    box-shadow: 0 0 0 2px rgba(145, 45, 60, .1);
}

.checkbox input { accent-color: var(--rose-dark); }
.flash, .form-error { border-radius: 12px; }

.page { max-width: 800px; }
.page-title { font-size: clamp(2rem, 5vw, 3.1rem); }
.page-lead { max-width: 62ch; font-size: 1.08rem; line-height: 1.75; }
.prose { color: #433a35; }
.prose p, .faq-answer { line-height: 1.8; }
.page h2 { padding-top: .15em; }

.faq-item {
    overflow: clip;
    border-color: rgba(126, 86, 57, .2);
    border-radius: 14px;
    background: rgba(255, 253, 249, .88);
    box-shadow: 0 3px 12px rgba(76, 48, 35, .035);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.faq-item:hover { border-color: rgba(163, 84, 88, .42); }
.faq-item summary { padding: 17px 20px; color: var(--gold-dark); }
.faq-item summary::marker { color: var(--rose); }
.faq-item[open] { box-shadow: var(--shadow-soft); }
.faq-answer { padding: 16px 20px 20px; }

.price-card { padding: 24px; border-top: 3px solid var(--gold-soft); }
.price-figure { color: var(--rose-dark); font-size: clamp(2rem, 6vw, 2.6rem); }

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: -8px calc((100% - 100vw) / 2) 0;
    padding: clamp(62px, 10vw, 118px) 20px clamp(48px, 8vw, 84px);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 253, 249, .92), transparent 62%),
        linear-gradient(180deg, rgba(238, 220, 209, .48), rgba(248, 242, 233, .12));
    border-bottom: 1px solid rgba(126, 86, 57, .14);
}

.home-hero::before,
.home-hero::after {
    position: absolute;
    z-index: -1;
    width: clamp(160px, 25vw, 340px);
    aspect-ratio: 1;
    border: 1px solid rgba(163, 84, 88, .16);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.home-hero::before { top: 10%; left: -12%; box-shadow: 0 0 0 22px rgba(163,84,88,.025), 0 0 0 46px rgba(163,84,88,.02); }
.home-hero::after { right: -13%; bottom: -22%; width: clamp(210px, 30vw, 400px); }
.home-hero h1 {
    max-width: 15em;
    margin-bottom: .34em;
    color: var(--gold-dark);
    font-size: clamp(2.4rem, 7vw, 5.2rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.home-hero .page-lead {
    max-width: 40em;
    margin-bottom: 0;
    color: #5c5049;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions { gap: 12px; margin-top: 1.8rem; }
.home-section { margin-top: clamp(48px, 8vw, 88px); }
.section-title { margin-bottom: 1.2rem; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-lead { max-width: 66ch; }

.steps { gap: 14px; }
.step {
    min-height: 170px;
    padding: 23px 20px 16px 70px;
    border-color: rgba(126, 86, 57, .2);
    border-radius: 16px;
    background: rgba(255, 253, 249, .88);
    box-shadow: 0 4px 14px rgba(76, 48, 35, .04);
}
.step::before {
    top: 22px;
    left: 20px;
    width: 36px;
    height: 36px;
    background: var(--rose-dark);
    font-family: var(--font-heading);
    line-height: 36px;
}
.step h3 { font-size: 1.12rem; }
.step p { color: var(--muted); font-size: .94rem; }

.template-grid { gap: 20px; }
.template-card {
    border-color: rgba(126, 86, 57, .22);
    border-radius: 18px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.template-card:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 84, 88, .46);
    box-shadow: 0 16px 34px rgba(76, 48, 35, .12);
}
.template-thumb { background: #eee2d8; }
.template-thumb img { transition: transform .45s ease; }
.template-card:hover .template-thumb img { transform: scale(1.025); }
.template-swatch { gap: 8px; padding: 22px; }
.template-swatch span { border-radius: 10px; }
.template-body { padding: 19px 20px 22px; }
.template-body h3 { font-size: 1.22rem; }
.template-price { color: var(--rose-dark); }

.featured-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.featured-heading .section-title { margin-bottom: .35rem; }
.featured-heading .section-lead { margin: 0; }
.featured-controls { display: flex; flex: none; gap: 8px; }
.carousel-control {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(126, 86, 57, .3);
    border-radius: 50%;
    background: rgba(255, 253, 249, .88);
    color: var(--rose-dark);
    font: inherit;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.carousel-control:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #fffaf4;
    box-shadow: 0 6px 16px rgba(76, 48, 35, .12);
}
.carousel-control:disabled { opacity: .45; cursor: not-allowed; }
.carousel-toggle {
    min-height: 44px;
    padding: 0 15px;
    border: 1px solid rgba(126, 86, 57, .3);
    border-radius: 999px;
    background: rgba(255, 253, 249, .88);
    color: var(--rose-dark);
    font: inherit;
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.carousel-toggle:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #fffaf4;
    box-shadow: 0 6px 16px rgba(76, 48, 35, .12);
}
.carousel-toggle:disabled { opacity: .5; cursor: not-allowed; }
.featured-track {
    display: grid;
    grid-auto-columns: minmax(245px, 31%);
    grid-auto-flow: column;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 18px;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: rgba(126, 86, 57, .4) transparent;
    scrollbar-width: thin;
}
.featured-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(126, 86, 57, .2);
    border-radius: 18px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
    scroll-snap-align: start;
}
.featured-card:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 84, 88, .48);
    box-shadow: 0 16px 34px rgba(76, 48, 35, .12);
}
.featured-preview-link {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    color: inherit;
}
.featured-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: #eee2d8;
}
.featured-cover img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-preview-frame {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fffaf6;
    pointer-events: none;
}
.featured-preview-badge {
    position: absolute;
    z-index: 3;
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 999px;
    color: #fff;
    background: rgba(70, 44, 39, .78);
    font-size: .75rem;
    font-weight: 700;
    pointer-events: none;
}
.featured-cover-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 251, 242, .88), transparent 42%),
        linear-gradient(145deg, #ead9cf, #dfc6b7 55%, #f0e6d9);
    color: var(--gold-dark);
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
}
.featured-card-body { padding: 17px 18px 20px; }
.featured-eyebrow {
    margin: 0 0 6px;
    color: var(--rose-dark);
    font-size: .76rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.featured-card-body h3 {
    margin: 0 0 14px;
    color: var(--gold-dark);
    font-size: 1.18rem;
    line-height: 1.35;
}
.featured-card-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--rose-dark);
    font-weight: 700;
}
.featured-card-action:hover { color: var(--rose-dark); }
.featured-card-action span { transition: transform .18s ease; }
.featured-card-action:hover span { transform: translateX(3px); }

.price-summary {
    max-width: 72ch;
    padding: 20px 22px;
    border-left: 3px solid var(--gold-soft);
    background: rgba(255, 253, 249, .72);
    color: #453a34;
}

.home-cta {
    position: relative;
    overflow: hidden;
    margin-top: clamp(54px, 8vw, 96px);
    padding: clamp(30px, 6vw, 58px) 20px;
    border: 1px solid rgba(126, 86, 57, .2);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(220, 183, 160, .3), transparent 38%),
        #f1e4db;
}
.home-cta .section-title { margin-bottom: .45em; }
.home-cta p:last-child { margin-bottom: 0; }

.account, .wedding-page, .editor { max-width: 980px; }
.account-grid { gap: 18px; }
.account-meta dt { letter-spacing: .04em; text-transform: uppercase; font-size: .75rem; }
.account-meta dd { color: var(--gold-dark); }

.wedding-list { gap: 18px; }
.wedding-item.card {
    padding: 20px;
    border-radius: 18px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.wedding-item.card:hover {
    transform: translateY(-2px);
    border-color: rgba(163, 84, 88, .4);
    box-shadow: var(--shadow);
}
.wedding-cover { border-radius: 12px; background: var(--paper); }
.wedding-info h3 { font-size: 1.35rem; }
.wedding-status { padding: 4px 11px; }
.wedding-status-draft { border-color: #d4b98f; background: #f5eddf; color: #5a4229; }
.wedding-actions { gap: 9px; }
.wedding-delete { border-color: rgba(145, 45, 60, .18); }

.template-options {
    border-color: rgba(126, 86, 57, .22);
    border-radius: 16px;
    background: rgba(250, 246, 239, .55);
}
.template-option {
    border-color: rgba(126, 86, 57, .2);
    border-radius: 12px;
    background: var(--surface-raised);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.template-option:hover { border-color: rgba(163, 84, 88, .5); }
.template-option:focus-within { outline-color: rgba(163, 84, 88, .48); }

.selected-template-summary {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(163, 84, 88, .48);
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(255, 246, 243, .98), rgba(255, 253, 249, .98));
    box-shadow: 0 8px 22px rgba(103, 54, 48, .09);
}
.selected-template-preview {
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 74px;
    aspect-ratio: 3 / 4;
    border-radius: 9px;
    background: var(--paper);
    color: var(--rose-dark);
    font-family: var(--font-display);
    font-size: .8rem;
    text-align: center;
}
.selected-template-preview img { width: 100%; height: 100%; object-fit: cover; }
.selected-template-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.selected-template-info strong { overflow-wrap: anywhere; }
.selected-template-info .muted { font-size: .88rem; }
.selected-template-eyebrow {
    color: var(--rose-dark);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.selected-template-badge {
    padding: 6px 10px;
    border: 1px solid rgba(163, 84, 88, .28);
    border-radius: 999px;
    background: rgba(163, 84, 88, .09);
    color: var(--rose-dark);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.template-change { margin: 0 0 14px; }
.template-change-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--rose-dark);
    border-radius: 999px;
    background: var(--rose-dark);
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.template-change-button::-webkit-details-marker { display: none; }
.template-change-button::after { content: "⌄"; font-size: 1rem; }
.template-change-button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(103, 54, 48, .2); }
.template-change-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.template-change[open] > .template-change-button { margin-bottom: 12px; }
.template-change[open] > .template-change-button::after { content: "⌃"; }

.publish-success-dialog {
    width: min(540px, calc(100vw - 28px));
    max-width: none;
    max-height: min(90vh, 760px);
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: var(--ink);
}
.publish-success-dialog::backdrop {
    background: rgba(42, 29, 29, .62);
    backdrop-filter: blur(5px);
}
.publish-success-card {
    position: relative;
    padding: clamp(24px, 6vw, 40px);
    border: 1px solid rgba(163, 84, 88, .2);
    border-radius: 22px;
    background: linear-gradient(145deg, #fffaf7, #fff 72%);
    box-shadow: 0 24px 70px rgba(35, 20, 20, .28);
    text-align: center;
    animation: publish-success-enter .38s cubic-bezier(.2,.75,.25,1) both;
}
.publish-success-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(63, 126, 91, .13);
    color: #32744f;
    font-size: 1.8rem;
    font-weight: 800;
}
.publish-success-eyebrow {
    margin-bottom: 6px;
    color: var(--rose-dark);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.publish-success-card h2 {
    margin: 0 0 10px;
    color: var(--brown);
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 5vw, 2rem);
}
.publish-success-url {
    overflow-wrap: anywhere;
    margin: 16px 0;
    padding: 12px;
    border: 1px dashed rgba(126, 86, 57, .35);
    border-radius: 10px;
    background: var(--paper);
    font-size: .9rem;
}
.publish-success-share { width: 100%; white-space: normal; }
.publish-success-status { min-height: 1.4em; margin: 12px 0 4px; color: var(--rose-dark); font-weight: 700; }
.publish-success-card form { margin-top: 14px; }
@keyframes publish-success-enter {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
    .selected-template-summary { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
    .selected-template-preview { width: 58px; }
    .selected-template-badge { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    .publish-success-card { animation: none; }
}

.editor-head { padding-bottom: 16px; border-bottom: 1px solid rgba(126, 86, 57, .18); }
.editor-back a { color: var(--rose-dark); }
.editor > h2 { margin-top: 30px; }
.editor-steps { gap: 9px; }
.editor-step a {
    border-color: rgba(126, 86, 57, .2);
    border-radius: 12px;
    background: rgba(255, 253, 249, .82);
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.editor-step a:hover { transform: translateY(-1px); border-color: var(--rose); }
.editor-step a[aria-current=step] {
    border-color: var(--rose-dark);
    background: var(--rose-dark);
    color: #fffaf4;
}
.editor-group.card {
    border-radius: 18px;
    background: rgba(255, 253, 249, .92);
}
.editor-group > legend { color: var(--rose-dark); }
.editor-summary { border-left: 3px solid var(--rose); }
.album-item {
    border-color: rgba(126, 86, 57, .2);
    border-radius: 14px;
    background: var(--surface-raised);
}
.photo-slot-image, .album-item-image { border-radius: 12px; background: var(--paper); }

.wedding-music-player, .gift-qr-card {
    border: 1px solid rgba(126, 86, 57, .2);
    background: rgba(255, 253, 249, .84);
    box-shadow: var(--shadow-soft);
}
.gift-qr-image { border: 1px solid rgba(126, 86, 57, .14); }

/* Existing backend/admin views often render plain tables and controls. */
.site-main table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid rgba(126, 86, 57, .22);
    border-radius: 14px;
    background: var(--surface-raised);
}
.site-main th, .site-main td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(126, 86, 57, .14);
    text-align: left;
    vertical-align: top;
}
.site-main th { background: #f1e6dc; color: var(--gold-dark); font-weight: 700; }
.site-main tr:last-child td { border-bottom: 0; }
.site-main tbody tr:hover { background: rgba(243, 231, 228, .45); }
.site-main input[type=file] { max-width: 100%; font: inherit; }
.site-main button:not(.btn):not(.nav-button) {
    font: inherit;
}

@supports (animation-timeline: view()) {
    .home-section,
    .home-cta,
    .page > h2,
    .faq-item,
    .price-card,
    .wedding-item,
    .editor-group {
        animation: gentle-arrive linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 22%;
    }

    @keyframes gentle-arrive {
        from { opacity: .55; transform: translateY(14px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (min-width: 720px) {
    .card { padding: 34px; }
    .home-hero { padding-top: clamp(78px, 10vw, 120px); }
    .template-thumb { aspect-ratio: 4 / 5; }
}

@media (max-width: 719px) {
    .site-header-inner { align-items: flex-start; }
    .site-nav { width: 100%; gap: 4px 14px; }
    .site-main { padding-top: 28px; }
    .home-hero { margin-top: -4px; }
    .home-hero h1 { max-width: 13em; }
    .steps { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .template-thumb { aspect-ratio: 4 / 3; }
    .featured-heading { align-items: center; flex-wrap: wrap; }
    .featured-controls { justify-content: flex-end; margin-left: auto; }
    .featured-track { grid-auto-columns: min(82%, 330px); gap: 14px; }
    .featured-card-body { padding: 15px 16px 18px; }
    .site-main table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 420px) {
    .container { padding-right: 16px; padding-left: 16px; }
    .site-nav { font-size: .9rem; }
    .site-nav a.btn { padding: 8px 13px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .card { padding: 20px 17px; }
    .wedding-item.card { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Form refinement: editor and account access screens only.
   Deliberately scoped away from the public invitation templates. */
.site-main .editor > form,
.site-main .auth-card > form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-main .editor .form-field,
.site-main .auth-card .form-field {
    margin: 0 0 20px;
}

.site-main .auth-card {
    width: min(100%, 540px);
    max-width: none;
    padding: clamp(28px, 5vw, 42px);
    overflow: hidden;
    border: 1px solid rgba(126, 86, 57, .2);
    border-top: 4px solid var(--rose-dark);
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 100% 0, rgba(224, 195, 176, .3), transparent 17rem),
        linear-gradient(145deg, #fffefa, #fffaf6);
    box-shadow: 0 22px 64px rgba(76, 48, 35, .13);
}

.site-main .auth-card > h1 {
    margin: 0;
    color: var(--rose-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 5vw, 2.45rem);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.18;
}

.site-main .auth-card > p.muted:not(.text-center) {
    margin: 10px 0 26px;
    color: #6c5a52;
    font-size: 1rem;
    line-height: 1.65;
}

.site-main .auth-card > form {
    gap: 0;
}

.site-main .auth-card > form > p {
    margin: -2px 0 20px;
    line-height: 1.6;
}

.site-main .auth-card .form-actions {
    margin-top: 4px;
}

.site-main .auth-card .btn-block {
    min-height: 52px;
    font-size: 1rem;
}

.site-main .auth-card > p.text-center {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(126, 86, 57, .16);
    line-height: 1.65;
}

.site-main .editor .form-field > label,
.site-main .auth-card .form-field > label {
    display: block;
    margin: 0 0 7px;
    color: #49372f;
    font-size: .97rem;
    font-weight: 700;
    line-height: 1.4;
}

.site-main .editor .form-field > label .muted,
.site-main .auth-card .form-field > label .muted {
    display: block;
    margin-top: 2px;
    color: #71635c;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.45;
}

.site-main .editor .form-hint,
.site-main .auth-card .form-hint {
    display: block;
    margin: 7px 0 0;
    padding-left: 11px;
    border-left: 2px solid #d9bba8;
    color: #685b54;
    font-size: .88rem;
    line-height: 1.55;
}

.site-main .editor .field-error,
.site-main .auth-card .field-error {
    margin: 7px 0 0;
    padding: 7px 10px;
    border-left: 3px solid var(--bad);
    border-radius: 0 7px 7px 0;
    background: #fbefed;
    color: #812d39;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.5;
}

.site-main .editor .form-field input[type=text],
.site-main .editor .form-field input[type=email],
.site-main .editor .form-field input[type=tel],
.site-main .editor .form-field input[type=password],
.site-main .editor .form-field input[type=url],
.site-main .editor .form-field input[type=number],
.site-main .editor .form-field input[type=date],
.site-main .editor .form-field input[type=time],
.site-main .editor .form-field select,
.site-main .editor .form-field textarea,
.site-main .auth-card .form-field input[type=text],
.site-main .auth-card .form-field input[type=email],
.site-main .auth-card .form-field input[type=tel],
.site-main .auth-card .form-field input[type=password],
.site-main .auth-card .form-field input[type=url],
.site-main .auth-card .form-field input[type=number],
.site-main .auth-card .form-field input[type=date],
.site-main .auth-card .form-field input[type=time],
.site-main .auth-card .form-field select,
.site-main .auth-card .form-field textarea {
    min-height: 50px;
    padding: 12px 14px;
    border-color: #cfbdae;
    border-radius: 11px;
    background: #fffefa;
    line-height: 1.45;
}

.site-main .editor .form-field textarea,
.site-main .auth-card .form-field textarea {
    min-height: 132px;
}

.site-main .editor .form-field {
    margin-bottom: 22px;
}

.site-main .editor .form-field label {
    margin-bottom: 8px;
    color: var(--rose-dark);
    font-size: 1rem;
    line-height: 1.45;
}

.site-main .editor .form-field .form-hint {
    margin-top: 8px;
    line-height: 1.55;
}

.site-main .editor .form-field .field-error {
    margin-top: 8px;
    line-height: 1.5;
}

.site-main .editor .form-field input:focus-visible,
.site-main .editor .form-field select:focus-visible,
.site-main .editor .form-field textarea:focus-visible,
.site-main .auth-card .form-field input:focus-visible,
.site-main .auth-card .form-field select:focus-visible,
.site-main .auth-card .form-field textarea:focus-visible {
    border-color: var(--rose-dark);
    outline: 3px solid rgba(120, 59, 67, .34);
    outline-offset: 2px;
    background: #fffefa;
    box-shadow: 0 0 0 1px var(--rose-dark);
}

.site-main .editor .form-field [aria-invalid=true],
.site-main .auth-card .form-field [aria-invalid=true] {
    border-color: var(--bad);
    background: #fffafa;
}

.site-main .editor .editor-group.card {
    margin: 0 0 20px;
    padding: 20px clamp(16px, 3vw, 26px) 22px;
    border: 1px solid rgba(126, 86, 57, .25);
    border-top: 3px solid #b88a65;
    border-radius: 16px;
    background: rgba(255, 253, 249, .96);
    box-shadow: 0 5px 18px rgba(76, 48, 35, .055);
}

.site-main .editor .editor-group > legend {
    max-width: calc(100% - 20px);
    padding: 2px 10px;
    border-radius: 5px;
    background: #f7eee7;
    color: var(--rose-dark);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.45;
}

.site-main .editor .editor-group > h3 {
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(126, 86, 57, .18);
    color: var(--rose-dark);
    font-size: 1.2rem;
    line-height: 1.35;
}

.site-main .editor .form-stack {
    display: grid;
    gap: 14px;
}

.site-main .editor .form-stack > .form-field {
    margin: 0;
}

.site-main .editor .form-stack > .editor-group.card {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px clamp(14px, 2.5vw, 20px);
}

.site-main .editor .form-stack > label:not(.checkbox-row) {
    margin: 0 0 6px;
    color: var(--rose-dark);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.site-main .editor .form-stack .form-row > div {
    display: grid;
    gap: 8px;
    align-content: start;
}

.site-main .editor .form-stack .form-row label {
    margin: 0;
    color: var(--rose-dark);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.site-main .editor .form-stack input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]),
.site-main .editor .form-stack select,
.site-main .editor .form-stack textarea {
    width: 100%;
    max-width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #cfbdae;
    border-radius: 11px;
    background: #fffefa;
    color: var(--ink);
    font: inherit;
    line-height: 1.45;
}

.site-main .editor .form-stack textarea {
    min-height: 132px;
    resize: vertical;
}

@media (max-width: 600px) {
    .site-main .auth-card {
        padding: 26px 20px;
        border-radius: 18px;
    }
}

.site-main .editor .form-stack input:focus-visible,
.site-main .editor .form-stack select:focus-visible,
.site-main .editor .form-stack textarea:focus-visible {
    border-color: var(--rose-dark);
    outline: 3px solid rgba(120, 59, 67, .34);
    outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--rose-dark);
}

.site-main .editor .form-stack [aria-invalid=true] {
    border-color: var(--bad);
    background: #fffafa;
}

.site-main .editor .editor-group .checkbox,
.site-main .auth-card .checkbox {
    margin: 8px 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(126, 86, 57, .18);
    border-radius: 10px;
    background: #fbf6ef;
    line-height: 1.55;
}

.site-main .editor .editor-group .form-hint:last-child {
    margin-top: 12px;
}

.site-main .auth-card {
    width: min(100%, 520px);
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid rgba(126, 86, 57, .24);
    border-top: 4px solid var(--rose);
    border-radius: 20px;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(243, 231, 228, .62), transparent 45%),
        var(--surface-raised);
    box-shadow: 0 16px 42px rgba(76, 48, 35, .1);
}

.site-main .auth-card h1 {
    margin-bottom: .35em;
    font-size: clamp(2rem, 5vw, 2.55rem);
    line-height: 1.15;
}

.site-main .auth-card > p.muted {
    margin: 0 0 24px;
    color: #62544d;
    font-size: .98rem;
    line-height: 1.65;
}

.site-main .auth-card > form {
    margin: 0;
}

.site-main .auth-card .form-field {
    margin-bottom: 20px;
}

.site-main .auth-card .form-field > label {
    margin-bottom: 8px;
    line-height: 1.5;
}

.site-main .auth-card .form-field input:not([type=checkbox]):not([type=radio]),
.site-main .auth-card .form-field select,
.site-main .auth-card .form-field textarea {
    min-height: 50px;
    border-radius: 11px;
}

.site-main .auth-card .form-field input:not([type=checkbox]):not([type=radio]):focus-visible,
.site-main .auth-card .form-field select:focus-visible,
.site-main .auth-card .form-field textarea:focus-visible {
    border-color: var(--rose-dark);
    outline: 3px solid rgba(120, 59, 67, .34);
    outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--rose-dark);
}

.site-main .auth-card .form-hint {
    margin-top: 8px;
    line-height: 1.55;
}

.site-main .auth-card .field-error {
    margin-top: 7px;
    line-height: 1.5;
}

.site-main .auth-card > form > p:not(.form-error) {
    margin: 0 0 18px;
    line-height: 1.5;
}

.site-main .auth-card .form-actions {
    margin: 4px 0 16px;
}

.site-main .auth-card > p.text-center {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(126, 86, 57, .2);
    line-height: 1.6;
}

.site-main .auth-card .form-error,
.site-main .editor .form-error {
    line-height: 1.55;
}

@media (max-width: 560px) {
    .site-main .editor .editor-group.card {
        margin-bottom: 16px;
        padding: 17px 15px 19px;
    }

    .site-main .editor .milestone-editor-heading {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-main .editor .milestone-editor-heading img {
        width: min(100%, 230px);
        max-height: 180px;
    }

    .site-main .auth-card .form-field {
        margin-bottom: 18px;
    }

    .site-main .auth-card {
        border-radius: 16px;
    }
}

.template-designer-panel {
    margin: 8px 0 24px;
    padding: clamp(16px, 3vw, 24px);
    border: 1px solid rgba(126, 86, 57, .24);
    border-top: 4px solid var(--rose-dark);
    border-radius: 16px;
    background: linear-gradient(145deg, #fffefa, #fbf4ee);
}

.template-designer-panel[hidden] { display: none !important; }
.template-designer-panel h3 {
    margin: 0 0 8px;
    color: var(--rose-dark);
    font-size: 1.25rem;
    line-height: 1.35;
}

.designer-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin: 18px 0;
}

.designer-add-row .form-field { margin: 0; }
.designer-add-row .btn { min-height: 48px; }

.designer-block-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.designer-block-item {
    display: grid;
    grid-template-columns: 30px minmax(120px, 1fr) minmax(150px, .7fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #ddcbbc;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(76, 48, 35, .045);
}

.designer-block-item.is-dragging { opacity: .45; }
.designer-block-item.is-drop-target { border-top: 3px dashed var(--rose-dark); }
.designer-drag-handle { color: #8a6a5b; font-size: 1.35rem; text-align: center; cursor: grab; }
.designer-block-title { min-width: 0; color: #49372f; line-height: 1.45; }
.designer-style-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cfbdae;
    border-radius: 9px;
    background: #fffefa;
    color: var(--ink);
    font: inherit;
}

.designer-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.designer-row-action { min-width: 40px; min-height: 40px; padding: 7px 10px; }
.designer-row-action:disabled { opacity: .5; cursor: not-allowed; }
.designer-status:empty { display: none; }

@media (max-width: 700px) {
    .designer-add-row { grid-template-columns: minmax(0, 1fr); }
    .designer-add-row .btn { justify-self: start; }
    .designer-block-item {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 8px 10px;
        padding: 10px;
    }
    .designer-style-select,
    .designer-row-actions { grid-column: 2; }
    .designer-row-actions { justify-content: flex-start; }
}

.designer-preview {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid rgba(126, 86, 57, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .75);
}

.designer-preview-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.designer-preview-heading h4 { margin: 0 0 4px; color: var(--rose-dark); font-size: 1.08rem; }
.designer-preview-heading p { margin: 0; }
.designer-preview-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.designer-preview-modes button[aria-pressed="true"] { border-color: var(--rose-dark); background: var(--rose-dark); color: #fff; }

.designer-preview-viewport {
    max-width: 100%;
    overflow-x: auto;
    padding: 16px;
    border: 1px dashed #cbb7a7;
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 0, rgba(210, 174, 148, .18), transparent 35%),
        #eee8e1;
    transition: padding .2s ease;
}

.designer-preview-viewport[data-preview-mode="mobile"] { padding: 16px 10px; }
.designer-preview-card {
    --preview-bg: #f4eee8;
    --preview-surface: #fffcf8;
    --preview-text: #342b28;
    --preview-primary: #8a4852;
    --preview-accent: #d5b77a;
    --preview-heading: Georgia, serif;
    --preview-body: Arial, sans-serif;
    width: 100%;
    max-width: 760px;
    min-height: 420px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 30px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--preview-primary) 25%, transparent);
    border-radius: 15px;
    color: var(--preview-text);
    background: var(--preview-bg);
    box-shadow: 0 12px 28px rgba(57, 39, 31, .13);
    font-family: var(--preview-body);
    line-height: 1.55;
    transition: max-width .25s ease, background .2s ease, color .2s ease;
}

.designer-preview-viewport[data-preview-mode="mobile"] .designer-preview-card { max-width: 360px; }
.designer-preview-block {
    margin: 0 0 13px;
    padding: 14px;
    border-radius: 10px;
    animation: designer-preview-in .28s both;
}

.designer-preview-style--framed { border: 1px solid color-mix(in srgb, var(--preview-primary) 26%, transparent); background: var(--preview-surface); box-shadow: 0 4px 12px rgba(52, 43, 40, .06); }
.designer-preview-style--minimal { border: 0; border-top: 1px solid color-mix(in srgb, var(--preview-primary) 35%, transparent); border-radius: 0; background: transparent; box-shadow: none; }
.designer-preview-style--band { border-block: 1px solid color-mix(in srgb, var(--preview-primary) 25%, transparent); border-radius: 0; background: color-mix(in srgb, var(--preview-accent) 27%, var(--preview-surface)); }
.designer-preview-style--split:not(.designer-preview-type--hero) { border-left: 3px solid var(--preview-accent); background: color-mix(in srgb, var(--preview-accent) 14%, var(--preview-surface)); }
.designer-preview-type--hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(100px, .6fr);
    align-items: center;
    gap: 15px;
    min-height: 150px;
    background: var(--preview-surface);
}

.designer-preview-card h1,
.designer-preview-card h2 { margin: 3px 0 8px; color: var(--preview-primary); font-family: var(--preview-heading); font-weight: 500; line-height: 1.08; }
.designer-preview-card h1 { font-size: clamp(1.5rem, 4vw, 2.6rem); }
.designer-preview-card h2 { font-size: clamp(1.2rem, 3vw, 1.9rem); }
.designer-preview-card p { margin: 5px 0; }
.designer-preview-kicker { color: var(--preview-primary); font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
.designer-preview-date { display: inline-block; margin-top: 6px; padding: 4px 9px; border: 1px solid var(--preview-accent); border-radius: 999px; color: var(--preview-primary); font-size: .78rem; }
.designer-preview-photo {
    display: grid;
    min-height: 75px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(140deg, var(--preview-accent), var(--preview-primary));
    font-family: var(--preview-heading);
}

.designer-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.designer-preview-mini-card { padding: 9px; border: 1px solid color-mix(in srgb, var(--preview-primary) 20%, transparent); border-radius: 8px; background: var(--preview-surface); font-size: .82rem; }
.designer-preview-mini-card small { display: block; margin-top: 4px; opacity: .75; }
.designer-preview-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.designer-preview-photos .designer-preview-photo { min-height: 82px; }
.designer-preview-timeline { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.designer-preview-timeline li { padding-left: 4px; }
.designer-preview-qr { display: flex; align-items: center; gap: 10px; }
.designer-preview-qr::before { display: grid; width: 56px; height: 56px; place-items: center; border: 2px solid var(--preview-primary); background: repeating-linear-gradient(45deg, var(--preview-surface) 0 4px, var(--preview-accent) 4px 7px); color: var(--preview-primary); content: "QR"; font-size: .75rem; font-weight: 700; }
.designer-preview-type--gratitude { text-align: center; }

@keyframes designer-preview-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .designer-preview-heading { align-items: flex-start; flex-direction: column; }
    .designer-preview-type--hero { grid-template-columns: minmax(0, 1fr) minmax(80px, .5fr); }
}

@media (prefers-reduced-motion: reduce) {
    .designer-preview-card,
    .designer-preview-viewport { transition: none; }
    .designer-preview-block { animation: none; }
}

/* Menu nho gon tren dien thoai; khi JavaScript khong bat, cac lien ket van hien. */
.site-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--gold-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.site-nav-toggle svg { flex: none; }

@media (max-width: 719px) {
    .site-header-inner { align-items: center; }
    .site-nav-toggle:not([hidden]) { display: inline-flex; }
    .site-nav.site-nav-collapsible:not(.is-open) { display: none; }
    .site-nav.site-nav-collapsible.is-open {
        display: flex;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-top: 8px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: var(--surface-raised);
        box-shadow: var(--shadow-soft);
    }
    .site-nav.site-nav-collapsible.is-open > a,
    .site-nav.site-nav-collapsible.is-open > .inline-form { width: 100%; }
    .site-nav.site-nav-collapsible.is-open > a { padding: 9px 6px; }
    .site-nav.site-nav-collapsible.is-open .nav-button { padding: 9px 6px; }
    .site-nav.site-nav-collapsible.is-open .inline-form { display: block; }
}

/* Hieu ung vao khung nhin cho cac muc noi bat cua trang chu. */
.home-reveal-pending {
    opacity: 0;
    transform: translateY(20px) scale(.99);
    transition: opacity .62s ease, transform .62s cubic-bezier(.2,.7,.2,1);
}

.home-section[data-home-reveal],
.home-cta[data-home-reveal] { animation: none; }

.home-reveal-pending.is-visible { opacity: 1; transform: none; }
.template-card.home-reveal-pending:nth-child(3n + 2),
.featured-card.home-reveal-pending:nth-child(3n + 2) { transition-delay: 80ms; }
.template-card.home-reveal-pending:nth-child(3n),
.featured-card.home-reveal-pending:nth-child(3n) { transition-delay: 150ms; }

.featured-empty {
    padding: 24px;
    border: 1px dashed rgba(126, 86, 57, .35);
    border-radius: 18px;
    background: rgba(255, 253, 249, .72);
}
.featured-empty p:last-child { margin-bottom: 0; }

.template-carousel-track {
    display: grid;
    grid-auto-columns: calc((100% - 40px) / 3);
    grid-auto-flow: column;
    gap: 20px;
    overflow-x: auto;
    padding: 4px 4px 18px;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: rgba(126, 86, 57, .4) transparent;
    scrollbar-width: thin;
}
.template-carousel-card { height: 100%; min-width: 0; scroll-snap-align: start; }
.template-carousel-card .template-carousel-thumb,
.template-catalogue .template-catalogue-thumb {
    display: grid;
    aspect-ratio: 3 / 4;
    place-items: center;
    padding: 10px;
    background: linear-gradient(145deg, #f7f0e9, #eee2d8);
}
.template-carousel-thumb img,
.template-catalogue-thumb img {
    object-fit: contain;
    object-position: center;
}
.template-carousel-card:hover .template-carousel-thumb img { transform: none; }
.template-carousel-card .template-body { display: flex; flex: 1; flex-direction: column; }
.template-carousel-card .template-body .btn { align-self: flex-start; margin-top: auto; }
.template-show-all { margin: 14px 0 0; text-align: center; }
.template-catalogue-count { color: var(--rose-dark); font-weight: 750; }

@media (max-width: 980px) {
    .template-carousel-track { grid-auto-columns: calc((100% - 20px) / 2); }
}

@media (max-width: 719px) {
    .template-carousel-track { grid-auto-columns: min(86%, 340px); gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-reveal-pending { opacity: 1; transform: none; transition: none; }
    .template-carousel-track { scroll-behavior: auto; }
}
