/* Vintage Audio Magazines Archive - 1950s/1960s Inspired Design */

/* Base Setup with Warm Vintage Palette */
:root {
  --bg-paper: #f4ede4;
  --bg-aged: #e8dfd3;
  --text-body: #2d2418;
  --text-muted: #5c4d3a;
  --accent-amber: #8b6914;
  --accent-rust: #9e4b2f;
  --border-warm: #c9b896;
  --shadow-subtle: rgba(45, 36, 24, 0.08);
  --font-headline: "Playfair Display", "Georgia", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* Paper Texture and Base Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-paper);
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
}

/* Top Navigation */
nav:first-of-type {
  background: linear-gradient(180deg, var(--bg-aged) 0%, transparent 100%);
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-warm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

nav:first-of-type a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.4rem auto;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

nav:first-of-type a:hover {
  color: var(--accent-rust);
  border-color: var(--border-warm);
}

nav:first-of-type a:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Main Content Area */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-warm);
  position: relative;
}

header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-amber);
}

h1 {
  font-family: var(--font-headline);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1.5rem;
  color: var(--text-body);
  letter-spacing: -0.02em;
}

h1 br {
  display: block;
  content: "";
  margin-top: 0.25em;
}

header p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

header p em {
  font-style: italic;
  color: var(--text-body);
  font-weight: 500;
}

/* Magazine Article Sections */
article {
  margin-bottom: 4rem;
  padding: 2rem;
  background: linear-gradient(135deg, 
    rgba(255, 252, 245, 0.7) 0%, 
    rgba(244, 237, 228, 0.5) 100%
  );
  border: 1px solid var(--border-warm);
  border-radius: 4px;
  box-shadow: 
    0 2px 8px var(--shadow-subtle),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

article:nth-child(2) { animation-delay: 0.1s; }
article:nth-child(3) { animation-delay: 0.2s; }
article:nth-child(4) { animation-delay: 0.3s; }

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

/* Decorative corner elements */
article::before,
article::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-amber);
  border-style: solid;
  opacity: 0.4;
}

article::before {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

article::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
}

h2 {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-body);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-amber);
  display: inline-block;
}

article > p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

article > p em {
  font-style: italic;
  color: var(--text-body);
}

/* Issue List Navigation */
article nav {
  margin-top: 1rem;
}

article nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
}

article nav ol li {
  counter-increment: issue-counter;
  position: relative;
}

article nav ol li::before {
  content: counter(issue-counter);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-amber);
  font-weight: 600;
  width: 28px;
  text-align: right;
  opacity: 0.7;
}

article nav ol li a {
  display: block;
  padding: 0.6rem 0.75rem 0.6rem 36px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 3px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

article nav ol li a::after {
  content: "PDF";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--accent-rust);
  background: rgba(158, 75, 47, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
  opacity: 0.0;
  transition: opacity 0.2s ease;
}

article nav ol li a:hover {
  background: rgba(139, 105, 20, 0.06);
  border-color: var(--border-warm);
  color: var(--accent-rust);
}

article nav ol li a:hover::after {
  opacity: 1;
}

article nav ol li a:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
  background: rgba(139, 105, 20, 0.08);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-warm);
  background: var(--bg-aged);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

footer a {
  color: var(--accent-rust);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

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

footer a:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Scroll Reveal Animation */
article {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

article.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  nav:first-of-type {
    padding: 1rem;
  }
  
  main {
    padding: 2rem 1rem 3rem;
  }
  
  article {
    padding: 1.5rem;
  }
  
  article nav ol {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  article nav ol li a {
    font-size: 0.8rem;
    padding: 0.5rem 0.5rem 0.5rem 32px;
  }
  
  article nav ol li::before {
    font-size: 0.6rem;
    width: 24px;
  }
  
  article nav ol li a::after {
    display: none;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    font-size: 12pt;
  }
  
  article {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    background: white;
  }
  
  article::before,
  article::after {
    display: none;
  }
  
  article nav ol li a::after {
    opacity: 1;
  }
}

/* Selection Highlight */
::selection {
  background: rgba(139, 105, 20, 0.2);
  color: var(--text-body);
}

/* Focus Styles for Accessibility */
:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Scrollbar Styling */
@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--bg-aged);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--border-warm);
    border-radius: 5px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
  }
}