/* ==========================================================================
   Counterweight Sentinel - Main Stylesheet
   ========================================================================== */

/* Design tokens
   ========================================================================== */

:root {
  --ink: #172233;
  --muted: #667085;
  --line: #e7e1d7;
  --paper: #fbf7ef;
  --paper-2: #f3eadc;
  --accent: #a13a28;
  --accent-2: #c9a55c;
  --white: #fffdf8;
  --shadow: 0 18px 45px rgba(23, 34, 51, .10);

  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

input {
  min-width: 200px;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

@view-transition {
  navigation: auto;
}

/* Typography
   ========================================================================== */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.05;
}

h1 {
  margin: 16px 0;
  font-size: clamp(42px, 6vw, 74px);
  letter-spacing: -.04em;
}

h2 {
  font-size: 36px;
  letter-spacing: -.025em;
}

h3 {
  font-size: 24px;
  letter-spacing: -.015em;
}

.standfirst {
  color: #354050;
  font-family: var(--serif);
  font-size: 21px;
}

.excerpt {
  margin: 0;
  color: #515b69;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent-2);
}

/* Header and navigation
   ========================================================================== */

.top-strip {
  background: var(--ink);
  color: #f9f0df;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.top-strip .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: 40px;
  padding: 24px 0;
}

.logo {
  width: 285px;
}

.nav {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  width: 100%;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 58px;
  padding: 8px 10px;

  font-size: 14px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.35;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 18%;
  bottom: 6px;
  width: 64%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav-secondary {
  display: contents;
}
.mobile-menu-button {
  display: none;
  width: 48px;
  height: 48px;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Buttons and forms
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.gold {
  background: #fff8e8;
  border-color: var(--accent-2);
  color: var(--ink);
}

.input {
  width: 100%;
  padding: 13px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin: 22px 0;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
}

/* Generic components
   ========================================================================== */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
}

.panel.dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff7ea;
}

.panel-title {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.dark .panel-title {
  color: var(--accent-2);
}

.mini-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.mini-item {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mini-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mini-item h3 {
  font-size: 20px;
}

.dark .mini-item {
  border-color: rgba(255, 255, 255, .16);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 26px 0 10px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.admin-note {
  margin-top: 18px;
  padding: 14px;
  background: #fff8e8;
  border: 1px dashed var(--accent-2);
  color: #554227;
  font-size: 14px;
}

/* Homepage
   ========================================================================== */

.ticker {
  background: #fffaf1;
  border-bottom: 1px solid var(--line);
}

.ticker .container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
}

.ticker strong {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 28px;
  padding: 34px 0 22px;
}

.lead-card {
  display: grid;
  grid-template-columns: 1fr .82fr;
  min-height: 520px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lead-image {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #182334, #8d3428);
}

.lead-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .18), transparent 28%),
    linear-gradient(0deg, rgba(23, 34, 51, .45), transparent);
}

.lead-content {
  padding: 36px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  padding: 28px 0;
}

.newsletter {
  margin: 28px 0;
  padding: 34px;
  background: linear-gradient(135deg, var(--ink), #29394f);
  color: white;
}

.newsletter h2 {
  font-size: 38px;
}

/* Cards and lists
   ========================================================================== */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(23, 34, 51, .06);
}

.card-body {
  padding: 18px;
}

.card h3 {
  margin: 8px 0 10px;
}

.thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #ded2bf, #172233);
}

.thumb img,
.lead-image img,
.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  padding: 4px 8px;
  background: #f7e7dd;
  border: 1px solid #ecd0c1;
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.list-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.list-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #ded2bf, #172233);
}

/* Pages
   ========================================================================== */

.page-hero {
  padding: 46px 0 20px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: 58px;
}

/* Article pages
   ========================================================================== */

.article-page {
  padding-top: 26px;
}

.article-newsletter {
  display: grid;
  grid-template-columns: auto 1fr minmax(320px, 500px);
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
  padding: 18px 26px;
  background: rgba(255, 253, 248, .76);
  border: 1px solid var(--line);
  box-shadow: 0 10px 34px rgba(23, 34, 51, .06);
}

.newsletter-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: #f4e5c9;
  border-radius: 50%;
  color: var(--accent-2);
  font-size: 28px;
}

.article-newsletter h3 {
  margin: 2px 0;
  font-size: 26px;
}

.article-newsletter p {
  margin: 0;
  color: var(--ink);
}

.article-newsletter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 0;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 320px;
  gap: 42px;
  padding: 34px 0;
}

.article-layout.redesigned {
  grid-template-columns: minmax(0, 827px) 350px;
  align-items: start;
  gap: 5px;
}

.article-main {
  padding: 38px;
  background: var(--white);
  border: 1px solid var(--line);
}

.article-main h1 {
  font-size: 58px;
}

.article-main .subtitle {
  color: #465161;
  font-family: var(--serif);
  font-size: 25px;
}

.article-byline {
  align-items: center;
}

