/*
 * Einheitliche Nav (Home/Guide/Buy more/Account/Logout) + zwei
 * Sub-Nav-Varianten (Account-Tabs, Guide-Kapitel). Ersetzt topbar/
 * account-nav aus account.css sowie guide-sidebar aus guide.css im
 * tatsächlichen Einsatz. Nutzt dieselben Farb-/Typo-Tokens wie der
 * Rest des Systems (siehe :root in base.css) für durchgängige Optik.
 */

/*
 * Einheitliche Nav: 3-Spalten-Grid (leer/Mitte/Aktionen), Mitte enthält
 * Home/Guide kaufen/Account (echt zentriert, unabhängig davon, wie viel
 * rechts steht), rechts Sprach-Dropdown + kompakter Logout-Icon-Button.
 * Ersetzt topbar/account-nav aus account.css sowie guide-sidebar aus
 * guide.css im tatsächlichen Einsatz. Nutzt dieselben Farb-/Typo-Tokens
 * wie der Rest des Systems (siehe :root in base.css) für durchgängige
 * Optik.
 */

.shell-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.shell-nav-side { display: flex; align-items: center; }

.shell-logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.shell-logo img { height: 28px; width: auto; display: block; }
.shell-logo-placeholder { font-family: inherit; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.shell-nav-actions { justify-content: flex-end; gap: 10px; }
.shell-nav-center { display: flex; align-items: center; gap: 4px; justify-self: center; }

.shell-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.shell-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.shell-nav-item:hover { background: var(--paper); color: var(--ink); }
.shell-nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.shell-nav-item.active { background: var(--paper); color: var(--ink); }

/* Kompakter, reiner Icon-Button (aktuell nur Logout) - bewusst ohne
   sichtbares Label, um "zu groß" zu vermeiden; aria-label + title
   übernehmen die Beschriftung für Screenreader/Tooltip. Bewusst mit
   "button."-Präfix bei JEDEM Zustand (nicht nur der Grundregel) -
   base.css hat für button[type="submit"] eigene Regeln für Ruhezustand,
   :hover UND :focus-visible, die sonst jeweils gewinnen würden (höhere
   Spezifität durch Element+Attribut-Selektor). */
button.shell-icon-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 8px 14px;
  border-radius: 7px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  margin-top: 0;
  transition: background .15s ease, color .15s ease;
}
.shell-icon-button svg { width: 18px; height: 18px; flex-shrink: 0; }
button.shell-icon-button:hover { background: var(--paper); color: var(--ink); }
button.shell-icon-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.shell-logout-form { display: flex; margin: 0; }

/* Sprach-Dropdown - dasselbe Erscheinungsbild wie die übrigen Nav-Elemente */
.shell-lang-switch { position: relative; }
.shell-lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 7px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.shell-lang-trigger:hover { background: var(--paper); color: var(--ink); }
.shell-lang-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.shell-lang-trigger[aria-expanded="true"] { background: var(--paper); color: var(--ink); }
.shell-lang-chevron { width: 12px; height: 12px; transition: transform .15s ease; }
.shell-lang-trigger[aria-expanded="true"] .shell-lang-chevron { transform: rotate(180deg); }

