/* templates/frontend/default/assets/css/style.css
 *
 * Komponenten-Bibliothek des Standard-Themes. Diese Klassen sind der
 * eigentliche "Vertrag" zwischen Theme und Content-Typen/Modulen (siehe
 * docs/contents.md, docs/module.md) - ein Content-Typ verwendet z.B.
 * ".nx-btn" für seinen "In den Warenkorb"-Button, ohne selbst zu wissen,
 * wie ein Button aussieht. Selbst gehostete Schriften (assets/fonts/,
 * @fontsource), kein CDN.
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* ------------------------------------------------------------------ */
/* Grundgerüst                                                         */
/* ------------------------------------------------------------------ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nx-bg);
  color: var(--nx-text);
  font-family: var(--nx-font-body);
  font-size: var(--nx-fs-base);
  line-height: var(--nx-lh-base);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-heading);
  line-height: var(--nx-lh-heading);
  font-weight: 700;
  margin: 0 0 var(--nx-space-4);
  color: var(--nx-text);
}
h1 { font-size: var(--nx-fs-3xl); font-weight: 800; }
h2 { font-size: var(--nx-fs-2xl); }
h3 { font-size: var(--nx-fs-xl); }

p { margin: 0 0 var(--nx-space-4); }

a { color: var(--nx-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sichtbarer Fokus-Ring auf ALLEN interaktiven Elementen (WCAG 2.4.7). */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--nx-primary);
  outline-offset: 2px;
}

.nx-container {
  width: 100%;
  max-width: var(--nx-max-width);
  margin: 0 auto;
  padding: 0 var(--nx-space-6);
}

.nx-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--nx-primary);
  color: var(--nx-on-primary);
  padding: var(--nx-space-3) var(--nx-space-4);
  border-radius: 0 0 var(--nx-radius-sm) 0;
  z-index: 1000;
}
.nx-skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */

.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  font-family: var(--nx-font-heading);
  font-weight: 700;
  font-size: var(--nx-fs-base);
  padding: 0.7rem 1.4rem;
  border-radius: var(--nx-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  text-decoration: none;
}
.nx-btn:hover { transform: translateY(-1px); text-decoration: none; }

.nx-btn-primary {
  background: var(--nx-primary);
  color: var(--nx-on-primary);
}
.nx-btn-primary:hover {
  background: var(--nx-primary-dark);
  color: var(--nx-on-primary);
}

.nx-btn-secondary {
  background: transparent;
  color: var(--nx-primary);
  border-color: var(--nx-primary);
}
.nx-btn-secondary:hover {
  background: var(--nx-surface-soft);
  color: var(--nx-primary-dark);
  border-color: var(--nx-primary-dark);
}

.nx-btn-ghost {
  background: transparent;
  color: var(--nx-text);
}
.nx-btn-ghost:hover { background: var(--nx-surface-soft); }

/* ------------------------------------------------------------------ */
/* Karten                                                               */
/* ------------------------------------------------------------------ */

.nx-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-sm);
  padding: var(--nx-space-6);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.nx-card:hover { box-shadow: var(--nx-shadow); }
.nx-card a.nx-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.nx-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--nx-space-6);
}

/* ------------------------------------------------------------------ */
/* Badges/Tags                                                         */
/* ------------------------------------------------------------------ */

.nx-badge {
  display: inline-block;
  font-family: var(--nx-font-heading);
  font-size: var(--nx-fs-sm);
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--nx-surface-soft);
  color: var(--nx-text);
}
.nx-badge-accent { background: var(--nx-secondary); color: var(--nx-text); }
.nx-badge-primary { background: var(--nx-primary); color: var(--nx-on-primary); }

/* ------------------------------------------------------------------ */
/* Formulare                                                           */
/* ------------------------------------------------------------------ */

