/*
 Theme Name: Roester Theme
 Theme URI: https://roesternest.de
 Author: Rösternest
 Author URI: https://roesternest.de
 Description: Custom clean theme for Rösternest Coffee Shop
 Version: 1.0.0
 Text Domain: roester-theme
 Requires at least: 6.0
 Requires PHP: 8.0
*/

/* ==========================================================================
   0. FONT FACES
   Brandon Grotesque = Live „Roesternest Regular/Bold“ (Woodmart custom fonts)
   Outfit = UI fallback / body weights where Brandon has no cut
   ========================================================================== */

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Regular.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Regular.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Regular.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Bold.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Bold.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Bold.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Bold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Bold.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Brandon Grotesque';
  src: url('./fonts/BrandonGrotesque-Bold.woff2') format('woff2'),
    url('./fonts/BrandonGrotesque-Bold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

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

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

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

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

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

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

/* ==========================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */

:root {
  /* --- Colors --- */
  --rn-black: #000000;
  --rn-white: #ffffff;
  --rn-off-white: #f8f7f5;
  --rn-cream: #f2efe9;
  --rn-charcoal: #2a2a2a;
  --rn-accent: #c9a876;
  /* Gold auf hellem Grund: dunkler, damit Text lesbar bleibt (≥ 4.5:1) */
  --rn-accent-dark: #8a6a3b;
  --rn-gray-100: #f5f5f5;
  --rn-gray-200: #e8e8e8;
  --rn-gray-300: #d1d1d1;
  --rn-gray-400: #999999;
  --rn-gray-500: #777777;
  --rn-gray-600: #555555;
  --rn-gray-700: #333333;
  --rn-success: #2e7d32;
  --rn-error: #c62828;

  /* --- White-alpha (dark section text/borders) --- */
  --rn-white-70: rgba(255, 255, 255, 0.7);
  --rn-white-55: rgba(255, 255, 255, 0.55);
  --rn-white-45: rgba(255, 255, 255, 0.45);
  --rn-white-40: rgba(255, 255, 255, 0.4);
  --rn-white-10: rgba(255, 255, 255, 0.1);
  --rn-white-08: rgba(255, 255, 255, 0.08);

  /* --- Typography --- */
  /* Brandon = Live custom fonts „Roesternest Regular/Bold“. Outfit = fallback. */
  --rn-font-primary: 'Brandon Grotesque', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rn-font-display: 'Brandon Grotesque', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- Font Sizes (fluid / clamp) --- */
  --rn-text-xs: 0.8125rem;
  /* 12px */
  --rn-text-sm: 0.875rem;
  /* 14px */
  --rn-text-base: 1.0625rem;
  /* 17px – Fließtext (Lesbarkeit, CI 2026-11) */
  --rn-text-md: 1.125rem;
  /* 18px */
  --rn-text-lg: 1.25rem;
  /* 20px */
  --rn-text-xl: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
  --rn-text-2xl: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  --rn-text-3xl: clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem);
  --rn-text-4xl: clamp(2rem, 3vw + 0.5rem, 3.25rem);
  --rn-text-5xl: clamp(2.5rem, 4vw + 0.5rem, 4rem);
  --rn-text-hero: clamp(1.7rem, 4.2vw + 1rem, 5.5rem);

  /* --- Spacing (8px grid) --- */
  --rn-space-1: 0.25rem;
  /* 4px */
  --rn-space-2: 0.5rem;
  /* 8px */
  --rn-space-3: 0.75rem;
  /* 12px */
  --rn-space-4: 1rem;
  /* 16px */
  --rn-space-5: 1.5rem;
  /* 24px */
  --rn-space-6: 2rem;
  /* 32px */
  --rn-space-8: 3rem;
  /* 48px */
  --rn-space-10: 4rem;
  /* 64px */
  --rn-space-12: 5rem;
  /* 80px */
  --rn-space-16: 6rem;
  /* 96px */
  --rn-space-20: 8rem;
  /* 128px */

  /* --- Layout --- */
  /* Canonical content width + gutter – all pages/heroes must use these. */
  --rn-max-width: 1440px;
  --rn-max-wide: 1440px;
  --rn-gutter: clamp(1rem, 3vw, 2rem);
  /* Aliases used by Unterseiten / Woo / Account (keep in sync via var()) */
  --rn-dc-max: var(--rn-max-width);
  --rn-dc-pad: var(--rn-gutter);
  --rn-acct-max: var(--rn-max-width);
  --rn-container-max: var(--rn-max-width);
  --rn-container-pad: var(--rn-gutter);
  /* Hero heights: home = full viewport; Unterseiten share one standard (slightly shorter) */
  --rn-hero-home-height: 100dvh;
  --rn-hero-home-min-height: 640px;
  --rn-hero-min-height: max(540px, 66vh);
  /* --- CI 2026-11: drei Radien. Buttons/Felder eckig, Karten/Bilder 16px, Pillen rund --- */
  --rn-radius-control: 0;
  --rn-radius-card: 16px;
  --rn-radius-pill: 999px;
  --rn-radius: var(--rn-radius-control);
  --rn-radius-lg: var(--rn-radius-card);

  /* Shadow bleed for scroll/slider viewports (padding + negative margin) */
  --rn-shadow-bleed-x: 1.5rem;
  --rn-shadow-bleed-top: 1.25rem;
  --rn-shadow-bleed-bottom: 2.75rem;

  /* --- Section Spacing --- */
  --rn-section-spacing: clamp(5rem, 8vw, 9rem);

  /* --- Transitions --- */
  --rn-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --rn-duration: 0.3s;
  --rn-duration-slow: 0.6s;

  /* --- Shadows --- */
  --rn-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --rn-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --rn-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  --rn-shadow-card: 0 10px 30px rgba(10, 10, 10, 0.06);
  --rn-shadow-card-hover: 0 18px 40px rgba(10, 10, 10, 0.1);

  /* --- CI 2026-11: Flächen, Linien, Nebentext --- */
  --rn-sand: #f6f4ef;
  --rn-line: #e7e5e0;
  --rn-text-mute: #5c5c5c;

  /* --- CI 2026-11: Überschriften, Labels, Buttons (eine Quelle für alle Seiten) --- */
  --rn-title-h1: clamp(46px, 6.4vw, 92px);
  --rn-title-h1-compact: clamp(40px, 5vw, 72px);
  --rn-title-h2: clamp(32px, 4vw, 52px);
  --rn-title-h3: clamp(20px, 1.6vw, 24px);
  --rn-text-lead: 1.1875rem;
  --rn-eyebrow-size: 13px;
  --rn-eyebrow-track: 0.2em;
  --rn-btn-height: 52px;
  --rn-btn-size: 14px;
  --rn-btn-track: 0.14em;

  /* --- Header --- */
  --rn-header-height: 100px;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
  /* Overscroll über Hero / unter Footer dunkel wie Header und Footer (body bleibt weiß) */
  background-color: #0a0a0a;
}

