/* ==========================================================================
   BrandAtlas — leCMS theme stylesheet
   Ported from the Next.js design system (app/globals.css).
   Light, data-driven, restrained. No glassmorphism, no gradient cards.
   ========================================================================== */

:root {
    --bg: #ffffff;
    --bg-sub: #f7f8fa;
    --bg-soft: #f1f3f6;
    --line: #e5e8ec;
    --line-strong: #d3d8de;
    --ink: #12161c;
    --ink-2: #3d4652;
    --ink-3: #6b7684;
    --ink-4: #98a1ad;
    --brand: #1f5eff;
    --brand-dark: #1549cc;
    --brand-soft: #eef3ff;
    --ok: #0f8a5f;
    --ok-soft: #e8f6f0;

    --max: 1280px;
    --gap: 28px;
    --r-s: 8px;
    --r: 10px;
    --r-l: 14px;
    --shadow-h: 0 6px 20px rgba(18, 22, 28, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
        "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px;
}
::selection { background: var(--brand-soft); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- header ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; gap: 20px; height: 68px;
}
.wordmark {
    display: flex; align-items: center; gap: 9px;
    font-weight: 800; font-size: 17px; letter-spacing: -.03em; flex: none;
}
.brand-mark {
    width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
    color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
    padding: 8px 11px; border-radius: 8px;
    font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.main-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.main-nav a.active { color: var(--brand); background: var(--brand-soft); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.language { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.language a:hover { color: var(--brand); }
.language span { width: 1px; height: 13px; background: var(--line-strong); }
.header-search {
    width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
    display: grid; place-items: center; color: var(--ink-3);
}
.header-search:hover { border-color: var(--line-strong); background: var(--bg-sub); }
.header-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-toggle {
    display: none; width: 38px; height: 38px; padding: 9px 8px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    flex-direction: column; justify-content: space-between; cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; background: var(--ink-2); border-radius: 2px; }

/* ---------------- hero ---------------- */
.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: var(--bg-sub); }
.hero-inner { max-width: 780px; }
.eyebrow {
    font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--brand); margin-bottom: 12px;
}
.hero h1 { font-size: 46px; letter-spacing: -.035em; }
.hero-lead { font-size: 18px; color: var(--ink-2); margin: 16px 0 26px; max-width: 620px; }
.search { display: flex; gap: 10px; }
.search input[type=search] {
    flex: 1; min-width: 0; height: 52px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: #fff; outline: none;
}
.search input[type=search]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search button {
    height: 52px; padding: 0 26px; flex: none; cursor: pointer;
    border: 1px solid var(--brand); border-radius: 12px;
    background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
}
.search button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.disclosure {
    margin-top: 20px; font-size: 12.5px; color: var(--ink-3);
    padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s);
}

/* ---------------- sections ---------------- */
.section { padding: 52px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-sub); }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.section-head h2 { font-size: 28px; }
.section-sub { color: var(--ink-3); font-size: 15px; margin-top: 6px; }
.section-note { margin-top: 20px; font-size: 12.5px; color: var(--ink-3); }
.text-link { font-size: 14px; font-weight: 600; color: var(--brand); flex: none; }
.text-link:hover { color: var(--brand-dark); }

