/* Cricket Newsroom - light static newsroom theme.
   Palette taken from the source site's design tokens:
   --cricket-green #40a829, --cricket-blue #3170b7, --cricket-yellow #ffcd00. */

:root {
  --bg:        #fbfbf9;
  --surface:   #ffffff;
  --surface-2: #f3f5f1;
  --text:      #14181b;
  --text-dim:  #5c6770;
  --line:      #e5e8e3;
  --line-soft: #eef0ec;
  --brand:     #40a829;
  --brand-ink: #2f7d1e;
  --brand-wash:#eef7ea;
  --accent:    #ffcd00;
  --shadow:    0 1px 2px rgba(16, 24, 18, .04), 0 8px 24px -12px rgba(16, 24, 18, .16);
  --shadow-lg: 0 2px 4px rgba(16, 24, 18, .05), 0 22px 48px -20px rgba(16, 24, 18, .28);
  --radius:    16px;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #101312;
    --surface:   #171b19;
    --surface-2: #1d2220;
    --text:      #eef1ed;
    --text-dim:  #a0aaa3;
    --line:      #29302c;
    --line-soft: #222826;
    --brand:     #6cc94f;
    --brand-ink: #8ada6e;
    --brand-wash:#18251500;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 22px 48px -20px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  --bg:        #101312;
  --surface:   #171b19;
  --surface-2: #1d2220;
  --text:      #eef1ed;
  --text-dim:  #a0aaa3;
  --line:      #29302c;
  --line-soft: #222826;
  --brand:     #6cc94f;
  --brand-ink: #8ada6e;
  --brand-wash:#18251500;
  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 22px 48px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 16px; }
.wrap-narrow { max-width: 720px; }

/* ------------------------------------------------------------- header */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -.015em; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); flex: none; }
.brand-name em { font-style: normal; color: var(--text-dim); font-weight: 500; }

.theme-btn {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text-dim); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-btn:hover { color: var(--text); border-color: var(--text-dim); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* --------------------------------------------------------------- hero */

.hero { padding: 64px 16px 40px; text-align: center; }
.eyebrow {
  margin: 0 0 14px; font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand-ink);
}
.hero-title { margin: 0; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; }
.hero-sub { margin: 16px auto 0; max-width: 48ch; color: var(--text-dim); font-size: 1.05rem; }

.search-box {
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 420px); margin: 30px auto 0; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow);
  color: var(--text-dim);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
.search-box input {
  flex: 1; min-width: 0; height: 46px; border: 0; outline: 0;
  background: transparent; color: var(--text); font: inherit; font-size: .97rem;
}
.search-box input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }

/* -------------------------------------------------------------- cards */

.lead-slot { margin-top: 8px; }

.rail {
  display: flex; align-items: center; gap: 14px;
  margin: 56px 0 22px; font-size: .82rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim);
}
.rail::after { content: ""; flex: 1; height: 1px; background: var(--line); }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.card:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.card-link:focus-visible { outline: none; }

.card-media { background: var(--surface-2); aspect-ratio: 16 / 10; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.7,.3,1); }
.card:hover .card-media img { transform: scale(1.035); }

