/* หน้าเว็บสาธารณะ: แบนเนอร์เต็มจอ + แถบบัตรเต็มจอทีละใบ (รูปบัตรเลื่อนจากซ้าย ข้อความเลื่อนจากขวา) */

:root {
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: #e5e5ea;
    --surface: #ffffff;
    --surface-alt: #f5f5f7;
    --night: #0b0b0f;
    --night-ink: #f5f5f7;
    --night-muted: #a1a1aa;
    --night-line: rgba(255, 255, 255, 0.1);
    --accent: #0071e3;
    --new: #34c759;
    --radius: 18px;
    --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #f5f5f7;
        --muted: #a1a1a6;
        --line: #2c2c2e;
        --surface: #111114;
        --surface-alt: #1a1a1e;
        --accent: #2997ff;
    }
}

:root[data-theme="dark"] {
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2c2c2e;
    --surface: #111114;
    --surface-alt: #1a1a1e;
    --accent: #2997ff;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: "Prompt", "Noto Sans Thai", Tahoma, sans-serif;
    font-weight: 300;
    line-height: 1.65;
    overflow-x: hidden;
}

img { max-width: 100%; }

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

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.container.narrow { max-width: 820px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ----- แถบเมนูด้านบน ----- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 11, 15, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--night-line);
}

.topbar-inner {
    position: relative;
    max-width: 1140px;
    min-height: var(--header-h);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.brand {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 32px;
}

.site-nav a {
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    font-weight: 400;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
    color: #fff;
    border-color: var(--accent);
}

.nav-toggle { display: none; }

@media (max-width: 860px) {
    .js .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
        margin-left: auto;
        padding: 10px 8px;
        border: 0;
        background: none;
        cursor: pointer;
    }

    .nav-toggle span:not(.sr-only) {
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
        transition: transform 0.25s, opacity 0.25s;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .js .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 4px 16px 12px;
        background: rgba(11, 11, 15, 0.97);
        border-bottom: 1px solid var(--night-line);
    }

    .js .site-nav.open { display: flex; }

    .js .site-nav a {
        padding: 12px 0;
        border-bottom: 1px solid var(--night-line);
    }
}

/* ----- แบนเนอร์สไลด์เต็มจอ ----- */

.banner {
    position: relative;
    background: var(--night);
}

/* ทุกภาพซ้อนกันในช่องเดียว แล้วใช้ transform/opacity เปลี่ยนภาพตามรูปแบบที่เลือก (data-effect) */
.slider-track {
    display: grid;
    align-items: center;
    overflow: hidden;
    touch-action: pan-y;
}

.slide {
    position: relative;
    grid-area: 1 / 1;
    margin: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--speed, 0.8s) cubic-bezier(0.65, 0, 0.35, 1),
        opacity var(--speed, 0.8s) ease,
        visibility 0s linear var(--speed, 0.8s);
}

.slide.is-active,
.slide.is-leaving {
    visibility: visible;
    transition-delay: 0s;
}

.slide.is-active {
    z-index: 1;
    pointer-events: auto;
}

/* สถานะเริ่มต้นของภาพที่ไม่ได้แสดง (JS จะกำหนดทิศทางเข้า/ออกให้) */
[data-effect="fade"] .slide:not(.is-active) { opacity: 0; }
[data-effect="zoom"] .slide:not(.is-active) { opacity: 0; transform: scale(1.15); }
[data-effect="zoom"] .slide.is-leaving { transform: scale(1); }

/* แสดงรูปเต็มทั้งภาพตามสัดส่วนจริง ไม่ครอป (จำกัดไม่ให้สูงเกินหน้าจอ) */
.slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--header-h));
    object-fit: contain;
}

.slide figcaption {
    position: absolute;
    left: max(16px, calc((100% - 1140px) / 2 + 16px));
    bottom: 52px;
    max-width: 70%;
    color: #fff;
    font-size: clamp(1.1rem, 2.6vw, 2rem);
    font-weight: 600;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.slider-btn:hover { background: rgba(0, 0, 0, 0.6); }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

.slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slider-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: width 0.3s, background 0.3s;
}

.slider-dots button.on {
    width: 28px;
    background: #fff;
}

@media (max-width: 640px) {
    .slider-btn { display: none; }
    .slide figcaption { bottom: 40px; }
}

/* ----- ส่วนแนะนำ ----- */

.intro {
    padding: clamp(56px, 8vw, 88px) 0 clamp(48px, 7vw, 76px);
    background:
        radial-gradient(1100px 420px at 50% -10%, rgba(41, 151, 255, 0.32), transparent 70%),
        var(--night);
    color: var(--night-ink);
    text-align: center;
}

.intro h1 {
    margin: 0 0 12px;
    font-size: clamp(1.7rem, 4.4vw, 3rem);
    font-weight: 600;
    line-height: 1.3;
}