/* ---------------- categories ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.category {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
    padding: 16px 18px; transition: .15s;
}
.category:hover { border-color: var(--brand); box-shadow: var(--shadow-h); }
.category strong { display: block; font-size: 15.5px; }
.category small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.category b { margin-left: auto; color: var(--ink-4); font-weight: 400; flex: none; }
.cat-mark {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: grid; place-items: center; font-size: 15px; font-weight: 800;
    color: #fff; background: var(--brand); overflow: hidden;
}
.cat-mark.cat-blue { background: #1f5eff; }
.cat-mark.cat-red { background: #e0483d; }
.cat-mark.cat-green { background: #0f8a5f; }
.cat-mark.cat-violet { background: #7a4ddb; }
.cat-mark.cat-yellow { background: #d9921a; }

/* ---------------- product cards ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 18px; }
.product {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
    padding: 18px; transition: .15s;
}
.product:hover { border-color: var(--line-strong); box-shadow: var(--shadow-h); }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.product-mark {
    width: 44px; height: 44px; border-radius: var(--r); background: var(--bg-soft);
    display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--ink-3);
}
.product-kind {
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--brand-dark); background: var(--brand-soft); padding: 4px 8px; border-radius: 6px;
}
.product h3 { font-size: 16.5px; }
.product h3 a:hover { color: var(--brand); }
.product-desc { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.product-meta {
    margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--ink-3);
    display: flex; flex-wrap: wrap; gap: 10px;
}
.product-meta b { color: var(--ink); font-weight: 600; }
.merchant-link {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600; color: var(--brand);
}
.merchant-link:hover { color: var(--brand-dark); }

/* ---------------- ad slot ---------------- */
.ad-slot {
    margin: 26px 0; border: 1px solid var(--line); background: #fbfbfc;
    border-radius: var(--r); padding: 12px; text-align: center;
}
.ad-label {
    display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-4); margin-bottom: 8px;
}
.ad-slot { padding: 8px 12px 12px; }
.ad-slot > span:last-child {
    display: flex; align-items: center; justify-content: center; height: 72px;
    border-radius: var(--r-s); background: var(--bg-soft);
    color: var(--ink-4); font-size: 12.5px;
}

/* ---------------- topics ---------------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.topic {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-l); padding: 20px; transition: .15s;
}
.topic:hover { border-color: var(--line-strong); box-shadow: var(--shadow-h); }
.topic-kicker {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-4); margin-bottom: 10px;
}
.topic h3 { font-size: 16.5px; }
.topic p { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.topic-more { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--brand); }

/* ---------------- brands ---------------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.brand {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
    padding: 16px; transition: .15s;
}
.brand:hover { border-color: var(--brand); box-shadow: var(--shadow-h); }
.brand-logo {
    width: 40px; height: 40px; border-radius: var(--r); background: var(--bg-soft);
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
    color: var(--ink-2); overflow: hidden; text-align: center; line-height: 1.1;
}
.brand strong { font-size: 14.5px; }
.brand small { font-size: 12px; color: var(--ink-4); }

/* ---------------- journal ---------------- */
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.journal {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
    padding: 20px; transition: .15s;
}
.journal:hover { border-color: var(--line-strong); box-shadow: var(--shadow-h); }
.journal-date { font-size: 12px; color: var(--ink-4); }
.journal h3 { font-size: 16px; margin-top: 8px; }
.journal h3 a:hover { color: var(--brand); }
.journal p { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.journal .text-link { display: inline-block; margin-top: 14px; }

/* ---------------- empty states ---------------- */
.empty-state {
    border: 1px dashed var(--line-strong); border-radius: var(--r-l);
    padding: 26px; background: #fff; max-width: 640px;
}
.empty-state strong { display: block; font-size: 15.5px; }
.empty-state p { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.empty-state.compact { padding: 16px 18px; font-size: 13.5px; color: var(--ink-3); }

/* ---------------- footer ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-sub); margin-top: 60px; padding: 44px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h3 {
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-4); margin-bottom: 14px;
}
.footer-grid a { display: block; padding: 5px 0; font-size: 14px; color: var(--ink-2); }
.footer-grid a:hover { color: var(--brand); }
.footer-brand p { font-size: 13.5px; color: var(--ink-3); margin-top: 12px; max-width: 290px; }
.footer-note { font-size: 12.5px; color: var(--ink-4); margin-top: 10px; }
.footer-bottom {
    margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--ink-4);
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .main-nav {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; gap: 0; padding: 8px 16px 14px;
        background: #fff; border-bottom: 1px solid var(--line);
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .main-nav a:last-child { border-bottom: 0; }
    .header-inner { position: relative; }
}

@media (max-width: 720px) {
    .wrap { padding: 0 16px; overflow-x: clip; }
    .hero { padding: 40px 0 32px; }
    .hero h1 { font-size: 32px; }
    .hero-lead { font-size: 16px; }
    .section { padding: 36px 0; }
    .section-head h2 { font-size: 22px; }
    .search { flex-direction: column; }
    .search button { width: 100%; }
    .category-grid, .product-grid, .topic-grid, .brand-grid, .journal-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .ad-slot > span:last-child { height: 72px; }
}

@media (max-width: 480px) {
    .header-inner { gap: 10px; }
    .wordmark span:last-child { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 27px; }
}