body {
  font-family: var(--rn-font-primary);
  font-size: var(--rn-text-base);
  line-height: 1.6;
  color: var(--rn-black);
  background-color: var(--rn-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  max-width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--rn-duration) var(--rn-ease),
    opacity var(--rn-duration) var(--rn-ease);
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--rn-font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  font-size: var(--rn-text-hero);
}

h2 {
  font-size: var(--rn-text-4xl);
}

h3 {
  font-size: var(--rn-text-2xl);
}

h4 {
  font-size: var(--rn-text-xl);
}

p {
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}


/* ==========================================================================
   3. LAYOUT UTILITIES
   ========================================================================== */

.rn-container {
  width: 100%;
  max-width: var(--rn-max-width);
  margin-inline: auto;
  padding-inline: var(--rn-gutter);
}

.rn-container--wide {
  max-width: var(--rn-max-wide);
}

/* Shared Unterseiten hero height (home uses --rn-hero-home-* separately) */
.rn-dc-hero,
.rn-page-hero,
.rn-about-hero:not(.rn-about-hero--slim) {
  min-height: var(--rn-hero-min-height);
}

@media (max-width: 768px) {
  :root {
    --rn-hero-min-height: max(480px, 62vh);
  }
}

.rn-section {
  padding-block: var(--rn-section-spacing);
}

.rn-section--dark,
.rn-section--black {
  background-color: var(--rn-black);
  color: var(--rn-white);
}

.rn-section--white {
  background-color: var(--rn-white);
  color: var(--rn-black);
}

.rn-section--cream {
  background-color: var(--rn-cream);
}

.rn-section--accent {
  background-color: var(--rn-accent);
  color: var(--rn-black);
}

/* CI: invert section-header text on dark backgrounds */
.rn-section--dark .section-label,
.rn-section--black .section-label {
  color: var(--rn-accent);
}

