/* Jornal Atlas — newspaper design system
   Guardian/NYTimes influence: generous whitespace, strong typography, no clutter */

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:       #111111;
  --ink:         #222222;
  --mid:         #555555;
  --muted:       #888888;
  --border:      #e2e2e2;
  --bg:          #f9f7f4;
  --white:       #ffffff;
  --accent:      #1a3a5c;   /* deep editorial blue */
  --accent-warm: #8b1a1a;   /* atlas red for section accents */
  --font-serif:  Georgia, "Times New Roman", serif;
  --font-sans:   Inter, "Helvetica Neue", Arial, sans-serif;
  --max-w:       1200px;
  --content-w:   720px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.content-narrow {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header / Masthead ─────────────────────────────────────────────────── */
.masthead {
  background: var(--white);
  border-bottom: 3px solid var(--black);
  padding: 20px 0 0;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 16px;
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 16px;
}

.masthead-wordmark {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--black);
  text-decoration: none !important;
  line-height: 1;
}

.masthead-wordmark:hover { text-decoration: none !important; }

.masthead-tagline {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.masthead-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Navigation ────────────────────────────────────────────────────────── */
.nav-strip {
  background: var(--black);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.nav-strip::-webkit-scrollbar { display: none; }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.nav-item {
  display: inline-block;
  padding: 10px 16px;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.nav-item.active { background: var(--accent); }

/* ─── Hero Section ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-warm);
  margin-bottom: 8px;
  display: block;
}

.section-header {
  border-bottom: 2px solid var(--black);
  padding-bottom: 10px;
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
}

.section-header .see-all {
  font-size: 12px;
  color: var(--accent);
  margin-left: auto;
  font-weight: 500;
}

/* ─── Article Cards ─────────────────────────────────────────────────────── */
.card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); text-decoration: none; }

.card-img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  background: var(--border);
}

.card-img-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e2e2e2 0%, #d0d0d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 28px;
}

.card-body { padding: 16px; }

.card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-warm);
  margin-bottom: 6px;
  display: block;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--black);
  margin-bottom: 8px;
}

.card-title.large { font-size: 24px; }

.card-summary {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-meta .author { font-weight: 500; color: var(--mid); }

/* ─── Homepage Grid ─────────────────────────────────────────────────────── */
.home-hero {
  padding: 32px 0 24px;
}

/* Big featured story on top */
.hero-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 32px;
  transition: box-shadow 0.15s;
}

.hero-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.1); text-decoration: none; }

.hero-card-img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  height: 100%;
  background: var(--border);
}

.hero-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--black);
  margin-bottom: 12px;
}

.hero-card-summary {
  font-size: 15px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 16px;
}

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

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card-img { aspect-ratio: 16/9; height: auto; }
  .hero-card-body { padding: 20px; }
}

@media (max-width: 580px) {
  .articles-grid { grid-template-columns: 1fr; }
  .hero-card-title { font-size: 22px; }
}

/* ─── Pagination ────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 0;
}

.pagination button, .pagination .page-info {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--font-sans);
}

.pagination button:hover:not(:disabled) { background: var(--black); color: var(--white); border-color: var(--black); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { cursor: default; border: none; color: var(--muted); }

/* ─── Category Tags ─────────────────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 24px 0;
}

.category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-align: center;
  transition: all 0.15s;
}

.category-chip:hover { background: var(--black); color: var(--white); text-decoration: none; border-color: var(--black); }
.category-chip:hover .cat-count { color: rgba(255,255,255,0.6); }

.cat-name {
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 4px;
}

.cat-count { font-size: 12px; color: var(--muted); }

/* ─── Article Page ──────────────────────────────────────────────────────── */
.article-page { padding: 40px 0 80px; }

.article-header { margin-bottom: 32px; }

.article-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-warm);
  margin-bottom: 12px;
  display: block;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--black);
  margin-bottom: 16px;
}

.article-summary {
  font-size: 18px;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 20px;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.byline-author { font-size: 14px; font-weight: 600; color: var(--ink); }
.byline-date { font-size: 13px; color: var(--muted); }

.article-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 32px;
  background: var(--border);
}

/* Article body — journalistic prose */
.article-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
}

.article-body p { margin-bottom: 1.4em; }
.article-body h2 { font-size: 24px; margin: 1.5em 0 0.6em; font-weight: 700; }
.article-body h3 { font-size: 20px; margin: 1.2em 0 0.5em; font-weight: 700; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: rgba(26,58,92,0.04);
  font-style: italic;
  color: var(--mid);
}
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body ul, .article-body ol { margin: 1em 0 1em 1.5em; }
.article-body li { margin-bottom: 0.4em; }

/* ─── Columnist Profile ─────────────────────────────────────────────────── */
.columnist-profile { padding: 40px 0 80px; }

.columnist-hero {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 40px;
}

.columnist-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.columnist-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.columnist-name {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 4px;
}

.columnist-tagline { font-size: 15px; color: var(--mid); margin-bottom: 12px; }
.columnist-bio { font-size: 14px; color: var(--mid); line-height: 1.7; }

@media (max-width: 580px) {
  .columnist-hero { flex-direction: column; align-items: center; text-align: center; padding: 24px; }
}

/* ─── Columnists List ───────────────────────────────────────────────────── */
.columnists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

.columnist-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: box-shadow 0.15s;
}

.columnist-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); text-decoration: none; }

.columnist-card-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}

.columnist-card-name { font-size: 16px; font-weight: 600; color: var(--black); margin-bottom: 2px; }
.columnist-card-tagline { font-size: 13px; color: var(--muted); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--black);
  color: rgba(255,255,255,0.7);
  padding: 40px 0;
  margin-top: 60px;
  font-size: 13px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-wordmark {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: var(--white); text-decoration: none; }

/* ─── States: Loading / Empty / Error ──────────────────────────────────── */
.state-box {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.state-box .state-icon { font-size: 40px; margin-bottom: 16px; }
.state-box p { font-size: 16px; line-height: 1.6; }

/* Skeleton shimmer */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 3px;
}

.skeleton-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skeleton-img { height: 180px; }
.skeleton-line { height: 14px; margin: 10px 16px; }
.skeleton-line.wide { width: 80%; }
.skeleton-line.medium { width: 55%; }
.skeleton-line.short { width: 35%; }

/* ─── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { color: var(--border); }

/* ─── Page Headings ─────────────────────────────────────────────────────── */
.page-heading {
  padding: 24px 0 20px;
  border-bottom: 2px solid var(--black);
  margin-bottom: 32px;
}

.page-heading h1 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--black);
}

.page-heading p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Responsive polish ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .masthead-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .masthead-date { display: none; }
  .footer-inner { flex-direction: column; gap: 12px; }
}

/* ─── CC Source Attribution Block ──────────────────────────────────────── */
.source-attribution {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--surface, #f8f8f6);
  border-left: 3px solid var(--accent, #1a1a1a);
  border-radius: 4px;
  font-size: 13px;
  color: var(--muted, #666);
  line-height: 1.6;
}
.source-attribution strong {
  color: var(--black, #111);
}
.source-attribution a {
  color: var(--black, #111);
  text-decoration: underline;
  word-break: break-all;
}
.source-attribution .source-row {
  margin-bottom: 4px;
}
