/* Styles specific to gallery.html. */

:root {
            --wine: #57121b;
            --wine-dark: #2d080e;
            --gold: #d4af37;
            --gold-light: #f8e8ab;
            --cream: #fbf8f0;
            --ink: #2e2522;
            --muted: #6f625b;
            --surface: #ffffff;
            --line: #eadfcb;
            --shadow: 0 18px 45px rgba(45, 8, 14, .14);
        }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
        margin: 0;
        min-width: 320px;
        color: var(--ink);
        background: var(--cream);
        font-family: "Noto Sans Lao", "Noto Sans Thai", Tahoma, sans-serif;
        line-height: 1.6;
    }

    button, a { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; }
    img { display: block; max-width: 100%; }
    :focus-visible { outline: 3px solid #1769aa; outline-offset: 3px; }

    .skip-link {
        position: fixed;
        z-index: 100;
        top: -100px;
        left: 16px;
        padding: 10px 16px;
        color: #fff;
        background: var(--wine-dark);
        border-radius: 0 0 12px 12px;
    }
    .skip-link:focus { top: 0; }

    .site-header {
        position: sticky;
        z-index: 20;
        top: 0;
        border-bottom: 2px solid rgba(212, 175, 55, .7);
        color: #fff;
        background: rgba(87, 18, 27, .97);
        box-shadow: 0 5px 18px rgba(28, 4, 8, .24);
    }
    .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        max-width: 1200px;
        min-height: 76px;
        margin: 0 auto;
        padding: 10px 24px;
    }
    .brand {
        display: inline-flex;
        align-items: center;
        gap: 11px;
        color: #fff;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }
    .brand img {
        width: 45px;
        height: 45px;
        padding: 3px;
        object-fit: cover;
        background: var(--gold-light);
        border: 1px solid var(--gold);
        border-radius: 50%;
    }
    .brand-text { display: grid; line-height: 1.25; }
    .brand-text small { color: var(--gold-light); font-size: .68rem; font-weight: 500; letter-spacing: .06em; }
    .site-nav { display: flex; align-items: center; gap: 4px; }
    .site-nav a {
        padding: 8px 11px;
        color: #fff9e9;
        border-radius: 9px;
        font-size: .9rem;
        text-decoration: none;
    }
    .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold-light); background: rgba(212, 175, 55, .17); }
    .header-actions { display: flex; align-items: center; gap: 8px; }
    .language-menu { position: relative; }
    .language-menu-trigger {
        display: inline-flex;
        align-items: center;
        gap: .42rem;
        min-height: 2.25rem;
        padding: .34rem .68rem;
        color: var(--wine);
        border: 1px solid rgba(212, 175, 55, .75);
        border-radius: .7rem;
        background: linear-gradient(145deg, #fffdf8, #f8ebbf);
        box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
        font-size: .76rem;
        font-weight: 700;
        transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    }
    .language-menu-trigger:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 7px 16px rgba(0, 0, 0, .22); }
    .language-icon { display: grid; width: 1.35rem; height: 1.35rem; place-items: center; color: #fff; border-radius: 50%; background: var(--wine); }
    .language-chevron { color: #9d7516; font-size: .65rem; transition: transform .2s ease; }
    .language-menu-trigger[aria-expanded="true"] .language-chevron { transform: rotate(180deg); }
    .language-menu-popover { position: absolute; z-index: 50; top: calc(100% + .5rem); right: 0; display: grid; width: 11.25rem; padding: .35rem; border: 1px solid rgba(212, 175, 55, .7); border-radius: .9rem; background: #fffdf8; box-shadow: 0 14px 34px rgba(45, 8, 14, .26); opacity: 0; pointer-events: none; transform: translateY(-.35rem) scale(.97); transform-origin: top right; transition: opacity .16s ease, transform .16s ease; }
    .language-menu.is-open .language-menu-popover { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
    .language-option { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .62rem .7rem; color: var(--ink); border: 0; border-radius: .65rem; background: transparent; text-align: left; font-size: .82rem; font-weight: 700; transition: background .18s ease, color .18s ease, transform .18s ease; }
    .language-option:hover, .language-option[aria-current="true"] { color: var(--wine); background: #fff1c8; transform: translateX(2px); }
    .language-option-flag { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border-radius: 50%; background: #f7ebcb; font-size: .9rem; }

    .hero {
        position: relative;
        overflow: hidden;
        padding: 54px 24px 62px;
        color: #fff;
        background: radial-gradient(circle at 82% 10%, rgba(212, 175, 55, .28), transparent 30%), linear-gradient(125deg, var(--wine-dark), var(--wine));
    }
    .hero::after {
        position: absolute;
        inset: auto -16px -40px auto;
        width: 270px;
        height: 270px;
        border: 1px solid rgba(248, 232, 171, .24);
        border-radius: 50%;
        content: "";
    }
    .hero-inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
    .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 11px; color: var(--gold-light); font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
    .eyebrow::before { width: 26px; height: 1px; background: var(--gold); content: ""; }
    h1 { max-width: 780px; margin: 0; color: #fff; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.2; }
    .hero p { max-width: 720px; margin: 17px 0 0; color: #f9ecd3; font-size: 1.04rem; }
    .hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
    .meta-chip { padding: 8px 12px; border: 1px solid rgba(248, 232, 171, .35); border-radius: 99px; background: rgba(0, 0, 0, .14); color: #fff3d4; font-size: .86rem; }

    .page-shell { max-width: 1120px; margin: 0 auto; padding: 44px 24px 66px; }
    .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
    .section-heading h2 { margin: 0; color: var(--wine); font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.3; }
    .section-heading p { max-width: 560px; margin: 0; color: var(--muted); font-size: .94rem; text-align: right; }

    .slider {
        overflow: hidden;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 22px;
        box-shadow: var(--shadow);
    }
    .slide-stage {
        position: relative;
        display: block; /* เปลี่ยนจาก grid เป็น block ให้คุมส่วนสูงได้ดีขึ้น */
        height: 500px;  /* บังคับความสูงตายตัว */
        isolation: isolate;
        background: #211517;
        overflow: hidden; /* **สำคัญ** ตัดรูปส่วนที่เกิน/ซูมล้นออกไป ไม่ให้ทับข้อความ */
    }
    .slide-image { 
        width: 100%; 
        height: 100%; 
        object-fit: cover; 
        cursor: zoom-in;
        opacity: .96; 
        transform: scale(1.025); 
        will-change: opacity, transform, filter; 
        transition: opacity .5s ease, transform 7s cubic-bezier(.16, 1, .3, 1), filter .5s ease; 
        animation: slide-ken-burns 12s ease-out both; 
    }
    .slide-stage.is-changing .slide-image { opacity: .1; transform: scale(1.08); filter: saturate(.7) blur(1px); }
    @keyframes slide-ken-burns { from { transform: scale(1.025); } to { transform: scale(1.1); } }
    
    .slide-number { position: absolute; z-index: 3; top: 22px; right: 24px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; background: rgba(0, 0, 0, .35); color: #fff; font-size: .78rem; font-variant-numeric: tabular-nums; }
    .slider-controls { position: absolute; z-index: 4; top: 50%; right: 18px; left: 18px; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; }
    .slider-controls button {
        display: grid;
        width: 46px;
        height: 46px;
        place-items: center;
        padding: 0;
        color: #fff;
        border: 1px solid rgba(255, 255, 255, .5);
        border-radius: 50%;
        background: rgba(27, 7, 10, .7);
        font-size: 1.65rem;
        line-height: 1;
        pointer-events: auto;
        transition: background .2s ease, transform .2s ease;
    }
    .slider-controls button:hover { background: var(--wine); transform: scale(1.06); }
    
    .slide-info { padding: 25px 35px 15px; color: var(--ink); background: #fffdfa; position: relative; z-index: 5; }
    .slide-kicker { margin: 0 0 6px; color: #b28d1b; font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
    .slide-info h3 { margin: 0; color: var(--wine); font-size: clamp(1.4rem, 3.5vw, 1.8rem); line-height: 1.28; }
    .slide-info p { margin: 6px 0 0; color: var(--muted); font-size: .96rem; }

    .slider-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px 20px; background: #fffdfa; position: relative; z-index: 5; }
    .slider-dots { display: flex; flex-wrap: wrap; gap: 7px; }
    .slider-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #d9cdbd; transition: width .25s ease, background .25s ease, transform .2s ease; }
    .slider-dots button:hover { transform: scale(1.2); background: #b28d1b; }
    .slider-dots button.active { width: 25px; border-radius: 8px; background: var(--wine); }
    .pause-button { padding: 6px 9px; color: var(--wine); border: 1px solid #dac9ae; border-radius: 7px; background: #fff; font-size: .78rem; font-weight: 700; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
    .pause-button:hover { background: #fff7df; transform: translateY(-1px); box-shadow: 0 5px 12px rgba(87, 18, 27, .12); }

    .thumbnail-section { margin-top: 43px; }
    .thumbnail-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
    .thumbnail {
        position: relative;
        overflow: hidden;
        min-height: 128px;
        padding: 0;
        color: #fff;
        border: 2px solid transparent;
        border-radius: 13px;
        background: var(--wine-dark);
        text-align: left;
        transition: border-color .2s ease, transform .2s ease;
    }
    .thumbnail:hover { transform: translateY(-3px); }
    .thumbnail.active { border-color: var(--gold); box-shadow: 0 8px 20px rgba(87, 18, 27, .2); }
    .thumbnail img { width: 100%; height: 128px; object-fit: cover; opacity: .81; transition: opacity .2s ease, transform .35s ease; }
    .thumbnail:hover img, .thumbnail.active img { opacity: 1; transform: scale(1.05); }
    .thumbnail span { position: absolute; right: 0; bottom: 0; left: 0; padding: 23px 9px 8px; background: linear-gradient(transparent, rgba(26, 4, 7, .91)); color: #fff; font-size: .74rem; font-weight: 600; line-height: 1.35; }

    .service-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 22px; margin-top: 54px; }
    .service-card { padding: 27px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 8px 22px rgba(69, 45, 22, .06); }
    .service-card h2 { margin: 0; color: var(--wine); font-size: 1.4rem; }
    .service-card p { margin: 9px 0 0; color: var(--muted); font-size: .94rem; }
    .guide-list { display: grid; gap: 11px; margin: 19px 0 0; padding: 0; list-style: none; }
    .guide-list li { display: flex; gap: 11px; align-items: flex-start; }
    .guide-list b { display: grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; color: var(--wine); border-radius: 50%; background: #f9edd0; font-size: .77rem; }
    .drive-card { display: flex; flex-direction: column; justify-content: center; color: #fff; border-color: transparent; background: linear-gradient(145deg, var(--wine), var(--wine-dark)); }
    .drive-card h2 { color: var(--gold-light); }
    .drive-card p { color: #f8e8c5; }
    .drive-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: flex-start; margin-top: 21px; padding: 11px 15px; color: var(--wine-dark); border-radius: 9px; background: var(--gold-light); font-weight: 700; text-decoration: none; }
    .drive-link:hover { background: #fff1bd; }

    .site-footer { padding: 30px 24px; color: #f9ecd3; background: var(--wine-dark); text-align: center; }
    .site-footer p { margin: 0; font-size: .86rem; }
    .site-footer small { display: block; margin-top: 4px; color: #d9c6a3; }

    .gallery-lightbox { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px 76px; background: rgba(18, 5, 7, .94); opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
    .gallery-lightbox.is-open { opacity: 1; visibility: visible; }
    .gallery-lightbox-frame { display: grid; width: min(100%, 1100px); max-height: 100%; gap: 12px; margin: 0; text-align: center; }
    .gallery-lightbox-image-wrap { display: grid; min-height: 0; place-items: center; overflow: hidden; border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px; background: #0f0507; touch-action: pan-y; }
    .gallery-lightbox-image { display: block; max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; cursor: zoom-in; transform: scale(1); transition: transform .28s ease; }
    .gallery-lightbox.is-zoomed .gallery-lightbox-image { cursor: zoom-out; transform: scale(1.65); }
    .gallery-lightbox-caption { color: #fff3d4; font-size: .9rem; line-height: 1.45; }
    .gallery-lightbox-caption strong { display: block; color: var(--gold-light); font-size: 1rem; }
    .gallery-lightbox-close, .gallery-lightbox-nav { position: absolute; z-index: 2; display: grid; width: 46px; height: 46px; padding: 0; place-items: center; color: #fff; border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%; background: rgba(27, 7, 10, .75); font-size: 1.8rem; line-height: 1; transition: transform .2s ease, background .2s ease; }
    .gallery-lightbox-close { top: 18px; right: 20px; font-size: 1.5rem; }
    .gallery-lightbox-nav { top: 50%; transform: translateY(-50%); }
    .gallery-lightbox-nav:hover, .gallery-lightbox-close:hover { background: var(--wine); transform: translateY(-50%) scale(1.06); }
    .gallery-lightbox-close:hover { transform: scale(1.06); }
    .gallery-lightbox-prev { left: 18px; }
    .gallery-lightbox-next { right: 18px; }
    body.gallery-lightbox-open { overflow: hidden; }

    @media (max-width: 860px) {
        .site-nav { display: none; }
        .topbar { min-height: 68px; padding: 9px 16px; }
        .brand-text small { display: none; }
        .slide-stage { height: 440px; }
        .thumbnail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .service-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 560px) {
        .brand-text { font-size: .88rem; }
        .brand img { width: 39px; height: 39px; }
        .hero { padding: 42px 19px 49px; }
        .page-shell { padding: 32px 16px 49px; }
        .section-heading { display: block; }
        .section-heading p { margin-top: 6px; text-align: left; }
        .slide-stage { height: 405px; }
        .slide-info { padding: 20px 20px 10px; }
        .slide-number { top: 14px; right: 15px; }
        .slider-controls { right: 11px; left: 11px; }
        .slider-controls button { width: 40px; height: 40px; }
        .slider-bottom { align-items: flex-start; }
        .thumbnail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
        .service-card { padding: 22px; }
        .gallery-lightbox { padding: 18px 52px; }
        .gallery-lightbox-nav { width: 40px; height: 40px; font-size: 1.55rem; }
        .gallery-lightbox-prev { left: 7px; }
        .gallery-lightbox-next { right: 7px; }
        .gallery-lightbox-close { top: 9px; right: 9px; width: 38px; height: 38px; }
        .gallery-lightbox-image { max-height: calc(100vh - 130px); }
    }
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    }
