/* =====================================================
   CMS — News list, article, and inline prose
   Used by:
     - /news (list)
     - /news/<id>-<slug> (article)
     - homepage "Latest news" card grid
     - TinyMCE editor (content_style mirrors .cms-prose so
       WYSIWYG matches the live page)
   ===================================================== */

:root {
    --cms-gold:        var(--site-gold,        #c89142);
    --cms-gold-bright: var(--site-gold-bright, #ffe1a1);
    --cms-gold-soft:   var(--site-gold-2,      #b77a32);
    --cms-text:        var(--site-text,        #f3e5c8);
    --cms-text-soft:   var(--site-text-soft,   #cdb98e);
    --cms-muted:       var(--site-muted,       #8d7756);
    --cms-edge:        var(--site-edge,        rgba(129, 82, 35, 0.42));
    --cms-edge-bright: var(--site-edge-strong, rgba(230, 171, 82, 0.64));
    --cms-surface:     linear-gradient(160deg, rgba(34, 18, 9, .92), rgba(14, 7, 3, .94));
    --cms-link:        #d8bd7c;
    --cms-link-hover:  var(--cms-gold-bright);
}

/* ---------- Shared eyebrow / breadcrumb ---------- */
.cms-body .cms-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cms-gold-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.cms-body .cms-breadcrumb {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--cms-muted);
}

.cms-body .cms-breadcrumb a { color: var(--cms-text-soft); text-decoration: none; }
.cms-body .cms-breadcrumb a:hover { color: var(--cms-gold-bright); }
.cms-body .cms-breadcrumb .sep { color: var(--cms-muted); opacity: .55; }

/* =====================================================
   Article (/news/<id>-<slug>)
   ===================================================== */
.cms-article {
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.cms-article-head {
    margin-bottom: 20px;
}

.cms-article-head h1 {
    margin: 8px 0 10px;
    color: var(--cms-gold-bright);
    font-size: clamp(24px, 3.4vw, 38px);
    font-weight: 700;
    line-height: 1.18;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}

.cms-article-summary {
    margin: 0 0 12px;
    color: var(--cms-text-soft);
    font-size: 16px;
    line-height: 1.6;
}

.cms-article-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    color: var(--cms-muted);
    font-size: 13px;
}

.cms-article-cover {
    margin: 0 0 24px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--cms-edge);
    background: var(--cms-surface);
}

.cms-article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.cms-article-footer {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--cms-edge);
}

.cms-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--cms-text);
    border: 1px solid var(--cms-edge);
    border-radius: 999px;
    text-decoration: none;
    transition: color .15s, background .15s, border-color .15s;
}

.cms-back-link:hover {
    color: var(--cms-gold-bright);
    border-color: var(--cms-edge-bright);
    background: rgba(34, 20, 9, .65);
}

/* =====================================================
   Prose — TinyMCE-rendered article body
   This is the section the editor's content_style must mirror.
   Keep selectors minimal so they're easy to copy verbatim into TinyMCE.
   ===================================================== */
.cms-prose {
    color: var(--cms-text);
    font-family: "Prompt", "Kanit", Tahoma, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    word-wrap: break-word;
}

.cms-prose h1, .cms-prose h2, .cms-prose h3,
.cms-prose h4, .cms-prose h5, .cms-prose h6 {
    color: var(--cms-gold-bright);
    font-weight: 700;
    line-height: 1.25;
    margin: 1.4em 0 .55em;
}

.cms-prose h1 { font-size: 1.85em; }
.cms-prose h2 { font-size: 1.55em; }
.cms-prose h3 { font-size: 1.3em; }
.cms-prose h4 { font-size: 1.12em; }
.cms-prose h5 { font-size: 1em; }
.cms-prose h6 { font-size: .92em; color: var(--cms-gold-soft); }

.cms-prose p { margin: 0 0 1em; }

.cms-prose a {
    color: var(--cms-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.cms-prose a:hover { color: var(--cms-link-hover); }

.cms-prose strong, .cms-prose b { color: var(--cms-gold-bright); }
.cms-prose em, .cms-prose i { color: var(--cms-text); }

.cms-prose ul, .cms-prose ol {
    margin: 0 0 1em 1.4em;
    padding: 0;
}
.cms-prose li { margin: .25em 0; }
.cms-prose ul li::marker { color: var(--cms-gold-soft); }
.cms-prose ol li::marker { color: var(--cms-gold-bright); font-weight: 700; }

.cms-prose blockquote {
    margin: 1em 0;
    padding: .8em 1.1em;
    border-left: 3px solid var(--cms-gold);
    background: rgba(255, 222, 145, .06);
    color: var(--cms-text-soft);
    border-radius: 0 8px 8px 0;
}

.cms-prose code {
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .06);
    color: #ffe9a3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .92em;
}

.cms-prose pre {
    margin: 1em 0;
    padding: 14px 16px;
    background: rgba(0, 0, 0, .45);
    color: #ffe9a3;
    border: 1px solid var(--cms-edge);
    border-radius: 10px;
    overflow-x: auto;
}
.cms-prose pre code { background: transparent; padding: 0; color: inherit; }

.cms-prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2em auto;
    border-radius: 10px;
    border: 1px solid var(--cms-edge);
}

.cms-prose hr {
    margin: 1.8em 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cms-edge-bright), transparent);
}

