/* === Custom Properties === */
:root {
  --bg: #faf9f6;
  --text: #1a1a1a;
  --accent: #2a6b6b;
  --muted: #666;
  --border: #ddd;
  --max-width: 720px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
}

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

html {
  font-size: 18px;
}

/* Disable smooth scroll for users who prefer reduced motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--accent);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  z-index: 100;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus-visible {
  top: 0;
}

/* === Typography === */
h1, h2, h3, h4 {
  font-family: Georgia, serif;
  line-height: 1.3;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-weight: 700; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--accent);
  text-decoration: underline;
}

a:hover { text-decoration: none; }

/* Visible focus ring for all interactive elements */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li { margin-bottom: var(--space-xs); }

/* === Layout === */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  width: 100%;
}

/* === Navigation === */
/* header spans full width; border-bottom goes on header so it spans the viewport */
header {
  border-bottom: 1px solid var(--border);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

header nav a {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Site title styled differently from nav links */
header nav .site-title {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin-right: auto; /* pushes other links to the right */
}

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

/* === Footer === */
/* border-top on footer so it spans full viewport width */
footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

footer nav {
  display: flex;
  gap: var(--space-md);
}

footer p {
  margin: 0; /* override base p margin-bottom */
}

footer a {
  color: var(--muted);
  text-decoration: underline;
}

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

/* === Cards (print-card, artist-card) === */
.print-card,
.artist-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.print-card a,
.artist-card a {
  text-decoration: none;
  color: var(--text);
}

.print-card img,
.artist-card img {
  width: 100%;
}

.card-body {
  padding: var(--space-md);
}

.print-card h2,
.artist-card h2 {
  font-size: 1rem;
  margin: 0 0 var(--space-xs);
}

.print-card p,
.artist-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* === Collection Index === */
.collection-index h1 {
  margin-top: 0;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-md);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

/* === Print Detail === */
.print-detail figure,
.artist-profile figure,
.guide figure {
  margin-bottom: var(--space-lg);
}

.print-detail h1,
.artist-profile h1,
.guide h1 {
  margin-top: 0;
}

/* Definition list for print metadata */
.print-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
}

.print-meta dt {
  font-weight: 600;
  color: var(--muted);
}

/* Compact metadata line on artist pages */
.artist-meta {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

/* === Image Credit === */
.image-credit {
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* === Affiliate Links === */
.affiliate-links {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  margin-top: var(--space-xl);
}

.affiliate-links h2 {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.affiliate-links ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* === FAQ === */
.faq {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}

.faq h2 {
  margin-top: 0;
  margin-bottom: var(--space-lg);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: '+ ';
  color: var(--accent);
}

.faq details[open] summary::before { content: '− '; }

.faq details p {
  margin-top: var(--space-md);
  margin-bottom: 0;
}

/* === Static Pages (glossary, about) === */
.page h1 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.page h3 {
  margin-top: var(--space-lg);
}
