/* ============================================
   THE BROADSIDE — gstuart.com
   Constitutional document meets Texas editorial
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #1b2838;
  --navy-light: #22334a;
  --parchment: #f0e6d3;
  --parchment-dim: #d4c9b5;
  --dust: #a89b8c;
  --slate: #7a7068;
  --gold: #b8860b;
  --gold-bright: #d4a017;
  --rule: #3a4a5c;
  --tag-bg: #2a3a4e;
  --quote-bg: rgba(184, 134, 11, 0.06);
  --serif: 'Playfair Display', 'Georgia', serif;
  --body: 'Source Serif 4', 'Georgia', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: 17px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--body);
  color: var(--parchment);
  background: var(--navy);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-bright); }

/* ---- Utility ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 2rem; }

/* ============================================
   MASTHEAD
   ============================================ */
.masthead {
  padding: 2rem 0 1.5rem;
  text-align: center;
}

.masthead-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 2rem;
}

.masthead-rule {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 0.6rem 0;
}

.masthead-title {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--parchment);
  letter-spacing: -0.01em;
  line-height: 1.1;
  display: block;
}

.masthead-title:hover { color: var(--gold); }

.masthead-byline {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.2rem;
}

/* ============================================
   HERO (latest post, page 1 only)
   ============================================ */
.hero {
  max-width: 1080px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
}

.hero-bg { display: none; }

.hero-link {
  display: grid;
  grid-template-columns: 55% 45%;
  height: 380px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  overflow: hidden;
}

.hero-link:hover { color: inherit; }

.hero-image {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}

.hero-link:hover .hero-image img {
  transform: scale(1.03);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
  background: var(--navy-light);
  border-left: 3px solid var(--gold);
  min-width: 0;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dateline {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.hero-tags .tag-link,
.hero-tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--parchment);
  margin-bottom: 0.75rem;
}

.hero-link:hover .hero-title { color: var(--gold); }

.hero-excerpt {
  color: var(--dust);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.hero-link:hover .read-more { color: var(--gold-bright); }

/* ============================================
   INDEX LAYOUT (sidebar + grid)
   ============================================ */
.index-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  padding: 0.5rem 0 2rem;
}

/* ============================================
   POST GRID
   ============================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.grid-card {
  background: var(--navy-light);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}

.grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.grid-card-img {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--navy);
}

.grid-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}

.grid-card:hover .grid-card-img img {
  transform: scale(1.05);
}

.grid-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.grid-card-body .dateline {
  margin-bottom: 0.4rem;
}

.grid-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.grid-card-title a { color: var(--parchment); }
.grid-card-title a:hover { color: var(--gold); }

.grid-card-excerpt {
  color: var(--dust);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
}

.grid-card-tags {
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--slate);
}

.grid-card-tags .tag-link {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-block {
  margin-bottom: 2rem;
}

.sidebar-heading {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.75rem;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.topic-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--parchment-dim);
  background: var(--tag-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  transition: all .15s;
}

.topic-tag:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.topic-tag sup {
  font-size: 0.6rem;
  margin-left: 0.15rem;
  opacity: 0.5;
}

.bio {
  font-size: 0.9rem;
  color: var(--dust);
  line-height: 1.6;
}

.bio-location {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--slate);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.pag-link { font-weight: 500; color: var(--gold); }
.pag-link:hover { color: var(--gold-bright); }
.pag-link.disabled { color: var(--slate); opacity: 0.3; pointer-events: none; }
.pag-info { color: var(--slate); font-size: 0.78rem; font-weight: 500; }

/* ============================================
   ARTICLE PAGE
   ============================================ */
/* Article hero with blurred background */
.article-hero-wrap {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.article-hero-blur {
  position: absolute;
  left: 0;
  right: 0;
  top: 20%;
  bottom: 20%;
  background: center / cover no-repeat;
  filter: blur(30px) brightness(0.35);
  transform: scaleX(1.2);
  overflow: hidden;
}

.article-hero {
  position: relative;
  max-width: 720px;
  width: 100%;
  z-index: 1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.article-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(27, 40, 56, 0.6));
  pointer-events: none;
}

.article-hero img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: cover;
}

.article-header {
  margin-bottom: 2rem;
}

.article-header .container-narrow {
  padding-top: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.article-tags .tag-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-title {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* ---- Article Body ---- */
.article-body {
  font-size: 1.08rem;
  line-height: 1.85;
}

.article-body > p:first-child::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 900;
  line-height: 0.8;
  padding: 0.05em 0.12em 0 0;
  color: var(--gold);
}

.article-body p { margin-bottom: 1.3rem; }

.article-body h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  color: var(--parchment);
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.article-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  background: var(--quote-bg);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--dust);
  font-size: 1.05rem;
}

.article-body blockquote p { margin-bottom: 0.5rem; }
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body strong { font-weight: 700; color: var(--parchment); }
.article-body em { font-style: italic; }

.article-body ul, .article-body ol { margin: 1rem 0 1.3rem 1.5rem; }
.article-body li { margin-bottom: 0.5rem; }

.article-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.25rem 0;
}

.article-body a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(184, 134, 11, 0.3);
  text-underline-offset: 3px;
}

.article-body a:hover { text-decoration-color: var(--gold-bright); }

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 2rem 0;
  border-radius: 6px;
  background: var(--navy-light);
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---- Article Footer ---- */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.back-link {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
}

/* ============================================
   TAG PAGE
   ============================================ */
.tag-header {
  padding: 2rem 0;
}

.tag-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  margin: 0.5rem 0 0.25rem;
  text-transform: capitalize;
}

.tag-count {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--slate);
}

/* ============================================
   TAG LINK (inline in meta)
   ============================================ */
.tag-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* ============================================
   404
   ============================================ */
.not-found {
  text-align: center;
  padding: 8rem 0;
}

.not-found h1 {
  font-family: var(--serif);
  font-size: 6rem;
  font-weight: 900;
  color: var(--rule);
}

.not-found p {
  color: var(--dust);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: auto;
  padding: 1.5rem 2rem;
  text-align: center;
}

.footer-rule {
  max-width: 600px;
  margin: 0 auto 1rem;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.site-footer p {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--slate);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .index-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    order: -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
  }

  .sidebar-block { margin-bottom: 0; }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  .hero { padding: 0 2rem; }

  .hero-link {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }

  .hero-image {
    aspect-ratio: 4 / 3;
  }

  .hero-image img {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .hero-content {
    padding: 1.25rem 1.25rem 1.5rem;
    border-left: none;
    border-top: 3px solid var(--gold);
  }

  .hero-title { font-size: 1.5rem; }

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

  .article-title { font-size: 2rem; }

  .article-hero-wrap { padding: 0; overflow: hidden; }
  .article-hero { max-width: none; box-shadow: none; border-radius: 0; }
  .article-hero-blur { display: none; }

  .masthead-title { font-size: 2rem; }

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

@media (max-width: 480px) {
  .container, .container-narrow { padding: 0 1.25rem; }
  .hero { padding: 0 1.25rem; }
  .article-title { font-size: 1.7rem; }
  .article-body > p:first-child::first-letter { font-size: 3.2rem; }
}
