/* ============================================================
 * ALLOVE Activity — Public Stylesheet
 * Theme: white background, red-purple (สีแดงอมม่วง) accent bar
 * ============================================================ */

:root {
    --red:        #8B1A2B;
    --red-2:      #6E1B3F;       /* แดงอมม่วงเข้ม */
    --red-soft:   rgba(139, 26, 43, 0.08);
    --red-glow:   rgba(139, 26, 43, 0.18);

    --bg:         #ffffff;
    --bg-soft:    #f7f7fa;
    --bg-card:    #ffffff;
    --line:       #e6e7ec;
    --line-2:     #eef0f5;
    --text:       #1f2330;
    --text-2:     #4a4f5e;
    --muted:      #7a8093;

    --shadow-sm:  0 2px 6px rgba(20, 20, 40, 0.04);
    --shadow:     0 8px 24px rgba(20, 20, 40, 0.06);
    --shadow-lg:  0 20px 48px rgba(20, 20, 40, 0.10);
    --radius:     14px;
    --radius-lg:  20px;
    --radius-xl:  28px;
    --container:  1200px;

    --gradient:   linear-gradient(135deg, var(--red) 0%, var(--red-2) 100%);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Sarabun", "Tahoma", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-2); }
img { max-width: 100%; display: block; }

/* ============================================================
 * HEADER (สีแดงอมม่วง — gradient bar)
 * ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(110, 27, 63, 0.20);
}
.site-header__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.4px;
}
.brand__logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.brand__text { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand__th   { font-size: 19px; font-weight: 800; }
.brand__sub  { font-size: 11px; font-weight: 600; opacity: 0.88; letter-spacing: 2px; }

/* Compact text-only brand (no logo box) — header สั้นลง */
.brand__text-only {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #fff;
}
@media (max-width: 760px) {
    .brand__text-only { font-size: 15px; letter-spacing: 1px; }
}

.site-nav {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.site-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: background .18s ease;
}
.site-nav a:hover, .site-nav a.is-active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* ============================================================
 * MAIN
 * ============================================================ */
.site-main { min-height: 60vh; padding: 0 0 64px; }

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

/* ============================================================
 * SECTIONS
 * ============================================================ */
.section {
    padding: 40px 0 8px;
    scroll-margin-top: 80px;
}
/* section แรก (videos) ติดกับ header — ขยับเว้นด้านบนเล็กน้อย */
.section:first-of-type { padding-top: 32px; }
.section__head {
    margin: 0 auto 24px;
    text-align: center;
    max-width: 800px;
    padding: 0 22px;
}
.section__title {
    margin: 0 0 4px;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.2px;
}
.section__title-en {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.section__rule {
    width: 60px;
    height: 4px;
    margin: 14px auto 0;
    background: var(--gradient);
    border-radius: 4px;
}
.section__empty {
    max-width: 600px;
    margin: 12px auto 0;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

/* ============================================================
 * GRID — 2 columns desktop / 1 column mobile (per spec)
 * ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 0 22px;
    max-width: var(--container);
    margin: 0 auto;
}

@media (max-width: 760px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0 16px; }
}

/* ============================================================
 * VIDEO CARD
 * ============================================================ */
.video-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.video-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #d9c0c5;
}
.video-card__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.video-card__frame iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0;
    display: block;
}
/* ปุ่ม play (facade pattern — แทน iframe ที่หนัก) */
.video-card__trigger {
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: block;
    overflow: hidden;
    background: #000;
}
.video-card__thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease, opacity .2s ease;
}
.video-card__trigger:hover .video-card__thumb { transform: scale(1.04); opacity: .92; }
.video-card__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.45));
    transition: transform .2s ease;
}
.video-card__trigger:hover .video-card__play { transform: translate(-50%, -50%) scale(1.08); }
.video-card__trigger:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }

.video-card__body { padding: 16px 18px 18px; }
.video-card__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
}
.video-card__desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
 * VIDEO LIGHTBOX — overlay เต็มจอ
 * ============================================================ */
.vbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: opacity .2s ease;
}
.vbox.is-open { display: flex; opacity: 1; }
.vbox__close {
    position: absolute;
    top: 16px; right: 18px;
    width: 44px; height: 44px;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
    z-index: 2;
}
.vbox__close:hover {
    background: rgba(255,255,255,.25);
    transform: scale(1.08);
}
.vbox__close:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.vbox__stage {
    width: min(1200px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vbox__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.vbox__player iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0;
}
.vbox__caption {
    color: #fff;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    opacity: .95;
    padding: 0 12px;
}
@media (max-width: 760px) {
    .vbox { padding: 12px; }
    .vbox__close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 20px; }
    .vbox__caption { font-size: 13.5px; }
}

/* ============================================================
 * ALBUM CARD
 * ============================================================ */
.album-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: var(--shadow-sm);
    display: block;
    position: relative;
}
.album-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #d9c0c5;
}
.album-card__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-soft);
}
.album-card__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.album-card:hover .album-card__cover img { transform: scale(1.04); }
.album-card__cover--empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    background: linear-gradient(135deg, #f4f5fa, #ebedf3);
    font-size: 14px;
}
.album-card__count {
    position: absolute;
    right: 12px; top: 12px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}
.album-card__body { padding: 16px 18px 18px; }
.album-card__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
}
.album-card__desc {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.album-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--red);
    font-weight: 700;
    font-size: 14px;
}
.album-card__cta::after {
    content: "→";
    transition: transform .2s ease;
}
.album-card:hover .album-card__cta::after { transform: translateX(4px); }

/* ============================================================
 * ALBUM PAGE — masonry-like photo grid
 * ============================================================ */
.album-hero {
    background: var(--gradient);
    color: #fff;
    padding: 38px 22px 32px;
}
.album-hero__inner {
    max-width: var(--container);
    margin: 0 auto;
}
.album-hero__back {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    margin-bottom: 16px;
}
.album-hero__back:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.album-hero__title {
    margin: 0 0 6px;
    font-size: clamp(24px, 3.6vw, 36px);
    font-weight: 900;
    line-height: 1.2;
}
.album-hero__meta {
    margin: 8px 0 0;
    font-size: 14px;
    opacity: 0.92;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.album-hero__desc {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.6;
    max-width: 800px;
    opacity: 0.95;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 28px 22px 0;
    max-width: var(--container);
    margin: 0 auto;
}
@media (max-width: 1024px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 22px 14px 0;} }

.photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.photo-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.photo-tile img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.photo-tile:hover img { transform: scale(1.06); }

/* ============================================================
 * LIGHTBOX
 * ============================================================ */
.lb {
    position: fixed; inset: 0;
    background: rgba(10, 10, 16, 0.94);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.lb.is-open { display: flex; }
.lb__img {
    max-width: 96vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    user-select: none;
}
.lb__btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    width: 50px; height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
    user-select: none;
}
.lb__btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb__close { top: 18px; right: 18px; }
.lb__prev  { left: 18px;  top: 50%; transform: translateY(-50%); }
.lb__next  { right: 18px; top: 50%; transform: translateY(-50%); }
.lb__count {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
@media (max-width: 600px) {
    .lb__btn { width: 42px; height: 42px; font-size: 18px; }
    .lb__close { top: 12px; right: 12px; }
    .lb__prev  { left: 8px; }
    .lb__next  { right: 8px; }
}

/* ============================================================
 * FOOTER — สีแดงอมม่วงเหมือน header
 * ============================================================ */
.site-footer {
    background: linear-gradient(135deg, #8B1A2B 0%, #6E1B3F 100%);
    color: #ffffff;
    padding: 36px 22px 28px;
    margin-top: 48px;
}
.site-footer__inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}
.site-footer__brand {
    font-weight: 800;
    color: #fff;
    font-size: 18px;
    letter-spacing: 1px;
}
.site-footer__links {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.site-footer__links a { color: #ffffff; text-decoration: none; }
.site-footer__links a:hover { color: #ffffff; text-decoration: underline; }
.site-footer__links .dot { opacity: 0.55; }
.site-footer__copy {
    font-size: 12.5px;
    letter-spacing: 1px;
    color: #ffffff;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    width: 100%;
    max-width: 600px;
}
