/* ═══════════════════════════════════════════════════════════════════════════
   app.css – Fotokreis Südliche Weinstraße
   Design-Tokens, CSS-Reset, @font-face, Basis-Typografie
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Design-Tokens (1:1 aus dem Briefing) ─────────────────────────────── */
:root {
  /* Farben */
  --paper:          #EAE6DA;
  --paper-deep:     #DCD5C2;
  --ink:            #1C1B18;
  --ink-soft:       #4A463F;
  --film:           #232C1D;
  --film-soft:      #333F29;
  --amber:          #C08A2E;
  --amber-deep:     #8F6519;
  --line:           #C9C2AC;
  --line-dark:      #454F3C;

  /* Schriften */
  --font-display:   'Fraunces', serif;
  --font-mono:      'JetBrains Mono', monospace;
  --font-body:      'Work Sans', sans-serif;

  /* Layout */
  --header-height:  64px;
  --content-max:    1280px;
  --content-pad:    clamp(1rem, 4vw, 2.5rem);

  /* Abstände (8-px-Raster) */
  --space-xs:  0.25rem;   /*  4px */
  --space-s:   0.5rem;    /*  8px */
  --space-m:   1rem;      /* 16px */
  --space-l:   1.5rem;    /* 24px */
  --space-xl:  2rem;      /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */

  /* Typografie-Skala */
  --text-xs:   0.75rem;   /* 12px */
  --text-s:    0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-l:    1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */

  /* Übergänge */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Fokus-Ring (Barrierefreiheit) */
  --focus-ring: 2px solid var(--amber);
  --focus-offset: 3px;

  /* Radius */
  --radius-s: 2px;
  --radius-m: 4px;
  --radius-l: 8px;
}

/* ── 2. @font-face (lokale woff2, kein CDN) ──────────────────────────────── */
/* Fraunces – Display-Schrift (OFL-Lizenz, lokal gehostet) */
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* JetBrains Mono – Mono-Schrift (OFL-Lizenz, lokal gehostet) */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Work Sans – Body-Schrift (OFL-Lizenz, lokal gehostet) */
@font-face {
  font-family: 'Work Sans';
  src: url('/fonts/work-sans/WorkSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/fonts/work-sans/WorkSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/fonts/work-sans/WorkSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── 3. CSS-Reset ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent font-size inflation on mobile */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Respect users who prefer reduced motion */
@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;
    scroll-behavior: auto !important;
  }
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* ── 4. Basis-Typografie und Farben ──────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: var(--text-4xl); font-weight: 600; }
h2 { font-size: var(--text-3xl); font-weight: 600; }
h3 { font-size: var(--text-2xl); font-weight: 600; }
h4 { font-size: var(--text-xl);  font-weight: 600; }
h5 { font-size: var(--text-l);   font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

/* Mono-Elemente */
code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Links */
a {
  color: var(--amber-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--amber);
}

/* Fokus sichtbar für Tastaturnavigation (WCAG 2.2 AA) */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-s);
}

/* Trennlinien */
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-2xl) 0;
}

/* Listen */
ul, ol {
  padding-left: var(--space-l);
}

/* ── 5. Buttons (Basis) ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.625rem var(--space-l);
  font-family: var(--font-body);
  font-size: var(--text-s);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}
.btn-primary:hover {
  background-color: var(--amber-deep);
  border-color: var(--amber-deep);
  color: var(--paper);
}

.btn-secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover {
  background-color: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  background-color: transparent;
  color: var(--amber-deep);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover {
  color: var(--amber);
}

/* ── 6. Hilfs-Container ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--content-pad);
}

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

/* ── 8. Skip-Link (Barrierefreiheit) ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-m);
  z-index: 9999;
  padding: var(--space-s) var(--space-m);
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 0;
}
