/* ==========================================================================
   Montgomery County Crime News — stylesheet
   Classic small-town newspaper look:
   - Serif headlines (Georgia / Times New Roman)
   - Off-white page, black text, one dark red accent
   - Responsive: sidebar stacks under content on small screens
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --accent: #8b0000;          /* dark red accent */
  --accent-dark: #6d0000;
  --ink: #1a1a1a;             /* body text */
  --ink-soft: #555;           /* secondary text (dates, towns) */
  --paper: #fbf9f4;           /* off-white background */
  --card: #ffffff;
  --rule: #d8d2c4;            /* hairline rules */
  --rule-strong: #111;        /* heavy masthead rules */
  --placeholder: #e4e0d6;     /* gray image placeholder */

  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Arial, sans-serif;

  --maxw: 1100px;
}

/* ---- Reset / base ------------------------------------------------------- */
* {
  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: 18px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

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

.masthead__inner {
  text-align: center;
  padding: 22px 20px 16px;
}

.masthead__dateline {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: var(--maxw);
  margin: 0 auto 14px;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.masthead__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.05;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}

.masthead__title a {
  color: var(--ink);
}

.masthead__title a:hover {
  text-decoration: none;
}

.masthead__tagline {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* ---- Navigation --------------------------------------------------------- */
.nav {
  background: var(--ink);
}

.nav__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--maxw);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nav__list a {
  display: block;
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 16px;
}

.nav__list a:hover,
.nav__list a.is-active {
  background: var(--accent);
  text-decoration: none;
}

/* ---- Page layout -------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 28px 0 50px;
}

.page-heading {
  font-family: var(--serif);
  font-size: 30px;
  margin: 0 0 4px;
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 8px;
}

.page-subheading {
  font-family: var(--sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

/* ---- Shared bits -------------------------------------------------------- */
.kicker {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.meta {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.meta .dot {
  margin: 0 6px;
}

.readmore {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.placeholder-img {
  background: var(--placeholder);
  border: 1px solid var(--rule);
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a927f;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Top Story ---------------------------------------------------------- */
.top-story {
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 26px;
  margin-bottom: 26px;
}

.top-story__label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  margin-bottom: 14px;
  display: block;
}

.top-story__title {
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.12;
  margin: 10px 0;
}

.top-story__title a {
  color: var(--ink);
}

.top-story__summary {
  font-size: 20px;
  margin: 12px 0 14px;
}

.top-story .placeholder-img {
  margin-bottom: 14px;
}

/* ---- Latest news list --------------------------------------------------- */
.section-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 6px;
  margin: 0 0 18px;
}

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

.story {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.story:first-child {
  padding-top: 0;
}

.story__title {
  font-size: 22px;
  line-height: 1.2;
  margin: 6px 0 8px;
}

.story__title a {
  color: var(--ink);
}

.story__summary {
  font-size: 16px;
  margin: 0 0 8px;
  color: #333;
}

.story .placeholder-img {
  aspect-ratio: 4 / 3;
}

/* ---- Load more button --------------------------------------------------- */
.loadmore-wrap {
  text-align: center;
  margin: 26px 0 0;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-dark);
}

.btn[hidden] {
  display: none;
}

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar > * + * {
  margin-top: 30px;
}

.widget__title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin: 0 0 12px;
}

/* Search box */
.search {
  display: flex;
  gap: 0;
}

.search input {
  flex: 1;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-right: none;
  background: #fff;
}

.search button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.search button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.search-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

/* Most read list */
.mostread {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: mr;
}

.mostread li {
  counter-increment: mr;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.3;
}

.mostread li::before {
  content: counter(mr);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.mostread a {
  color: var(--ink);
}

/* Previously Featured / archive list */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list a {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}

.archive-list .meta {
  display: block;
  margin-top: 4px;
}

/* Town links */
.townlinks {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 16px;
}

.townlinks li {
  padding: 5px 0;
  font-family: var(--sans);
  font-size: 14px;
}

/* ---- Article page ------------------------------------------------------- */
.article {
  max-width: 760px;
}

.article__title {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.12;
  margin: 8px 0 12px;
}

.article__byline {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  margin: 0 0 20px;
}

.article__byline strong {
  color: var(--ink);
}

.article__figure {
  margin: 0 0 20px;
}

.article__figure .placeholder-img {
  aspect-ratio: 16 / 9;
}

.article__figcaption {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.article__body p {
  font-size: 19px;
  margin: 0 0 18px;
}

.article__body p:first-child::first-letter {
  font-size: 56px;
  line-height: 0.8;
  float: left;
  padding: 4px 8px 0 0;
  font-weight: 700;
  color: var(--accent);
}

.related {
  margin-top: 40px;
  border-top: 2px solid var(--rule-strong);
  padding-top: 20px;
}

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

.related__item .placeholder-img {
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
}

.related__item h3 {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
}

.related__item h3 a {
  color: var(--ink);
}

.back-link {
  font-family: var(--sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-bottom: 10px;
}

/* ---- About page --------------------------------------------------------- */
.prose {
  max-width: 760px;
}

.prose p {
  font-size: 19px;
}

.disclaimer {
  background: #FBF9F4;
  border: 1px solid #FBF9F4;
  border-left: 4px #FBF9F4;
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: #FBF9F4;
  margin-top: 24px;
}

.disclaimer strong {
  color: #FBF9F4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

/* ---- States (loading / empty / error) ---------------------------------- */
.state {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
  padding: 30px 0;
  text-align: center;
}

/* ---- Footer ------------------------------------------------------------- */
.footer {
  border-top: 3px double var(--rule-strong);
  background: var(--paper);
  margin-top: 20px;
}

.footer__inner {
  padding: 24px 20px 40px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.footer__links {
  margin-bottom: 10px;
}

.footer__links a {
  margin: 0 8px;
}

.footer__disclaimer {
  max-width: 760px;
  margin: 12px auto 0;
  font-size: 12px;
  line-height: 1.5;
  color: #FBF9F4;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  .layout {
    grid-template-columns: 1fr; /* sidebar stacks below content */
  }

  .sidebar {
    border-top: 2px solid var(--rule-strong);
    padding-top: 24px;
  }

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

  .masthead__dateline {
    flex-direction: column;
    text-align: center;
    gap: 2px;
  }
}

@media (max-width: 560px) {
  .story {
    grid-template-columns: 1fr; /* stack thumbnail above text */
  }

  .story .placeholder-img {
    aspect-ratio: 16 / 9;
  }

  .townlinks {
    columns: 1;
  }

  .nav__list a {
    padding: 10px 11px;
    font-size: 12px;
  }
}