.intro p {
    max-width: 680px;
    margin: 0 auto 28px;
    color: var(--night-muted);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.pill-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.45);
}

/* ----- หัวข้อส่วนต่างๆ ----- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.light { background: var(--surface); }
.section.alt { background: var(--surface-alt); }

.section.dark {
    background:
        radial-gradient(900px 500px at 85% 0%, rgba(41, 151, 255, 0.18), transparent 60%),
        var(--night);
    color: var(--night-ink);
}

.section-title {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 3.6vw, 2.4rem);
    font-weight: 600;
    text-align: center;
}

.section-sub {
    margin: 0 0 36px;
    color: var(--muted);
    text-align: center;
}

.dark .section-sub { color: var(--night-muted); }

/* ----- ขั้นตอนการสมัคร ----- */

/* ใช้ flex จัดกึ่งกลาง เพื่อไม่ให้ขั้นตอนสุดท้ายค้างอยู่ชิดซ้ายแถวเดียว */
.step-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step {
    flex: 1 1 190px;
    max-width: 280px;
    padding: 28px 24px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    transition: transform 0.25s, box-shadow 0.25s;
}

.step:hover,
.js .step.reveal.in:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.step-no {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.step h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 500;
}

.step p {
    margin: 0;
    color: var(--muted);
}

/* ----- ข่าวสาร: การ์ดข่าว (หน้าแรก, หน้าข่าวทั้งหมด, ข่าวที่เกี่ยวข้อง) ----- */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 24px;
}

.news-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: transform 0.25s, box-shadow 0.25s;
}

.news-card:hover,
.js .news-card.reveal.in:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

.news-thumb {
    display: block;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: var(--surface-alt);
}

.news-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.news-card:hover .news-thumb img { transform: scale(1.04); }

.news-thumb-empty {
    display: block;
    height: 100%;
    background:
        radial-gradient(400px 200px at 80% 0%, rgba(41, 151, 255, 0.35), transparent 60%),
        var(--night);
}

.news-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px 22px;
}

.news-cat {
    align-self: flex-start;
    padding: 1px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

.news-body h3 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 500;
    line-height: 1.45;
}

.news-body h3 a {
    color: var(--ink);
    text-decoration: none;
}

.news-body h3 a:hover { color: var(--accent); }

