/* =============================================
   NICHTVERLEIH – BASIS-CSS (responsive + Look&Feel beibehalten)
   Elemente: Logo, H1, Body-Text, Button, Textlink, Form, Label, Input, Popup
   Hinweis: Vereint altes CSS + Responsive-Regeln. Form & Popup sind global.
   ============================================= */

/* 0) Fonts (lokal bereitstellen) */
@font-face {
  font-family: 'OswaldMedium';
  src: url('/fonts/oswald-v56-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

@font-face {
  font-family: 'SpaceMono';
  src: url('/fonts/space-mono-v17-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 1) Root-Scaler – skaliert ALLE rem-Werte (Mobile → Desktop) */
html {
  font-size: clamp(16px, 0.9vw + 12px, 24px); /* skaliert Typografie dynamisch */
  -webkit-text-size-adjust: 100%;             /* verhindert Safari-Zoom-Bugs */
  height: 100%;                               /* nötig für full-height Background in *2 */
}

body {
  height: 100%;                               /* füllt den html-Container komplett */
  margin: 0;                                  /* entfernt Standardabstände */
}

/* 2) Grundlayout + Hintergrund (vollflächig, ohne Kacheln) */
html, body { height: 100%; }

body {
  font-family: 'SpaceMono', monospace;
  color: #111;
  line-height: 1.65;
  margin: 0;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  background-color: #E3E3E3;   /* Fallback-Farbe */
  position: relative;          /* Basis für ::before */
}

/* Fixierter Hintergrund-Layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/img/background.jpg');
  background-repeat: no-repeat;     /* keine Kacheln */
  background-position: center top;  /* Start oben, zentriert */
  background-size: cover;           /* füllt den Viewport */
  pointer-events: none;             /* klicks gehen durch */
  will-change: transform;           /* glatte Scroll-Performance */
}

/* 3) Bühne / Lesespalte */
.wrapper, main, .content, body > div{
  max-width: min(72ch, 92vw);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 48px);
  text-align: center; /* H1 mittig */
}

/* 4) Logo (optional Bild) – schräg möglich via .logo-tilt */
.logo, img[alt="NICHTVERLEIH.DE"]{
  width: clamp(260px, 40vw, 520px);
  height: auto;
  display: block;
  margin: clamp(12px, 4vw, 32px) auto;
}
.logo-tilt{ transform: rotate(-3deg); display:block; }

/* 5) Headline (H1) – textbreit, in zentrierter Spalte linksbündig
   Fix: Breite in ch anhand der Body-Schrift berechnen, damit H1 und Text bündig bleiben */
.headline-wrap{
  font-family: 'SpaceMono', monospace;   /* ch-Basis = Body-Font */
  max-width: min(65ch, 92vw);            /* gleiche Zahl wie bei p, li */
  margin: 0 auto;
  text-align: left;
  padding: 0;
}

h1{
  font-family: 'OswaldBold', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 2.2vw + 1.1rem, 3rem);
  display: inline-block;                 /* nur so breit wie der Text */
  background: #000;
  color: #fff;
  padding: 0em 0.5em;                    /* Innenabstand des schwarzen Kastens */
  transform: rotate(-3deg);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.2);
  margin: 0 0 2rem;
}

/* 6) Subline – leicht kleiner, ital, mit Karte-Optik */
.subline{
  font-family: 'OswaldMedium', sans-serif;
  text-align: center;
  font-style: italic;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem);
  background: #fdfcf8;
  padding: 0.4em 1em;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
  display: inline-block;
  transform: rotate(-1deg);
  margin: 0 0 3rem;
}

