/* =====================================================================
   Naija Sports — 03 components: cards, hero, grids, forms, comments
   ===================================================================== */

/* --------------------------------------------------------------- *
   1. Article cards
   --------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(43,181,142,.35); }
.card-media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--surface-2); overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-flag {
  position: absolute; top: 12px; left: 12px; background: var(--danger); color: #fff;
  font-family: var(--font); font-weight: 700; font-size: .68rem; letter-spacing: .07em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.cat-label {
  align-self: flex-start; font-family: var(--font); font-weight: 700; font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark);
  background: var(--accent-soft); padding: 3px 11px; border-radius: 999px; margin-bottom: 9px;
}
.cat-label:hover { background: var(--accent); color: #fff; }
.card-title { margin: 0 0 8px; font-size: 1.06rem; line-height: 1.35; }
.card-lg .card-title { font-size: 1.42rem; }
.card-sm .card-title { font-size: .98rem; }
.card-xs .card-title { font-size: .9rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); }
.card-excerpt { color: var(--muted); font-size: .9rem; line-height: 1.6; margin: 0 0 12px; }
.card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: auto;
  font-size: .78rem; color: var(--muted); font-family: var(--font); font-weight: 500;
}
.card-meta .meta-author { color: var(--ink-2); font-weight: 700; }
.card-meta a:hover { color: var(--accent-dark); }
.card-meta .dot { opacity: .5; }

.card-horizontal { flex-direction: row; }
.card-horizontal .card-media { aspect-ratio: auto; width: 38%; flex-shrink: 0; }
.card-horizontal .card-body { padding: 18px 20px; }
@media (max-width: 640px) {
  .card-horizontal { flex-direction: column; }
  .card-horizontal .card-media { width: 100%; aspect-ratio: 16/9; }
}

/* compact list rows */
.row-item { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row-item:first-child { padding-top: 0; }
.row-item:last-child { border-bottom: 0; padding-bottom: 0; }
.row-thumb {
  width: 104px; flex-shrink: 0; aspect-ratio: 4 / 3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.row-item:hover .row-thumb img { transform: scale(1.07); }
.row-body { min-width: 0; flex: 1; }
.mini-cat {
  font-family: var(--font); font-weight: 700; font-size: .64rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-dark); display: inline-block; margin-bottom: 4px;
}
.row-title { margin: 0 0 6px; font-size: .96rem; line-height: 1.38; }
.row-title a { color: var(--ink); }
.row-title a:hover { color: var(--accent-dark); }
.row-excerpt { font-size: .85rem; color: var(--muted); margin: 0 0 7px; }

/* number + headline list (hot / most read) */
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-num {
  font-family: var(--font); font-weight: 700; font-size: 1.5rem; line-height: 1;
  color: var(--line); flex-shrink: 0; min-width: 30px; counter-increment: rank;
}
.rank-item:nth-child(1) .rank-num { color: var(--accent); }
.rank-item:nth-child(2) .rank-num { color: var(--amber); }
.rank-item:nth-child(3) .rank-num { color: var(--info); }
.rank-item h4 { margin: 0 0 5px; font-size: .95rem; line-height: 1.4; }
.rank-item h4 a { color: var(--ink); }
.rank-item h4 a:hover { color: var(--accent-dark); }

/* --------------------------------------------------------------- *
   2. Grids & page layout
   --------------------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid { gap: 18px; }
}

.layout-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 332px;
  gap: 34px; align-items: start;
}
/* minmax(0, 1fr) rather than 1fr: a bare 1fr floors the track at its
   min-content, which lets a wide child push the column past the viewport */
@media (max-width: 1080px) { .layout-main { grid-template-columns: minmax(0, 1fr); } }
.sticky-side { position: sticky; top: 18px; display: grid; gap: 22px; }
@media (max-width: 1080px) { .sticky-side { position: static; } }

.stack-sm > * + * { margin-top: 10px; }
.list-rows > * + * { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }

/* --------------------------------------------------------------- *
   3. Hero
   --------------------------------------------------------------- */
/* The band height is set here and nowhere else. Both columns are pinned to
   it so the three side cards can never dictate the height of the hero. */
.hero {
  --hero-h: 260px;
  display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: 26px; margin-bottom: 46px;
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { height: auto; min-height: 260px; }
  .hero-side { height: auto; }
}
.hero-main {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  height: var(--hero-h); border-radius: var(--radius-xl); overflow: hidden;
  background: #0d1620; box-shadow: var(--shadow);
}
/* cover crops, it never distorts; the 26% anchor keeps heads and shoulders
   in frame when the source photo is portrait */
.hero-main > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 26%; opacity: .92;
}
/* Low-resolution source: fill with a blurred copy, then lay the real photo on
   top at 1:1 pixels so it stays sharp and nothing is stretched or enlarged. */