.card-body { padding: 20px 20px 22px; }
.card-title { margin: 8px 0 0; font-size: 1.12rem; line-height: 1.32; letter-spacing: -.015em; font-weight: 650; }
.card-lead-text {
  margin: 10px 0 0; color: var(--text-dim); font-size: .94rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.meta { margin: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: .8rem; color: var(--text-dim); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }

.more {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-size: .88rem; font-weight: 600; color: var(--brand-ink);
}
.more svg { transition: transform .2s; }
.card:hover .more svg { transform: translateX(3px); }

/* lead card: image beside text on wide screens */
.card-lead .card-link { display: grid; grid-template-columns: 1.15fr 1fr; }
.card-lead .card-media { aspect-ratio: auto; height: 100%; min-height: 300px; }
.card-lead .card-body { padding: 36px; align-self: center; }
.card-lead .card-title { font-size: clamp(1.4rem, 2.6vw, 1.95rem); line-height: 1.22; margin-top: 10px; }
.card-lead .card-lead-text { font-size: 1rem; -webkit-line-clamp: 4; line-clamp: 4; margin-top: 14px; }

@media (max-width: 760px) {
  .card-lead .card-link { grid-template-columns: 1fr; }
  .card-lead .card-media { aspect-ratio: 16 / 10; min-height: 0; }
  .card-lead .card-body { padding: 22px 20px 24px; }
}

/* While a search is active the lead story is just another result, so it drops
   back to the compact card shape and sits above the grid. */
.lead-slot.is-filtered .card-lead .card-link { grid-template-columns: 1fr; }
.lead-slot.is-filtered .card-lead .card-media { aspect-ratio: 16 / 10; min-height: 0; }
.lead-slot.is-filtered .card-lead .card-body { padding: 20px 20px 22px; }
.lead-slot.is-filtered .card-lead .card-title { font-size: 1.12rem; line-height: 1.32; }
.lead-slot.is-filtered .card-lead .card-lead-text { font-size: .94rem; -webkit-line-clamp: 3; line-clamp: 3; }
.lead-slot.is-filtered { max-width: 350px; margin-bottom: 24px; }

.no-hits { margin: 40px 0 0; text-align: center; color: var(--text-dim); }

/* --------------------------------------------------------------- post */

.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 30; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .1s linear; }

.post { padding-top: 40px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .87rem; font-weight: 600; color: var(--text-dim); text-decoration: none;
}
.back:hover { color: var(--brand-ink); }

.post-title { margin: 22px 0 0; font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; }
.post-meta { margin-top: 18px; }

.post-hero { margin: 36px 0 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.post-hero img { width: 100%; max-height: 460px; object-fit: cover; }

/* ------------------------------------------------------------- prose */

.prose { margin-top: 40px; font-family: var(--serif); font-size: 1.14rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose em { color: var(--text-dim); }

.prose h2 {
  margin: 2.2em 0 .6em; font-family: var(--ui); font-weight: 680;
  font-size: 1.42rem; line-height: 1.25; letter-spacing: -.02em;
}
.prose h3 { margin: 1.8em 0 .5em; font-family: var(--ui); font-weight: 650; font-size: 1.12rem; letter-spacing: -.01em; }
.prose h4 { margin: 1.6em 0 .4em; font-family: var(--ui); font-weight: 650; font-size: 1rem; }

.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.3em; }
.prose li { margin: .4em 0; padding-left: .2em; }
.prose ul { list-style: none; padding-left: 1.1em; }
.prose ul > li { position: relative; }
.prose ul > li::before {
  content: ""; position: absolute; left: -1em; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}

.prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }

.prose img { margin: 2em auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }

.prose table {
  width: 100%; margin: 1.8em 0; border-collapse: collapse;
  font-family: var(--ui); font-size: .95rem;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.prose thead th, .prose tr:first-child td strong { font-weight: 650; }
.prose thead th { background: var(--surface-2); }
.prose tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.prose tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------- pager, footer */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 8px; }
.pager-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.pager-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager-item span { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.pager-item strong { font-size: .97rem; font-weight: 600; line-height: 1.35; }
.pager-next { text-align: right; align-items: flex-end; }
@media (max-width: 620px) { .pager { grid-template-columns: 1fr; } .pager-next { text-align: left; align-items: flex-start; } }

.related-wrap { padding-bottom: 8px; }

.site-foot { margin-top: 90px; border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { padding-block: 34px 42px; }
.foot-brand { margin: 0 0 8px; font-weight: 650; letter-spacing: -.015em; }
.foot-brand em { font-style: normal; color: var(--text-dim); font-weight: 500; }
.foot-note { margin: 0; max-width: 62ch; font-size: .87rem; color: var(--text-dim); }
.foot-note a { color: var(--brand-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
