/*
Theme Name: Deskline
Theme URI: https://example.com/deskline
Author: Your Name
Description: A single-page news homepage theme built around a live time spine. 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: deskline
*/

/* ---------------------------------------------------------
   1. Tokens
   --------------------------------------------------------- */
:root {
  --paper:      #F4F5F1;
  --paper-deep: #E9EBE4;
  --ink:        #101B2D;
  --muted:      #5A6472;
  --rule:       #CDD2C8;
  --accent:     #0B5C4E;
  --live:       #C4361F;

  --max: 1180px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  --step--1: clamp(0.80rem, 0.78rem + 0.10vw, 0.86rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2:  clamp(1.50rem, 1.32rem + 0.90vw, 2.05rem);
  --step-3:  clamp(2.05rem, 1.65rem + 2.00vw, 3.40rem);

  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", 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(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
}

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

a { color: inherit; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--sans);
}

/* ---------------------------------------------------------
   3. Masthead
   --------------------------------------------------------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.4rem 1.1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: var(--step-2);
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
  margin: 0;
}

.wordmark span { color: var(--accent); }

.edition {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.subnav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.subnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0.7rem;
}
.subnav ul::-webkit-scrollbar { display: none; }

.subnav a {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
  padding-block: 0.15rem;
  border-bottom: 2px solid transparent;
}
.subnav a:hover { border-bottom-color: var(--accent); }
.subnav .current-menu-item > a { border-bottom-color: var(--accent); }

/* ---------------------------------------------------------
   4. Top block: lead story + time spine
   --------------------------------------------------------- */
.top {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 0;
  padding-block: clamp(1.5rem, 4vw, 2.75rem);
}

.lede { padding-right: clamp(1.5rem, 3vw, 2.75rem); }

.lede__media {
  margin: 0 0 1.15rem;
  background: var(--paper-deep);
}

.lede__title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin: 0 0 0.7rem;
  text-wrap: balance;
}
.lede__title a { text-decoration: none; }
.lede__title a:hover { color: var(--accent); }

.lede__deck {
  font-size: var(--step-1);
  line-height: 1.45;
  color: #2C3948;
  margin: 0 0 1rem;
  max-width: 58ch;
}

.byline {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0;
}

.byline strong { color: var(--ink); font-weight: 600; }

/* --- the time spine: the signature element --- */
.spine {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.25rem, 3vw, 2.25rem);
}

.spine__head {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}

.spine__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) {
  .spine__head .dot { animation: none; }
}

.spine__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spine__item {
  display: grid;
  grid-template-columns: 3.9rem 1fr;
  gap: 0.85rem;
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
}
.spine__item:first-child { border-top: 0; padding-top: 0; }

.spine__time {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  padding-top: 0.15rem;
}

.spine__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.28;
  letter-spacing: -0.012em;
  margin: 0;
}
.spine__title a { text-decoration: none; }
.spine__title a:hover { color: var(--accent); }

.spine__item--live .spine__time {
  color: var(--live);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---------------------------------------------------------
   5. Secondary strip (deliberately unequal columns)
   --------------------------------------------------------- */
.strip {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.story__media {
  margin: 0 0 0.85rem;
  background: var(--paper-deep);
}

.story__kicker {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.3rem;
}
.story__kicker:hover { text-decoration: underline; }

.story__title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.16;
  letter-spacing: -0.022em;
  margin: 0 0 0.45rem;
  text-wrap: balance;
}
.story__title a { text-decoration: none; }
.story__title a:hover { color: var(--accent); }

.story__deck {
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-size: var(--step-0);
  max-width: 46ch;
}

.strip .story:first-child .story__title { font-size: var(--step-2); }

/* ---------------------------------------------------------
   6. Desk sections
   --------------------------------------------------------- */
.desk {
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.desk__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.desk__name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  margin: 0;
}
.desk__name a { text-decoration: none; }
.desk__name a:hover { color: var(--accent); }

.desk__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.desk__count {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
}

.desk__body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.digest {
  list-style: none;
  margin: 0;
  padding: 0;
}

.digest li {
  padding-block: 0.8rem;
  border-top: 1px solid var(--rule);
}
.digest li:first-child { border-top: 0; padding-top: 0; }

.digest__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.3;
  margin: 0 0 0.2rem;
}
.digest__title a { text-decoration: none; }
.digest__title a:hover { color: var(--accent); }

.digest__meta {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------------------------------------------------------
   6b. Article reading column
   --------------------------------------------------------- */
.article {
  max-width: 68ch;
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 3.5rem);
}

.article .lede__media { margin-block: 1.75rem; }

.article__body {
  font-size: var(--step-1);
  line-height: 1.7;
}

.article__body p { margin-block: 0 1.25em; }

.article__body h2,
.article__body h3 {
  font-family: var(--sans);
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin-block: 2em 0.5em;
}

.article__body a { color: var(--accent); text-underline-offset: 3px; }

.article__body blockquote {
  margin: 1.75em 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

/* ---------------------------------------------------------
   7. Empty state
   --------------------------------------------------------- */
.empty {
  padding-block: clamp(3rem, 10vw, 6rem);
  max-width: 46ch;
}
.empty h2 {
  font-family: var(--sans);
  font-size: var(--step-2);
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}
.empty p { color: var(--muted); margin: 0 0 0.4rem; }

/* ---------------------------------------------------------
   8. Footer
   --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-block: 2rem 3rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   9. Responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; }
  .lede { padding-right: 0; padding-bottom: 1.75rem; }
  .spine {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 1.5rem;
  }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .story:first-child { grid-column: 1 / -1; }
  .desk__body { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .strip { grid-template-columns: 1fr; }
  .strip .story:first-child { grid-column: auto; }
  .masthead__inner { padding-block: 1.1rem 0.9rem; }
}
