/* ============================================================
   style.css – toolbasis.de
   Mobile-first. Systemschriften. Dark Theme.
   ============================================================ */

/* ---- RESET ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0; /* Verhindert, dass Grid/Flex-Items auf min-content-Breite aufblähen */
}

/* ---- DESIGN TOKENS --------------------------------------- */
:root {
  --bg:           #131313;
  --surface:      #1c1c1c;
  --surface-2:    #252525;
  --border:       #2e2e2e;
  --text:         #efefef;
  --text-muted:   #9a9a9a;
  --accent:       #e8174a;   /* Logo-Rot */
  --accent-hover: #ff2558;
  --radius:       8px;
  --radius-sm:    4px;
  --header-h:     116px;
  --max-w:        780px;
  --font:         system-ui, -apple-system, BlinkMacSystemFont,
                  'Segoe UI', Verdana, Arial, sans-serif;
}

/* ---- BASE ------------------------------------------------- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font);
  font-size:   1rem;
  line-height: 1.65;
  min-height:  100dvh;
  display:     flex;
  flex-direction: column;
}

main { flex: 1; }

img  { display: block; max-width: 100%; height: auto; }
a    { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
}

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

ul, ol { padding-left: 1.4rem; }
li     { margin-bottom: 0.3rem; }

/* ---- LAYOUT WRAPPER -------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin:  0 auto;
  padding: 0 1rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position:   sticky;
  top:        0;
  z-index:    100;
  height:     var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display:    flex;
  align-items: center;
}

.header-inner {
  width:          100%;
  max-width:      var(--max-w);
  margin:         0 auto;
  padding:        0 1rem;
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  gap:            1rem;
}

/* Logo */
.logo-link {
  display:     flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-link img {
  height: 100px;
  width:  auto;
}

/* Hamburger Button */
.hamburger {
  display:        flex;
  flex-direction: column;
  justify-content: space-between;
  width:          28px;
  height:         20px;
  background:     none;
  border:         none;
  cursor:         pointer;
  padding:        0;
  flex-shrink:    0;
  /* Touch-friendly hit area */
  position:       relative;
}
.hamburger::before {
  content: '';
  position: absolute;
  inset: -12px;
}

.hamburger span {
  display:    block;
  width:      100%;
  height:     2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

/* Hamburger → X */
.hamburger.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ============================================================
   NAVIGATION (mobile: dropdown under header)
   ============================================================ */
.main-nav {
  display:    none;
  position:   absolute;
  top:        var(--header-h);
  left:       0;
  right:      0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index:    99;
  padding:    0.5rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.main-nav.is-open { display: block; }

.main-nav ul {
  list-style: none;
  padding:    0;
  max-width:  var(--max-w);
  margin:     0 auto;
}

.main-nav li { border-bottom: 1px solid var(--border); }
.main-nav li:last-child { border-bottom: none; }

.main-nav a {
  display:     block;
  padding:     0.85rem 1rem;
  color:       var(--text);
  text-decoration: none;
  font-size:   0.95rem;
  transition:  background 0.15s;
}
.main-nav a:hover,
.main-nav a.active { background: var(--surface-2); color: var(--accent); }

/* Nav category label (optional grouping) */
.nav-label {
  display:     block;
  padding:     0.6rem 1rem 0.2rem;
  font-size:   0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:       var(--text-muted);
}

/* ============================================================
   PAGE HERO (tool title)
   ============================================================ */
.tool-hero {
  padding:    1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tool-hero h1 {
  font-size:    1.5rem;
  color:        var(--text);
  margin-bottom: 0.3rem;
}

.tool-hero .tagline {
  font-size:  0.9rem;
  color:      var(--text-muted);
}

/* ============================================================
   TOOL SECTION (the interactive tool itself)
   ============================================================ */
.tool-section {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.25rem 1rem;
  margin-bottom: 1.5rem;
  overflow:      clip; /* Verhindert, dass überlaufende SVGs/Kinder den Layout-Fluss brechen */
}

/* Input groups inside tools */
.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display:       block;
  font-size:     0.85rem;
  font-weight:   600;
  color:         var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-group input,
.input-group select {
  width:         100%;
  padding:       0.65rem 0.85rem;
  background:    var(--surface-2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  color:         var(--text);
  font-family:   var(--font);
  font-size:     1rem;
  transition:    border-color 0.15s;
  -webkit-appearance: none;
  appearance:    none;
}

.input-group input:focus,
.input-group select:focus {
  outline:       none;
  border-color:  var(--accent);
}

/* Primary Button */
.btn-primary {
  display:       inline-block;
  width:         100%;
  padding:       0.8rem 1.5rem;
  background:    var(--accent);
  color:         #fff;
  border:        none;
  border-radius: var(--radius-sm);
  font-family:   var(--font);
  font-size:     1rem;
  font-weight:   700;
  cursor:        pointer;
  text-align:    center;
  transition:    background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }

/* Result box */
.result-box {
  margin-top:    1rem;
  padding:       1rem;
  background:    var(--surface-2);
  border:        1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size:     1rem;
  display:       none; /* shown via JS */
}
.result-box.visible { display: block; }

.result-box .result-value {
  font-size:   1.6rem;
  font-weight: 700;
  color:       var(--accent);
  display:     block;
  margin-bottom: 0.25rem;
}

/* ============================================================
   AD UNITS
   ============================================================ */
.ad-unit {
  margin:        1.5rem 0;
  text-align:    center;
  min-height:    90px; /* Prevents layout shift while AdSense loads */
  overflow:      hidden;
}

/* Subtle "Anzeige" label above ad (empfohlen für UX-Klarheit) */
.ad-unit::before {
  content:     'Anzeige';
  display:     block;
  font-size:   0.65rem;
  color:       var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq-section {
  margin-bottom: 2rem;
}

.faq-section h2 {
  font-size:     1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color:         var(--text);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width:        100%;
  background:   none;
  border:       none;
  color:        var(--text);
  font-family:  var(--font);
  font-size:    0.95rem;
  font-weight:  600;
  text-align:   left;
  padding:      0.9rem 2rem 0.9rem 0;
  cursor:       pointer;
  position:     relative;
  line-height:  1.4;
  -webkit-tap-highlight-color: transparent;
}

/* Arrow icon */
.faq-question::after {
  content:    '›';
  position:   absolute;
  right:      0;
  top:        50%;
  transform:  translateY(-50%) rotate(90deg);
  font-size:  1.2rem;
  color:      var(--text-muted);
  transition: transform 0.2s;
  line-height: 1;
}

.faq-item.is-open .faq-question::after {
  transform: translateY(-50%) rotate(-90deg);
}

.faq-answer {
  font-size:   0.9rem;
  color:       var(--text-muted);
  padding:     0 0 1rem;
  display:     none;
  line-height: 1.6;
}

.faq-item.is-open .faq-answer { display: block; }

/* ============================================================
   SEO CONTENT BLOCK
   ============================================================ */
.seo-content {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.25rem 1rem;
  margin-bottom: 1.5rem;
  font-size:     0.92rem;
  color:         var(--text-muted);
}

.seo-content h2 {
  font-size:     1rem;
  color:         var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.seo-content h3 {
  font-size:     0.92rem;
  color:         var(--text);
  margin:        1rem 0 0.4rem;
}

.seo-content p,
.seo-content li { color: var(--text-muted); }

/* ============================================================
   WEITERE TOOLS (Grid)
   ============================================================ */
.more-tools {
  margin-bottom: 2rem;
}

.more-tools h2 {
  font-size:     1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tools-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   0.75rem;
  margin-bottom: 3rem !important;
}

.tool-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1rem;
  text-decoration: none;
  color:         var(--text);
  transition:    border-color 0.15s, background 0.15s;
  display:       block;
}

.tool-card:hover {
  border-color:  var(--accent);
  background:    var(--surface-2);
  color:         var(--text);
}

.tool-card-title {
  font-size:     0.9rem;
  font-weight:   700;
  margin-bottom: 0.25rem;
  display:       block;
}

.tool-card-desc {
  font-size:   0.78rem;
  color:       var(--text-muted);
  line-height: 1.4;
  display:     block;
}

/* ============================================================
   FOOTER
   ============================================================ */
   
.ogimg {
  margin-bottom: 2rem !important;
  display: flex;
  justify-content: center;
  align-items: center;
}
   
.site-footer {
  border-top:  1px solid var(--border);
  padding:     1.25rem 1rem;
  text-align:  center;
  font-size:   0.8rem;
  color:       var(--text-muted);
}

.site-footer nav {
  display:     flex;
  justify-content: center;
  flex-wrap:   wrap;
  gap:         0.25rem 1.5rem;
  margin-bottom: 0.6rem;
}

.site-footer a {
  color:       var(--text-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); }

.footer-copy { font-size: 0.75rem; }

/* ============================================================
   DESKTOP (min-width: 680px)
   ============================================================ */
@media (min-width: 680px) {

  /* Header */
  .site-header { height: 116px; }
  :root        { --header-h: 116px; }

  /* Hide hamburger, show inline nav */
  .hamburger   { display: none; }

  .main-nav {
    display:    flex !important; /* overrides is-open/closed logic */
    position:   static;
    background: transparent;
    border:     none;
    padding:    0;
    box-shadow: none;
  }

  .main-nav ul {
    display:     flex;
    align-items: center;
    gap:         0.25rem;
    flex-wrap:   wrap;
  }

  .main-nav li  { border: none; }

  .main-nav a {
    padding:     0.4rem 0.75rem;
    font-size:   0.85rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  /* Tool hero */
  .tool-hero h1 { font-size: 1.85rem; }

  /* Tool section */
  .tool-section  { padding: 1.75rem 1.5rem; }

  /* Input grid (2 columns for wider inputs) */
  .input-grid-2 {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   1rem;
  }

  /* Btn: auto width on desktop */
  .btn-primary { width: auto; min-width: 200px; }

  /* Tools grid: 3 columns */
  .tools-grid { grid-template-columns: 1fr 1fr 1fr; }

  /* SEO & FAQ padding */
  .seo-content,
  .faq-section   { padding: 0; }
  .seo-content   { padding: 1.5rem; }
}

.alle-tools-btn {
  display:       inline-block;
  padding:       0.45rem 0.9rem;
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  color:         var(--text-muted);
  text-decoration: none;
  font-size:     0.85rem;
  font-weight:   600;
  transition:    border-color 0.15s, color 0.15s;
  white-space:   nowrap;
}
.alle-tools-btn:hover {
  border-color: var(--accent);
  color:        var(--accent);
}

/* ============================================================
   ALLE-TOOLS-BUTTON (Seitenabschluss)
   ============================================================ */
.discover-tools {
  margin-bottom: 2rem;
  text-align: center;
}

.discover-tools-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             0.6rem;
  width:           100%;
  padding:         1.1rem 2rem;
  background:      transparent;
  color:           var(--accent);
  border:          2px solid var(--accent);
  border-radius:   var(--radius);
  font-family:     var(--font);
  font-size:       1.05rem;
  font-weight:     700;
  text-decoration: none;
  letter-spacing:  0.02em;
  transition:      background 0.18s, color 0.18s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.discover-tools-btn:hover {
  background: var(--accent);
  color:      #fff;
}

.discover-tools-btn:active {
  transform: scale(0.98);
}

.discover-tools-btn svg {
  flex-shrink: 0;
  transition:  transform 0.18s;
}

.discover-tools-btn:hover svg {
  transform: translateX(4px);
}

@media (min-width: 680px) {
  .discover-tools-btn {
    width:     auto;
    min-width: 320px;
    font-size: 1.1rem;
    padding:   1.2rem 2.5rem;
  }
}