/* ============================================================
   ALLOVE — Promotion site styles
   Palette: white base · oxblood maroon (แดงเลือดหมู) · gold
   Display: Playfair Display / Noto Serif Thai
   Body:    Sarabun
   ============================================================ */

:root {
    --white:        #ffffff;
    --paper:        #fbf8f4;   /* warm off-white panels */
    --line:         #ece3da;

    --maroon:       #6e1423;   /* oxblood — primary brand */
    --maroon-dark:  #4e0d18;   /* footer / depth */
    --maroon-soft:  #8a2438;

    --gold:         #c8a24a;   /* refined gold */
    --gold-bright:  #e6c76e;
    --gold-deep:    #a57c1b;

    --ink:          #2a1a1d;   /* warm near-black text */
    --muted:        #7a6b6e;

    --radius:       14px;
    --shadow:       0 12px 30px -16px rgba(78, 13, 24, .35);
    --maxw:         1180px;
    --gold-grad:    linear-gradient(135deg, var(--gold-deep), var(--gold-bright) 45%, var(--gold) 70%, var(--gold-deep));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font-family: "Sarabun", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    /* Footer pinned to bottom on short pages */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .display {
    font-family: "Playfair Display", "Noto Serif Thai", Georgia, serif;
    color: var(--maroon);
    line-height: 1.2;
    margin: 0 0 .4em;
}

a { color: var(--maroon); }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- decorative gold lozenge marker (signature element) ---- */
.diamond {
    display: inline-block;
    width: 9px; height: 9px;
    background: var(--gold-grad);
    transform: rotate(45deg);
    margin: 0 .55em;
    box-shadow: 0 0 0 1px rgba(165,124,27,.4);
}

/* ============================ Header ============================ */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--white);
    position: sticky; top: 0; z-index: 30;
}
.site-header .bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .wordmark {
    font-family: "Playfair Display", "Noto Serif Thai", serif;
    font-weight: 800; font-size: 1.7rem; letter-spacing: .22em;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-transform: uppercase;
}
.brand .crest {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--maroon);
    display: grid; place-items: center;
    border: 2px solid var(--gold);
}
.brand .crest span { width: 11px; height: 11px; background: var(--gold-grad); transform: rotate(45deg); }

