/*
Theme Name: Steine mit Geschichte
Theme URI: https://steinemitgeschichte.ch
Description: An archival theme for appreciating stones. Prioritizes respect, clarity, slowness, and durability.
Version: 1.5.0
Author: Steine mit Geschichte
Text Domain: steine-mit-geschichte
Requires at least: 6.0
Requires PHP: 8.0

License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   Design Tokens
   Source of truth for all design decisions.
   Based on: Steine mit Geschichte Web Design Specifications
   ========================================================================== */

:root {
  /* -------------------------------------------------------------------------
     Typography Scale (√2 ratio = 1.414)
     ------------------------------------------------------------------------- */
  --font-scale-ratio: 1.333;

  --font-size-xs: 0.875rem;    /* 14px - metadata, labels */
  --font-size-sm: 1rem;        /* 16px - captions, secondary */
  --font-size-base: 1.125rem;  /* 18px - body text (readable) */
  --font-size-md: 1.5rem;      /* 24px - subheadings */
  --font-size-lg: 2rem;        /* 32px - section headings */
  --font-size-xl: 2.5rem;      /* 40px - collection titles */

  /* Font Families - Cinzel headings, EB Garamond body */
  --font-heading: "Cinzel", Georgia, serif;
  --font-primary: "EB Garamond", Garamond, Georgia, serif;
  --font-secondary: "EB Garamond", Garamond, Georgia, serif;

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.8;

  /* Measure (line length) */
  --measure: 65ch;  /* ~60-75 characters */

  /* -------------------------------------------------------------------------
     Spacing Scale (modular, based on root)
     ------------------------------------------------------------------------- */
  --space-unit: 1rem;

  --space-3xs: calc(var(--space-unit) * 0.25);   /* 4px */
  --space-2xs: calc(var(--space-unit) * 0.5);    /* 8px */
  --space-xs: calc(var(--space-unit) * 0.75);    /* 12px */
  --space-sm: var(--space-unit);                  /* 16px */
  --space-md: calc(var(--space-unit) * 1.5);     /* 24px */
  --space-lg: calc(var(--space-unit) * 2);       /* 32px */
  --space-xl: calc(var(--space-unit) * 3);       /* 48px */
  --space-2xl: calc(var(--space-unit) * 4);      /* 64px */
  --space-3xl: calc(var(--space-unit) * 6);      /* 96px */

  /* -------------------------------------------------------------------------
     Colors: Paper, Ink, and Labels
     Archival palette - no pure black/white, no gradients, no high saturation
     ------------------------------------------------------------------------- */

  /* Backgrounds (Paper) */
  --color-bg-primary: #f8f7f4;      /* Archival off-white */
  --color-bg-secondary: #f3f2ef;    /* Subtle tonal variation */
  --color-bg-tertiary: #eceae6;     /* Deeper variation */

  /* Text (Ink) */
  --color-text-primary: #2c2c2c;    /* Near-black, never pure */
  --color-text-secondary: #5a5a5a;  /* Softer gray, legible */
  --color-text-muted: #7a7a7a;      /* Metadata labels, quieter */

  /* Accent - single muted accent only */
  --color-accent: #6b7c6b;          /* Muted sage - historically plausible */
  --color-accent-hover: #5a6b5a;    /* Slightly darker for interaction */

  /* Functional Colors (calm states) */
  --color-focus: #6b7c6b;           /* Same as accent */
  --color-focus-outline: rgba(107, 124, 107, 0.4);
  --color-error: #a65d5d;           /* Muted red */
  --color-success: #5d7a5d;         /* Muted green */

  /* Borders */
  --color-border: #d4d2cd;
  --color-border-light: #e5e3de;

  /* -------------------------------------------------------------------------
     Layout
     ------------------------------------------------------------------------- */
  --content-width: 72rem;           /* Max content width (legacy) */
  --content-width-narrow: 48rem;    /* For text-heavy pages (legacy) */

  /* Dual-container system */
  --max-text: 72ch;                 /* Paragraphs, long-form reading */
  --max-mid: 980px;                 /* Headers, calm sections */
  --max-wide: 1400px;               /* Object grids, images, tables */
  --pad-x: clamp(16px, 4vw, 56px);  /* Responsive horizontal padding */

  /* Golden ratio for major divisions */
  --ratio-golden: 1.618;
  --ratio-golden-minor: 0.618;

  /* -------------------------------------------------------------------------
     Transitions (functional only, respect reduced motion)
     ------------------------------------------------------------------------- */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
  }
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  font-weight: normal;
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-xl);
}

h2 {
  font-size: var(--font-size-lg);
}

h3 {
  font-size: var(--font-size-md);
}

p {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  max-width: var(--measure);
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast);
}

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

a:focus {
  outline: 2px solid var(--color-focus-outline);
  outline-offset: 2px;
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   Pages must remain coherent when printed
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  .no-print {
    display: none !important;
  }
}
