/* ============================================================
   ThinkVerse News — public theme
   ------------------------------------------------------------
   The same flat-cartoon system as thinkverse-ai.com, so the two
   read as one company: cream paper, one ink weight on every shape
   (--line), a hard ink shelf under anything raised (--shelf), and
   Fredoka for headings. Values are copied from the main site's
   styles.css :root — change them there first, then here.

   Only the public pages load this file. The CMS (admin/, auth/)
   still loads css/main.css, the old dark theme, and is untouched.
   ============================================================ */
:root {
    --ink: #14102E;
    --paper: #FFF6E4;
    --paper-2: #E7F2FF;
    --sky: #5560E4;
    --cyan: #4FC8F5;
    --cyan-lt: #A9E7FF;
    --violet: #9B6DFF;
    --violet-lt: #C9B2FF;
    --pink: #FF7BB0;
    --mint: #5CE1A6;
    --yellow: #FFD24D;
    --slate: #4A4470;

    --line: 3px;
    --shelf: 6px;
    --radius: 22px;
    --boing: cubic-bezier(.34, 1.5, .5, 1);

    /* main.js's injected mobile menu still reads this name */
    --midnight-navy: #14102E;

    --head: 'Fredoka', 'Inter', 'Noto Sans Thai', sans-serif;
    --body: 'Inter', 'Noto Sans Thai', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
    font-family: var(--body);
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* ── Nav ─────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--ink);
    padding: 14px 0;
}

/* main.js injects its own .navbar.scrolled rule after this file loads;
   the body class keeps ours ahead of it. */
.tv .navbar.scrolled {
    background: var(--ink);
    padding: 10px 0;
    box-shadow: 0 4px 0 rgba(20, 16, 46, .25);
}

.nav-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    flex: none;
}

.logo-mark {
    width: 42px;
    height: 44px;
    flex: none;
    display: block;
    background: var(--cyan-lt);
    border: 2.5px solid #FFFFFF;
    border-radius: 50%;
    padding: 2px;
}

.logo-text {
    font-family: var(--head);
    font-size: 1.42rem;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: -.005em;
}

/* "News" as a yellow tag on the wordmark, so the sub-site is named
   without inventing a second logo. */
.logo-tag {
    font-family: var(--head);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    color: var(--ink);
    box-shadow: 0 2px 0 #FFFFFF;
}

/* Seven links, a logo and a search box: at 1200px they only fit on one line
   at this size. Wrapping to a second row is not an option — below 1180px
   they fold into the toggle instead (see Responsive). */
.nav-menu {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.nav-link {
    position: relative;
    font-family: var(--head);
    font-weight: 500;
    font-size: .9rem;
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 0;
    height: 4px;
    border-radius: 3px;
    background: var(--yellow);
    transition: width .25s ease;
}

.nav-link:hover,
.nav-link.is-current { color: var(--yellow); }
.nav-link:hover::after,
.nav-link.is-current::after { width: 100%; }

.nav-link-external { color: var(--cyan-lt); }
.nav-link-external i { font-size: .62rem; margin-left: 2px; }

.nav-link:focus-visible,
.nav-logo:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 4px;
    border-radius: 6px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: 3px 3px 3px 14px;
    transition: border-color .2s ease, background .2s ease;
}

.search-form:focus-within {
    border-color: var(--yellow);
    background: rgba(255, 255, 255, .16);
}

.search-input {
    width: 104px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #FFFFFF;
    font: inherit;
    font-size: .88rem;
}

.search-input::placeholder { color: rgba(255, 255, 255, .6); }

.search-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--yellow);
    color: var(--ink);
    cursor: pointer;
    font-size: .78rem;
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 2.5px solid #FFFFFF;
    border-radius: 12px;
    background: transparent;
    color: #FFFFFF;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--head);
    font-size: .98rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    padding: 12px 28px;
    border: var(--line) solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    color: var(--ink);
    box-shadow: 0 var(--shelf) 0 var(--ink);
    transition: transform .12s ease-out, box-shadow .12s ease-out, background .2s ease;
}

