/* ==========================================================================
   Hyperion Renderings — global stylesheet
   Design reference: https://maaars.ch/ (black, minimal, image-first)
   ========================================================================== */

:root {
    --bg: #000;
    --text: #fff;
    --muted: #999;
    /* horizontal page padding */
    --pad-x: clamp(0.75rem, 2vw, 1.75rem);
    /* gutter around each gallery image (item padding, like maaars) */
    --tile-pad: clamp(4px, 0.8vw, 12px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: page-fade-in 0.35s ease;
}

@keyframes page-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Visually hidden but available to screen readers and crawlers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

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

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem var(--pad-x) 1rem;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: clamp(1.4rem, 3.2vw, 2.3rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.1;
    color: var(--text);
    text-decoration: none;
}

.menu {
    display: flex;
    gap: clamp(1rem, 2vw, 1.75rem);
    padding-top: 0.45rem;
    flex-shrink: 0;
}

.menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: opacity 0.25s ease;
}

.menu a:hover {
    opacity: 0.6;
}

.menu a.current {
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
}

/* Hero (home page)
   ========================================================================== */

.hero-section {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.hero-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Home page never scrolls; dvh keeps the hero exactly viewport-sized on
   mobile browsers with collapsing URL bars */
.home {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Header and footer float above the fixed hero image; a soft scrim keeps
   the white text readable on whichever hero image was picked */
.home .site-header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent);
}

.home .logo,
.home .menu a {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.home .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
}

.home .site-footer,
.home .site-footer a {
    color: #eee;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Gallery
   ========================================================================== */

.gallery-section {
    flex: 1;
    /* tile padding already provides the outer gutter's inner half */
    padding: 0 calc(var(--pad-x) - var(--tile-pad));
}

.gallery-grid {
    position: relative;
    /* No-JS fallback: CSS column masonry (script.js replaces this with a
       row-ordered masonry and absolute positioning). Mobile-first so the
       breakpoints line up exactly with columnsFor() in script.js. */
    column-count: 1;
}

@media (min-width: 600px)  { .gallery-grid { column-count: 2; } }
@media (min-width: 900px)  { .gallery-grid { column-count: 3; } }
@media (min-width: 1200px) { .gallery-grid { column-count: 4; } }

.gallery-item {
    display: block;
    padding: var(--tile-pad);
    break-inside: avoid;
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-item:hover img {
    opacity: 0.85;
}

/* JS masonry active */
.gallery-grid.masonry {
    column-count: auto;
}

.masonry .gallery-item {
    position: absolute;
    top: 0;
    left: 0;
}

/* Transitions only after the first layout, so tiles don't fly in on load */
.masonry-ready .gallery-item {
    transition: transform 0.35s ease, width 0.35s ease;
}

/* Info page
   ========================================================================== */

.info-section {
    flex: 1;
    width: 100%;
    max-width: 90rem;
    padding: 2.5rem var(--pad-x) 4rem;
}

.info-content h1 {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.info-content h2 {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.6rem;
}

.info-content p {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.65;
    color: #e6e6e6;
    max-width: 48rem;
    margin-bottom: 1.2rem;
}

.info-content a {
    color: inherit;
}

/* Two-column layout like maaars.ch: columns side by side on wide
   viewports, stacked on narrow ones */
.info-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 5rem;
}

.info-col {
    flex: 1 1 26rem;
    min-width: 0;
}

.info-content hr {
    border: 0;
    border-top: 1px solid #1e1e1e;
    margin: 2rem 0 3rem;
}

.info-content .info-address {
    margin-top: 2.2rem;
    color: #9a9a9a;
}

/* Error page (404)
   ========================================================================== */

.error-section {
    flex: 1;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 1rem;
    padding: 4rem var(--pad-x);
}

.error-section a {
    color: var(--text);
}

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

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem var(--pad-x);
    margin-top: auto;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.site-footer a:hover {
    opacity: 0.6;
}

/* Rechtstexte (datenschutz.html) */
.legal h2 {
    font-size: 1.05rem;
    font-weight: 500;
    color: #fff;
    margin: 2.2rem 0 0.6rem;
}

.legal p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.legal a {
    color: #fff;
}

.legal code {
    font-size: 0.85em;
    color: #ddd;
}

.legal .legal-stand {
    margin-top: 2.5rem;
    color: #777;
    font-size: 0.85rem;
}

/* Cookie-Consent-Banner (von script.js eingefügt, solange keine Wahl
   getroffen wurde; beide Buttons bewusst gleichwertig gestaltet)
   ========================================================================== */

.consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding: 1rem var(--pad-x) calc(1rem + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 10, 10, 0.97);
    border-top: 1px solid #222;
    font-size: 0.85rem;
    color: #bbb;
}

.consent-banner p {
    margin: 0;
    max-width: 62ch;
}

.consent-banner a {
    color: #fff;
}

.consent-buttons {
    display: flex;
    gap: 0.75rem;
}

.consent-banner button {
    font: inherit;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: transparent;
    border: 1px solid #555;
    padding: 0.55rem 1.4rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.consent-banner button:hover,
.consent-banner button:focus-visible {
    border-color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

/* PhotoSwipe lightbox
   ========================================================================== */

.pswp {
    --pswp-bg: #000;
}

/* Prev/next arrows: subtle for mouse users, hidden on touch devices
   where swiping is the natural navigation */
.pswp__button--arrow--prev,
.pswp__button--arrow--next {
    opacity: 0.65;
}

@media (hover: none) and (pointer: coarse) {
    .pswp__button--arrow--prev,
    .pswp__button--arrow--next {
        display: none;
    }
}

/* Caption shown beneath the image (fed from data-caption / alt) */
.pswp__custom-caption {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    max-width: min(92%, 64rem);
    color: #c9c9c9;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
}

.pswp__custom-caption:empty {
    display: none;
}
