/**
 * BeGes Mediothek — Stylesheet
 *
 * Design-System: Switzer + Chillax Fonts, BeGes-Farbpalette
 */

/* =========================================================================
   Fonts
   ========================================================================= */

@font-face {
    font-family: 'Switzer';
    src: url('/assets/fonts/Switzer-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Chillax';
    src: url('/assets/fonts/Chillax-Variable.woff2') format('woff2');
    font-weight: 200 700;
    font-display: swap;
}

/* =========================================================================
   CSS Custom Properties
   ========================================================================= */

:root {
    --white: #fff;
    --black: #1f1f1f;
    --grey: #faf8f8;
    --grey-dark: #d7d3d0;
    --red-90: #b80309;
    --red-70: #e53138;
    --red-50: #fb787c;
    --red-30: #ffd4d6;
    --green-90: #0f7832;
    --green-70: #21a44c;
    --green-50: #87d879;
    --green-30: #ddffb4;
    --blue-90: #3734bd;
    --blue-70: #5856fc;
    --blue-50: #7d95ff;
    --blue-30: #bcdcff;

    --font-body: 'Switzer', system-ui, -apple-system, sans-serif;
    --font-heading: 'Chillax', 'Switzer', system-ui, sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --max-width: 1200px;
    --gap: 1.5rem;
}

/* =========================================================================
   Reset & Basis
   ========================================================================= */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--black);
    background-color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 600;
}

a {
    color: var(--red-70);
    text-decoration: none;
}

a:hover {
    color: var(--red-90);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================================================
   Layout
   ========================================================================= */

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

.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* =========================================================================
   Header
   ========================================================================= */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--grey-dark);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--black);
}

.logo:hover {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--grey-dark);
    letter-spacing: 0.05em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--black);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--grey);
    text-decoration: none;
}

.nav-warenkorb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.warenkorb-count {
    background: var(--red-70);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
}

.lang-switch {
    border: 1px solid var(--grey-dark);
    font-weight: 600;
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
    background: var(--grey);
    border-top: 1px solid var(--grey-dark);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--grey-dark);
}

.site-footer a {
    color: var(--black);
}

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--red-70);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--red-90);
    color: var(--white);
}

.btn-secondary {
    background: var(--grey);
    color: var(--black);
    border: 1px solid var(--grey-dark);
}

.btn-secondary:hover {
    background: var(--grey-dark);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* =========================================================================
   Startseite
   ========================================================================= */

.startseite {
    text-align: center;
    padding: 3rem 0;
}

.hero {
    margin-bottom: 3rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--grey-dark);
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.standort-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.standort-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--grey);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--black);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 500;
    transition: border-color 0.2s, transform 0.2s;
}

.standort-card:hover {
    border-color: var(--red-70);
    transform: translateY(-2px);
    text-decoration: none;
}

.lang-switch-container {
    margin: 2rem 0;
}

.lang-switch-link {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-sm);
    color: var(--black);
}

.lang-switch-link:hover {
    background: var(--grey);
    text-decoration: none;
}

.back-link {
    margin-top: 2rem;
    font-size: 0.85rem;
}

/* =========================================================================
   Suchbereich
   ========================================================================= */

.suchbereich {
    background: var(--grey);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.such-felder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.such-feld label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.such-feld input,
.such-feld select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--white);
}

.such-feld input:focus,
.such-feld select:focus {
    outline: 2px solid var(--red-70);
    outline-offset: 1px;
    border-color: transparent;
}

.such-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* =========================================================================
   Ergebnisse
   ========================================================================= */

.ergebnis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ergebnis-header h2 {
    font-size: 1.3rem;
}

.sortierung {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.sortierung select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

.keine-ergebnisse {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--grey-dark);
    font-size: 1.1rem;
}

/* =========================================================================
   Medien-Karten
   ========================================================================= */

.medien-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.medien-card {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.medien-card:hover {
    border-color: var(--red-50);
}

.medien-cover {
    width: 80px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--grey);
}

.medien-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.medien-info {
    min-width: 0;
}

.medien-titel {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.medien-untertitel {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
    margin-top: 0.15rem;
}

.medien-autor {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.medien-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    white-space: nowrap;
}

.tag-sachgebiet {
    background: var(--blue-30);
    color: var(--blue-90);
}

.tag-medienart {
    background: var(--green-30);
    color: var(--green-90);
}

.medien-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-warenkorb.im-warenkorb {
    background: var(--green-30);
    color: var(--green-90);
    cursor: default;
}

.medien-detail {
    grid-column: 1 / -1;
    padding: 1rem;
    background: var(--grey);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.7;
}

.medien-detail p {
    margin-bottom: 0.5rem;
}

.medien-inhalt p {
    margin-top: 0.3rem;
}

/* =========================================================================
   Paginierung
   ========================================================================= */

.paginierung {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0.3rem;
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--black);
}

.page-link:hover {
    background: var(--grey);
    text-decoration: none;
}

.page-link.active {
    background: var(--red-70);
    color: var(--white);
    border-color: var(--red-70);
}

/* =========================================================================
   Hinweise
   ========================================================================= */

.hinweis {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.hinweis-keinversand {
    background: var(--red-30);
    color: var(--red-90);
}

/* =========================================================================
   Warenkorb
   ========================================================================= */

.warenkorb-seite {
    padding: 2rem 0;
}

.warenkorb-seite h1 {
    margin-bottom: 1.5rem;
}

.warenkorb-liste {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.warenkorb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--grey);
    border-radius: var(--radius-sm);
}

.warenkorb-item-titel {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-entfernen {
    background: var(--red-30);
    color: var(--red-90);
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-entfernen:hover {
    background: var(--red-50);
    color: var(--white);
}

.warenkorb-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* =========================================================================
   Bestellformular
   ========================================================================= */

.bestellung-seite {
    padding: 2rem 0;
    max-width: 700px;
}

.bestellung-seite h1 {
    margin-bottom: 1.5rem;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group label,
.form-group legend {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--grey-dark);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.form-group input:focus {
    outline: 2px solid var(--red-70);
    outline-offset: 1px;
    border-color: transparent;
}

.form-group fieldset {
    border: none;
    padding: 0;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.3rem 0;
}

.optional {
    font-weight: 400;
    color: #999;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* =========================================================================
   Bestätigung
   ========================================================================= */

.bestaetigung-seite {
    padding: 3rem 0;
    text-align: center;
}

.bestaetigung-box {
    max-width: 500px;
    margin: 0 auto;
}

.bestaetigung-box h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--green-90);
}

.bestaetigung-box p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .medien-card {
        grid-template-columns: 60px 1fr;
    }

    .medien-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: flex-start;
    }

    .standort-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 0.8rem;
    }

    .such-felder {
        grid-template-columns: 1fr;
    }

    .standort-grid {
        grid-template-columns: 1fr;
    }
}