.nav { display: flex; gap: 6px; }
.nav a {
    text-decoration: none; color: var(--ink); font-weight: 600;
    padding: 9px 16px; border-radius: 999px; font-size: .95rem;
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--paper); }
.nav a.active { background: var(--maroon); color: #fff; }

/* ============================ Hero ============================ */
.hero {
    text-align: center;
    padding: 56px 0 30px;
    background:
        radial-gradient(1200px 240px at 50% -40px, rgba(200,162,74,.14), transparent 70%),
        var(--white);
}
.hero .eyebrow {
    display: inline-flex; align-items: center;
    color: var(--gold-deep); font-weight: 700; letter-spacing: .28em;
    text-transform: uppercase; font-size: .72rem; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero p { color: var(--muted); max-width: 640px; margin: 8px auto 0; font-size: 1.06rem; }

/* ===================== Country selector ===================== */
.country-bar { padding: 10px 0 4px; }
.country-tabs {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.country-tab {
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
    border: 1px solid var(--line); background: var(--white);
    color: var(--ink); font-weight: 600;
    padding: 9px 18px; border-radius: 999px; font-size: .95rem;
    transition: all .15s ease;
}
.country-tab .flag { font-size: 1.15rem; line-height: 1; }
.country-tab:hover { border-color: var(--gold); }
.country-tab.active {
    background: var(--maroon); color: #fff; border-color: var(--maroon);
    box-shadow: var(--shadow);
}
.country-tab.active .name-en { color: var(--gold-bright); }
.country-tab .name-en { color: var(--muted); font-weight: 500; font-size: .85em; }

/* ===================== Promotion grid ===================== */
.section { padding: 34px 0 12px; flex: 1; }
.section-head { text-align: center; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.section-head .sub { color: var(--muted); }

.promo-grid {
    display: grid; gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.promo-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
}
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }

.promo-media { aspect-ratio: 16 / 10; background: var(--paper); position: relative; overflow: hidden; }
.promo-media img { width: 100%; height: 100%; object-fit: cover; }
.promo-media.placeholder {
    display: grid; place-items: center;
    background:
        repeating-linear-gradient(45deg, rgba(110,20,35,.04) 0 12px, transparent 12px 24px),
        var(--paper);
}
.promo-media.placeholder .crest-lg {
    width: 64px; height: 64px; border-radius: 50%; background: var(--maroon);
    display: grid; place-items: center; border: 2px solid var(--gold);
}
.promo-media.placeholder .crest-lg span { width: 18px; height: 18px; background: var(--gold-grad); transform: rotate(45deg); }

.promo-badge {
    position: absolute; top: 14px; left: 0;
    background: var(--gold-grad); color: #3a2a00;
    font-weight: 800; font-size: .8rem; letter-spacing: .02em;
    padding: 6px 14px 6px 16px;
    border-radius: 0 999px 999px 0;
    box-shadow: 0 4px 10px -4px rgba(0,0,0,.4);
}
.promo-country {
    position: absolute; top: 12px; right: 12px;
    background: rgba(78,13,24,.92); color: #fff;
    font-size: .78rem; font-weight: 600;
    padding: 5px 11px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px;
}
.promo-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.promo-body h3 { font-size: 1.28rem; }
.promo-body .subtitle { color: var(--gold-deep); font-weight: 600; margin: -4px 0 10px; }
.promo-body .desc { color: var(--muted); font-size: .96rem; margin: 0 0 16px; }
.promo-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.promo-price { font-family: "Playfair Display", serif; color: var(--maroon); font-weight: 800; font-size: 1.15rem; }
.btn-gold {
    text-decoration: none; font-weight: 700; font-size: .92rem;
    background: var(--maroon); color: #fff;
    padding: 10px 18px; border-radius: 999px;
    border: 1px solid var(--maroon);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.btn-gold:hover { background: var(--gold-grad); color: #3a2a00; border-color: var(--gold-deep); }

/* ===================== Notifications ===================== */
.notice-list { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin: 0 auto; }
.notice {
    border: 1px solid var(--line); border-left: 5px solid var(--maroon);
    border-radius: var(--radius); background: var(--white);
    padding: 18px 20px; position: relative;
}
.notice.type-success { border-left-color: #2e7d4f; }
.notice.type-warning { border-left-color: var(--gold-deep); }
.notice.type-danger  { border-left-color: #b3261e; }
.notice .notice-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.notice h3 { margin: 0; font-size: 1.2rem; font-family: "Sarabun","Noto Sans Thai",sans-serif; color: var(--ink); font-weight: 700; }
.notice .tag {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--maroon);
}
.notice.type-success .tag { background: #2e7d4f; }
.notice.type-warning .tag { background: var(--gold-deep); }
.notice.type-danger  .tag { background: #b3261e; }
.notice .pin { color: var(--gold-deep); font-weight: 700; font-size: .8rem; }
.notice .body { color: var(--muted); }
.notice .date { color: var(--muted); font-size: .82rem; margin-top: 8px; }

/* ===================== Empty state ===================== */
.empty {
    text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 48px 20px; background: var(--paper);
    max-width: 560px; margin: 0 auto;
}
.empty .diamond { margin-bottom: 8px; }

/* ============================ Footer ============================ */
/* Maroon footer · white text · SINGLE LINE on desktop AND mobile */
.site-footer {
    background: var(--maroon-dark);
    margin-top: 44px;
}
.site-footer .copyright {
    color: #ffffff;
    text-align: center;
    padding: 16px 12px;
    font-size: clamp(0.6rem, 2.6vw, 0.9rem);  /* shrinks to stay one line on phones */
    letter-spacing: .04em;
    white-space: nowrap;          /* never wrap */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================ Responsive ============================ */
@media (max-width: 640px) {
    .site-header .bar { flex-direction: column; gap: 12px; }
    .nav { width: 100%; justify-content: center; }
    .hero { padding: 40px 0 22px; }
    .promo-grid { grid-template-columns: 1fr; }
}

/* Accessibility: visible focus + reduced motion */
a:focus-visible, .btn-gold:focus-visible, .country-tab:focus-visible {
    outline: 3px solid var(--gold); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ===================== Image-only promo cards ===================== */
/* Card shows the uploaded artwork only — no text/overlays. Full image, never cropped. */
.promo-card.image-only { padding: 0; }
.promo-card.image-only.is-link { display: block; text-decoration: none; cursor: pointer; }
.promo-card.image-only .promo-media { aspect-ratio: auto; }
.promo-card.image-only .promo-media img { width: 100%; height: auto; display: block; }
/* Keep a tidy box when no image has been uploaded yet. */
.promo-card.image-only .promo-media.placeholder { aspect-ratio: 4 / 3; }

/* ============================================================
   v2 layout — logo header, icon nav (desktop top + mobile bottom),
   circular flag tabs, landscape image cards, lightbox
   ============================================================ */

.page { flex: 1 0 auto; }

/* ---- Header: logo + title (desktop AND mobile) ---- */
.site-header .bar { gap: 14px; }
.brand { gap: 12px; min-width: 0; }
.brand .logo { width: 44px; height: 44px; object-fit: contain; display: block; flex: none; }
.brand .site-title {
    font-family: "Playfair Display", "Noto Serif Thai", serif;
    font-weight: 700;
    color: var(--maroon);
    font-size: clamp(1.05rem, 3.4vw, 1.5rem);
    line-height: 1.15;
    letter-spacing: .01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Icon nav: identical markup desktop + mobile ---- */
.nav-item {
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--ink); font-weight: 600;
    padding: 9px 14px; border-radius: 999px; font-size: .95rem;
    transition: background .15s, color .15s;
}
.nav-item svg { width: 22px; height: 22px; flex: none; }
.nav-item:hover { background: var(--paper); }
.nav-item.active { background: var(--maroon); color: #fff; }

.top-nav { display: flex; gap: 6px; }
.bottom-nav { display: none; }   /* shown only on mobile */

/* ---- Circular flag country tabs ---- */
.country-bar { padding: 16px 0 4px; }
.country-tab { gap: 9px; padding: 7px 16px 7px 7px; }
.flag-circle {
    width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
    flex: none; display: grid; place-items: center;
    background: var(--paper); border: 1px solid var(--line);
}
.flag-circle img { width: 100%; height: 100%; object-fit: cover; }
.flag-circle .flag-emoji { font-size: 1.5rem; line-height: 1; }
.flag-circle .flag-code { font-weight: 800; font-size: .8rem; color: var(--maroon); }
.country-tab.active .flag-circle { border-color: var(--gold); }

/* ---- Promotion cards: image only, LANDSCAPE, clickable (button) ---- */
.promo-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.promo-card.image-only {
    appearance: none; -webkit-appearance: none;
    margin: 0; padding: 0; font: inherit; text-align: left; width: 100%;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; display: block;
    cursor: pointer;
}
.promo-card.image-only:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.promo-card.image-only .promo-media { aspect-ratio: 16 / 9; }
.promo-card.image-only .promo-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-card.image-only .promo-media.placeholder { aspect-ratio: 16 / 9; }
.promo-card.image-only.js-zoom { cursor: zoom-in; }

/* ---- Lightbox (zoom + close) ---- */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 4, 9, .92);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
    max-width: 96vw; max-height: 90vh; width: auto; height: auto;
    border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.lightbox-close {
    position: absolute; top: 18px; right: 20px;
    width: 46px; height: 46px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, .16); color: #fff;
    font-size: 30px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
body.no-scroll { overflow: hidden; }

/* ============================ Mobile ============================ */
@media (max-width: 640px) {
    .site-header .bar { flex-direction: row; gap: 10px; padding: 12px 0; }
    .top-nav { display: none; }                 /* hide top icons on mobile */
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
        background: #fff; border-top: 1px solid var(--line);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
        box-shadow: 0 -6px 18px -12px rgba(78, 13, 24, .4);
    }
    .bottom-nav .nav-item {
        flex-direction: column; gap: 3px; flex: 1; justify-content: center;
        border-radius: 12px; padding: 7px 6px; font-size: .72rem; font-weight: 700;
    }
    .bottom-nav .nav-item svg { width: 24px; height: 24px; }
    .bottom-nav .nav-item.active { background: transparent; color: var(--maroon); }
    .bottom-nav .nav-item.active svg { color: var(--maroon); }
    body { padding-bottom: 72px; }              /* clear the fixed bottom bar */
    .promo-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v3 — country tabs: flag on TOP, short label BELOW (compact)
   ============================================================ */
.country-tabs { gap: 10px 8px; align-items: flex-start; }
.country-tab {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 80px;
    padding: 8px 4px 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    font-weight: 600;
}
.country-tab .name-th {
    font-size: .78rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}
.country-tab:hover { border-color: var(--line); background: var(--paper); }
.country-tab.active {
    background: var(--maroon);
    color: #fff;
    border-color: var(--maroon);
    box-shadow: var(--shadow);
}
.country-tab.active .name-th { color: #fff; }
.country-tab .flag-circle { width: 44px; height: 44px; }

/* ============================================================
   v4 — mobile: 5 country flags per row
   ============================================================ */
@media (max-width: 640px) {
    .country-tabs {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 10px 4px;
        align-items: start;
    }
    .country-tab { width: auto; padding: 6px 2px 8px; }
    .country-tab .flag-circle { width: 38px; height: 38px; }
    .country-tab .name-th { font-size: .66rem; }
}

/* ============================================================
   v5 — mobile: center the header title (PROMOTION / NEWS)
   ============================================================ */
@media (max-width: 640px) {
    .site-header .bar { justify-content: center; }
    .brand { justify-content: center; flex: 0 1 auto; }
    .brand .site-title { text-align: center; }
}
