/*
  RALLE Static Site
  Minimalist, typography-focused design
  Fonts: Union Gothic (display) + Klima (body) from wehtt.am/fonts
*/

/* Font faces */
@font-face {
  font-family: 'Union Gothic';
  src: url('../fonts/union-gothic/union_gothic-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klima';
  src: url('../fonts/klima-web/klima-regular-web.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klima';
  src: url('../fonts/klima-web/klima-medium-web.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klima';
  src: url('../fonts/klima-web/klima-bold-web.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clack';
  src: url('../fonts/clack/Clack-Regular_otf.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clack';
  src: url('../fonts/clack/Clack-Medium_otf.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clack';
  src: url('../fonts/clack/Clack-Bold_otf.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --accent: #c41e3a;
  --link: #1a1a1a;
  --link-hover: var(--accent);
  --border: #e0e0e0;
  --max-width: 720px;
  --font-display: 'Union Gothic', system-ui, sans-serif;
  --font-body: 'Klima', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Source Code Pro', monospace;
  --font-nav: 'Clack', ui-monospace, 'SF Mono', monospace;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.125rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
}

/* External links - distinct style for off-site references */
a.external {
  text-decoration: none;
  border-bottom: 2px solid gold;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

/* Offset anchors for sticky header */
[id] {
  scroll-margin-top: 6rem;
}

strong {
  font-weight: 700;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 4rem 0;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.logo:hover {
  color: var(--text);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

nav a:hover,
nav a.active {
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.hero-badge {
  position: absolute;
  top: 1rem;
  right: max(1.5rem, calc(50% - 360px + 1.5rem));
  width: clamp(80px, 12vw, 140px);
  height: auto;
  transform: rotate(-10deg);
  filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.15));
  z-index: 10;
  pointer-events: none;
}

@media (min-width: 900px) {
  .hero-badge {
    top: -1.5rem;
  }
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  max-width: 600px;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.hero .subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 2rem;
  text-transform: none;
}

/* CTAs */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Sections */
section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

/* Image gallery */
.gallery-container {
  margin: 2rem 0 0;
}

.gallery-page {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.5rem;
}

.gallery-page.active {
  display: grid;
}

.gallery-page img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.2s ease;
}

.gallery-page img:hover {
  filter: grayscale(0%);
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-body);
  font-size: 1.25rem;
  background: transparent;
  border: 2px solid var(--text);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.gallery-nav__btn:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.gallery-nav__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-nav__dots {
  display: flex;
  gap: 0.5rem;
}

.gallery-nav__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.gallery-nav__dot:hover {
  background: var(--text-secondary);
}

.gallery-nav__dot.active {
  background: var(--text);
}

/* Issues list */
.issues-list {
  list-style: none;
  margin: 2rem 0;
}

.issues-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.issues-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.issues-list a::after {
  content: '\2192';
  font-family: var(--font-body);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.issues-list a:hover::after {
  opacity: 1;
}

/* Issue detail */
.issue {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.issue:last-of-type {
  border-bottom: none;
}

.issue h3 {
  margin-top: 0;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.faq-item:last-of-type {
  border-bottom: none;
}

.faq-item h3 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 700;
}

.faq-item h3 a {
  color: inherit;
  text-decoration: none;
}

.faq-item h3 a:hover {
  color: var(--link-hover);
}

.faq-answer {
  padding-top: 1rem;
  color: var(--text-secondary);
}

/* Stats callout */
.stat-callout {
  background: var(--bg-alt);
  padding: 2rem;
  margin: 2rem 0 0;
}

.stat-callout .number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-callout .label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.footer-links a:hover {
  color: var(--text);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.colophon {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.colophon a {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .hero-badge {
    top: 0.5rem;
    right: 1.5rem;
    width: 60px;
    transform: rotate(-10deg);
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .gallery-page {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }

  nav {
    gap: 1rem;
  }

  footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-secondary {
  color: var(--text-secondary);
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Page Navigation Rail */
.page-nav {
  position: fixed;
  left: 1.5rem;
  top: 5rem;
  bottom: 2rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: none;
}

.page-nav::-webkit-scrollbar {
  display: none;
}

.page-nav__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-secondary);
}

.page-nav__item:hover {
  color: var(--text);
}

.page-nav__item.active {
  color: var(--accent);
}

.page-nav__item.active .page-nav__label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-nav__dot {
  display: none;
}

.page-nav__label {
  font-family: var(--font-nav);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Hide on smaller screens */
@media (max-width: 1100px) {
  .page-nav {
    display: none;
  }
}
