/* ============================================
   19eme.fr — Cabinet de Lecture
   Editorial design inspired by 19th century
   French book typography & engraving
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
  --ink: #1a1a2e;
  --ink-light: #2d2d44;
  --gold: #b8860b;
  --gold-light: #d4a843;
  --gold-pale: #f0e6c8;
  --parchment: #faf6ee;
  --parchment-dark: #f0e8d8;
  --cream: #fffdf7;
  --red-ancien: #8b2500;
  --text: #2c2c2c;
  --text-light: #5a5a5a;
  --border: #d4c9a8;
  --border-light: #e8e0cc;
}

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

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

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  color: var(--text);
  background-color: var(--parchment);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle paper texture via gradient noise */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 119, 80, 0.008) 2px,
      rgba(139, 119, 80, 0.008) 4px
    ),
    radial-gradient(ellipse at 20% 50%, rgba(184, 134, 11, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(184, 134, 11, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.8rem; font-weight: 300; letter-spacing: 0.02em; }
h2 { font-size: 1.9rem; font-weight: 500; }
h3 { font-size: 1.4rem; font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p { margin-bottom: 1.2rem; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
a:hover {
  color: var(--red-ancien);
  border-bottom-color: var(--red-ancien);
}

::selection {
  background: var(--gold-pale);
  color: var(--ink);
}

/* ---- Ornaments ---- */

.ornament {
  text-align: center;
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 0.5em;
  margin: 2rem 0;
  opacity: 0.7;
  user-select: none;
}

.ornament-line {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.ornament-line::before,
.ornament-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.ornament-line span {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.6;
}

.flourish {
  display: block;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.4;
  margin: 3rem 0;
  letter-spacing: 0.3em;
}

/* ---- Header ---- */

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--cream) 0%, var(--parchment) 100%);
}

.header-top {
  text-align: center;
  padding: 2rem 2rem 0;
}

.site-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
}
.site-title a {
  color: inherit;
  border: none;
}
.site-title a:hover {
  color: var(--gold);
}

.site-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.3rem;
  font-weight: 400;
}

.header-rule {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 1.2rem auto;
  border: none;
}

/* Navigation */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  padding: 0 2rem 1.2rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0.4rem 1rem;
  border: none;
  position: relative;
  transition: color 0.3s ease;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.site-nav a:hover {
  color: var(--ink);
  border: none;
}
.site-nav a:hover::after {
  width: 70%;
}
.site-nav a.active {
  color: var(--ink);
}
.site-nav a.active::after {
  width: 70%;
}

.nav-separator {
  color: var(--border);
  align-self: center;
  font-size: 0.5rem;
  user-select: none;
}

/* ---- Main content ---- */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* ---- Page hero (home) ---- */

.page-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.page-hero h1 {
  font-size: 3.2rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.page-hero .dates {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  font-weight: 400;
}

.page-hero .intro {
  max-width: 600px;
  margin: 2rem auto 0;
  font-size: 1.05rem;
  color: var(--text-light);
  font-style: italic;
}

/* ---- Article content ---- */

.article-header {
  text-align: center;
  padding: 2rem 0 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.article-header .category {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.8rem;
  display: block;
}

.article-header h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.article-header .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--text-light);
  font-style: italic;
  font-weight: 300;
}

.article-header .meta {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
}

.article-content h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.article-content h3 {
  margin: 2rem 0 0.8rem;
}

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--gold);
  background: rgba(184, 134, 11, 0.04);
  font-style: italic;
  color: var(--ink-light);
}

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

/* Legal document styling */
.legal-text {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 2.5rem 2.5rem;
  margin: 2rem 0;
  position: relative;
}

.legal-text::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid var(--border-light);
  pointer-events: none;
}

.legal-text h3 {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  font-weight: 500;
}

.legal-text .article-law {
  margin-bottom: 1.2rem;
  text-indent: 0;
  padding-left: 0;
}

.legal-text .article-law strong {
  color: var(--ink);
  font-weight: 600;
}

.legal-text .signature {
  text-align: right;
  margin-top: 2rem;
  font-style: italic;
  color: var(--text-light);
}

/* Highlight box for quick answers (chiffre romain) */
.answer-box {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-light) 100%);
  color: var(--parchment);
  padding: 2.5rem 3rem;
  text-align: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.answer-box::before {
  content: '';
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid rgba(184, 134, 11, 0.3);
  pointer-events: none;
}

.answer-box .label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 0.8rem;
}

.answer-box .big-answer {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.answer-box .explanation {
  font-size: 1rem;
  opacity: 0.8;
  max-width: 500px;
  margin: 0 auto;
}

/* ---- Cards (home page) ---- */

.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title h2 {
  display: inline;
  border: none;
  padding: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  border: 1px solid var(--border);
  padding: 1.8rem 2rem;
  background: var(--cream);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 20px rgba(184, 134, 11, 0.08);
}

.card .card-category {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card h3 a {
  color: var(--ink);
  border: none;
}
.card h3 a:hover {
  color: var(--gold);
}

.card p {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 0;
  line-height: 1.65;
}

/* ---- Painters grid ---- */

.painter-entry {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
}
.painter-entry:last-child {
  border-bottom: none;
}

.painter-entry h3 {
  margin-bottom: 0.2rem;
}

.painter-entry .painter-dates {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
  font-style: italic;
}

.painter-entry .painter-movement {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

/* Roman numeral table */
.roman-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: 'Cormorant Garamond', serif;
}

.roman-table th {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 500;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--ink);
  text-align: left;
}

.roman-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 1.05rem;
}

.roman-table tr:hover td {
  background: rgba(184, 134, 11, 0.04);
}

.roman-table .highlight-row td {
  background: rgba(184, 134, 11, 0.08);
  font-weight: 600;
}

/* ---- Footer ---- */

.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  background: linear-gradient(0deg, var(--cream) 0%, var(--parchment) 100%);
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-content p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  border: none;
}
.footer-nav a:hover {
  color: var(--gold);
}

/* ---- Animations ---- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.8s ease-out both;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

/* ---- Responsive ---- */

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

  h1 { font-size: 2.2rem; }
  .page-hero h1 { font-size: 2.4rem; }
  .article-header h1 { font-size: 2rem; }
  .answer-box .big-answer { font-size: 3rem; }

  main { padding: 2rem 1.2rem 3rem; }

  .legal-text { padding: 1.5rem; }
  .legal-text::before { top: 5px; left: 5px; right: 5px; bottom: 5px; }

  .answer-box { padding: 2rem 1.5rem; }

  .site-nav { gap: 0; }
  .site-nav a { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
  .nav-separator { display: none; }
}

@media (max-width: 480px) {
  .page-hero h1 { font-size: 1.9rem; }
  .site-title { font-size: 1.6rem; letter-spacing: 0.1em; }
  .answer-box .big-answer { font-size: 2.4rem; }
}

/* ---- Print ---- */
@media print {
  body::before { display: none; }
  .site-header, .site-footer { display: none; }
  main { max-width: 100%; padding: 0; }
}