.cms-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: .95em;
}
.cms-prose table th,
.cms-prose table td {
    padding: 10px 12px;
    border: 1px solid var(--cms-edge);
    text-align: left;
}
.cms-prose table th {
    background: rgba(255, 222, 145, .08);
    color: var(--cms-gold-bright);
    font-weight: 700;
}

/* =====================================================
   News list (/news)
   ===================================================== */
.cms-list-shell {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.cms-list-head {
    text-align: center;
    margin-bottom: 22px;
}

.cms-list-head h1 {
    margin: 6px 0 6px;
    color: var(--cms-gold-bright);
    font-size: clamp(24px, 3.4vw, 36px);
    font-weight: 700;
}

.cms-list-head p {
    margin: 0;
    color: var(--cms-text-soft);
    font-size: 14px;
}

.cms-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 0 22px;
}

.cms-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    color: var(--cms-text-soft);
    border: 1px solid var(--cms-edge);
    border-radius: 999px;
    background: rgba(5, 2, 1, .55);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: color .15s, background .15s, border-color .15s;
}

.cms-tab:hover {
    color: var(--cms-gold-bright);
    border-color: var(--cms-edge-bright);
    background: rgba(34, 20, 9, .65);
}

.cms-tab.is-active {
    color: #2b1404;
    background: linear-gradient(135deg, #ffe08a, #b77a32);
    border-color: rgba(255, 222, 145, .85);
}

.cms-tab-count {
    background: rgba(0, 0, 0, .2);
    color: inherit;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}
.cms-tab.is-active .cms-tab-count {
    background: rgba(255, 255, 255, .25);
    color: #2b1404;
}

.cms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.cms-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cms-edge);
    border-radius: 14px;
    background: var(--cms-surface);
    color: var(--cms-text);
    overflow: hidden;
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    box-shadow: 0 14px 26px rgba(0, 0, 0, .35);
}

.cms-card:hover {
    transform: translateY(-3px);
    border-color: var(--cms-edge-bright);
    box-shadow: 0 22px 42px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 195, 90, .22);
}

.cms-card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 195, 90, .22), transparent 55%),
        linear-gradient(135deg, rgba(70, 28, 10, .95), rgba(20, 10, 4, .98));
    overflow: hidden;
}

.cms-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cms-card-cover-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255, 222, 145, .25);
    font-size: 36px;
}

.cms-card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(5, 2, 1, .7);
    border: 1px solid var(--cms-edge-bright);
    color: var(--cms-gold-bright);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    backdrop-filter: blur(4px);
}

.cms-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}

.cms-card-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--cms-text);
    line-height: 1.35;
}

