/* Design-Tokens, abgeglichen mit der Hauptseite traktortreffen-aspach.de
   (Tailwind-Build: amber-700 als Akzent, gray-Skala, System-Schriftstack,
   kein Dark Mode - die Hauptseite nutzt keine einzige dark:-Klasse). */
:root {
    --color-primary: #b45309;        /* amber-700 - Logo, Buttons */
    --color-primary-hover: #d97706;  /* amber-600 - Hover */
    --color-primary-soft: #fffbeb;   /* amber-50  - aktive Nav-Fläche */
    --color-bg: #ffffff;
    --color-surface: #f9fafb;        /* gray-50 */
    --color-text: #111827;           /* gray-900 */
    --color-text-nav: #374151;       /* gray-700 */
    --color-text-muted: #6b7280;     /* gray-500 */
    --color-border: #e5e7eb;         /* gray-200 */
    --color-footer-bg: #111827;      /* gray-900 */
    --color-footer-text: #9ca3af;    /* gray-400 */
    --radius: 0.5rem;                /* rounded-lg */
    --radius-lg: 0.75rem;            /* rounded-xl */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, .1);
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --wrap: 80rem;                   /* max-w-7xl */
    --nav-h: 4rem;                   /* h-16 */
    --crumb-h: 2.75rem;
}

* { box-sizing: border-box; }

html {
    scroll-padding-top: calc(var(--nav-h) + var(--crumb-h));
}

body {
    margin: 0;
    padding-top: var(--nav-h);
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }
a { color: var(--color-primary); }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .wrap { padding: 0 2rem; } }

/* ---------------------------------------------------------------------------
   Navigation - Aufbau wie auf der Hauptseite:
   fixed, weiß mit leichter Transparenz + Blur, 4rem hoch, dezenter Schatten
   --------------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm);
}
.site-nav .nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    gap: 1rem;
}

.logo-link {
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    font-size: 1.25rem;      /* text-xl */
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
}
.logo-link .logo-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-link .logo-sub {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Links rechts - ab 768px sichtbar, darunter Hamburger (wie Hauptseite) */
.nav-links {
    display: none;
    align-items: center;
    gap: 1.5rem;             /* space-x-6 */
}
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-toggle { display: none; }
}
.nav-links a {
    font-size: .875rem;      /* text-sm */
    color: var(--color-text-nav);
    text-decoration: none;
    transition: color .15s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--color-primary-hover); }
.nav-links a.is-active {
    color: var(--color-primary);
    font-weight: 600;
}
.nav-links .nav-external {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}
.nav-links .nav-external svg { width: .875rem; height: .875rem; }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    border: 0;
    background: none;
    border-radius: var(--radius);
    color: var(--color-text-nav);
    cursor: pointer;
}
.nav-toggle:hover { color: var(--color-primary-hover); }
.nav-toggle svg { width: 1.5rem; height: 1.5rem; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Aufklappendes Mobilmenü */
.nav-mobile {
    display: none;
    background: #fff;
    border-top: 1px solid var(--color-border);
}
.nav-mobile.is-open { display: block; }
@media (min-width: 768px) { .nav-mobile { display: none !important; } }
.nav-mobile .wrap { padding-top: .75rem; padding-bottom: .75rem; }
.nav-mobile a {
    display: block;
    padding: .5rem 0;
    color: var(--color-text-nav);
    text-decoration: none;
}
.nav-mobile a:hover { color: var(--color-primary-hover); }
.nav-mobile a.is-active { color: var(--color-primary); font-weight: 600; }

/* Breadcrumb-Leiste, klebt direkt unter der Navigation */
.breadcrumb {
    position: sticky;
    top: var(--nav-h);
    z-index: 40;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    font-size: .875rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: .375rem;
    list-style: none;
    margin: 0;
    padding: 0;
    height: var(--crumb-h);
    white-space: nowrap;
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before {
    content: "\203A";
    color: #9ca3af;
    margin-right: .375rem;
}
.breadcrumb a { color: var(--color-text-nav); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary-hover); }
.breadcrumb [aria-current] { color: var(--color-text); font-weight: 600; }

main { padding-bottom: 3rem; }

/* --- Hero --- */
.hero {
    position: relative;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
}
.hero img {
    display: block;
    width: 100%;
    height: clamp(180px, 38vw, 380px);
    object-fit: cover;
}
.hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 3rem 1.25rem 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent);
    color: #fff;
}
.hero-caption h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}
.hero-caption p { margin: .25rem 0 0; opacity: .9; font-size: .9375rem; }

