/* ============================================================
   Café Amadeus – Public Site Stylesheet
   ============================================================ */

/* --- Base -------------------------------------------------- */
html {
    min-height: 100%;
    background: #000;
}
body {
    min-height: 100vh;
}

/* One number scales the whole site: every content size below is in em, so it
   is relative to this. Raised from 1.1em because the site is read across the
   room on a large screen, where ~18px body text is too small to make out. */
:root { --site-font-size: 1.25em; }

body {
    font-family: "Times New Roman", Times, serif;
    font-size: var(--site-font-size);   /* ~20px at a 16px browser default */
    background: #000;
    color: #fff;
    text-align: center;
    padding-top: 50px;         /* fixed navbar */
    line-height: 1.4;
}

h1, h2, h3, h4, h5, h6 { color: #fff; }
.h1, h1 { font-size: 2em; }
.h2, h2 { font-size: 1.75em; }

a, a:focus, a:hover { color: #fff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header (logo + clown with textured background) -------- */
.site-header {
    background: #000 url('/images/hintergrund.png') repeat;
    overflow: hidden;
}
.site-header a { text-decoration: none; }
.logo-img  { display: block; max-width: 100%; height: auto; }
.clown-img { display: block; max-width: 100%; height: auto; margin-left: auto; }

/* --- Navbar (matches original navbar-inverse style) --------- */
.navbar {
    background: linear-gradient(to bottom, #3c3c3c 0%, #222 100%) !important;
    border-bottom: 1px solid #080808;
    min-height: 50px;
    font-size: 0.85em;
    padding: 0;
}
.navbar .nav-link {
    color: rgba(255,255,255,.75) !important;
    font-weight: bold;
    padding: 14px 10px !important;
    border-bottom: 2px solid transparent;
    line-height: 1;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff !important;
    background: transparent !important;
    border-bottom-color: rgba(255,255,255,.25);
}
.navbar .nav-link.active { color: #fff !important; border-bottom-color: #fff; }

.dropdown-menu { background: #222; border: 1px solid #444; font-size: 1em; }
.dropdown-item { color: rgba(255,255,255,.75); }
.dropdown-item:hover, .dropdown-item:focus { background: #333; color: #fff; }
.dropdown-divider { border-color: #444; }

/* --- Main content ------------------------------------------ */
.site-main { min-height: 60vh; }
.container { padding-top: 8px; padding-bottom: 8px; }

/* --- Homepage: news-latest --------------------------------- */
.news-latest-container {
    padding: 10px;
    border: 5px solid white;
    margin: 10px auto;
    max-width: 860px;
}
.news-latest-container h2 { margin: 0 0 4px; }
.news-latest-item { padding: 3px; }
.news-latest-item img { display: block; margin: 8px auto; max-width: 100%; }
/* The "Beginn …" line and the date under the headline: these carry the two
   facts a visitor comes for, so they read at body size rather than as a
   caption. */
.news-latest-subheader { font-size: 1.15em; color: rgba(255,255,255,.9); margin: 3px 0 10px; }

/* --- Events list: news-list -------------------------------- */
.news-list-container { padding: 10px 0; text-align: left; }
.news-list-item {
    padding: 10px 0;
    border-bottom: solid white 2px;
    overflow: hidden;
}
.news-list-item:last-child { border-bottom: none; }
.news-list-container h2 { margin: 0; padding-bottom: 4px; }
.news-list-date {
    display: block; font-size: 1.3em; font-weight: 600;
    margin-bottom: 6px; color: rgba(255,255,255,.95);
}
.news-list-container img {
    float: right;
    margin: 0 0 10px 10px;
    width: 280px;
    max-width: 40%;
}
.news-list-morelink a { text-decoration: underline; }

/* --- Event single: news-single ----------------------------- */
.news-single-item { padding: 5px; text-align: left; }
.news-single-img { float: right; margin: 0 0 10px 15px; max-width: 55%; }
.news-single-img img { max-width: 100%; }
.news-single-backlink { padding: 6px 0; text-align: left; }
.news-single-backlink a { text-decoration: underline; }
/* The date and time of the event being read about: it was the smallest and
   dimmest text on the page at 0.65em/60% white. Matches the archive list now. */
.news-single-date {
    font-size: 1.3em; font-weight: 600; color: rgba(255,255,255,.95);
    clear: both; padding-top: 16px;
}

/* --- Month archive grid ------------------------------------ */
.amenu-year-nav { margin: 6px 0 12px; font-size: 0.75em; }
.amenu-year-nav a { text-decoration: underline; }

.month-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin: 0 auto;
    max-width: 660px;
}
.month-tile { position: relative; overflow: hidden; margin-bottom: 3px; }
.month-tile a { display: block; text-decoration: none !important; }
.month-tile-inner { position: relative; }
.month-tile-inner img { display: block; width: 100%; height: auto; }
/* The scrim separates a month with events from an empty one; it is not there
   to set a mood. Keep it light — the Kalender artwork is already dark, around
   19% mean luminance on its own, so the overlay multiplies down from there
   rather than starting at white. At the .45/.78 it was imported with, an active
   month rendered near 10% luminance and an empty one near 4%: a black bar. */
.month-tile-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.18);
}
/* Hover lifts the scrim off entirely — with the resting state this light, a
   partial step would not read as a state change. */
.month-tile.has-events:hover .month-tile-inner::after { background: rgba(0,0,0,0); }
.month-tile.no-events .month-tile-inner::after { background: rgba(0,0,0,.55); }
.month-year-label {
    position: absolute;
    bottom: 4px;
    right: 6px;
    z-index: 1;
    font-size: 0.65em;
    /* Near-opaque with a shadow: it used to lean on a heavily darkened tile for
       its contrast, and there is much less tile behind it now. */
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.8);
    letter-spacing: 1px;
}

/* --- Static content pages ---------------------------------- */
.static-content { text-align: left; max-width: 700px; margin: 0 auto; overflow: hidden; }
.menu-section {
    text-align: left;
    max-width: 700px;
    margin: 0 auto 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 16px;
    align-items: start;
}
.menu-img-right {
    grid-column: 2;
    grid-row: 1 / span 99;
    max-width: 160px;
    width: auto;
    height: auto;
    margin: 0;
    align-self: start;
}
.allergen-code {
    font-size: 0.75rem;
    color: #aaa;
    white-space: nowrap;
    padding: 5px 8px;
}
.static-content p { line-height: 1.7; margin-bottom: 1em; }

table { width: 100%; max-width: 700px; margin: 0 auto 16px auto; }
table td, table th { text-align: left; padding: 4px 6px; vertical-align: top; }
.price { text-align: right !important; white-space: nowrap; }
.menu-table { border-collapse: collapse; }
.menu-table th { border-bottom: 2px solid #555; font-weight: bold; padding: 6px; }
.menu-table td { border-bottom: 1px solid #2a2a2a; padding: 5px 6px; }
.menu-table tr:last-child td { border-bottom: none; }
.section-header {
    font-size: 1em;
    font-weight: bold;
    margin: 14px 0 4px;
    border-bottom: 1px solid #555;
    padding-bottom: 3px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* --- Photo gallery ----------------------------------------- */
.gallery-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px auto; max-width: 720px; }
.gallery-album { position: relative; width: 220px; overflow: hidden; cursor: pointer; }
.gallery-album a { display: block; text-decoration: none; }
.gallery-album img { width: 100%; height: 140px; object-fit: cover; display: block; }
.gallery-album-title {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 6px 4px;
    font-size: 0.75em;
    text-align: center;
}
.gallery-album:hover img { opacity: .85; }

/* An album's thumbnails. These used to live in a <style> block on the album
   template; they sit next to the viewer that opens from them instead. */
.photo-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 8px auto; max-width: 960px; }
.photo-grid a { display: block; cursor: zoom-in; }
.photo-grid a:focus-visible { outline: 2px solid #c9a227; outline-offset: 2px; }
.photo-grid img { width: 180px; height: 120px; object-fit: cover; display: block; }
.photo-grid a:hover img { opacity: .85; }

/* --- Photo viewer (lightbox_controller.js) ------------------ */
/* The overlay is built by the controller and appended to <body>; none of this
   is on the page until a visitor opens a photo. */
body.lightbox-open { overflow: hidden; }

.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.94);
    padding: 8px;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
    margin: 0; max-width: 100%;
    position: relative;   /* the loading spinner below centres on this */
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
/* Capped by the viewport but never stretched past its own size: a good half of
   the album is scanned material only ~450px wide, and upscaling it to fill the
   screen just makes it mushy. */
.lightbox-figure img {
    max-width: 100%; max-height: 82vh;
    width: auto; height: auto;
    object-fit: contain;
    background: #111;
}
.lightbox-figure figcaption {
    color: rgba(255,255,255,.75); font-size: 0.7em; text-align: center;
    max-width: 60ch; min-height: 1.2em;
}
.lightbox-counter { color: rgba(255,255,255,.45); margin-left: 8px; white-space: nowrap; }

/* Shown while the full-size file is still on the wire — without it a slow
   connection looks like a click that did nothing. */
.lightbox-figure.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%;
    animation: lightbox-spin .8s linear infinite;
}
.lightbox-figure.is-loading img { opacity: .25; }
@keyframes lightbox-spin { to { transform: rotate(360deg); } }

.lightbox button {
    background: none; border: 0; color: rgba(255,255,255,.8);
    cursor: pointer; line-height: 1; padding: 8px 14px;
    /* Above the photo, not behind it: the close and prev buttons precede the
       figure in the DOM, so without this the figure paints over them — which
       on a phone, where the arrows sit on the image, loses the back arrow
       entirely. The shadow keeps them legible over a bright photo. */
    z-index: 2;
    text-shadow: 0 0 6px rgba(0,0,0,.9);
}
.lightbox button:hover, .lightbox button:focus-visible { color: #fff; }
.lightbox button:focus-visible { outline: 2px solid #c9a227; outline-offset: 2px; }

.lightbox-close {
    position: absolute; top: 6px; right: 10px;
    font-size: 2.2rem;
}
.lightbox-nav { position: relative; font-size: 3.5rem; flex: 0 0 auto; }
.lightbox-nav[hidden] { display: none; }

@media (max-width: 576px) {
    /* No room beside the photo on a phone, so the arrows overlay its edges —
       and a swipe does the same job. */
    .lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2.6rem; }
    .lightbox-prev { left: 0; }
    .lightbox-next { right: 0; }
    .lightbox-figure img { max-height: 74vh; }
}

/* Respect a reader who has asked the system for less motion. */
@media (prefers-reduced-motion: reduce) {
    .lightbox-figure.is-loading::after { animation-duration: 3s; }
}

/* --- Map --------------------------------------------------- */
/* Season heading above each opening-hours table ("September bis Juni"). */
.opening-period { font-style: italic; margin: 10px 0 0 6px !important; }

.map-wrap { max-width: 700px; margin: 16px auto 0; }
.map-wrap iframe { width: 100%; height: 320px; border: 2px solid #555; }

/* --- Footer (mastfoot) ------------------------------------- */
.mastfoot {
    color: rgba(255,255,255,.5);
    font-size: 0.6em;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 16px;
}
.mastfoot p { margin: 2px 0; }
.mastfoot a { color: rgba(255,255,255,.5); text-decoration: underline; }
.mastfoot a:hover { color: rgba(255,255,255,.8); }

/* --- Media players (videos, event clips, musician profiles) --
   One set of rules for every place a library clip is rendered, so the /videos
   page, an event page and a musician profile all look the same. */
.mp-media { margin: 0 0 8px; }
.mp-media .ratio { background: #000; border: 1px solid #333; }
.mp-media iframe, .mp-media video { border: 0; }
.mp-media audio { width: 100%; margin-top: 6px; }
/* Cover art above an audio player: bounded so a large image cannot dwarf the
   controls it belongs to. */
.mp-media-cover {
    display: block; width: 100%; max-height: 260px;
    object-fit: cover; border: 1px solid #333;
}
.mp-media figcaption {
    color: #ccc; font-size: 0.72em; text-align: left;
    padding: 6px 2px 0;
}
.mp-media-missing { color: rgba(255,255,255,.4); font-size: 0.75em; font-style: italic; }

/* A list of clips under an event or on a profile. */
.mp-media-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; margin: 12px 0;
}
.mp-media-list.mp-media-list-audio { grid-template-columns: 1fr; gap: 10px; }

/* --- Musician profiles ------------------------------------- */
.musician-dates { list-style: none; padding: 0; margin: 8px 0; text-align: left; }
.musician-dates li { padding: 5px 0; border-bottom: 1px solid #222; font-size: 0.8em; }
.musician-dates a { color: #ddd; text-decoration: none; }
.musician-dates a:hover { color: #c9a227; }
.musician-dates-past a { color: rgba(255,255,255,.55); }

/* --- Error pages ------------------------------------------- */
.error-page { max-width: 720px; margin: 40px auto; padding: 0 12px; }
.error-page .error-code {
    font-size: 3.5em; line-height: 1; margin: 0 0 4px;
    color: rgba(255,255,255,.25);
}
.error-page h1 { margin-bottom: 16px; }
.error-text { font-size: 0.9em; color: rgba(255,255,255,.85); }
.error-links { margin-top: 24px; font-size: 0.85em; }
/* Separated by a middot rather than a list, so the row wraps on a phone
   without leaving a stray bullet behind. */
.error-links a { display: inline-block; padding: 4px 0; }
.error-links a + a::before { content: "·"; color: rgba(255,255,255,.4); padding: 0 8px; }

/* --- Flash, misc ------------------------------------------- */
.alert { text-align: left; font-size: 0.8em; }
hr { border-color: #333; }
.text-muted { color: rgba(255,255,255,.4) !important; }

@media (max-width: 576px) {
    body { font-size: 1.1em; }
    .news-list-container img { width: 110px; }
    /* The menu's side image is a fixed 160px column, which together with the
       table pushed the page wider than the screen. Stack it instead. */
    .menu-section { grid-template-columns: 1fr; }
    .menu-img-right {
        grid-column: 1; grid-row: auto;
        max-width: 100%; margin: 8px 0;
    }
    .news-single-img { float: none; max-width: 100%; margin: 8px 0; }
    .gallery-album { width: 44vw; }
    .mp-media-list { grid-template-columns: 1fr; }
}
