/* ===========================================================
   SEMalytics blog
   Distinct from internexio-theme (navy/green editorial) and
   kpt-theme (near-black/blue text list): cream field, navy
   structure, orange accent, chunky illustration tiles.
   =========================================================== */

:root {
  --navy:       #1a2744;
  --navy-deep:  #121c33;
  --orange:     #f28c18;
  --orange-dk:  #d97a0c;
  --ink:        #141a26;
  --muted:      #64748b;
  --rule:       #e2e8f0;
  --paper:      #ffffff;
  --cream:      #faf6e9;

  --measure: 1140px;
  --narrow:  700px;
  --radius:  14px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { max-width: var(--narrow); }
a { color: inherit; text-decoration: none; }

/* --- nav (navy: the only ground the wordmark is legible on) - */
.site-nav { background: var(--navy); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.nav-brand img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; gap: 24px; flex-wrap: wrap; }
.nav-link { color: rgba(255,255,255,.76); font-size: .89rem; font-weight: 500; transition: color .15s; }
.nav-link:hover { color: var(--orange); }

/* --- hero --------------------------------------------------- */
.hero { background: var(--navy); color: #fff; padding: 58px 0 66px; border-bottom: 4px solid var(--orange); }
.hero-kicker { display: inline-block; color: var(--orange); font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 16px; }
.hero-title { font-size: clamp(2.1rem, 4.4vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 0 0 14px; color: #fff; max-width: 20ch; }
.hero-sub { color: rgba(255,255,255,.74); font-size: 1.05rem; max-width: 56ch; margin: 0; }

/* --- shared ------------------------------------------------- */
.kicker { display: inline-block; color: var(--orange-dk); font-size: .71rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.kicker-link { background: rgba(242,140,24,.12); padding: 4px 9px; border-radius: 4px; margin-right: 6px; }
.meta { display: flex; align-items: center; gap: 9px; font-size: .79rem; color: var(--muted); flex-wrap: wrap; }
.meta-dot { opacity: .5; }
.tile { background: var(--cream); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }

/* --- feed --------------------------------------------------- */
.feed { padding: 56px 24px 76px; }
.lead { display: grid; grid-template-columns: 1.25fr 1fr; gap: 44px; align-items: center; padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--rule); }
.lead:hover .tile img { transform: scale(1.03); }
.lead-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 0 0 14px; color: var(--navy); }
.lead-excerpt { color: var(--muted); margin: 0 0 14px; font-size: 1.02rem; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 44px 36px; }
.card-img { margin-bottom: 16px; }
.card:hover .tile img { transform: scale(1.03); }
.card-title { font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 9px; color: var(--navy); }
.card:hover .card-title { color: var(--orange-dk); }
.card-excerpt { color: var(--muted); font-size: .94rem; margin: 0 0 10px; }
.card-flat { border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; transition: border-color .2s; }
.card-flat:hover { border-color: var(--orange); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* --- post --------------------------------------------------- */
.post-head { padding: 54px 0 28px; }
.post-title { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 0 0 16px; color: var(--navy); }
.post-standfirst { font-size: 1.14rem; color: var(--muted); margin: 0; }
.post-hero { margin-bottom: 42px; }
.post-hero img { width: 100%; border-radius: var(--radius); display: block; background: var(--cream); }
.post-hero figcaption { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 10px; }

.post-body { font-size: 1.08rem; line-height: 1.75; }
.post-body h2 { font-size: 1.58rem; font-weight: 800; letter-spacing: -.02em; margin: 44px 0 14px; color: var(--navy); }
.post-body h3 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 10px; color: var(--navy); }
.post-body p { margin: 0 0 20px; }
.post-body a { color: var(--orange-dk); border-bottom: 1px solid rgba(242,140,24,.42); }
.post-body a:hover { border-bottom-color: var(--orange); }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-body blockquote { border-left: 3px solid var(--orange); padding-left: 20px; margin: 28px 0; color: var(--muted); font-size: 1.08rem; }
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body code { background: var(--cream); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.post-body pre { background: var(--navy-deep); color: #e8edf5; padding: 18px; border-radius: var(--radius); overflow-x: auto; margin: 0 0 20px; }
.post-body pre code { background: none; padding: 0; }

.post-foot { padding: 36px 24px 8px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.byline { border-top: 1px solid var(--rule); padding-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.byline-name { font-weight: 700; color: var(--navy); }
.byline-sub { color: var(--muted); font-size: .9rem; }
.more-reading { padding: 48px 24px 64px; }
.more-reading-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }

/* --- bridge ------------------------------------------------- */
.bridge { background: var(--cream); border-top: 1px solid var(--rule); }
.bridge-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 34px 24px; flex-wrap: wrap; }
.bridge-title { font-weight: 800; font-size: 1.1rem; margin: 0 0 6px; color: var(--navy); }
.bridge-sub { color: var(--muted); font-size: .92rem; margin: 0; max-width: 62ch; }
.bridge-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 11px 24px; border-radius: 8px; font-weight: 600; font-size: .92rem; transition: all .18s; }
.btn-solid { background: var(--orange); color: #fff; }
.btn-solid:hover { background: var(--orange-dk); }
.btn-ghost { border: 2px solid var(--navy); color: var(--navy); padding: 9px 22px; }
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* --- footer ------------------------------------------------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.62); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 26px 24px; gap: 16px; flex-wrap: wrap; font-size: .86rem; }
.footer-brand { color: #fff; font-weight: 700; }

.pagination { display: flex; justify-content: center; gap: 16px; align-items: center; padding: 48px 0 0; font-size: .9rem; color: var(--muted); }
.pagination a { color: var(--orange-dk); font-weight: 600; }

@media (max-width: 900px) {
  .lead { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 640px) {
  .grid, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 42px 0 46px; }
  .bridge-inner { flex-direction: column; align-items: flex-start; }
}

/* --- Koenig editor image widths (required by gscan) ------- */
.post-body :where(.kg-width-wide) {
  width: min(96vw, 1000px);
  margin-inline: calc(50% - min(48vw, 500px));
  max-width: none;
}
.post-body :where(.kg-width-full) {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  max-width: none;
  border-radius: 0;
}
.post-body :where(.kg-image-card, .kg-card) { margin: 28px 0; }
.post-body :where(.kg-image-card figcaption, .kg-card figcaption) {
  text-align: center; color: var(--muted); font-size: .84rem; margin-top: 10px;
}

/* --- mobile nav: stack brand, scroll links, never wrap ----- */
@media (max-width: 760px) {
  .nav-inner {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-block: 14px;
  }
  .nav-links {
    width: 100%;
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; padding-block: 6px; }
  .nav-brand { white-space: nowrap; }
}