.hero-main.is-lowres::before {
  content: ''; position: absolute; inset: -6%;
  background-image: var(--hero-img); background-size: cover; background-position: center 26%;
  filter: blur(22px) saturate(1.15); transform: scale(1.04); opacity: .62;
}
.hero-main.is-lowres > img {
  inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; object-position: center; opacity: 1;
}
/* stand-in for an article with no photo: a tinted panel rather than a flat
   grey plate, which read as a blurry image */
.hero-fallback {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(13,22,32,.5), rgba(13,22,32,.12) 42%, rgba(13,22,32,.78)),
    radial-gradient(120% 95% at 82% 4%, var(--cat, #2bb58e), transparent 62%),
    linear-gradient(140deg, var(--cat, #2bb58e), #0d1620 78%);
}
.hero-main::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,23,32,.95) 2%, rgba(15,23,32,.58) 45%, rgba(15,23,32,0) 80%);
}
.hero-content { position: relative; z-index: 2; padding: 26px 30px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent);
  color: #fff; font-family: var(--font); font-weight: 700; font-size: .68rem;
  letter-spacing: .11em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 999px; margin-bottom: 12px;
}
/* clamped so a long headline can never push the copy out of a short band */
.hero-title {
  color: #fff; font-size: clamp(1.35rem, 2.4vw, 1.95rem); margin: 0 0 10px; line-height: 1.18;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-title a { color: #fff; }
.hero-title a:hover { color: var(--accent); }
.hero-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: rgba(255,255,255,.7); font-size: .78rem; font-family: var(--font); font-weight: 500;
}
.hero-meta a { color: rgba(255,255,255,.9); font-weight: 700; }
.hero-meta a:hover { color: var(--accent); }

/* secondary stories: compact rows so three of them sit inside the same band */
.hero-side { display: flex; flex-direction: column; gap: 10px; height: var(--hero-h); }
.hero-side .card { flex: 1; flex-direction: row; min-height: 0; }
.hero-side .card-media { width: 34%; flex-shrink: 0; aspect-ratio: auto; }
.hero-side .card-body { padding: 11px 16px; min-width: 0; }
.hero-side .card-title {
  font-size: .95rem; line-height: 1.3; margin: 0 0 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-side .card-meta { font-size: .72rem; }
.hero-side .cat-label, .hero-side .card-excerpt { display: none; }

/* --------------------------------------------------------------- *
   4. Forms
   --------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label,
.label {
  display: block; font-family: var(--font); font-weight: 700;
  font-size: .84rem; color: var(--ink); margin-bottom: 7px;
}
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 6px; display: block; }
.field .req { color: var(--danger); }

.input, .select, .textarea {
  width: 100%; font-family: var(--font-body); font-size: .95rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; transition: border-color .18s, box-shadow .18s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.65; }
.textarea-lg { min-height: 380px; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23969fa9' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 10px;
  padding-right: 38px;
}
.input-sm { padding: 7px 11px; font-size: .87rem; }
.check {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: .9rem; color: var(--ink-2);
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0;
}
.check-row { display: flex; flex-wrap: wrap; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .field-row-3 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--line);
  position: relative; transition: background .2s; flex-shrink: 0;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs);
  transition: transform .2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch .switch-label { font-family: var(--font); font-weight: 600; font-size: .89rem; color: var(--ink); }

/* --- segmented two-state choice (draft / published) --- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface-2);
}
.seg-opt { display: block; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-face {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border-radius: 999px;
  font-family: var(--font); font-weight: 700; font-size: .87rem;
  color: var(--muted); text-align: center; transition: all .18s ease;
}
.seg-face svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.seg-opt:hover .seg-face { color: var(--ink); }
.seg-opt input:checked + .seg-face {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
/* the "Published" half picks up the accent so the live state reads instantly */
.seg-opt input[value="published"]:checked + .seg-face { color: var(--accent-dark); }
.seg-opt input:focus-visible + .seg-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .8rem; color: var(--muted); margin-top: 10px;
}
.seg-note svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; margin-top: 2px; }