.btn:hover {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--ink);
    background: #FFDF7A;
}

.btn:active {
    transform: translateY(var(--shelf));
    box-shadow: 0 0 0 var(--ink);
}

.btn:focus-visible {
    outline: 4px solid var(--cyan);
    outline-offset: 4px;
}

.btn-sm {
    padding: 7px 16px;
    font-size: .8rem;
    box-shadow: 0 3px 0 #FFFFFF;
}

/* ── Page header: the sky band with the sunburst ─────────────────
   Same drawing as the main site's .page-header: rays turning slowly
   behind the heading, a halftone that thickens toward the edges, a
   thick ink rule underneath. Used by the home hero, category, search
   and article headers alike. */
.hero-section,
.category-header,
.search-header,
.post-header {
    position: relative;
    background: var(--sky);
    border-bottom: 5px solid var(--ink);
    text-align: center;
    color: #FFFFFF;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(56px, 8vw, 96px) 0 clamp(52px, 7vw, 78px);
}

.hero-section::before,
.category-header::before,
.search-header::before,
.post-header::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 10%;
    width: 180vmax;
    height: 180vmax;
    margin: -90vmax 0 0 -90vmax;
    z-index: -1;
    background: repeating-conic-gradient(from 0deg,
            rgba(255, 255, 255, .085) 0deg 7deg,
            transparent 7deg 14deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, .5) 22%, transparent 40%);
    mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, .5) 22%, transparent 40%);
    animation: burst-spin 90s linear infinite;
}

.hero-section::after,
.category-header::after,
.search-header::after,
.post-header::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(20, 16, 46, .22) 1.7px, transparent 1.8px);
    background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(66% 62% at 50% 46%, transparent 34%, #000 100%);
    mask-image: radial-gradient(66% 62% at 50% 46%, transparent 34%, #000 100%);
}

@keyframes burst-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-section::before,
    .category-header::before,
    .search-header::before,
    .post-header::before { animation: none; }
}

/* The outlined white heading with the violet drop — the main site's H1. */
.hero-title,
.category-title,
.search-title,
.post-detail-title {
    font-family: var(--head);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.01em;
    color: #FFFFFF;
    text-shadow:
        3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
        2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
        .07em .085em 0 var(--violet);
}

.hero-title { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.category-title,
.search-title { font-size: clamp(2rem, 5vw, 3.2rem); }

.post-detail-title {
    max-width: 22em;
    margin: 18px auto 0;
    font-size: clamp(1.7rem, 4vw, 2.7rem);
    line-height: 1.3;
}

.gradient-text { color: var(--yellow); }

.hero-eyebrow { margin-bottom: 20px; }

.eyebrow {
    display: inline-block;
    font-family: var(--head);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 7px 16px;
    border: 2.5px solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink);
}

.hero-subtitle,
.category-desc,
.search-info {
    max-width: 40em;
    margin: 20px auto 0;
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, .95);
    text-shadow: 0 2px 0 rgba(20, 16, 46, .5);
}

.hero-company {
    margin-top: 6px;
    font-size: .92rem;
    color: rgba(255, 255, 255, .82);
}

.hero-particles { display: none; }

/* ── Bands and section headings ──────────────────────────────── */
.featured-section,
.posts-section {
    padding: clamp(52px, 7vw, 88px) 0;
}

.featured-section {
    background: var(--paper-2);
    border-bottom: var(--line) solid var(--ink);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(32px, 4vw, 48px);
}

.section-title {
    font-family: var(--head);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    text-align: center;
}

.section-title i {
    color: var(--violet);
    font-size: .8em;
    margin-right: 6px;
}

/* The rule under a heading is a drawn object, not a hairline. */
.section-title::after {
    content: '';
    display: block;
    width: 74px;
    height: 8px;
    margin: 16px auto 0;
    border-radius: 8px;
    background: var(--yellow);
    border: 2.5px solid var(--ink);
}

