/* =========================================================================
   geoAPI · Hauptstil (TYCAN-inspiriert)
   Wird von allen Seiten geladen, die das Standard-Layout nutzen. Studio
   ladet bewusst NICHT — dort gilt nur Stile.css plus eigene Inline-Stile.
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------- */
body {
  --bg:           #ffffff;
  --fg:           #111111;
  --muted:        #777777;
  --border:       #e6e6e6;
  --accent:       #EAB543;
  --accent-hover: #d99c1f;
  --highlight:    #fdf3d6;

  font-family: 'Montserrat', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* ---- Top-Navigation (Topbar) ------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #000;
  border-bottom: 1px solid #111;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  height: 70px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar .brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; letter-spacing: 0.02em;
  font-size: 1.25rem;
  color: #fff; text-decoration: none;
}
.topbar .brand::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--accent);
}
.topbar-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; flex: 1;
  justify-content: end;
}
.topbar-link {
  display: inline-block;
  padding: 8px 14px;
  color: #e6e6e6;
  font-size: 0.92rem; font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.topbar-link:hover { color: #fff; border-bottom-color: rgba(255,255,255,.4); }
.topbar-link.aktiv { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Dropdown-Submenüs */
.topbar-item { position: relative; }
.topbar-link .caret {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.75em;
  opacity: 0.7;
  transform: translateY(-1px);
  transition: transform .15s;
}
.topbar-item.has-children:hover .topbar-link .caret,
.topbar-item.has-children:focus-within .topbar-link .caret { transform: rotate(180deg) translateY(1px); }

.topbar-submenu {
  list-style: none; margin: 0; padding: 6px 0;
  position: absolute; top: 100%; right: 0;
  min-width: 200px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-top: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  border-radius: 0 0 4px 4px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility 0s linear .15s;
  z-index: 60;
}
.topbar-item.has-children:hover > .topbar-submenu,
.topbar-item.has-children:focus-within > .topbar-submenu {
  opacity: 1; visibility: visible;
  transform: translateY(0);
  transition: opacity .15s, transform .15s, visibility 0s linear 0s;
}
.topbar-sublink {
  display: block;
  padding: 8px 16px;
  color: #e6e6e6;
  font-size: 0.88rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.topbar-sublink:hover {
  background: #1a1a1a;
  color: #fff;
  border-left-color: var(--accent);
}
.topbar-sublink.aktiv {
  color: var(--accent);
  background: #141414;
  border-left-color: var(--accent);
  font-weight: 600;
}
.topbar-sub-sep {
  padding: 6px 16px 4px;
  margin-top: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  border-top: 1px solid #1a1a1a;
}
.topbar-sub-sep:first-child { border-top: none; margin-top: 0; }

@media (max-width: 720px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  /* Mobile-Layout (Burger-Menue + Slide-Down) wird in partials/Hauptmenue.php gestylt. */
}

/* ---- Hauptcontainer ----------------------------------------------------- */
main {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* ---- Typo --------------------------------------------------------------- */
h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-top: 2.2rem;
  letter-spacing: -0.005em;
}
h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}
p, li { font-size: 1rem; line-height: 1.65; }
.lead {
  color: #555;
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}
a { color: var(--accent-hover); }
a:hover { color: #b07a00; }

/* ---- Form-Inputs (überschreibt Stile.css) ------------------------------ */
input[type=text],
input[type=date],
input[type=time],
input[type=number],
select {
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  padding: 12px 14px;
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 181, 67, 0.18);
}

button {
  background: var(--accent);
  color: #000;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 14px 28px;
  cursor: pointer;
  transition: all .15s;
}
button:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

/* ---- Tabs (für demo.php / map.php) ------------------------------------- */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid #000;
  margin: 1.8rem 0 0;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 14px 24px;
  margin-right: 4px; margin-bottom: -2px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #777;
  cursor: pointer;
  border-radius: 0;
  transition: all .15s ease;
}
.tab-btn:hover {
  color: #000;
  border-color: var(--accent);
  background: #fff;
}
.tab-btn.active {
  color: #fff;
  background: #000;
  border-color: #000;
}

/* ---- Stage / Eingabe-Container ----------------------------------------- */
.stage {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.4rem 1.6rem;
}
.stage label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
}
.hint { color: #777; font-size: 0.85rem; margin-top: 0.5rem; }

/* ---- Terminal- und Code-Boxen ----------------------------------------- */
.terminal {
  background: #0a0a0a;
  color: #f3f3f3;
  border-radius: 4px;
  border: 1px solid #000;
  font: 0.84rem/1.6 "SF Mono", Menlo, Consolas, monospace;
}
.terminal .key   { color: #999; }
.terminal .val   { color: var(--accent); }
.terminal .url   { color: var(--accent); word-break: break-all; }
.terminal .empty { color: #666; font-style: italic; }
.terminal .err   { color: #ff8585; }

pre {
  background: #0a0a0a;
  color: #f3f3f3;
  border-radius: 4px;
  border: 1px solid #000;
  font: 0.84rem/1.55 "SF Mono", Menlo, Consolas, monospace;
}
pre code { font-family: "SF Mono", Menlo, Consolas, monospace; }

/* ---- Panels / Step-Boxen / Notes -------------------------------------- */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.panel h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 700;
}

.step-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: #fff;
}
.step-box h3 {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.num {
  background: #000;
  color: var(--accent);
  font-weight: 700;
}

.what-happens {
  background: #fdf3d6;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.legend { color: #777; }

/* ---- Auswahl-Liste (#place-suggest) ----------------------------------- */
#place-suggest {
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}
#place-suggest li:hover,
#place-suggest li.active {
  background: var(--highlight);
}

/* ---- Resolved-Box (auf Startseite) ------------------------------------ */
.resolved {
  background: #fdf3d6;
  border: 1px solid var(--accent);
  border-radius: 4px;
}

/* ---- docs.php / tutorial.php H2-Trennlinien ---------------------------- */
main.docs h2,
main.tutorial h2 {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 2.4rem;
  font-size: 1.5rem;
}
main.docs h4,
main.tutorial h4 {
  color: #888;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

/* ---- Inline-Stile aus demo.php Tab 3, die jetzt zur Akzentfarbe passen */
[data-geoapi-fill] { color: #b07a00 !important; }

/* =========================================================================
   Mobile-Optimierungen (global)
   ========================================================================= */
@media (max-width: 720px) {
  /* Forms: Labels + Inputs vertikal stapeln, Inputs auf voller Breite */
  form label {
    display: block;
    width: 100%;
  }
  form input[type=text],
  form input[type=email],
  form input[type=password],
  form input[type=date],
  form input[type=time],
  form input[type=number],
  form input[type=search],
  form input[type=tel],
  form input[type=url],
  form select,
  form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.3rem;
  }

  /* Param- und Vergleichs-Tabellen: scroll-fähiger Block */
  table.params,
  table.compare,
  .compare-table,
  main.docs table,
  main.tutorial table,
  main.preise table {
    display: block;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Code-Blocks: kleinere Schrift + Scroll bleiben */
  pre, pre code {
    font-size: 0.78rem;
  }

  /* Container-Padding: weniger horizontal-Verschwendung */
  main { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.2rem; }
  pre, pre code { font-size: 0.74rem; }
}
