/* ============================================================
   PATRIA — Editorial Theme
   Navy #0d1b2a / Gold #d4a853 / Off-white #f0ede6
   ============================================================ */

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1b2a;
  --bg-card:     #152238;
  --bg-header:   #09131e;
  --border:      #1e3452;
  --gold:        #d4a853;
  --gold-dim:    #a8833e;
  --text:        #f0ede6;
  --text-muted:  #8da3bb;
  --text-dim:    #5a7490;
  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --max-w:       1200px;
  --max-w-text:  740px;
  --radius:      6px;
  --transition:  0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); }

img { max-width: 100%; height: auto; display: block; }

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-logo:hover { color: var(--gold); }

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--bg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a.active { color: var(--gold); }

/* --- Hero (homepage) -------------------------------------- */
.site-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, #09131e 0%, var(--bg) 100%);
}

/* Subtle skyline silhouette at bottom of hero */
.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/patria/assets/img/hero-bg.jpg') center bottom / cover no-repeat;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto 1.5rem;
  letter-spacing: -0.02em;
}

.hero-title em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Section layout --------------------------------------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-link:hover { color: var(--gold); }

/* --- Article grid ----------------------------------------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.articles-grid--featured {
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.articles-grid--featured .article-card:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
  max-height: 340px;
}

.articles-grid--featured .article-card:first-child .card-image {
  height: 100%;
  min-width: 420px;
}

/* --- Article card ----------------------------------------- */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition);
}

.article-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.card-image-link { display: block; }

.card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 0.25rem;
}

.card-title a { color: inherit; }
.card-title a:hover { color: var(--gold); }

.card-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: 0.5rem;
}

/* --- Star badge ------------------------------------------- */
.star-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--star-color) 15%, transparent);
  color: var(--star-color);
  border: 1px solid color-mix(in srgb, var(--star-color) 30%, transparent);
  transition: background var(--transition);
  white-space: nowrap;
}

.star-badge:hover {
  background: color-mix(in srgb, var(--star-color) 25%, transparent);
  color: var(--star-color);
}

.star-badge--small { font-size: 0.65rem; }

/* --- Article page ----------------------------------------- */
.article-page {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-hero {
  margin: -3rem -1.5rem 2.5rem;
  max-width: calc(var(--max-w-text) + 3rem);
}

.article-hero img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-bottom: 2px solid var(--gold);
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.article-meta-top time {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.article-summary {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  font-style: italic;
}

/* --- Article body typography ------------------------------ */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.article-body p { margin-bottom: 1.5rem; }

.article-body a { color: var(--gold); border-bottom: 1px solid var(--gold-dim); }
.article-body a:hover { color: var(--text); border-bottom-color: var(--text); }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body em { font-style: italic; color: var(--text-muted); }

.article-body blockquote {
  border-left: 3px solid var(--gold);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body li { margin-bottom: 0.5rem; }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Sources section */
.article-body h2:last-of-type + ul {
  list-style: none;
  padding: 0;
}
.article-body h2:last-of-type + ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Article footer --------------------------------------- */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-footer-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.share-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.share-links { display: flex; gap: 0.75rem; }

.share-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: all var(--transition);
}

.share-links a:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.back-link {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.back-link:hover { color: var(--gold); }

/* --- Stars page ------------------------------------------- */
.stars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.star-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 3px solid var(--star-color);
  transition: border-color var(--transition), transform var(--transition);
}

.star-card:hover { transform: translateY(-2px); }

.star-card-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--star-color);
  margin-bottom: 0.5rem;
}

.star-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.star-card-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* --- Articles list page ----------------------------------- */
.articles-list-header {
  padding: 3rem 1.5rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.articles-list-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.articles-list-sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.star-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* --- Reading progress bar --------------------------------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gold);
  z-index: 200;
  pointer-events: none;
  transition: width 0.05s linear;
  border-radius: 0 2px 2px 0;
}

/* --- Reading time ----------------------------------------- */
.reading-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-meta .card-date {
  margin-top: 0;
  padding-top: 0;
}

.card-meta-sep {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* --- See-all CTA (homepage bottom) ------------------------ */
.see-all-cta {
  text-align: center;
  padding: 1.5rem 1.5rem 3.5rem;
}

.see-all-btn {
  display: inline-block;
  padding: 0.65rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all var(--transition);
}

.see-all-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 5%, transparent);
}

/* --- Continue reading ------------------------------------- */
.continue-reading {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.continue-reading-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.continue-reading-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.continue-reading-list li {
  border-bottom: 1px solid var(--border);
}

.continue-reading-list li:last-child { border-bottom: none; }

.continue-reading-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  color: var(--text);
  transition: color var(--transition);
}

.continue-reading-list a:hover { color: var(--gold); }

.cr-title {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.cr-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.continue-reading-list a:hover .cr-date { color: var(--gold-dim); }

/* --- Pagination ------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.pagination .current {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 600;
}

/* --- About page ------------------------------------------- */
.about-page {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.about-page h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-page .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.about-page h2 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

.about-page p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

/* --- Newsletter section ----------------------------------- */
.newsletter-section {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem;
  text-align: center;
}

.newsletter-inner {
  max-width: 520px;
  margin: 0 auto;
}

.newsletter-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.newsletter-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.newsletter-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.newsletter-field {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 0 auto 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.newsletter-field:focus-within {
  border-color: var(--gold-dim);
}

.newsletter-field input[type="email"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
  font-family: var(--font-sans);
}

.newsletter-field input[type="email"]::placeholder {
  color: var(--text-dim);
}

.newsletter-field button {
  background: var(--gold);
  border: none;
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.newsletter-field button:hover {
  background: var(--gold-dim);
}

.newsletter-gdpr {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.newsletter-gdpr a {
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.newsletter-gdpr a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold-dim);
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.footer-links a:hover { color: var(--gold); }

/* --- View toggle (articles page) -------------------------- */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.view-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}

.view-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.view-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.theme-section { margin-bottom: 3rem; }

.star-section-link { text-decoration: none; }
.star-section-link:hover { opacity: 0.8; }

/* --- Stars page — rich cards ------------------------------ */
.stars-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.star-card--rich {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.star-card-angle {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0.25rem 0 0.5rem;
  flex: 1;
}

.star-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.theme-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--star-color) 10%, transparent);
  color: color-mix(in srgb, var(--star-color) 70%, var(--text-muted));
  border: 1px solid color-mix(in srgb, var(--star-color) 20%, transparent);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-dim);
  width: 100%;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  .articles-grid--featured { grid-template-columns: 1fr; }
  .articles-grid--featured .article-card:first-child { flex-direction: column; max-height: none; }
  .articles-grid--featured .article-card:first-child .card-image { min-width: unset; height: 200px; }
  .site-nav { gap: 1.25rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .article-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .site-nav a { font-size: 0.75rem; }
  .hero-title { font-size: 2rem; }
}

/* --- Utility ---------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}