/* ── Category badge ──────────────────────────────────────────────
   Each category gets a colour from the brand palette. The database
   still stores its own hex per category (the admin sets it); that is
   the fallback for any category added later, through --cat. */
.category-badge {
    display: inline-block;
    align-self: flex-start;
    font-family: var(--head);
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 3px 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--cat, var(--cyan-lt));
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 2px 0 var(--ink);
}

.category-badge[data-cat="ai-machine-learning"]    { background: var(--cyan); }
.category-badge[data-cat="technology"]             { background: var(--violet-lt); }
.category-badge[data-cat="digital-transformation"] { background: var(--pink); }
.category-badge[data-cat="tutorials"]              { background: var(--mint); }
.category-badge[data-cat="industry-news"]          { background: var(--yellow); }

.post-header .category-badge { box-shadow: 0 3px 0 var(--ink); font-size: .84rem; padding: 5px 16px; }

/* ── Cards ───────────────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.posts-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }

.post-card,
.featured-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 var(--shelf) 0 var(--ink);
    overflow: hidden;
    transition: transform .18s var(--boing), box-shadow .18s var(--boing);
}

.post-card:hover,
.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 calc(var(--shelf) + 5px) 0 var(--ink);
}

.post-card:focus-within,
.featured-card:focus-within {
    outline: 4px solid var(--cyan);
    outline-offset: 3px;
}

.post-image,
.featured-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--paper-2);
    border-bottom: var(--line) solid var(--ink);
    overflow: hidden;
}

.post-image img,
.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.post-card:hover .post-image img,
.featured-card:hover .featured-image img { transform: scale(1.04); }

.placeholder-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 2.4rem;
    color: var(--violet);
    background:
        radial-gradient(rgba(20, 16, 46, .12) 1.5px, transparent 1.6px) 0 0 / 16px 16px,
        var(--paper-2);
}

.featured-overlay { display: none; }

.post-content,
.featured-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    padding: 20px 22px 22px;
}

.post-title,
.featured-title {
    font-family: var(--head);
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

.post-title a,
.featured-title a {
    text-decoration: none;
    color: inherit;
    /* the whole card is the target, not just the words */
    background-image: linear-gradient(var(--yellow), var(--yellow));
    background-size: 0 40%;
    background-position: 0 88%;
    background-repeat: no-repeat;
    transition: background-size .25s ease;
}

.post-title a::after,
.featured-title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.post-card:hover .post-title a,
.featured-card:hover .featured-title a { background-size: 100% 40%; }

/* the badge must stay clickable above the stretched title link */
.post-content .category-badge { position: relative; z-index: 1; }

.post-excerpt,
.featured-excerpt {
    font-size: .93rem;
    line-height: 1.7;
    color: var(--slate);
    flex: 1;
}

.post-meta,
.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 12px;
    border-top: 2px dashed rgba(20, 16, 46, .18);
    font-size: .82rem;
    font-weight: 500;
    color: var(--slate);
}

.post-meta i,
.featured-meta i { color: var(--violet); margin-right: 3px; }

.post-card-sm .post-content { padding: 16px 16px 18px; }
.post-card-sm .post-title { font-size: .98rem; }

/* Featured: one big story, the rest stacked beside it. */
.featured-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
}

.featured-main { grid-row: span 2; }
.featured-main .featured-title { font-size: 1.5rem; }
.featured-card:not(.featured-main) .featured-excerpt { display: none; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 52px;
}

.page-link,
.page-ellipsis {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    font-family: var(--head);
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
}

.page-link {
    background: #FFFFFF;
    border: 2.5px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .12s ease-out, box-shadow .12s ease-out;
}

.page-link:hover {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--ink);
}

.page-link.active { background: var(--yellow); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px 32px;
    text-align: center;
    background: #FFFFFF;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 var(--shelf) 0 var(--ink);
}

.empty-state i { font-size: 2.6rem; color: var(--violet); margin-bottom: 14px; }
.empty-state h3 { font-family: var(--head); font-size: 1.4rem; margin-bottom: 8px; }
.empty-state p { color: var(--slate); margin-bottom: 22px; }