.shell-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 20;
}
.shell-lang-menu[hidden] { display: none; }
.shell-lang-menu ul { list-style: none; margin: 0; padding: 0; }
.shell-lang-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: .85rem;
  color: var(--ink);
  background: var(--card);
  position: sticky;
  top: 0;
}
.shell-lang-search:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.shell-lang-empty {
  margin: 0 0 6px;
  padding: 6px 10px;
  font-size: .8rem;
  color: var(--ink-soft);
}
.shell-lang-empty[hidden] { display: none; }
.shell-lang-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.shell-lang-menu a:hover { background: var(--paper); color: var(--ink); }
.shell-lang-menu a[aria-current="true"] { background: var(--ink); color: #fff; }
.shell-lang-menu form { margin: 0; }
.shell-lang-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.shell-lang-menu button:hover { background: var(--paper); color: var(--ink); }
.shell-lang-menu button[aria-current="true"] { background: var(--ink); color: #fff; }

@media (max-width: 780px) {
  .shell-nav-label { display: none; }
  .shell-nav-item svg { width: 20px; height: 20px; }
  .shell-nav-item { padding: 8px; }
}

@media (max-width: 560px) {
  .shell-nav { padding: 8px 12px; gap: 4px; }
  .shell-nav-center { gap: 0; }
}


/* ------------------------------------------------------------------ */
/* Content-Wrapper für Home/Guide-Übersicht/Buy more                   */
/* ------------------------------------------------------------------ */
.shell-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.shell-content h1 {
  font-size: 1.5rem;
  margin: 0 0 24px;
}
.content-card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 28px 30px;
  max-width: 460px;
  margin: 0 auto 20px;
}
.content-card:last-child { margin-bottom: 0; }

/* Für Seiten mit einer einzelnen, zentrierten Karte (Support,
   Checkout-Bestätigung/Abbruch, Sprachauswahl-Detail): Überschrift auf
   dieselbe Breite/Zentrierung wie die Karte darunter bringen, sonst
   steht sie linksbündig über einer mittig stehenden Karte. */
.shell-content h1.narrow-heading { max-width: 460px; margin: 0 auto 24px; }
.content-card-danger { border-color: var(--danger); }

/* Account-Übersicht: E-Mail/Passwort/Löschen nebeneinander statt
   untereinander gestapelt - so viele Spalten wie passen, mindestens
   220px pro Karte, fällt auf schmalen Bildschirmen automatisch auf
   weniger Spalten zurück. align-items: stretch sorgt dafür, dass alle
   Karten in einer Reihe dieselbe Höhe haben (an der höchsten Karte
   ausgerichtet), statt sich individuell an den eigenen Inhalt anzupassen. */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.account-grid .content-card { max-width: none; margin: 0; padding: 22px 22px; }
.delete-confirm-step { margin-top: 14px; }
.delete-confirm-step .btn-danger,
.delete-confirm-step .btn-secondary { width: auto; display: inline-block; margin-right: 8px; }
.btn-secondary {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  background: none;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--ink); }
.btn-buy {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--cta);
  color: #fff;
}
.btn-buy:hover { background: var(--cta-hover); }

/* home.php: Cover + Kauf-/Lese-Button. .guide-cover ist ein reiner
   CSS-Platzhalter (Titel-Text, kein Bild) - durch ein echtes <img>
   ersetzen, sobald ein richtiges Cover existiert (dann max-width:100%
   statt fester Breite/Höhe, damit das Seitenverhältnis des echten
   Bildes erhalten bleibt). */
.guide-cover-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 30px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.guide-cover {
  width: 220px;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.35);
  margin-bottom: 28px;
}
.guide-cover-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .6;
}
.guide-cover-title { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }

.guide-cta {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: background .15s ease;
}
.guide-cta-buy { background: var(--cta); }
.guide-cta-buy:hover { background: var(--cta-hover); }
.guide-cta-read { background: var(--cta); }
.guide-cta-read:hover { background: var(--cta-hover); }

.guide-cover-caption { margin: 20px 0 0; font-size: .95rem; font-weight: 600; color: var(--ink); }

/* Kategorie-Übersicht (nur bei GUIDE_HAS_CATEGORIES = true) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .category-grid { grid-template-columns: 1fr; }
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease;
}
.category-tile:hover { border-color: var(--cta); }
.category-tile-cover { width: 100%; aspect-ratio: 3 / 4; background: var(--ink); border-radius: 6px; overflow: hidden; }
.category-tile-cover img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-drag: none; }
.category-tile-title { font-weight: 600; font-size: .92rem; text-align: center; }

/* buy-more.php + guide-Übersicht: Sprach-Liste */
.lang-catalog { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang-catalog-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--card);
  flex-wrap: wrap;
}
.lang-catalog-row:last-child { border-bottom: none; }
.lang-catalog-info { display: flex; flex-direction: column; gap: 3px; }
.lang-catalog-name { font-weight: 600; }
.lang-catalog-price { color: var(--ink-soft); font-size: .92rem; }
.lang-catalog-pay { display: flex; gap: 8px; }
button.lang-catalog-buy {
  padding: 7px 16px; border-radius: 7px; border: none; width: auto; margin-top: 0;
  font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  background: var(--cta); color: #fff; transition: background .15s ease;
}
button.lang-catalog-buy:hover { background: var(--cta-hover); }
button.lang-catalog-buy:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

@media (max-width: 480px) {
  .guide-cover { width: 180px; height: 250px; }
}