.rn-section--dark .section-title,
.rn-section--black .section-title {
  color: var(--rn-white);
}

.rn-section--dark .section-subtitle,
.rn-section--black .section-subtitle {
  color: rgba(255, 255, 255, 0.65);
}

.rn-grid {
  display: grid;
  gap: var(--rn-space-6);
}

.rn-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.rn-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.rn-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .rn-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {

  .rn-grid--4,
  .rn-grid--3,
  .rn-grid--2 {
    grid-template-columns: 1fr;
  }

  .rn-section {
    padding-block: clamp(3rem, 6vw, 5rem);
  }
}


/* ==========================================================================
   4. BUTTONS
   ========================================================================== */


/* ==========================================================================
   4b. BUTTON SYSTEM
   – Only 3 variants, clean and consistent:
     --primary:      black fill  / white text   (default CTA)
     --outline:      white border / white text   (on dark backgrounds)
     --outline-dark: black border / black text   (on light/white backgrounds)
   ========================================================================== */

.rn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rn-space-2);
  /* CI: gleiche Maße wie .rn-dc-btn (docs/CI.md) – ein Button-Bild auf allen Seiten */
  min-height: var(--rn-btn-height);
  font-family: var(--rn-font-display);
  font-size: var(--rn-btn-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--rn-btn-track);
  padding: 0 32px;
  border: 2px solid transparent;
  border-radius: var(--rn-radius-control);
  cursor: pointer;
  transition: background-color var(--rn-duration) var(--rn-ease),
    color var(--rn-duration) var(--rn-ease),
    border-color var(--rn-duration) var(--rn-ease);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

/* ① Black fill – white text (on any bg) */
.rn-btn--primary {
  background-color: var(--rn-black);
  color: var(--rn-white);
  border-color: var(--rn-black);
}

.rn-btn--primary:hover {
  background-color: transparent;
  color: var(--rn-black);
  border-color: var(--rn-black);
}

/* ② White outline – white text (on dark/black sections) */
.rn-btn--outline {
  background-color: transparent;
  color: var(--rn-white);
  border-color: var(--rn-white);
}

.rn-btn--outline:hover {
  background-color: var(--rn-white);
  color: var(--rn-black);
}

/* ③ Black outline – black text (on white/light sections) */
.rn-btn--outline-dark {
  background-color: transparent;
  color: var(--rn-black);
  border-color: var(--rn-black);
}

.rn-btn--outline-dark:hover {
  background-color: var(--rn-black);
  color: var(--rn-white);
}

/* ④ White fill – black text (primary variant on dark backgrounds) */
.rn-btn--primary-light {
  background-color: var(--rn-white);
  color: var(--rn-black);
  border-color: var(--rn-white);
}

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

/* Sizes */
.rn-btn--sm {
  min-height: 44px;
  font-size: 13px;
  padding: 0 20px;
}

.rn-btn--lg {
  padding: 0 40px;
}

/* Long German CTAs must not force horizontal page scroll on phones */
@media (max-width: 768px) {
  .rn-btn--lg {
    padding: 12px 24px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    height: auto;
  }
}

/* Legacy alias – maps to --primary (TODO: migrate usages to rn-btn--primary) */


/* ==========================================================================
   17. WORDPRESS DEFAULTS / PAGE CONTENT
   ========================================================================== */

.page-content {
  padding-top: calc(var(--rn-header-height) + var(--rn-space-8));
  padding-bottom: var(--rn-space-12);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.entry-content p {
  max-width: 75ch;
}

.entry-content ul,
.entry-content ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content img {
  border-radius: var(--rn-radius-lg);
}

.entry-content a {
  color: var(--rn-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content a:hover {
  color: var(--rn-black);
}


/* ==========================================================================
   18. SCREEN READER / A11Y
   ========================================================================== */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--rn-white);
  border-radius: var(--rn-radius);
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: var(--rn-black);
  display: block;
  font-size: var(--rn-text-sm);
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   SECTION UTILITIES (shared across page templates)
   ========================================================================== */
.rn-section-label {
  display: block;
  font-family: var(--rn-font-display);
  font-size: var(--rn-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rn-accent);
  margin-bottom: var(--rn-space-3);
}

.rn-section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--rn-black);
  margin: 0 0 var(--rn-space-4) 0;
}

.rn-section-text {
  font-size: var(--rn-text-base);
  line-height: 1.75;
  color: var(--rn-gray-600);
  margin: 0 0 var(--rn-space-4) 0;
}