/* ── Search page ─────────────────────────────────────────────── */
.search-form-large {
    display: flex;
    gap: 12px;
    max-width: 620px;
    margin: 28px auto 0;
}

.search-input-large {
    flex: 1;
    min-width: 0;
    padding: 14px 22px;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: #FFFFFF;
    border: var(--line) solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 var(--shelf) 0 var(--ink);
    outline: 0;
}

.search-input-large:focus { box-shadow: 0 var(--shelf) 0 var(--ink), 0 0 0 4px var(--cyan); }

/* ── Article ─────────────────────────────────────────────────── */
.post-header {
    padding-bottom: clamp(120px, 14vw, 170px);   /* room for the image to overlap */
}

.post-detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
    margin-top: 22px;
    font-size: .92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .92);
}

.meta-item i { margin-right: 4px; color: var(--yellow); }

/* The picture sits across the header's bottom rule, like a card
   pinned over the edge of the sky. */
.post-featured-image {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: calc(-1 * clamp(96px, 11vw, 140px)) auto 0;
    padding: 0 20px;
}

.post-featured-image img {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 var(--shelf) 0 var(--ink);
    background: var(--paper-2);
}

.post-body {
    padding: clamp(36px, 5vw, 56px) 0 clamp(56px, 7vw, 88px);
}

/* Reading column: body copy at a Thai-friendly size and leading.
   Thai has no word spaces, so a long line is harder to track than an
   English one — the measure stays narrow. */
.post-content-html {
    background: #FFFFFF;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 var(--shelf) 0 var(--ink);
    padding: clamp(26px, 5vw, 52px);
    font-size: 1.06rem;
    line-height: 1.95;
    color: #2A2548;
    overflow-wrap: anywhere;
}

.post-content-html > * + * { margin-top: 1.1em; }

.post-content-html h2,
.post-content-html h3,
.post-content-html h4 {
    font-family: var(--head);
    color: var(--ink);
    line-height: 1.35;
    margin-top: 1.8em;
}

.post-content-html h2 { font-size: 1.6rem; }
.post-content-html h3 { font-size: 1.3rem; }
.post-content-html h4 { font-size: 1.12rem; }

/* h2 gets the same drawn underline as the section titles, left-aligned */
.post-content-html h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 6px;
    margin-top: 10px;
    border-radius: 6px;
    background: var(--yellow);
    border: 2px solid var(--ink);
}

.post-content-html > :first-child { margin-top: 0; }

.post-content-html a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--violet);
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
}

.post-content-html a:hover { background: var(--yellow); text-decoration-color: var(--ink); }

.post-content-html ul,
.post-content-html ol { padding-left: 1.4em; }
.post-content-html li + li { margin-top: .4em; }
.post-content-html li::marker { color: var(--violet); font-weight: 700; }

.post-content-html blockquote {
    margin-left: 0;
    padding: 16px 22px;
    background: var(--paper);
    border: 2.5px solid var(--ink);
    border-left-width: 8px;
    border-left-color: var(--yellow);
    border-radius: 14px;
    color: var(--slate);
}

.post-content-html img,
.post-content-html figure img {
    border: 2.5px solid var(--ink);
    border-radius: 14px;
    height: auto;
}

.post-content-html figcaption { margin-top: 8px; font-size: .88rem; color: var(--slate); text-align: center; }

.post-content-html code {
    font-size: .9em;
    padding: 2px 7px;
    background: var(--paper-2);
    border-radius: 6px;
}

.post-content-html pre {
    padding: 18px 20px;
    background: var(--ink);
    color: #F2EEFF;
    border-radius: 14px;
    overflow-x: auto;
    line-height: 1.6;
}

.post-content-html pre code { background: none; padding: 0; color: inherit; }

.post-content-html table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.post-content-html th,
.post-content-html td {
    padding: 10px 12px;
    border: 2px solid var(--ink);
    text-align: left;
}

.post-content-html th { background: var(--paper-2); font-family: var(--head); }