.page-title {
    margin: 1.5rem 0 1rem;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
}

/* --- Album-Kacheln --- */
.album-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0 1.5rem;
}
@media (min-width: 640px) {
    .album-tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
.album-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    background: var(--color-surface);
    transition: all .3s ease;      /* card-hover der Hauptseite */
}
.album-tile:hover, .album-tile:focus-visible {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}
.album-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-tile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    opacity: .3;
}
.album-tile .label {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: 2rem 1rem .875rem;
    background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
    color: #fff;
}
.label-title { font-weight: 600; font-size: 1.0625rem; }
.label-count { font-size: .8125rem; opacity: .85; white-space: nowrap; }

/* --- Fotos: mobil untereinander, ab 640px buendige Zeilen ---
   Jede Zeile wird auf eine gemeinsame Hoehe gebracht, die Breite ergibt sich
   aus dem Seitenverhaeltnis des Fotos (--ar, vom Template gesetzt). Dadurch
   bleiben Hoch- und Querformat unverzerrt und unbeschnitten, die Reihenfolge
   liest sich aber weiter zeilenweise von links oben nach rechts unten.

   Rechnerisch: flex-grow und flex-basis sind beide proportional zu --ar, also
   ist die Endbreite jedes Fotos genau proportional zu seinem Verhaeltnis - und
   damit die Hoehe (Breite / --ar) in der ganzen Zeile gleich. */
.photo-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0 1rem;
}
.photo-item {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
    line-height: 0;
    transition: box-shadow .3s ease, transform .3s ease;
}
.photo-item:hover, .photo-item:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

@media (min-width: 640px) {
    .photo-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .photo-item {
        /* Der Basis-Faktor entspricht ungefaehr der Zeilenhoehe in px. */
        flex: var(--ar, 1.333) 1 calc(var(--ar, 1.333) * 12rem);
        min-width: 0;
    }
    /* Flex streckt alle Fotos einer Zeile auf exakt dieselbe Hoehe; cover
       faengt dabei nur die Rundungsdifferenz von unter einem Pixel ab. */
    .photo-item img {
        height: 100%;
        object-fit: cover;
    }
    /* Fuellt den Rest der letzten Zeile, damit die letzten ein, zwei Fotos
       nicht auf volle Breite aufgeblasen werden. */
    .photo-list::after {
        content: "";
        flex-grow: 999999;
    }
}

/* --- Hinweise / 404 --- */
.notice {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    margin: 2rem 0;
    color: var(--color-text-muted);
}
.notice-center { text-align: center; }
.notice h1 { color: var(--color-text); margin-top: 0; font-weight: 700; }
.notice .hint { font-size: .875rem; }
.notice code {
    background: var(--color-border);
    padding: .1rem .35rem;
    border-radius: .25rem;
}
.button {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: .75rem 1.5rem;
    border-radius: var(--radius);
    transition: background-color .3s ease;
}
.button:hover { background: var(--color-primary-hover); }

/* --- Footer, entspricht dem der Hauptseite --- */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 2rem 0;
    font-size: .875rem;
}
.site-footer .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: center;
}
@media (min-width: 768px) {
    .site-footer .wrap { flex-direction: row; text-align: left; }
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color .15s ease;
}
.site-footer a:hover { color: #fff; }

/* --- PhotoSwipe: Teilen-Button --- */
.pswp__button--share-link { background: none; font-size: 1.1rem; color: #fff; }
.pswp__copy-hint {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, .92);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    z-index: 100000;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
