/* ============================================================
   DE: Basis-Layout und Design-Variablen (hell/dunkel)
   EN: Base layout and design variables (light/dark)
   RU: Базовый макет и переменные дизайна (светлая/тёмная тема)
   ============================================================ */

:root {
  /* DE: Standard ist HELL, aber Script setzt gleich "dark".
     EN: Default is light, but script will set "dark".
     RU: По умолчанию здесь светлая, но скрипт сразу включает тёмную. */
  --bg-page: #f2f4f8;
  --bg-surface: #ffffff;
  --border-subtle: #d0d7e2;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-strong: #1d4ed8;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* DE: Dunkle Thema (wenn html[data-theme="dark"])
   EN: Dark theme (when html[data-theme="dark"])
   RU: Тёмная тема (когда у html стоит data-theme="dark") */
html[data-theme="dark"] {
  --bg-page: #020617;
  --bg-surface: #020617;
  --border-subtle: #1e293b;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-soft: #0f172a;
  --accent-strong: #93c5fd;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   Reset / Grundlayout
   ============================================================ */

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

html {
  font-size: 14px;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-page);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* ============================================================
   Container / Cards
   ============================================================ */

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 10px 24px;
}

.card {
  background: var(--bg-surface);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* DE: Rundes LG-Logo
   EN: Round LG logo
   RU: Круглый логотип LG */
.site-header__logo {
  width: 32px;
  height: 32px;
  border-radius: 40%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.site-header__title-main {
  font-weight: 600;
  font-size: 1rem;
}

.site-header__title-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Navigation */
.site-header__nav {
  display: flex;
  gap: 8px;
  margin-left: 24px;
  flex-wrap: wrap;
}

/* DE: Links im Header
   EN: Links in header
   RU: Ссылки в шапке */
.nav-link {
  font-size: 0.85rem;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   Buttons / Theme Toggle
   ============================================================ */

.btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
}

.theme-icon {
  display: none;
  font-size: 1rem;
}

/* DE: In HELL-Thema Sonne anzeigen
   EN: Show sun in light theme
   RU: В светлой теме – солнце */
html:not([data-theme="dark"]) .theme-icon--light {
  display: inline;
}
html:not([data-theme="dark"]) .theme-icon--dark {
  display: none;
}

/* DE: In DUNKEL-Thema Mond anzeigen
   EN: Show moon in dark theme
   RU: В тёмной теме – луна */
html[data-theme="dark"] .theme-icon--light {
  display: none;
}
html[data-theme="dark"] .theme-icon--dark {
  display: inline;
}

/* ============================================================
   Uhr / Datum / KW
   ============================================================ */

.header-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border-subtle);
  padding: 8px 0 16px;
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.site-footer small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   Language generator layout (generator/*)
   ============================================================ */

.language-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 12px;
}

.language-panel {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.language-panel__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.language-panel__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.form-row label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 80px;
}

.form-row select,
.form-row input[type="text"] {
  flex: 1 1 140px;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  background: var(--bg-page);
  color: var(--text-main);
}

.sentence-output {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed var(--border-subtle);
  background: var(--bg-page);
  min-height: 42px;
  font-size: 0.95rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   Portal cards (index.html, Bibliothek, usw.)
   ============================================================ */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.portal-card {
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
}

.portal-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1rem;
}

.portal-card p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-card a {
  font-size: 0.85rem;
  text-decoration: none;
}