/* --- top-story toggle --- */
.topstory { display: block; cursor: pointer; }
.topstory input { position: absolute; opacity: 0; pointer-events: none; }
.topstory-body {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
  transition: all .18s ease;
}
.topstory:hover .topstory-body { border-color: var(--muted); }
.topstory-body > svg {
  width: 18px; height: 18px; fill: var(--muted); flex-shrink: 0; margin-top: 1px;
}
.topstory-text { flex: 1; min-width: 0; }
.topstory-text b {
  display: block; font-family: var(--font); font-weight: 700;
  font-size: .89rem; color: var(--ink-2);
}
.topstory-text small { display: block; font-size: .79rem; color: var(--muted); margin-top: 3px; }
.topstory input:checked + .topstory-body {
  border-color: var(--accent); background: var(--accent-soft);
}
.topstory input:checked + .topstory-body > svg { fill: var(--accent-dark); }
.topstory input:checked + .topstory-body .topstory-text b { color: var(--accent-dark); }
.topstory input:focus-visible + .topstory-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.topstory-current {
  display: flex; align-items: center; gap: 7px;
  font-size: .79rem; color: var(--muted); margin-top: 10px;
}
.topstory-current svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }
.topstory-current a { color: var(--accent-dark); font-weight: 600; }

.form-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line);
}

/* newsletter strip */
.newsletter-strip {
  background: linear-gradient(135deg, var(--ink) 0%, #22394f 100%);
  border-radius: var(--radius-xl); padding: 34px 34px; color: #fff;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px; align-items: center;
  position: relative; overflow: hidden;
}
/* without this the tracks size to the form's max-content and push past the
   card on narrow screens */
.newsletter-strip > * { min-width: 0; }
.newsletter-strip::before {
  content: ''; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(43,181,142,.22);
}
.newsletter-strip h2 { color: #fff; margin: 0 0 8px; font-size: 1.5rem; }
.newsletter-strip p { color: rgba(255,255,255,.76); margin: 0; }
.newsletter-form { display: flex; gap: 10px; position: relative; z-index: 2; }
.newsletter-form input {
  flex: 1; min-width: 0; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1); color: #fff; padding: 12px 20px; font-size: .92rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.55); }
.newsletter-form input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.16); }
@media (max-width: 780px) { .newsletter-strip { grid-template-columns: 1fr; padding: 26px 22px; } }
@media (max-width: 420px) {
  .newsletter-form { flex-wrap: wrap; }
  .newsletter-form input { flex: 1 1 100%; }
  .newsletter-form button { width: 100%; }
}
.newsletter-note { font-size: .8rem; color: rgba(255,255,255,.55); margin-top: 10px; }

/* --------------------------------------------------------------- *
   5. Alerts
   --------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 16px; border-radius: var(--radius); margin-bottom: 18px;
  font-size: .9rem; border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--accent-soft); color: #1a7d63; border-color: rgba(43,181,142,.3); }
.alert-error   { background: #fdecec; color: #b64d4d; border-color: rgba(227,107,107,.32); }
.alert-warning { background: #fff6e6; color: #a4701a; border-color: rgba(250,191,97,.4); }
.alert-info    { background: #e9f5fa; color: #1a7d9b; border-color: rgba(34,163,201,.3); }
[data-theme="dark"] .alert-success { background: rgba(43,181,142,.14); color: #6fd7ba; }
[data-theme="dark"] .alert-error   { background: rgba(227,107,107,.14); color: #f19a9a; }
[data-theme="dark"] .alert-warning { background: rgba(250,191,97,.14); color: var(--amber); }
[data-theme="dark"] .alert-info    { background: rgba(34,163,201,.14); color: #6ecbe8; }

/* --------------------------------------------------------------- *
   6. Pagination & empty states
   --------------------------------------------------------------- */
.pagination { margin: 34px 0 10px; }
.pagination ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
  list-style: none; margin: 0; padding: 0;
}
.pagination a, .pagination span {
  display: grid; place-items: center; min-width: 40px; height: 40px;
  padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--font); font-weight: 700; font-size: .89rem;
  transition: all .18s ease;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .ellipsis { border: 0; background: none; color: var(--muted); min-width: 22px; }

.empty-state { text-align: center; padding: 60px 24px; }
.empty-state svg { width: 62px; height: 62px; fill: var(--line); margin: 0 auto 18px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 44ch; margin: 0 auto 20px; }

/* --------------------------------------------------------------- *
   7. Tabs
   --------------------------------------------------------------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line);
  margin-bottom: 22px; scrollbar-width: thin;
}
.tabs a, .tabs button {
  padding: 11px 16px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-family: var(--font); font-weight: 700; font-size: .9rem; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color .18s, border-color .18s;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .active { color: var(--accent-dark); border-bottom-color: var(--accent); }
