/* MICEcafe Insights — shared design system.
   Previously each page carried its own inline <style> block, so the four
   templates drifted apart. Everything visual now lives here. */

:root {
  --brand: #ef2b17;
  --brand-dark: #c81f0d;
  --brand-tint: #fff6f4;
  --brand-line: #ffd7cc;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #64748b;

  --page: #f6f8fb;
  --surface: #ffffff;
  --line: #e8ecf2;

  --radius: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lift: 0 16px 40px rgba(15, 23, 42, .1);

  /* Inter was named in the old CSS but never loaded, so every page silently
     fell back to Arial. Both families are now linked in the document head. */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-prose: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 860px; }

/* ---------- Site chrome ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
}

.brand { display: flex; align-items: baseline; gap: 9px; }
.brand__logo { display: block; height: 46px; width: auto; align-self: center; }
.brand__word { font-size: 20px; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }
.brand__word span { color: var(--ink); }
.brand__sub {
  font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-muted);
}

.nav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.nav a:hover { color: var(--brand); }
.nav__cta {
  padding: 8px 15px; border-radius: var(--radius-pill);
  background: var(--brand); color: #fff;
}
.nav__cta:hover { background: var(--brand-dark); color: #fff; }

.site-footer {
  margin-top: 64px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 14px;
}
.site-footer__inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* ---------- Hero ---------- */

/* The hero ran full width with everything left-aligned, leaving the right
   half of the row empty. Recent posts fill it. */
.hero {
  padding: 56px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.hero__eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 800;
}
.hero__lede { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }

.search { display: flex; gap: 10px; margin-top: 26px; max-width: 560px; }
.search__input {
  flex: 1; height: 50px;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0 16px; font: inherit; background: var(--surface);
}
.search__input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 22px;
  border: none; border-radius: 14px;
  background: var(--brand); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.chip {
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip__count { color: var(--ink-muted); font-weight: 500; }

/* ---------- Recent posts rail ---------- */

.recent { padding-top: 34px; }
.recent__head {
  margin: 0 0 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-muted);
}
.recent__item {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.recent__item:last-child { border-bottom: none; }
.recent__item:hover { color: var(--brand); }
.recent__date {
  display: block; margin-top: 4px;
  font-size: 12px; font-weight: 400; color: var(--ink-muted);
}

/* ---------- Media ---------- */

/* featured_image values come from the database and some rows point at paths
   that do not resolve here, which showed a broken-image icon and sprawling
   alt text. The image sits on a branded placeholder and removes itself on
   error, so a bad URL degrades to the placeholder instead. */
.media {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--brand-tint), #eef2f7);
  border-radius: var(--radius);
}
.media::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 35%, rgba(239, 43, 23, .14), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(15, 23, 42, .08), transparent 55%);
}
.media img {
  position: relative; z-index: 1;
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
.media--feature { min-height: 340px; height: 100%; }
.media--thumb { aspect-ratio: 16 / 10; }
.media--cover { aspect-ratio: 21 / 9; max-height: 460px; margin-top: 22px; }

/* ---------- Cards ---------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 48px 0 18px;
}
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.section-head span { font-size: 14px; color: var(--ink-muted); }

.feature {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 0; margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.feature:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.feature .media { border-radius: 0; }
.feature__body { padding: 36px; align-self: center; }
.feature__title {
  font-size: clamp(24px, 3vw, 34px); line-height: 1.15;
  letter-spacing: -.02em; font-weight: 800; margin: 16px 0 12px;
}
.feature__excerpt { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 0; }

.badge {
  display: inline-block; padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--brand-tint); color: var(--brand-dark);
  border: 1px solid var(--brand-line);
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
}

.meta { font-size: 13px; color: var(--ink-muted); margin: 12px 0 0; }
.meta--tight { margin: 10px 0 8px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card .media { border-radius: 0; }
.card__body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-size: 19px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; margin: 0; }
.card__excerpt { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; }

/* ---------- Article ---------- */

.article { padding: 44px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); font-size: 14px; }
.crumb { font-size: 13px; color: var(--ink-muted); margin: 22px 0 16px; }
.crumb a:hover { color: var(--brand); }

.article__title {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1; letter-spacing: -.03em;
  font-weight: 800; margin: 0 0 14px;
}

.tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.tag {
  padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--ink-soft);
}
.tag:hover { border-color: var(--brand); color: var(--brand); }

/* Long-form body copy: a serif face at a comfortable measure. The old rules
   set 16px/1.8 sans across the full container width, which read poorly. */
.prose {
  margin-top: 34px;
  font-family: var(--font-prose);
  font-size: 19px;
  line-height: 1.75;
  color: #1f2937;
}
.prose > * { max-width: 68ch; }
.prose p { margin: 0 0 1.35em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-ui);
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--ink);
  margin: 2em 0 .6em;
}
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 22px; }
.prose h4 { font-size: 18px; }
.prose a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.3em; }
.prose li { margin: .5em 0; }
.prose li::marker { color: var(--brand); }
.prose img { width: 100%; height: auto; border-radius: var(--radius); margin: 1.6em 0; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-family: var(--font-ui); font-size: 13px; color: var(--ink-muted); margin-top: 8px; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--brand);
  color: var(--ink-soft); font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em; background: #f1f5f9; padding: .15em .4em; border-radius: 6px;
}
.prose pre { background: var(--ink); color: #e2e8f0; padding: 18px; border-radius: 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table {
  width: 100%; max-width: 100%;
  border-collapse: collapse; margin: 1.6em 0;
  font-family: var(--font-ui); font-size: 15px;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 11px 13px; text-align: left; }
.prose th { background: #f8fafc; font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- CTA, pager, misc ---------- */

.cta {
  margin-top: 48px; padding: 32px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-lg);
}
.cta h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.cta p { margin: 0; color: #cbd5e1; max-width: 56ch; }

.related { margin-top: 56px; }
.rel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rel-item {
  padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  font-weight: 600; line-height: 1.4;
}
.rel-item:hover { border-color: var(--brand); }
.rel-date { margin-top: 8px; font-size: 12.5px; color: var(--ink-muted); font-weight: 400; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.pagebtn {
  min-width: 42px; height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.pagebtn:hover { border-color: var(--brand); color: var(--brand); }
.pagebtn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.empty {
  margin-top: 32px; padding: 40px;
  background: var(--surface); border: 1px dashed #cbd5e1;
  border-radius: var(--radius); color: var(--ink-muted); text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .recent { padding-top: 0; }
  .feature { grid-template-columns: 1fr; }
  .feature .media { min-height: 260px; }
  .feature__body { padding: 28px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .grid, .rel-list { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 4px; }
  .nav { gap: 14px; font-size: 13px; }
  .nav__desktop { display: none; }
  .prose { font-size: 17.5px; }
  .cta { padding: 24px; }
  .site-header__inner { height: 64px; }
}
