/* Pediatrician by Tio Manolo - Vintage Medical Book Styles */

:root {
  --primary: #3d2914;
  --primary-light: #5c4a32;
  --accent: #8b4513;
  --accent-light: #a0522d;
  --bg: #f4efe4;
  --bg-paper: #faf6ed;
  --bg-aged: #e8e0d0;
  --text: #2c2416;
  --text-muted: #6b5d4d;
  --border: #d4c9b5;
  --gold: #b8860b;
  --cream: #f5f0e1;
  --sepia: #704214;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Libre Baskerville', 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 17px;
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Typography - Old Book Style */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', 'Palatino', serif;
  font-weight: 500;
  line-height: 1.3;
  color: var(--primary);
  letter-spacing: 0.02em;
}

h1 { 
  font-size: 2rem;
  text-transform: none;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

h2 { 
  font-size: 1.5rem; 
  margin-bottom: 1rem;
  font-variant: small-caps;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px dotted var(--accent);
}

a:hover {
  color: var(--gold);
  border-bottom-style: solid;
}

/* Header - NOT sticky, classic book header */
.header {
  background: linear-gradient(to bottom, var(--bg-paper), var(--bg));
  color: var(--primary);
  padding: 2rem 0;
  border-bottom: 3px double var(--border);
  position: relative;
}

.header::before,
.header::after {
  content: '❧';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.5;
}

.header::before { left: 2rem; }
.header::after { right: 2rem; transform: translateY(-50%) scaleX(-1); }

.header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.header-title h1 {
  color: var(--primary);
  font-size: 1.6rem;
  margin: 0;
  border: none;
  padding: 0;
}

.header-title .icon {
  font-size: 2rem;
  opacity: 0.7;
}

.header-meta {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.header-meta .edition {
  font-weight: 600;
  color: var(--accent);
}

/* Decorative divider */
.divider {
  text-align: center;
  padding: 1rem 0;
  color: var(--accent);
  font-size: 1.2rem;
  opacity: 0.6;
}

.divider::before {
  content: '— ✦ —';
}

/* Navigation - simple, not sticky */
.nav {
  background: var(--bg-aged);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.nav-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  border: none;
  text-transform: lowercase;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.nav a:hover {
  color: var(--accent);
}

/* Main Layout - Book page style */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.content {
  background: var(--bg-paper);
  padding: 2.5rem 3rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: 
    inset 0 0 80px rgba(139, 69, 19, 0.03),
    0 2px 10px rgba(0,0,0,0.05);
  position: relative;
}

/* Simulated page edge */
.content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* Section Cards - Book chapter style */
.section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-icon {
  font-size: 1.3rem;
  opacity: 0.7;
}

/* Article Items */
.article-item {
  padding: 1.25rem 0;
  border-bottom: 1px dotted var(--border);
}

.article-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-item:first-child {
  padding-top: 0;
}

.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.article-summary {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-align: justify;
}

.article-meta {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-style: italic;
}

.article-meta a {
  font-style: normal;
  border: none;
}

.article-meta .source {
  background: var(--bg-aged);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  font-style: normal;
}

/* Clinical Takeaway - Prescription style */
.clinical-takeaway {
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-style: italic;
}

.clinical-takeaway strong {
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Belief Items */
.belief-item {
  background: var(--bg-aged);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.belief-claim {
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.belief-claim::before {
  content: "❝ ";
  opacity: 0.5;
}

.belief-reality {
  font-size: 0.95rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-aged);
  border: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.stat-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Sidebar - moved to bottom for book feel */
.sidebar {
  margin-top: 2rem;
  border-top: 3px double var(--border);
  padding-top: 2rem;
}

.sidebar-card {
  background: var(--bg-aged);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-variant: small-caps;
}

.archive-list {
  list-style: none;
}

.archive-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
  font-size: 0.9rem;
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
}

.archive-list .edition-num {
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  background: var(--cream);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Footer */
.footer {
  background: var(--bg-aged);
  color: var(--text-muted);
  padding: 2rem;
  margin-top: 2rem;
  text-align: center;
  border-top: 3px double var(--border);
}

.footer p {
  font-size: 0.85rem;
  max-width: 600px;
  margin: 0 auto;
}

.footer .disclaimer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  font-size: 0.8rem;
}

/* Language Toggle - vintage button */
.lang-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lang-toggle-btn {
  background: var(--bg-aged);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-family: 'Playfair Display', serif;
  cursor: pointer;
  transition: all 0.2s;
  font-variant: small-caps;
}

.lang-toggle-btn:hover {
  background: var(--cream);
  border-color: var(--accent);
  color: var(--accent);
}

.lang-label {
  font-size: 0.75rem;
  font-style: italic;
}

/* Subscribe Form - vintage style */
.subscribe-form {
  margin-top: 1rem;
}

.subscribe-form input[type="email"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-paper);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 0.5rem;
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.subscribe-form button {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--bg-aged);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-family: 'Playfair Display', serif;
  cursor: pointer;
  transition: all 0.2s;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.subscribe-form button:hover {
  background: var(--cream);
  border-color: var(--accent);
}

.subscribe-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  padding: 0.5rem;
  text-align: center;
  font-style: italic;
}

.subscribe-status.success {
  color: var(--success);
}

.subscribe-status.error {
  color: #8b0000;
}

/* Responsive */
@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  .header::before,
  .header::after {
    display: none;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .nav-content {
    gap: 1rem;
  }
}

/* Drop cap for first paragraph */
.section > .article-item:first-of-type .article-summary::first-letter,
.section > p:first-of-type::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 0.8;
  padding-right: 0.5rem;
  font-family: 'Playfair Display', serif;
  color: var(--accent);
}

/* Utility */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}