.news-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.news-excerpt {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-more {
    margin: 36px 0 0;
    text-align: center;
}

.news-empty {
    padding: 40px 0;
    color: var(--muted);
    text-align: center;
}

/* ----- หน้าข่าวทั้งหมด ----- */

.news-head { padding-bottom: 40px; }

.news-search { margin-bottom: 20px; }

.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.chip {
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: var(--night-ink);
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.chip:hover { border-color: #fff; }

.chip.on {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.filter-note {
    margin: 16px 0 0;
    color: var(--night-muted);
    text-align: center;
}

.filter-note a { margin-left: 8px; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    min-width: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
}

.pagination a:hover { border-color: var(--accent); }

.pagination .on {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.pagination .gap {
    border-color: transparent;
    background: none;
}

.tag-cloud {
    margin-top: 48px;
    text-align: center;
}

.tag-cloud h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 500;
}

.tag {
    display: inline-block;
    margin: 4px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.tag:hover,
.tag.on {
    border-color: var(--accent);
    color: var(--accent);
}

/* ----- หน้าอ่านข่าว ----- */

.preview-bar {
    margin: 0;
    padding: 10px 16px;
    background: #ff9f0a;
    color: #111;
    font-weight: 500;
    text-align: center;
}

.article { padding-top: 32px; padding-bottom: 56px; }

.crumbs {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

.crumbs a:hover { color: var(--accent); }

.article .news-cat { margin-right: 6px; }

.article h1 {
    margin: 12px 0 8px;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.3;
}

.article-cover {
    display: block;
    width: 100%;
    margin: 24px 0 8px;
    border-radius: var(--radius);
}

.article-content {
    margin-top: 24px;
    font-size: 1.08rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.6em 0 0.5em;
    font-weight: 600;
    line-height: 1.4;
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.2em auto;
    border-radius: 12px;
}

.article-content .ql-align-right img { margin-right: 0; }

.article-content hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.article-content code {
    padding: 0.1em 0.4em;
    border-radius: 6px;
    background: var(--surface-alt);
    font-size: 0.9em;
}

.article-content .ql-size-small { font-size: 0.8em; }
.article-content .ql-size-large { font-size: 1.4em; line-height: 1.5; }
.article-content .ql-size-huge { font-size: 2em; line-height: 1.35; }

.article-content .ql-indent-1 { padding-left: 2em; }
.article-content .ql-indent-2 { padding-left: 4em; }
.article-content .ql-indent-3 { padding-left: 6em; }
.article-content .ql-indent-4 { padding-left: 8em; }
.article-content .ql-indent-5 { padding-left: 10em; }
.article-content .ql-indent-6 { padding-left: 12em; }
.article-content .ql-indent-7 { padding-left: 14em; }
.article-content .ql-indent-8 { padding-left: 16em; }

.article-content iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 1.2em 0;
    border: 0;
    border-radius: 12px;
}

.article-content blockquote {
    margin: 1.2em 0;
    padding: 4px 0 4px 18px;
    border-left: 4px solid var(--accent);
    color: var(--muted);
}

.article-content pre {
    overflow-x: auto;
    padding: 14px;
    border-radius: 10px;
    background: var(--surface-alt);
}

.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }

.attachments {
    margin-top: 32px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.attachments h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 500;
}

.attachments ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.attachments li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.attachments li:first-child { border-top: 0; }

.attachments span {
    color: var(--muted);
    white-space: nowrap;
}

.article-tags { margin: 24px 0 0; }

.article-tags .tag { margin: 4px 6px 4px 0; }

.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.share > span {
    margin-right: 4px;
    font-weight: 500;
}

.share-btn {
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.share-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.share-btn.fb { background: #1877f2; }
.share-btn.line { background: #06c755; }
.share-btn.x { background: #000; }

.share-btn.copy {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--ink);
}

/* ----- บัตรที่รองรับ: หัวส่วน + ช่องค้นหา ----- */

.cards-head { padding-bottom: 40px; }

.search {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
}

.search::placeholder { color: var(--night-muted); }

.search:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.empty,
.no-result {
    margin: 20px 0 0;
    color: var(--night-muted);
    text-align: center;
}

/* ----- แถบบัตรเต็มจอ (ใบละแถบ พื้นหลังตามสีธีม/รูปของแต่ละบัตร) ----- */

.feature {
    --theme: #1d1d1f;
    display: flex;
    align-items: center;
    min-height: min(80vh, 720px);
    padding: clamp(56px, 8vw, 96px) 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background-color: var(--night);
    background-image:
        linear-gradient(100deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.05)),
        linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 25%, #000));
    background-size: cover;
    background-position: center;
    color: #fff;
}

.feature[hidden] { display: none; }

/* ปุ่มเปลี่ยนหน้าใต้รายการบัตร (สร้างด้วย JavaScript) */
.card-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 16px;
    border-top: 1px solid var(--night-line);
    background: var(--night);
}

.card-pager[hidden] { display: none; }

.card-pager button,
.card-pager span {
    min-width: 42px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--night-ink);
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.card-pager span {
    border-color: transparent;
    background: none;
    cursor: default;
}

.card-pager button:hover:not(:disabled) { border-color: #fff; }

.card-pager button.on {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.card-pager button:disabled {
    opacity: 0.35;
    cursor: default;
}

.feature-inner {
    width: 100%;
    display: grid;
    grid-template-columns: 6fr 6fr;
    align-items: center;
    gap: clamp(28px, 5vw, 80px);
}

.feature-card img { display: block; }

.feature-card img,
.feature-card .card-mock {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 22px;
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.5), 0 10px 22px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease;
}

.feature-card img:hover,
.feature-card .card-mock:hover {
    transform: translateY(-6px) rotate(-1.5deg);
}

.feature-text h3 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 600;
    line-height: 1.15;
}

.feature-bank {
    margin: 8px 0 14px;
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.feature-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.feature-meta li {
    padding: 3px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.feature-note {
    max-width: 520px;
    margin: 0 0 28px;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.badge-new {
    display: inline-block;
    margin-bottom: 10px;
    padding: 1px 12px;
    border-radius: 999px;
    background: var(--new);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
}

.circle-btn {
    display: inline-grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.25s, color 0.25s, transform 0.25s;
}

.circle-btn:hover {
    background: #fff;
    color: #111;
    transform: scale(1.06);
}

.feature-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.apply-btn {
    display: inline-block;
    padding: 14px 44px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s, box-shadow 0.25s;
}

.apply-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 760px) {
    .feature { min-height: 0; }

    .feature-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .feature-meta,
    .feature-actions { justify-content: center; }
    .feature-note { margin-inline: auto; }

    .feature-card img,
    .feature-card .card-mock { max-width: 340px; }
}

/* ----- บัตรจำลอง เมื่อยังไม่มีรูปบัตร ----- */

.card-mock {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1.586;
    padding: 7% 8%;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--theme) 80%, #fff),
        var(--theme) 45%,
        color-mix(in srgb, var(--theme) 40%, #000));
    color: #fff;
    font-size: clamp(0.7rem, 1.6vw, 1rem);
    text-align: left;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.card-mock::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 60%);
    pointer-events: none;
}

.card-mock .chip {
    width: 16%;
    aspect-ratio: 1.3;
    border-radius: 6px;
    background: linear-gradient(135deg, #e9d18a, #b8953d);
}

.mock-bank {
    font-weight: 500;
    opacity: 0.9;
}

.mock-name {
    font-size: 1.35em;
    font-weight: 600;
    line-height: 1.25;
}

.mock-net {
    align-self: flex-end;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ----- คำถามที่พบบ่อย ----- */

.faq {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: box-shadow 0.2s, opacity 0.6s, transform 0.6s;
}

.faq[open] { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }

.faq summary {
    position: relative;
    padding: 18px 52px 18px 20px;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 22px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.25s;
}

.faq[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.faq p {
    margin: 0;
    padding: 0 20px 18px;
    color: var(--muted);
}

/* ----- โฆษณา ----- */

.ad-slot {
    margin: 32px auto;
    text-align: center;
}

/* ซ่อนช่องว่างเมื่อ Google ไม่มีโฆษณามาแสดง */
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

/* โฆษณาแบบกำหนดเอง: แนวนอน */
.sp-box {
    padding: 20px 0;
    background: var(--surface);
    text-align: center;
}

.sp-box .container {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.article .sp-box { padding: 8px 0 24px; background: none; }
.article .sp-box .container { padding: 0; }

.sp-tag {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    margin-bottom: -6px;
}

.sp-link {
    display: block;
    max-width: 100%;
    line-height: 0;
}

.sp-link img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* iframe ที่ฝัง */
.sp-embed {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.sp-embed iframe {
    display: block;
    width: 100%;
    border: 0;
}

.sp-side .sp-embed { width: 160px; }

/* การ์ดตัวอย่างลิงก์ (โฆษณาที่ไม่ได้อัปโหลดรูป ระบบดึงจากหน้าเว็บ) */
.sp-card {
    display: flex;
    width: 100%;
    max-width: 760px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sp-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.sp-card img {
    flex: 0 0 40%;
    width: 40%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
    border-radius: 0;
}

.sp-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 14px 18px;
}

.sp-card-site {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sp-card strong {
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-card-desc {
    color: var(--muted);
    font-size: 0.88rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-side .sp-card,
.sp-side .sp-card img { width: 160px; }

.sp-side .sp-card { flex-direction: column; }
.sp-side .sp-card img { flex: none; }
.sp-side .sp-card-body { padding: 10px 12px; }
.sp-side .sp-card-desc { -webkit-line-clamp: 4; }

@media (max-width: 600px) {
    .sp-card { flex-direction: column; }
    .sp-card img { flex: none; width: 100%; }
}

/* โฆษณาแบบกำหนดเอง: แนวตั้งติดข้างจอ เฉพาะจอที่มีที่ว่างข้างเนื้อหา (1140 px) พอ */
.sp-side { display: none; }

@media (min-width: 1500px) {
    .sp-side {
        position: fixed;
        top: calc(var(--header-h) + 24px);
        z-index: 40;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 160px;
        max-height: calc(100vh - var(--header-h) - 48px);
        overflow: hidden;
    }

    .sp-side-left { right: calc(50% + 570px + 16px); }
    .sp-side-right { left: calc(50% + 570px + 16px); }

    .sp-side .sp-tag {
        margin: 0;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.45);
        color: #fff;
    }

    .sp-side .sp-link img { width: 160px; }
}

/* ----- ท้ายเว็บ ----- */

.footer {
    padding: 36px 0;
    background: #050507;
    color: var(--night-muted);
    font-size: 0.9rem;
    text-align: center;
}

.footer nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 14px;
}

.footer a {
    color: var(--night-ink);
    text-decoration: none;
}

.footer p { margin: 4px 0; }

.footer .visit-counter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 12px;
}

.visit-counter span {
    padding: 4px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.visit-counter strong {
    color: var(--night-ink);
    font-variant-numeric: tabular-nums;
}

/* ----- เอฟเฟกต์เลื่อนเข้ามาเมื่อเลื่อนถึง (ทำงานเฉพาะเมื่อมี JavaScript) ----- */

.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* รูปบัตรเลื่อนจากซ้าย ข้อความเลื่อนจากขวา */
.js .reveal.from-left,
.js .reveal.from-right {
    transition: opacity 1.1s ease, transform 1.2s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.js .reveal.from-left { transform: translateX(-30vw); }

/* ข้อความเริ่มอยู่ทางขวา แล้วเลื่อนมาทางซ้ายเข้าที่ หลังรูปบัตรเล็กน้อย */
.js .reveal.from-right { transform: translateX(35vw); }
.js .reveal.from-right.in { transition-delay: 0.2s; }

.js .reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .slide { transition: none; }

    .js .reveal,
    .js .reveal.from-left,
    .js .reveal.from-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
