/*
Theme Name: Broadsheet
Theme URI: https://news.suprita.net
Author: Suprita
Description: A high-density news portal homepage. Three-column rails, section blocks, small serif headlines. Classic PHP templates, no build step.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: broadsheet
*/

/* ---------------------------------------------------------
   1. Tokens
   --------------------------------------------------------- */
:root {
  --paper:   #FFFFFF;
  --wash:    #F5F5F2;
  --ink:     #17181A;
  --muted:   #6A6D72;
  --rule:    #DCDCD7;
  --rule-hard: #17181A;
  --accent:  #A81E22;
  --accent-dark: #7C1518;
  --live:    #C4361F;

  --max: 1280px;
  --gutter: clamp(0.85rem, 2.5vw, 1.75rem);

  /* Dense scale: portals run small and tight. */
  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1.0625rem;
  --fs-lg:   clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-xl:   clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem);
  --fs-mark: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem);

  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans:  "Noto Sans", system-ui, -apple-system, sans-serif;
}

/* ---------------------------------------------------------
   2. Base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.45;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem; top: 0.5rem; z-index: 60;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem;
}

.ph { aspect-ratio: 16 / 10; background: var(--wash); }

/* ---------------------------------------------------------
   3. Masthead
   --------------------------------------------------------- */
.topbar {
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.topbar__inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding-block: 0.45rem; flex-wrap: wrap;
}
.topbar a { color: var(--muted); }
.topbar__links { display: flex; gap: 1.1rem; }

.masthead { text-align: center; padding-block: 1.15rem 1rem; }

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-mark);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.wordmark a:hover { color: inherit; }

.tagline {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0.4rem 0 0;
  letter-spacing: 0.06em;
}

/* Section navigation band */
.mainnav {
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 40;
}
.mainnav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a {
  display: block;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  white-space: nowrap;
}
.mainnav a:hover { background: var(--accent-dark); color: #fff; }
.mainnav .current-menu-item > a { background: var(--accent-dark); }

/* ---------------------------------------------------------
   4. Top block: three rails
   --------------------------------------------------------- */
.portal {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 290px;
  gap: 0;
  padding-block: 1.25rem;
}

.rail { padding-inline: 1.15rem; }
.rail--left  { padding-left: 0;  border-right: 1px solid var(--rule); }
.rail--right { padding-right: 0; border-left: 1px solid var(--rule); }

.rail__head {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rule-hard);
  display: flex; align-items: center; gap: 0.4rem;
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live); flex: none;
}
.rail__head .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .rail__head .dot { animation: none; } }

/* Ranked list — numbers are legitimate here, it is a ranking */
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.ranked li {
  counter-increment: r;
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.5rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--rule);
}
.ranked li:first-child { border-top: 0; padding-top: 0; }
.ranked li::before {
  content: counter(r);
  font-family: var(--serif);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.ranked h3 {
  font-family: var(--serif);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.32;
  margin: 0;
}

/* Latest ticker */
.ticker { list-style: none; margin: 0; padding: 0; }
.ticker li {
  padding-block: 0.6rem;
  border-top: 1px solid var(--rule);
}
.ticker li:first-child { border-top: 0; padding-top: 0; }
.ticker time {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.ticker li.is-live time { color: var(--live); }
.ticker h3 {
  font-family: var(--serif);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.32;
  margin: 0;
}

/* ---------------------------------------------------------
   5. Centre: lead + subs
   --------------------------------------------------------- */
.lead__media { margin: 0 0 0.7rem; }
.kicker {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.lead__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-xl);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}
.lead__deck {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: #35383D;
  margin: 0 0 0.55rem;
  max-width: 62ch;
}
.meta {
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 0;
}
.meta strong { color: var(--ink); font-weight: 600; }

.subs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}
.sub__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.25;
  margin: 0.45rem 0 0.3rem;
}
.sub__deck { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* ---------------------------------------------------------
   6. Section blocks
   --------------------------------------------------------- */
.block { padding-block: 1.5rem; border-top: 3px solid var(--rule-hard); }
.block:nth-of-type(even) { background: var(--wash); }
.block:nth-of-type(even) .ph { background: #E7E7E2; }

.block__head {
  display: flex; align-items: baseline; gap: 0.85rem;
  margin-bottom: 1rem;
}
.block__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-lg);
  margin: 0;
}
.block__name a:hover { color: var(--accent); }
.block__rule { flex: 1; height: 1px; background: var(--rule); }
.block__more { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }

.block__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.15rem, 3vw, 2rem);
}

.feature__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-lg);
  line-height: 1.2;
  margin: 0.5rem 0 0.35rem;
}
.feature__deck { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* thumbnail rows beside the feature */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.75rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--rule);
}
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows .ph, .rows img { aspect-ratio: 4 / 3; object-fit: cover; }
.rows h3 {
  font-family: var(--serif);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.2rem;
}
.rows .meta { font-size: 0.6875rem; }

/* ---------------------------------------------------------
   7. Empty state, article, footer
   --------------------------------------------------------- */
.empty { padding-block: clamp(2.5rem, 8vw, 5rem); max-width: 46ch; }
.empty h2 { font-family: var(--serif); font-size: var(--fs-lg); margin: 0 0 0.5rem; }
.empty p { color: var(--muted); margin: 0 0 0.35rem; }

.article { max-width: 44rem; margin-inline: auto; padding-block: 1.75rem 3rem; }
.article__body { font-family: var(--serif); font-size: var(--fs-md); line-height: 1.72; }
.article__body p { margin: 0 0 1.2em; }
.article__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article__body h2 { font-size: var(--fs-lg); margin: 1.8em 0 0.5em; }
.article__body blockquote {
  margin: 1.5em 0; padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-size: var(--fs-lg); line-height: 1.4;
}

.site-footer {
  background: var(--ink);
  color: #B9BCC1;
  padding-block: 1.75rem;
  font-size: var(--fs-xs);
  margin-top: 2rem;
}
.site-footer a { color: #E4E6E9; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }

.pagination { padding-block: 1.5rem; font-size: var(--fs-sm); }
.pagination .page-numbers { padding: 0.3rem 0.6rem; border: 1px solid var(--rule); margin-right: 0.3rem; display: inline-block; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------------------------------------------------------
   8. Responsive
   --------------------------------------------------------- */
@media (max-width: 1080px) {
  .portal { grid-template-columns: minmax(0, 1fr) 260px; }
  .rail--left {
    grid-column: 1 / -1;
    order: 3;
    border-right: 0;
    border-top: 1px solid var(--rule);
    padding: 1.15rem 0 0;
    margin-top: 1.15rem;
  }
  .rail--left .ranked { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
  .rail--left .ranked li:nth-child(2) { border-top: 0; padding-top: 0; }
}

@media (max-width: 820px) {
  .portal { grid-template-columns: 1fr; }
  .rail { padding-inline: 0; }
  .rail--right {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-top: 1.15rem;
    margin-top: 1.15rem;
    order: 2;
  }
  .block__body { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .subs { grid-template-columns: 1fr; }
  .rail--left .ranked { grid-template-columns: 1fr; }
  .rail--left .ranked li:nth-child(2) { border-top: 1px solid var(--rule); padding-top: 0.6rem; }
  .topbar__links { display: none; }
}
