/* ibai-research — academic research aesthetic
 * Palette: navy #1a2942 / cream #f5f0e6 / burgundy #7a2e33 / paper #fafaf5
 * Type: Merriweather (headings/prose serif), Source Serif Pro / Georgia stack
 */

:root {
  --navy: #1a2942;
  --navy-light: #2d3e5c;
  --cream: #f5f0e6;
  --cream-deep: #e8dfc9;
  --burgundy: #7a2e33;
  --burgundy-dim: #5c2226;
  --paper: #fafaf5;
  --ink: #1f1f1f;
  --ink-soft: #4a4a4a;
  --rule: #d4c9b0;
  --measure: 66ch;
}

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

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

body {
  font-family: Georgia, "Source Serif Pro", "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--cream);
  padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Header --- */
.site-header {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 4px solid var(--burgundy);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--cream); text-decoration: none;
  font-size: 1.35rem;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: var(--cream); color: var(--navy);
  font-family: Georgia, serif; font-weight: 700; font-size: 1.1rem;
  letter-spacing: -0.02em;
  border: 1px solid var(--cream-deep);
}
.brand-text strong { font-weight: 700; }
.brand-text { letter-spacing: 0.01em; }

.primary-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem; flex-wrap: wrap;
}
.primary-nav a {
  color: var(--cream);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  border-bottom-color: var(--burgundy);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  margin-top: 1rem; margin-bottom: 0.5rem;
  font-size: 0.85rem; color: var(--ink-soft);
  font-style: italic;
}
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.breadcrumbs li:not(:last-child)::after {
  content: "›"; margin-left: 0.5rem; color: var(--rule);
}
.breadcrumbs a { color: var(--burgundy); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- Article header --- */
.article-header {
  padding-top: 2.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  color: var(--burgundy);
  font-family: Georgia, serif;
  font-style: normal;
  margin: 0 0 0.6rem;
  font-weight: 600;
}
h1 {
  font-family: Georgia, "Source Serif Pro", serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1rem;
  max-width: var(--measure);
}
.byline {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-style: italic;
}
.byline .author { color: var(--navy); font-weight: 600; font-style: normal; }

/* --- Hero figure --- */
.hero { margin: 1.5rem auto; }
.hero img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  display: block;
}
.hero figcaption,
.inline-figure figcaption {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: italic;
  padding: 0.6rem 0.2rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

/* --- Prose column --- */
.prose { max-width: var(--measure); }

.prose h2 {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--navy);
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--burgundy);
  letter-spacing: -0.01em;
}
.prose h3 {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}
.prose p { margin: 0 0 1rem; }

.prose a { color: var(--burgundy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--burgundy-dim); }

/* --- Table of contents --- */
.toc {
  background: var(--cream);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
}
.toc h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.6rem;
  padding: 0;
  border: none;
  color: var(--burgundy);
}
.toc ol {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding-left: 1.5rem;
}
.toc li { break-inside: avoid; margin-bottom: 0.25rem; }
.toc a { color: var(--navy); text-decoration: none; }
.toc a:hover { text-decoration: underline; color: var(--burgundy); }

/* --- Pull quote --- */
.pullquote {
  border-left: 4px solid var(--burgundy);
  background: var(--cream);
  padding: 1.5rem 1.5rem 1.2rem;
  margin: 2rem 0;
  max-width: var(--measure);
}
.pullquote blockquote {
  margin: 0 0 0.6rem;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.4;
}
.pullquote cite {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* --- Author card --- */
.author-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--cream);
  border-top: 3px solid var(--burgundy);
  margin: 2rem 0;
  align-items: start;
}
.author-card img {
  width: 120px; height: 120px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 0;
}
.author-card h3 {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
}
.author-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

/* --- FAQ (details/summary) --- */
details {
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0;
}
details:first-of-type { border-top: 1px solid var(--rule); }
summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute; right: 0.2rem; top: 0;
  color: var(--burgundy);
  font-size: 1.3rem;
  font-weight: 400;
  transition: transform 0.15s;
}
details[open] > summary::after { content: "−"; }
details p { margin-top: 0.7rem; font-size: 0.98rem; color: var(--ink-soft); }

/* --- Disclaimer --- */
.disclaimer {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--burgundy);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.disclaimer h3 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--burgundy);
}
.disclaimer p { margin: 0; }

/* --- Related block --- */
.related-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.related-block h3 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.related-block ul { margin: 0; padding-left: 1.5rem; }
.related-block li { margin-bottom: 0.35rem; }

/* --- Inline figure --- */
.inline-figure {
  margin: 2rem 0;
}
.inline-figure img {
  width: 100%; height: auto;
  border: 1px solid var(--rule);
  display: block;
}

/* --- Contact form --- */
.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
  margin: 1.5rem 0;
}
.contact-form label {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--rule);
  background: white;
  font-family: Georgia, serif;
  font-size: 1rem;
  color: var(--ink);
  margin-top: 0.3rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--burgundy);
}
.contact-form button {
  background: var(--navy);
  color: var(--cream);
  border: none;
  padding: 0.7rem 1.5rem;
  font-family: Georgia, serif;
  font-size: 1rem;
  cursor: pointer;
  justify-self: start;
  transition: background 0.15s;
}
.contact-form button:hover { background: var(--burgundy); }

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: var(--cream);
  margin-top: 4rem;
  padding: 2.5rem 0 1.5rem;
  border-top: 4px solid var(--burgundy);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-brand { font-size: 1.2rem; margin: 0 0 0.5rem; }
.site-footer nav ul { list-style: none; padding: 0; margin: 0; }
.site-footer nav a { color: var(--cream); text-decoration: none; opacity: 0.9; }
.site-footer nav a:hover { text-decoration: underline; opacity: 1; }
.copyright {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 240, 230, 0.2);
  font-size: 0.85rem;
  opacity: 0.75;
}

/* --- :target highlight for TOC anchors --- */
section:target {
  scroll-margin-top: 2rem;
  animation: target-flash 1.5s ease-out;
}
@keyframes target-flash {
  0% { background: var(--cream); }
  100% { background: transparent; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .primary-nav ul { gap: 0.1rem; }
  .primary-nav a { padding: 0.3rem 0.5rem; font-size: 0.88rem; }
  .toc ol { columns: 1; }
  .author-card { grid-template-columns: 1fr; }
  .author-card img { width: 100px; height: 100px; }
  .footer-inner { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
  .prose h2 { font-size: 1.35rem; }
}

/* --- Print styles --- */
@media print {
  .site-header, .site-footer, .primary-nav, .breadcrumbs,
  .related-block, .contact-form { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  .container { max-width: 100%; padding: 0; }
  a { color: black; text-decoration: none; }
  h1, h2, h3 { color: black; page-break-after: avoid; }
  .hero img, .inline-figure img { max-width: 100%; page-break-inside: avoid; }
  .disclaimer { border: 1px solid black; background: transparent; }
  details { border-color: black; }
  details p { display: block !important; }
}