.cms-card-summary {
    margin: 0;
    flex: 1;
    color: var(--cms-text-soft);
    font-size: 13px;
    line-height: 1.55;
    /* Clamp to 3 lines. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cms-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--cms-edge);
    color: var(--cms-muted);
    font-size: 12px;
}

.cms-card-more {
    color: var(--cms-gold-bright);
    font-weight: 700;
    letter-spacing: .02em;
}

.cms-empty {
    text-align: center;
    padding: 42px 18px;
    color: var(--cms-text-soft);
    border: 1px dashed var(--cms-edge);
    border-radius: 14px;
    background: rgba(5, 2, 1, .4);
}
.cms-empty i { display: block; font-size: 32px; margin-bottom: 10px; color: var(--cms-gold-soft); }

/* =====================================================
   Homepage embed — same cards, just spaced for the hp shell
   ===================================================== */
.hp-news-section {
    margin-top: 26px;
    margin-bottom: 26px;
}

.hp-news-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.hp-news-head h2 {
    margin: 4px 0 0;
    color: var(--cms-gold-bright);
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
}

.hp-news-head .hp-news-view-all {
    color: var(--cms-gold-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--cms-edge);
    padding: 6px 12px;
    border-radius: 999px;
    transition: color .15s, border-color .15s, background .15s;
}
.hp-news-head .hp-news-view-all:hover {
    color: var(--cms-gold-bright);
    border-color: var(--cms-edge-bright);
    background: rgba(34, 20, 9, .65);
}

/* Homepage news carousel. Keep archive/article layouts independent. */
.hp-news-section { position: relative; }
.hp-news-total { padding: 7px 13px; border: 1px solid var(--cms-edge); border-radius: 999px; color: var(--cms-gold-bright); font-size: 12px; background: rgba(200,145,66,.07); }
.hp-news-section .hp-news-carousel { grid-template-columns: repeat(var(--news-columns, 4), minmax(0, 1fr)); gap: 18px; min-height: 325px; transition: opacity .18s ease; }
.hp-news-carousel.is-loading { opacity: .45; pointer-events: none; }
.hp-news-carousel .cms-card { min-width: 0; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg,#251a10 0%,#100b07 65%); border: 1px solid rgba(200,145,66,.32); box-shadow: 0 12px 28px rgba(0,0,0,.22); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.hp-news-carousel .cms-card:hover { transform: translateY(-5px); border-color: #c89142; box-shadow: 0 16px 32px rgba(0,0,0,.35), 0 0 20px rgba(200,145,66,.09); }
.hp-news-carousel .cms-card-cover { aspect-ratio: auto; flex-shrink: 0; overflow: hidden; }
.hp-news-carousel .cms-card-cover img { display: block; width: 100%; height: auto; transition: transform .35s ease; }
.hp-news-carousel .cms-card:hover img { transform: scale(1.045); }
.hp-news-carousel .cms-card-body { padding: 16px; }
.hp-news-carousel .cms-card-title { line-height: 1.55; min-height: 3.1em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-news-carousel .cms-card-summary { line-height: 1.7; min-height: 5.1em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #bca987; }
.hp-news-carousel .cms-card-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid rgba(200,145,66,.18); }
.hp-news-slide { animation: hp-news-enter .3s ease both; }
@keyframes hp-news-enter { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.hp-news-navigation { display: flex; justify-content: center; align-items: center; gap: 24px; margin: 25px 0 8px; }
.hp-news-arrow { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--cms-edge-bright); border-radius: 50%; color: #ffe1a1; background: linear-gradient(145deg,#382510,#160e07); cursor: pointer; transition: background .2s, transform .2s; }
.hp-news-arrow:hover:not(:disabled) { background: #68451d; transform: scale(1.08); }
.hp-news-arrow:disabled { opacity: .3; cursor: not-allowed; }
.hp-news-pagination { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hp-news-dots { max-width: min(260px, 48vw); display: flex; align-items: center; gap: 5px; overflow: hidden; padding: 4px; }
.hp-news-dot { flex: 0 0 22px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.hp-news-dot::after { content: ''; position: absolute; top: 8px; left: 7px; width: 8px; height: 8px; border-radius: 10px; background: #614827; transition: all .2s; }
.hp-news-dot.is-active { flex-basis: 34px; }
.hp-news-dot.is-active::after { left: 3px; width: 28px; background: linear-gradient(90deg,#bc8235,#ffe1a1); box-shadow: 0 0 12px rgba(255,210,124,.22); }
.hp-news-dot:hover::after { background: #d3a459; }
.hp-news-arrow:focus-visible,.hp-news-dot:focus-visible { outline: 2px solid #ffe1a1; outline-offset: 3px; }
.hp-news-page-label { font-size: 11px; color: #b39a71; letter-spacing: .05em; }
.hp-news-error { padding: 12px; margin-bottom: 14px; border: 1px solid #935244; border-radius: 10px; color: #ffc5b7; }
.hp-news-error button { margin-left: 8px; border: 0; background: none; color: #ffe1a1; text-decoration: underline; }
@media(max-width:599px) { .hp-news-section .hp-news-carousel { min-height: 350px; } .hp-news-navigation { gap: 15px; } }
@media(prefers-reduced-motion:reduce) { .hp-news-slide { animation: none; } .hp-news-carousel,.hp-news-carousel .cms-card,.hp-news-carousel img,.hp-news-arrow,.hp-news-dot::after { transition: none; } }

/* Category strip at the top of the card, above the artwork. */
.hp-news-card-label { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border-bottom: 1px solid rgba(200,145,66,.22); background: linear-gradient(100deg,#352411,#140d07); }
.hp-news-card-label .cms-card-tag { position: static; display: inline-flex; align-items: center; padding: 2px 9px; font-size: 10px; line-height: 1.5; border-radius: 6px; border-color: rgba(214,163,77,.5); background: rgba(10,6,2,.55); color: #ffe1a1; backdrop-filter: none; }

/* Distinct category accents, with gold as the fallback for new categories. */
.hp-news-card-label { --category-rgb: 214,163,77; --category-text: #ffe1a1; background: linear-gradient(100deg,rgba(var(--category-rgb),.2),#140d07); border-bottom-color: rgba(var(--category-rgb),.28); }
.hp-news-card-label[data-category="news"] { --category-rgb: 83,170,245; --category-text: #a9d8ff; }
.hp-news-card-label[data-category="update"] { --category-rgb: 166,125,246; --category-text: #d8c0ff; }
.hp-news-card-label[data-category="event"] { --category-rgb: 245,156,67; --category-text: #ffd09a; }
.hp-news-card-label[data-category="promotion"] { --category-rgb: 240,112,168; --category-text: #ffb9d8; }
.hp-news-card-label[data-category="guide"] { --category-rgb: 69,199,158; --category-text: #a0eed2; }
.hp-news-card-label .cms-card-tag { color: var(--category-text); border-color: rgba(var(--category-rgb),.55); background: rgba(var(--category-rgb),.12); box-shadow: 0 0 12px rgba(var(--category-rgb),.08); }

.hp-news-carousel .cms-card-cover-empty { aspect-ratio: 16 / 9; height: auto; }
