/* =============================================================
   Philipp Kögl — Firmen-Webseite
   ============================================================= */

/* --- Design-Tokens (zentral änderbar) ---------------------- */
:root {
    /* Farben */
    --color-primary:    #1a2332;   /* Dunkelblau/Anthrazit, Headlines + Header */
    --color-accent:     #2563eb;   /* Akzent: gedecktes Blau */
    --color-accent-hover: #1d4ed8; /* Hover-Variante */
    --color-bg:         #ffffff;
    --color-bg-muted:   #f8f9fa;   /* Sektionshintergrund */
    --color-border:     #e5e7eb;
    --color-text:       #1f2937;   /* Fließtext */
    --color-text-muted: #6b7280;   /* Sekundärtext */

    /* Typografie */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --line-height: 1.6;

    /* Maße */
    --container-max: 1200px;
    --content-max:   840px;      /* schmaler für Fließtext */
    --radius:        8px;
    --radius-sm:     4px;

    /* Schatten (subtil) */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.06);

    /* Transitions */
    --t-fast: 150ms ease;
    --t:      200ms ease;
}

/* --- Reset / Basis ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

h1, h2, h3 {
    color: var(--color-primary);
    line-height: 1.25;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.35em; }
.lead { font-size: 1.125rem; color: var(--color-text-muted); }

/* --- Container -------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Header / Navigation ---------------------------------- */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1.5rem;
}
.brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--color-primary); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--color-primary);
    font-size: 1rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}
.site-nav a {
    color: var(--color-text);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.site-nav a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

/* --- Hero -------------------------------------------------- */
.hero {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-muted) 100%);
    padding: 5rem 0 4rem;
    border-bottom: 1px solid var(--color-border);
}
.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    max-width: 800px;
}
.hero .subline {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 720px;
    margin-bottom: 2rem;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Buttons ---------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: background-color var(--t), color var(--t), border-color var(--t), transform var(--t-fast);
    line-height: 1.2;
}
.btn-primary {
    background: var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
    text-decoration: none;
}
.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border);
}
.btn-secondary:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-text-muted);
    color: var(--color-primary);
    text-decoration: none;
}

/* --- Section-Grundlagen ----------------------------------- */
.section {
    padding: 4rem 0;
}
.section--muted {
    background: var(--color-bg-muted);
}
.section-header {
    max-width: var(--content-max);
    margin: 0 auto 2.5rem;
    text-align: center;
}
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--color-text-muted); margin: 0; }

.content-narrow {
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}

/* --- Produkt-Karten (index) ------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.product-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--t), transform var(--t-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
}
.product-card__image {
    background: var(--color-bg-muted);
    border-bottom: 1px solid var(--color-border);
}
.product-card__image img {
    width: 100%;
    height: auto;
    display: block;
}
.product-card__body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-card__body h3 { margin-top: 0; }
.product-card__body p { color: var(--color-text-muted); flex: 1; }
.product-card__link {
    margin-top: 1rem;
    font-weight: 600;
}
.product-card__link::after {
    content: " \2192"; /* → */
    transition: margin-left var(--t-fast);
    display: inline-block;
    margin-left: 0.25rem;
}
.product-card__link:hover::after {
    margin-left: 0.5rem;
}

/* --- Feature-Liste (Produktseite) ------------------------- */
.feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.feature-list li {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}
.feature-list li strong {
    display: block;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}
.feature-list li span {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* --- Screenshot-Galerie ----------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.gallery figure {
    margin: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t);
}
.gallery figure:hover { box-shadow: var(--shadow-md); }
.gallery img { width: 100%; height: auto; display: block; }
/* Klickbare Thumbnail-Verlinkung zur Vollbild-Lightbox */
.gallery a {
    display: block;
    cursor: zoom-in;
    position: relative;
}
.gallery a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: -3px;
}
.gallery a img { transition: transform var(--t), opacity var(--t-fast); }
.gallery a:hover img { transform: scale(1.015); opacity: 0.95; }
.gallery figcaption {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-muted);
}

/* --- Lightbox (reine CSS, :target) ------------------------ */
/* Standardmäßig versteckt; per URL-Anker (#zoom-…) sichtbar. Der gesamte
   Overlay-Anker schließt beim Klick (href="#galerie") wieder. */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
    text-decoration: none;
}
.lightbox:target {
    display: flex;
    animation: lightbox-fade 150ms ease-out;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-sm);
    cursor: zoom-out;
}
/* Visuelle „Schließen"-Hilfe in der Ecke des Overlays. Nur Dekoration —
   der gesamte Overlay-Anker schließt bereits beim Klick. */
.lightbox::after {
    content: "× Schließen";
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.85;
    pointer-events: none;
}
@keyframes lightbox-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Body-Scroll sperren, solange ein Lightbox-Ziel aktiv ist (CSS-only) */
body:has(.lightbox:target) { overflow: hidden; }

/* --- Kontaktformular -------------------------------------- */
.contact-form {
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 1.25rem; }
.form-row label {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
.form-row input,
.form-row textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-row textarea { resize: vertical; min-height: 140px; }
.form-actions { margin-top: 1.5rem; }
.form-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
}
/* Honeypot-Feld für Spam-Schutz — fuer Anwender unsichtbar, fuer
   ungezielte Bots aber bedienbar (Submits mit befuelltem _honey
   werden serverseitig verworfen, siehe FormSubmit-Doku). */
.honeypot { display: none; }

/* --- Footer ----------------------------------------------- */
.site-footer {
    background: var(--color-primary);
    color: #cbd5e1;
    padding: 2.5rem 0;
    margin-top: 0;
    font-size: 0.9rem;
}
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.site-footer a {
    color: #e2e8f0;
}
.site-footer a:hover { color: #fff; }
.footer-nav { display: flex; gap: 1.5rem; }

/* --- Hilfsklassen ----------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

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

/* Tablet (>=768px) */
@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero { padding: 6rem 0 5rem; }
    .hero h1 { font-size: 3rem; }
    .section { padding: 5rem 0; }

    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-card {
        flex-direction: row;
    }
    .product-card__image {
        flex: 0 0 45%;
        border-bottom: none;
        border-right: 1px solid var(--color-border);
    }
    .product-card__body {
        flex: 1;
        padding: 2rem;
    }

    .feature-list { grid-template-columns: 1fr 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; }
}

/* Desktop (>=1024px) */
@media (min-width: 1024px) {
    .hero h1 { font-size: 3.25rem; }
    .feature-list { grid-template-columns: 1fr 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; }
}

/* Mobile-Menü-Toggle (<768px) */
@media (max-width: 767px) {
    .nav-toggle { display: inline-flex; align-items: center; gap: 0.5rem; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }
    .site-nav.open { display: block; }
    .site-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1.25rem 1rem;
    }
    .site-nav a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--color-border);
    }
    .site-nav li:last-child a { border-bottom: none; }
    .hero { padding: 3.5rem 0 3rem; }
    .hero h1 { font-size: 2rem; }
    .hero .subline { font-size: 1.1rem; }
    .section { padding: 3rem 0; }
    .site-footer .container { flex-direction: column; align-items: flex-start; }
}