.mini-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.article-image {
  height: 380px;
  margin: 26px -38px;
  background: linear-gradient(135deg, #172233, #a13a28);
}

.caption {
  margin-top: -18px;
  color: var(--muted);
  font-size: 12px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prose {
  color: #222a35;
  font-family: var(--serif);
  font-size: 20px;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose h2 {
  margin: 1.3em 0 .45em;
  font-size: 34px;
}

.article-sidebar {
  position: sticky;
  top: 115px;
  display: grid;
  gap: 22px;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: #fff8ec;
  border: 1px solid var(--line);
}

.author-side-box {
  padding: 28px;
}

.author-side-inner {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.author-side-inner h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  background: var(--ink);
  border-radius: 50%;
  color: #f7e7dd;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: bold;
}

/* Editor picks rail
   ========================================================================== */

.rail-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.rail-heading span {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rail-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.editor-picks-panel {
  background: var(--white);
}

.editor-picks-list {
  display: grid;
  gap: 18px;
}

.editor-pick-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: start;
  gap: 16px;
}

.editor-pick-thumb {
  width: 88px;
  aspect-ratio: 1.22 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #ded2bf, #172233);
  border-radius: 5px;
}

.editor-pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-pick-text h3 {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -.01em;
}

.editor-pick-text time {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

/* Author pages
   ========================================================================== */

.author-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 30px;
  margin: 30px 0;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
}

.author-header .avatar {
  width: 160px;
  height: 160px;
  font-size: 64px;
}

.stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
}

.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
}

/* Pagination
   ========================================================================== */

.pagy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 42px 0 10px;
}

.pagy a,
.pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(23, 34, 51, .04);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all .18s ease;
}

.pagy a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pagy .current {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 34, 51, .18);
  color: white;
}

.pagy .gap {
  min-width: auto;
  padding: 0 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
}

.pagy a[aria-label="Previous"],
.pagy a[aria-label="Next"] {
  padding: 0 18px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Footer
   ========================================================================== */

.footer {
  margin-top: 48px;
  padding: 34px 0;
  background: var(--ink);
  color: #efe8dc;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 26px;
}

.footer h4 {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.footer a,
.footer p {
  color: #d6d0c7;
  font-size: 14px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

/* Utility classes
   ========================================================================== */

.short-top-pad {
  margin-top: 0 !important;
  padding-top: 5px !important;
}

.bottomless {
  margin-bottom: 0 !important;
}

.newsletter-top {
  grid-template-columns: auto 1fr;
}

/* Responsive
   ========================================================================== */

@media (max-width: 1050px) {
  .masthead-inner {
    grid-template-columns: auto auto;
    gap: 24px;
  }

  .nav,
  .nav-secondary {
    display: none;
  }

  .mobile-menu-button {
    display: flex;
    justify-self: end;
  }
}

@media (max-width: 900px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .top-strip .container {
    align-items: flex-start;
  }

  .hero-grid,
  .lead-card,
  .two-col,
  .article-layout,
  .article-layout.redesigned,
  .footer-grid,
  .author-header {
    grid-template-columns: 1fr;
  }

  .lead-image {
    min-height: 260px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .form-row,
  .search-bar {
    flex-direction: column;
  }

  .article-page {
    padding-top: 16px;
  }

  .article-newsletter {
    grid-template-columns: 1fr;
  }

  .article-newsletter-form {
    grid-template-columns: 1fr;
  }

  .article-layout.redesigned {
    display: grid;
    gap: 22px;
    padding: 20px 0;
  }

  .article-main {
    padding: 22px;
    overflow: hidden;
  }

  .article-main h1,
  .page-hero h1 {
    font-size: clamp(36px, 10vw, 46px);
    line-height: 1.03;
    letter-spacing: -.035em;
  }

  .article-main .subtitle {
    font-size: 22px;
    line-height: 1.22;
  }

  .article-image {
    height: auto;
    aspect-ratio: 16 / 10;
    margin: 22px -22px;
  }

  .share-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .share-row .btn {
    width: 100%;
    padding: 10px 8px;
    font-size: 12px;
  }

  .prose {
    font-size: 19px;
    line-height: 1.58;
  }

  .article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .author-side-inner {
    grid-template-columns: 64px 1fr;
    gap: 14px;
  }

  .author-side-inner .avatar,
  .article-sidebar .avatar {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .editor-pick-row {
    grid-template-columns: 84px 1fr;
  }
}
@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .top-strip .container {
    display: grid;
    gap: 4px;
  }

  .top-strip-subtitle {
    display: none;
  }

  .masthead-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0 12px;
  }

  .brand-link,
  .masthead-inner > a {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .logo {
    width: min(320px, 86vw);
    max-width: 100%;
    margin: 0 auto;
  }

  .mobile-menu-button {
    display: flex;
    position: static;
    align-self: center;
    margin: 0;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
  }

  .mobile-menu {
    position: static;
    width: 100%;
    margin: 0;
    padding: 12px 20px 20px;
    border-top: 1px solid var(--line);
  }

  .article-newsletter {
    gap: 14px;
    padding: 16px;
  }

  .newsletter-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .article-newsletter h3 {
    font-size: 23px;
  }

  .article-main {
    padding: 18px;
  }

  .article-main h1 {
    font-size: clamp(34px, 11vw, 42px);
  }

  .article-main .subtitle {
    font-size: 20px;
  }

  .article-image {
    margin: 20px -18px;
  }

  .article-byline {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 6px 12px;
  }

  .article-byline .mini-avatar {
    grid-row: span 3;
  }

  .share-row {
    grid-template-columns: 1fr;
  }

  .prose {
    font-size: 18px;
  }

  .prose h2 {
    font-size: 29px;
  }

  .section-head {
    display: block;
  }

  .section-head h2 {
    font-size: 30px;
  }

  .panel {
    padding: 18px;
  }

  .author-side-inner {
    grid-template-columns: 1fr;
  }

  .editor-pick-row {
    grid-template-columns: 76px 1fr;
    gap: 12px;
  }

  .editor-pick-thumb {
    width: 76px;
  }

  .editor-pick-text h3 {
    font-size: 17px;
  }
}