.nx-field { margin-bottom: var(--nx-space-4); }
.nx-field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--nx-space-2);
  font-size: var(--nx-fs-sm);
}
.nx-field input, .nx-field textarea, .nx-field select {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--nx-border);
  border-radius: var(--nx-radius-sm);
  background: var(--nx-surface);
  color: var(--nx-text);
}
.nx-field input:focus, .nx-field textarea:focus, .nx-field select:focus {
  border-color: var(--nx-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(191, 66, 26, 0.15);
}

.nx-alert {
  padding: var(--nx-space-4);
  border-radius: var(--nx-radius);
  margin-bottom: var(--nx-space-4);
  border: 1.5px solid transparent;
}
.nx-alert-success { background: #EAF4EE; border-color: var(--nx-success); color: #1F4A2E; }
.nx-alert-danger  { background: #FBEAEA; border-color: var(--nx-danger); color: #6B1F1F; }
.nx-alert-info    { background: var(--nx-surface-soft); border-color: var(--nx-border); color: var(--nx-text); }

/* ------------------------------------------------------------------ */
/* Breadcrumbs / Paginierung                                           */
/* ------------------------------------------------------------------ */

.nx-breadcrumbs {
  font-size: var(--nx-fs-sm);
  color: var(--nx-muted);
  margin-bottom: var(--nx-space-4);
}
.nx-breadcrumbs a { color: var(--nx-muted); }
.nx-breadcrumbs .sep { margin: 0 var(--nx-space-2); }

.nx-pagination {
  display: flex;
  gap: var(--nx-space-2);
  list-style: none;
  padding: 0;
  margin: var(--nx-space-8) 0 0;
}
.nx-pagination a, .nx-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--nx-radius-sm);
  border: 1.5px solid var(--nx-border);
  color: var(--nx-text);
  text-decoration: none;
}
.nx-pagination a:hover { border-color: var(--nx-primary); text-decoration: none; }
.nx-pagination .is-current { background: var(--nx-primary); border-color: var(--nx-primary); color: var(--nx-on-primary); }

/* ------------------------------------------------------------------ */
/* Header / Navigation                                                 */
/* ------------------------------------------------------------------ */

.nx-header {
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nx-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nx-space-4) 0;
  gap: var(--nx-space-6);
}
.nx-logo {
  font-family: var(--nx-font-heading);
  font-weight: 800;
  font-size: var(--nx-fs-lg);
  color: var(--nx-text);
  text-decoration: none;
}

.nx-nav { display: flex; }
.nx-nav ul {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nx-nav a {
  display: block;
  padding: var(--nx-space-2) var(--nx-space-3);
  border-radius: var(--nx-radius-sm);
  color: var(--nx-text);
  font-weight: 600;
  text-decoration: none;
}
.nx-nav a:hover, .nx-nav a[aria-current="page"] { background: var(--nx-surface-soft); color: var(--nx-primary); }

.nx-nav li { position: relative; }
.nx-nav .nx-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  box-shadow: var(--nx-shadow);
  padding: var(--nx-space-2);
  list-style: none;
  margin: var(--nx-space-1) 0 0;
}
.nx-nav li.is-open > .nx-submenu { display: block; }
.nx-nav .nx-submenu a { padding: var(--nx-space-2) var(--nx-space-3); }

.nx-menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--nx-border);
  border-radius: var(--nx-radius-sm);
  padding: var(--nx-space-2) var(--nx-space-3);
  cursor: pointer;
  font: inherit;
}

@media (max-width: 860px) {
  .nx-menu-toggle { display: inline-flex; }
  .nx-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nx-surface);
    border-bottom: 1px solid var(--nx-border);
    padding: var(--nx-space-4) var(--nx-space-6);
  }
  .nx-nav.is-open { display: block; }
  .nx-nav ul { flex-direction: column; align-items: stretch; }
  .nx-nav .nx-submenu { position: static; box-shadow: none; border: none; padding-left: var(--nx-space-4); }
}

/* ------------------------------------------------------------------ */
/* Hero (Startseite)                                                   */
/* ------------------------------------------------------------------ */

.nx-hero {
  padding: var(--nx-space-16) 0;
  text-align: center;
}
.nx-hero h1 { font-size: var(--nx-fs-3xl); margin-bottom: var(--nx-space-4); }
.nx-hero p { font-size: var(--nx-fs-lg); color: var(--nx-muted); max-width: 640px; margin: 0 auto var(--nx-space-8); }

/* ------------------------------------------------------------------ */
/* Footer                                                               */
/* ------------------------------------------------------------------ */

.nx-footer {
  background: var(--nx-surface-soft);
  border-top: 1px solid var(--nx-border);
  margin-top: var(--nx-space-16);
  padding: var(--nx-space-12) 0 var(--nx-space-6);
}
.nx-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--nx-space-8);
  margin-bottom: var(--nx-space-8);
}
.nx-footer h2 {
  font-size: var(--nx-fs-base);
  margin-bottom: var(--nx-space-3);
}
/* Footer-Widget-Module (siehe $position_footer_widgets in base.tpl) sollten
   ihre eigenen Überschriften ebenfalls als h2 setzen - h1 kommt bereits vom
   Seiteninhalt, ein direkter Sprung auf h3+ würde die WCAG-Überschriften-
   Hierarchie (2.4.6 / heading-order) verletzen. */
.nx-footer ul { list-style: none; margin: 0; padding: 0; }
.nx-footer li { margin-bottom: var(--nx-space-2); }
.nx-footer a { color: var(--nx-muted); }
.nx-footer-bottom {
  border-top: 1px solid var(--nx-border);
  padding-top: var(--nx-space-4);
  font-size: var(--nx-fs-sm);
  color: var(--nx-muted);
  text-align: center;
}

main { flex: 1; }

.nx-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