/* 7) Body-Text & Manifest – gleiche Spaltenbreite wie .headline-wrap */
p, li{
  font-size: 1.4rem;
  line-height: 1.7;
  max-width: 65ch;          /* gleiche Zahl wie .headline-wrap */
  margin: 0 0 1rem;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

.manifest{
  font-family: 'SpaceMono', monospace;
  font-size: clamp(1.2rem, 1vw + 1rem, 1.8rem);
  line-height: 1.6;
  max-width: 50rem;
  margin: clamp(2rem, 6vw, 4rem) auto;
  text-align: left;
  padding: 0 1rem;
}



/* 8) Buttons / CTAs (global) – Reihe mit Abstand & unregelmäßiger Drehung */
.cta{
  max-width: min(72ch, 92vw);
  margin: clamp(2rem, 8vw, 4rem) auto;
  padding: 0;

  /* Anordnung nebeneinander */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(.6rem, 1.8vw, 1.25rem); /* Abstand zwischen Buttons */
}

/* Grundstil für alle Buttons/Links in der CTA-Gruppe */
.button, .btn, a.button, button.button, .cta a{
  display: inline-block;
  font-family: 'OswaldMedium', sans-serif;
  font-size: clamp(1rem, .8vw + .9rem, 1.3rem);
  line-height: 1.2;
  padding: 1rem 1.5rem;
  border: 2px solid #000;
  background: #000;
  color: #fff;
  text-decoration: none;
  cursor: pointer;

  /* Drehung steuerbar über Variable */
  --tilt: -1deg;
  transform: rotate(var(--tilt));

  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

/* Interaktionen */
.button:hover, .cta a:hover{ filter: brightness(1.08); }
.button:active, .cta a:active{ transform: rotate(var(--tilt)) translateY(1px); }
.button:focus-visible, .cta a:focus-visible{
  outline: 2px dashed #000; outline-offset: 3px;
}

/* Unregelmäßige "aufgeklebt"-Wirkung pro Button */
.cta a:nth-child(1){ --tilt: -1deg; }
.cta a:nth-child(2){ --tilt: 2deg; }
.cta a:nth-child(3){ --tilt: -0.5deg; }
.cta a:nth-child(4){ --tilt: 1.5deg; }
.cta a:nth-child(5){ --tilt: -1.8deg; }
/* bei mehr Buttons nach Bedarf fortsetzen */

/* 9) Textlinks / Footer-Links */
a{ color: inherit; }
.footer-nav{
  margin-top: 2rem;
  text-align: center;
  font-family: 'SpaceMono', monospace;
  font-size: clamp(.9rem, .6vw + .75rem, 1.4rem);
  opacity: 0.75;
}
.footer-nav a{ color: inherit; text-decoration: none; }
.footer-nav a:hover{ text-decoration: underline; }

/* 10) Footer-Badge (zentriert) */
footer{
  display: block;                                /* statt inline-block */
  width: max-content;                            /* Breite = Inhalt */
  margin: clamp(4rem, 10vw, 8rem) auto 2rem;     /* zentriert */
  padding: 0em 0.5em;
  font-family: 'OswaldMedium', sans-serif;
  font-size: clamp(1.4rem, 1.2vw + 1.2rem, 2.2rem);
  background: #000;
  color: #fff;
  letter-spacing: 0.03em;
  transform: rotate(3deg);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  mix-blend-mode: multiply;
  border: 1px solid #fff;
}
footer a { color: #fff; text-decoration: none; }

/* 11) Formulare (GLOBAL, „wie gehtnicht“) */
form { margin: 1.25rem 0; }

/* Kartenstil für Form-Container */
.form-card{
  font-family: 'OswaldBold', sans-serif;
  font-size: clamp(1.05rem, .7vw + 1rem, 1.35rem);
  background: #fefefe;
  /* gleichmäßige, aber mobile-skalierende Innenabstände */
  padding: clamp(1rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2rem);
  border: 2px solid #000;
  transform: rotate(.5deg);
  box-shadow: 8px 8px 0 rgba(0,0,0,.1);
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: left;                 /* Inhalt grundsätzlich links */
}

/* Einheitliche vertikale Abstände zwischen den Reihen */
.form-row { margin: 0 0 clamp(.9rem, 2.5vw, 1.2rem); }
.form-row:last-child { margin-bottom: 0; }

/* Labels: Oswald 500, linksbündig */
label, .label{
  display: block;
  font-family: 'OswaldMedium', 'OswaldBold', sans-serif; /* 500 fallback -> 700 */
  letter-spacing: .01em;
  margin: 0 0 .5rem;
}

/* Felder füllen die Innenbreite exakt */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  box-sizing: border-box;           /* wichtig für gleichmäßige Kanten! */
  font-family: 'SpaceMono', monospace;
  font-size: clamp(1rem, .6vw + .9rem, 1.15rem);
  line-height: 1.35;
  padding: .7rem .8rem;
  border: 2px solid #000;
  background: #f6f2ea;             /* Papieriger Feld-Hintergrund wie im Mock */
  box-shadow: inset 0 0 .25em rgba(0,0,0,.06);
}

textarea{ min-height: 8rem; resize: vertical; }

input:focus,
textarea:focus,
select:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,.12);
}

/* Submit-Button: zentriert, mit sauberem Außenabstand */
input[type="submit"].button,
button.button{
  display: inline-block;
  font-family: 'SpaceMono', monospace;
  font-size: clamp(1rem, .6vw + .85rem, 1.15rem);
  padding: .85rem 1.25rem;
  margin: clamp(1rem, 3vw, 1.5rem) auto 0;  /* oben Platz, unten bündig */
}

.fineprint{font-size:.9rem;color:#333;margin-top:.8rem}

/* Mobile-Feinschliff */
@media (max-width: 480px){
  .form-card{
    padding: 1rem 1.25rem;          /* symmetrisch & kompakt mobil */
  }
  .form-row{ margin-bottom: 1rem; }
}

/* 12) Popup (GLOBAL) */
#popup{
  position: fixed; inset: 0;
  background: rgba(234,230,220,.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
  z-index: 9999;
}
#popup.show{ opacity: 1; pointer-events: all; }

.popup-box{
  background: #000; color: #fff;
  padding: 2rem 3rem;
  font-size: clamp(1rem, .6vw + .9rem, 1.2rem);
  font-family: 'SpaceMono', monospace;
  border: 1px solid #fff;
  transform: rotate(-2deg);
  text-align: center;
  position: relative;
}
#popup-close{
  position: absolute;
  top: -.5rem; right: -.5rem;
  background: #fff; color: #000;
  font-family: 'SpaceMono', monospace;
  font-size: 1.2rem; border: none;
  padding: .2rem .6rem; line-height: 1;
  cursor: pointer;
}

/* 13) Papiertextur-Scale (Hintergrund) */
.bg{ background-size: 420px auto; }
@media (min-width: 900px){ .bg{ background-size: 600px auto; } }
@media (max-width: 600px){ .bg{ background-size: 360px auto; } }

/* 14) Sehr breite Screens: Deckel für Lesbarkeit */
@media (min-width: 1400px){
  html{ font-size: 21px; }
  h1{ font-size: 3rem; }
}

/* 15) Kleinste Geräte: Ränder enger */
@media (max-width: 420px){
  .wrapper, main, .content, body > div{ padding: 16px; }
}

/* 16) Utilities */
.mt-0{ margin-top: 0 !important; }
.mb-0{ margin-bottom: 0 !important; }
.center{ text-align: center; }
.hide{ display: none !important; }