/*
 * Startseite (index.php, body.page-home). Ergänzt styles.css, nur hier geladen.
 * Der Hero-Bereich (Titel, Text, "Selected Projects") bleibt bewusst so, wie styles.css ihn
 * gestaltet. Hier nur: Header ohne Springen beim Scrollen und das Kartenraster der Projekte.
 */

body.page-home {
    --home-text: #2b2f33;
    --home-heading: #111418;
    --home-muted: #6b7280;
    --home-border: #e6e9ed;
    --home-soft: #f5f7f9;
    --home-dark: #14181d;
    --home-accent-1: #3498db;
    --home-accent-2: #2ecc71;
    --home-accent: linear-gradient(90deg, var(--home-accent-1), var(--home-accent-2));
    --hh: 106px;                     /* Höhe des Headers oben auf der Seite (Handy), wie bisher */
    background-color: #fff;          /* fester Grund statt transparent (Dunkelmodus, eingebettete Browser) */
}

@media (min-width: 769px) {
    body.page-home {
        --hh: 116px;
    }
}

/* ---------- Header: oben unverändert (Logo 65 px, transparent), aber immer fixiert ----------
   Vorher wechselte er beim Scrollen von sticky auf fixed und der Inhalt rutschte ~100 px hoch.
   Jetzt ist er immer fixiert und main hält seinen Platz frei (siehe unten). */
.page-home header,
.page-home header.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.page-home header.scrolled {
    background-color: rgba(255, 255, 255, 0.88) !important;
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 1px 0 rgba(17, 20, 24, 0.07);
}

.page-home .mobile-menu {
    background-color: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 32px rgba(17, 20, 24, 0.14);
}

/* Platz des Headers in main freihalten: Titel, Text und Liste sitzen genau wie vorher
   (Header + 50 px Abstand, darunter ein Bereich von 100vh Höhe) */
.page-home main {
    padding-top: calc(var(--hh) + 50px);
    min-height: calc(100vh + var(--hh));
}

/* Sprungziele landen unter dem Header (smooth-scroll.js / script.js nutzen scrollIntoView) */
.page-home #Projekte,
.page-home .home-card {
    scroll-margin-top: 80px;
}

/* ---------- Projektkarten -------------------------------------------------------------- */

.home-projects {
    position: relative;
    padding: 48px 20px 64px;
    background: #f9f9f9;             /* gleiches Grau wie der Verlauf am Ende von main */
}

@media (min-width: 700px) {
    .home-projects {
        padding: 64px 32px 88px;
    }
}

.home-container {
    max-width: 1160px;
    margin: 0 auto;
}

.home-section-head {
    margin-bottom: 24px;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.home-eyebrow::before {
    content: '';
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: var(--home-accent);
}

.home-section-head h2 {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--home-heading);
}

.home-project-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 700px) {
    .home-project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1100px) {
    .home-project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

.home-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-card:hover {
    transform: translateY(-3px);
    border-color: #d5dbe1;
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.1);
}

.home-card:focus-within {
    outline: 3px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

/* Bildfläche wie auf den Projektseiten: jedes Format ganz sichtbar, nichts beschnitten */
.home-card__media {
    position: relative;
    aspect-ratio: 16 / 10;           /* feste Fläche: hohe Bilder dürfen sie nicht strecken */
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(52, 152, 219, 0.1), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(46, 204, 113, 0.1), transparent 55%),
        var(--home-soft);
    border-bottom: 1px solid #eef0f3;
}

.home-card__img {
    position: absolute;
    inset: 14px;
    display: block;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    object-fit: contain;
    border-radius: 8px;
}

.home-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px 20px;
}

.home-card__num {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #9aa1a9;
}

.home-card__title {
    font-size: 1.3rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--home-heading);
}

.home-card__title a {
    color: inherit;
    text-decoration: none;
}

/* Ganze Karte klickbar, aber nur ein Link (Titel) für Tastatur und Screenreader */
.home-card__title a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.home-card__title a:focus-visible {
    outline: none;
}

.home-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 0.975rem;
    line-height: 1.6;
    color: #4b5563;
}

.home-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--home-heading);
}

.home-card__more i {
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

.home-card:hover .home-card__more i {
    transform: translateX(3px);
}

/* Kurze Hervorhebung nach Sprung aus der Liste (smooth-scroll.js) */
.home-card.highlight-section {
    animation: home-card-highlight 1.5s ease-in-out;
}

@keyframes home-card-highlight {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
    40% { box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.35); }
}

@media (prefers-reduced-motion: reduce) {
    .home-card,
    .home-card__more i {
        transition: none;
    }

    .home-card:hover {
        transform: none;
    }
}
