/* ==========================================================================
   Broadsheet Theme — Production Styles
   Colors/fonts via CSS custom properties from brand.css (per-site).
   ========================================================================== */

/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body, 'Source Serif Pro', Georgia, serif);
  color: #222; background: #fafafa; line-height: 1.7;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand-primary, #005F8E); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.page-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 2rem;
  max-width: 1200px; margin: 2rem auto; padding: 0 1rem;
}
.page-layout > main { min-width: 0; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header { background: var(--brand-header-bg, #003D5C); color: #fff; }
.header-top {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem 1rem 0.6rem;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.site-title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 2.2rem; color: #fff; text-decoration: none; letter-spacing: -0.02em;
}
.site-title:hover { text-decoration: none; opacity: 0.9; }
.header-date { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

/* ── Navigation ─────────────────────────────────────────────────────── */
.site-nav {
  max-width: 1200px; margin: 0 auto; padding: 0.5rem 1rem;
  display: flex; gap: 0.3rem; flex-wrap: wrap;
}
.site-nav a {
  color: rgba(255,255,255,0.85); font-size: 0.85rem;
  padding: 0.25rem 0.6rem; border-radius: 3px;
  text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

/* ── Homepage Hero Grid ─────────────────────────────────────────────── */
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem;
}
.hero-main { grid-row: span 2; }
.hero-main .card-image { aspect-ratio: 16/10; }
.hero-main h3 { font-size: 1.5rem; }
.hero-side .card-image { aspect-ratio: 16/9; }
.hero-side h3 { font-size: 1rem; }

/* ── Section Title ──────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 1.4rem; margin: 2rem 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--brand-primary, #005F8E); color: #111;
}
.section-title:first-child { margin-top: 0; }

/* ── Article Grid ───────────────────────────────────────────────────── */
.article-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}

/* ── Article Card ───────────────────────────────────────────────────── */
.article-card {
  border: 1px solid #e5e5e5; border-radius: 4px;
  overflow: hidden; background: #fff; transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #eee; }
.card-content { padding: 0.8rem 1rem 1rem; }
.card-category {
  font-size: 0.7rem; text-transform: uppercase; font-weight: 700;
  color: var(--brand-accent, #F4A31C); letter-spacing: 0.03em;
}
.card-content h3 {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 1.05rem; margin: 0.25rem 0 0.4rem; line-height: 1.3;
}
.card-content h3 a { color: #111; }
.card-content h3 a:hover { color: var(--brand-primary, #005F8E); text-decoration: none; }
.card-description {
  font-size: 0.88rem; color: #555; margin-bottom: 0.4rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-content time { font-size: 0.78rem; color: #999; }

/* ── Single Article ─────────────────────────────────────────────────── */
.article-single { max-width: 100%; }
.article-header { margin-bottom: 1.5rem; }
.article-header h1 {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 2.2rem; line-height: 1.2; margin: 0.5rem 0; color: #111;
}
.article-meta {
  display: flex; gap: 0.8rem; align-items: center;
  flex-wrap: wrap; font-size: 0.85rem; color: #666;
}
.article-category {
  background: var(--brand-accent, #F4A31C); color: #fff;
  padding: 0.15rem 0.6rem; border-radius: 3px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; text-decoration: none;
}
.article-category:hover { opacity: 0.9; text-decoration: none; }
.article-updated { color: var(--brand-accent, #F4A31C); font-weight: 500; }
.article-lead { font-size: 1.15rem; color: #444; font-style: italic; margin-top: 0.5rem; }

.article-hero { margin: 1.5rem 0; }
.article-hero img { width: 100%; border-radius: 4px; }
.article-hero figcaption,
.article-body-image figcaption {
  font-size: 0.8rem; color: #888; margin-top: 0.4rem; font-style: italic;
}
.article-body { font-size: 1.05rem; }
.article-body p { margin-bottom: 1.2rem; }
.article-body p:first-child { font-size: 1.1rem; }
.article-body blockquote {
  border-left: 4px solid var(--brand-primary, #005F8E);
  padding: 0.5rem 1rem; margin: 1.5rem 0; background: #f5f5f5; font-style: italic; color: #444;
}
.article-body-image { margin: 1.5rem 0; }
.article-body-image img { width: 100%; border-radius: 4px; }

.update-notice {
  background: #fff3cd; border-left: 4px solid var(--brand-accent, #F4A31C);
  padding: 0.75rem 1rem; margin-bottom: 1.5rem;
  font-size: 0.9rem; color: #856404; border-radius: 0 4px 4px 0;
}

.article-tags {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #eee;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.tag {
  background: #f0f0f0; color: #555; padding: 0.2rem 0.7rem; border-radius: 3px;
  font-size: 0.8rem; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.tag:hover { background: var(--brand-primary, #005F8E); color: #fff; text-decoration: none; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.site-sidebar { min-width: 0; }
.sidebar-section { margin-bottom: 2rem; }
.sidebar-title {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 1.1rem; margin-bottom: 0.8rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--brand-primary, #005F8E);
}
.sidebar-article { padding: 0.6rem 0; border-bottom: 1px solid #eee; }
.sidebar-article:last-child { border-bottom: none; }
.sidebar-article h4 { font-size: 0.9rem; line-height: 1.3; margin-bottom: 0.2rem; }
.sidebar-article h4 a { color: #222; }
.sidebar-article h4 a:hover { color: var(--brand-primary, #005F8E); }
.sidebar-article time { font-size: 0.75rem; color: #999; }

/* ── Ad Slots ───────────────────────────────────────────────────────── */
.ad-slot { background: #f5f5f5; text-align: center; overflow: hidden; min-height: 90px; }
.ad-header { padding: 0.5rem 0; }
.ad-footer { padding: 0.5rem 0; }
.ad-sidebar { margin-bottom: 1.5rem; min-height: 250px; }
.ad-in-content { margin: 1.5rem 0; min-height: 90px; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0;
}
.page-link {
  padding: 0.4rem 0.8rem; border: 1px solid #ddd; border-radius: 3px;
  font-size: 0.9rem; color: #555;
}
.page-link:hover { background: var(--brand-primary, #005F8E); color: #fff; text-decoration: none; border-color: var(--brand-primary); }
.page-link.active { background: var(--brand-primary, #005F8E); color: #fff; border-color: var(--brand-primary); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer { background: var(--brand-header-bg, #003D5C); color: #ccc; margin-top: auto; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem;
  display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem;
}
.footer-inner a { color: #aaa; margin-left: 1.5rem; }
.footer-inner a:hover { color: #fff; text-decoration: none; }

/* ── 404 ────────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 4rem; color: var(--brand-primary, #005F8E);
}
.error-page p { font-size: 1.1rem; color: #666; margin: 1rem 0; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .page-layout { grid-template-columns: 1fr; }
  .site-sidebar { order: 2; }
}
@media (max-width: 768px) {
  .article-header h1 { font-size: 1.6rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; }
  .article-grid { grid-template-columns: 1fr; }
  .header-top { flex-direction: column; gap: 0.3rem; }
  .site-title { font-size: 1.7rem; }
  .site-nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
  .footer-inner a { margin-left: 0; margin: 0 0.5rem; }
}
@media (max-width: 480px) {
  html { font-size: 15px; }
  .card-content { padding: 0.6rem 0.8rem 0.8rem; }
}

/* ── Print ──────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-nav, .site-sidebar, .site-footer,
  .ad-slot, .article-tags, .pagination { display: none; }
  body { color: #000; background: #fff; font-size: 12pt; line-height: 1.5; }
  .page-layout { display: block; }
  .article-header h1 { font-size: 18pt; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