.post-content-html hr { border: 0; border-top: 2px dashed rgba(20, 16, 46, .25); }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.tag {
    font-size: .82rem;
    font-weight: 500;
    padding: 4px 13px;
    background: #FFFFFF;
    border: 2px solid var(--ink);
    border-radius: 999px;
    color: var(--slate);
}

.post-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.share-label { font-family: var(--head); font-weight: 600; margin-right: 4px; }

.share-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2.5px solid var(--ink);
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--ink);
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--ink);
    transition: transform .15s var(--boing), background .2s ease;
}

.share-btn:hover { transform: translateY(-3px); }
.share-btn.facebook:hover { background: #0866FF; color: #FFFFFF; }
.share-btn.twitter:hover  { background: var(--ink); color: #FFFFFF; }
.share-btn.linkedin:hover { background: #0A66C2; color: #FFFFFF; }
.share-btn.copy:hover     { background: var(--yellow); }

.related-posts {
    padding: clamp(52px, 7vw, 80px) 0;
    background: var(--paper-2);
    border-top: var(--line) solid var(--ink);
}

.related-posts .section-title { margin-bottom: clamp(30px, 4vw, 44px); }

/* ── Flash messages ──────────────────────────────────────────── */
.flash-messages {
    position: fixed;
    top: 84px;
    right: 20px;
    z-index: 1100;
    display: grid;
    gap: 10px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 2.5px solid var(--ink);
    border-radius: 14px;
    box-shadow: 0 4px 0 var(--ink);
    font-weight: 500;
}

.flash-success { background: #BFF3DD; }
.flash-danger,
.flash-error   { background: #FFD5E7; }
.flash-close { border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    background: var(--ink);
    color: rgba(255, 255, 255, .82);
    padding: clamp(48px, 6vw, 72px) 0 28px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: clamp(24px, 3vw, 44px);
    align-items: start;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 14px;
    text-decoration: none;
}

.footer-desc {
    font-family: var(--head);
    color: var(--yellow);
    font-size: 1.02rem;
    margin-bottom: 6px;
}

.footer-company { font-size: .92rem; }

.footer h4 {
    font-family: var(--head);
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 9px; }

.footer-links a,
.footer-admin-link {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-size: .94rem;
}

.footer-links a:hover,
.footer-admin-link:hover { color: var(--yellow); }

.footer-admin-link { font-size: .82rem; opacity: .7; }

.social-links { display: flex; gap: 10px; }

.social-links a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--violet);
    border: 2.5px solid #FFFFFF;
    color: #FFFFFF;
    text-decoration: none;
    transition: transform .15s var(--boing), background .2s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    background: var(--cyan);
    color: var(--ink);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 2px dashed rgba(255, 255, 255, .2);
    font-size: .86rem;
    color: rgba(255, 255, 255, .6);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .featured-grid { grid-template-columns: 1fr; }
    .featured-main { grid-row: auto; }
    .posts-grid,
    .posts-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* The category links do not fit beside the logo below ~1180px; they go
   into the toggle's drop-down (main.js adds .active). */
@media (max-width: 1180px) {
    .nav-menu { display: none; }
    .nav-actions { margin-left: auto; }
    .mobile-toggle { display: grid; place-items: center; }

    .tv .nav-menu.active {
        display: flex;
        position: absolute;
        top: calc(100% + 14px);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 4px;
        padding: 14px 20px 20px;
        background: var(--ink);
        border-bottom: var(--line) solid var(--ink);
        box-shadow: 0 6px 0 rgba(20, 16, 46, .25);
    }

    .tv .nav-menu.active .nav-link { padding: 10px 0; font-size: 1.05rem; }
    .tv .nav-menu.active .nav-link::after { display: none; }
}

@media (max-width: 640px) {
    .posts-grid,
    .posts-grid-4 { grid-template-columns: 1fr; gap: 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .search-form { display: none; }
    .logo-text { font-size: 1.24rem; }
    .search-form-large { flex-direction: column; }
    .post-content-html { font-size: 1.02rem; }
}
