/* ============================================================
   Bernds Atelier — Design System
   Concept: Warm Gallery Aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --nav-bg:        #1a1918;
    --nav-text:      #f0ede6;
    --nav-hover-bg:  rgba(255,255,255,0.07);
    --nav-accent:    #c9a96e;

    --bg:            #f7f5f0;
    --surface:       #ffffff;
    --text:          #1e1c1a;
    --text-muted:    #7a746c;
    --border:        #e6e1d8;
    --accent:        #c9a96e;
    --accent-dark:   #a8894e;

    --font-heading:  'Cormorant Garamond', Georgia, serif;
    --font-body:     'Inter', system-ui, -apple-system, sans-serif;

    --gap-xs:   6px;
    --gap-sm:   12px;
    --gap-md:   24px;
    --gap-lg:   40px;
    --gap-xl:   64px;

    --max-w:    1200px;
    --prose-w:  760px;

    --radius:   3px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

    --transition: 0.22s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent);
}

p {
    margin-bottom: var(--gap-md);
}

p:last-child {
    margin-bottom: 0;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--text);
    line-height: 1.15;
}

/* ── Navigation Wrapper ─────────────────────────────────────── */
#wrapper {
    background-color: var(--nav-bg);
    width: 100%;
    position: relative;
    z-index: 100;
}

/* On index.html the nav is inside #hiddenMenu inside #wrapper2 */
#wrapper2 {
    width: 100%;
    position: relative;
    z-index: 100;
}

/* ── Primary Nav ────────────────────────────────────────────── */
#menu {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    list-style: none;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gap-md);
}

#menu > li {
    position: relative;
}

#menu > li > a {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: var(--nav-text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

#menu > li > a:hover,
#menu > li:hover > a {
    background-color: var(--nav-hover-bg);
    color: var(--nav-accent);
}

/* Home icon item */
li.cat1 a {
    padding: 12px 18px;
}

li.cat1 img {
    height: 22px;
    width: auto;
    opacity: 0.85;
    transition: opacity var(--transition);
}

li.cat1 a:hover img {
    opacity: 1;
}

/* Dropdown */
#menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-bg);
    min-width: 210px;
    list-style: none;
    z-index: 200;
    border-top: 2px solid var(--accent);
    box-shadow: var(--shadow-md);
}

#menu li:hover > ul {
    display: block;
}

#menu ul li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#menu ul li a {
    display: block;
    padding: 12px 20px;
    color: var(--nav-text);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: none;
    font-weight: 300;
    transition: background var(--transition), color var(--transition);
}

#menu ul li a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--nav-accent);
}

/* ── Mobile hamburger ───────────────────────────────────────── */
.show-menu {
    display: none;
    background: var(--nav-bg);
    color: var(--nav-text);
    text-align: center;
    padding: 16px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

input[type=checkbox]#show-menu {
    display: none;
}

/* ── Headings ───────────────────────────────────────────────── */
h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 300;
    letter-spacing: 0.03em;
    text-align: center;
    margin: var(--gap-lg) var(--gap-md) var(--gap-md);
    color: var(--text);
}

h2.standard {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    text-align: center;
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-sm);
    position: relative;
    display: block;
}

h2.standard::after {
    content: '';
    display: block;
    width: 48px;
    height: 1px;
    background: var(--accent);
    margin: var(--gap-sm) auto 0;
}

h3 {
    font-size: 1.35rem;
    font-weight: 400;
    margin-top: var(--gap-lg);
    margin-bottom: var(--gap-sm);
}

/* Year section headings in chronological gallery */
#gallery-container h4 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text);
    letter-spacing: 0.05em;
    text-align: center;
    margin: var(--gap-lg) 0 var(--gap-md);
    padding-bottom: var(--gap-xs);
    border-bottom: 1px solid var(--border);
}

/* ── Main container (galleries, selection page) ─────────────── */
#container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--gap-lg) var(--gap-md);
    text-align: center;
}

/* ── Prose / text pages ─────────────────────────────────────── */
div#textdiv {
    max-width: var(--prose-w);
    margin: 0 auto var(--gap-lg);
    padding: var(--gap-md) var(--gap-md) var(--gap-lg);
    text-align: left;
    font-size: 1rem;
    line-height: 1.85;
}

div#textdiv table {
    width: 100%;
    border-collapse: collapse;
}

div#textdiv td {
    padding: var(--gap-sm);
    vertical-align: top;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Text page images */
div#textdiv img {
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-sm);
}

/* Exhibition image pages (#img350 legacy div) */
#img350 {
    max-width: var(--prose-w);
    margin: 0 auto var(--gap-lg);
    padding: var(--gap-lg) var(--gap-md);
}

#img350 img {
    margin-bottom: var(--gap-md);
}

/* ── Gallery Grid ───────────────────────────────────────────── */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    margin-bottom: var(--gap-lg);
}

/* Passe-partout frame: white border around each image */
.gallery-grid a {
    display: block;
    flex-shrink: 0;
    background: #fff;
    padding: 9px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    transition: box-shadow var(--transition), transform var(--transition);
}

.gallery-grid a:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    transform: translateY(-2px);
}

/* Inner frame clips the image for the hover-scale effect */
.gallery-frame {
    overflow: hidden;
    display: block;
    position: relative;
}

.gallery-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background var(--transition);
}

.gallery-grid a:hover .gallery-frame::after {
    background: rgba(0,0,0,0.06);
}

.gallery-grid img {
    display: block;
    height: 180px;
    width: auto;
    max-width: 100%;
    transition: transform 0.4s ease;
}

.gallery-grid a:hover img {
    transform: scale(1.04);
}

/* ── Home Page ──────────────────────────────────────────────── */
#container > h1 {
    margin-bottom: var(--gap-md);
}

#showMenu {
    text-align: center;
    padding: 0;
}

#main-image-container {
    min-height: 360px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--gap-md);
}

#main-image-container img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition);
}

#main-image-container img:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

.thumbnails {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-top: var(--gap-md);
    padding-top: var(--gap-md);
    border-top: 1px solid var(--border);
}

.thumb-trigger {
    cursor: pointer;
    display: block;
    height: 70px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition), transform var(--transition);
    filter: grayscale(20%);
}

.thumb-trigger:hover {
    opacity: 1;
    transform: translateY(-3px);
    filter: grayscale(0%);
}

/* ── Hidden menu (index.html only) ─────────────────────────── */
#hiddenMenu {
    overflow: hidden;
    transition: opacity 0.9s ease, max-height 0.9s ease;
}

#hiddenMenu.hidden {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
}

#hiddenMenu.visible {
    opacity: 1;
    pointer-events: auto;
    max-height: 120px;
}

/* ── Gallery Selection Page ─────────────────────────────────── */
#exhibitions {
    display: flex;
    justify-content: center;
    gap: var(--gap-md);
    flex-wrap: wrap;
    margin: var(--gap-md) 0 0;
}

.button2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--gap-lg) var(--gap-md);
    background: var(--surface);
    border: 1px solid var(--border);
    width: 220px;
    text-align: center;
    text-decoration: none;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.button2:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.icons2 {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.button2:hover .icons2 {
    opacity: 0.85;
}

.buttontext2 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
}

/* ── Category Selection (galeriek.html) ─────────────────────── */
.category-overview-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap-sm);
    max-width: 720px;
    margin: 0 auto;
}

#container figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    text-align: center;
}

#container figure a {
    display: block;
    background: #fff;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16);
    transition: box-shadow var(--transition), transform var(--transition);
}

.cat-img-wrap {
    display: block;
    overflow: hidden;
}

#container figure a:hover {
    box-shadow: 0 5px 16px rgba(0,0,0,0.26);
    transform: translateY(-2px);
}

#container figure img {
    display: block;
    height: 110px;
    width: auto;
    transition: transform 0.4s ease;
    filter: grayscale(15%);
}

#container figure a:hover img {
    transform: scale(1.06);
    filter: grayscale(0%);
}

figcaption {
    margin-top: var(--gap-sm);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Exhibition List ────────────────────────────────────────── */
.exhibition-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exhibition-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: var(--gap-md) var(--gap-lg);
    text-align: left;
    transition: border-color var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-sm);
}

.exhibition-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.exhibition-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text);
    margin: 0;
    text-align: left;
}

.exhibition-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-xs);
    flex-shrink: 0;
}

.exhibition-links a {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 400;
    transition: all var(--transition);
    white-space: nowrap;
}

.exhibition-links a:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: transparent;
}

/* ── Floated figures (ubermich, info pages) ──────────────────── */
.floated-figure {
    height: auto;
    box-shadow: var(--shadow-sm);
    max-width: 35%;
}

.floated-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
}

.floated-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}


/* ── Neuigkeiten List (impressum.html) ──────────────────────── */
.neuigkeiten-list {
    list-style: none;
    padding: 0;
    margin-top: var(--gap-md);
}

.neuigkeiten-list > li {
    margin-bottom: var(--gap-md);
    line-height: 1.6;
}

.neuigkeiten-list strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* ── Horizontal Rule ────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--gap-lg) 0;
}

/* ── Utility ────────────────────────────────────────────────── */
.text-center {
    text-align: center;
}

/* ── Lightbox ───────────────────────────────────────────────── */
#imagelightbox {
    cursor: pointer;
    position: fixed;
    z-index: 10000;
    touch-action: none;
    box-shadow: var(--shadow-lg);
}

#imagelightbox-loading,
#imagelightbox-loading div {
    border-radius: 50%;
}

#imagelightbox-loading {
    width: 2.5em;
    height: 2.5em;
    background-color: rgba(0, 0, 0, .45);
    position: fixed;
    z-index: 10003;
    top: 50%;
    left: 50%;
    padding: 0.625em;
    margin: -1.25em 0 0 -1.25em;
    box-shadow: 0 0 2.5em rgba(0, 0, 0, .5);
}

#imagelightbox-loading div {
    width: 1.25em;
    height: 1.25em;
    background-color: #fff;
    animation: imagelightbox-loading .5s ease infinite;
}

@keyframes imagelightbox-loading {
    from { opacity: .5; transform: scale(.75); }
    50%  { opacity: 1;  transform: scale(1);   }
    to   { opacity: .5; transform: scale(.75); }
}

#imagelightbox-overlay {
    background-color: rgba(15, 14, 13, 0.96);
    position: fixed;
    z-index: 9998;
    inset: 0;
}

#imagelightbox-close {
    width: 44px;
    height: 44px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    position: fixed;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 10002;
    top: 28px;
    right: 28px;
    cursor: pointer;
    transition: background-color var(--transition);
}

#imagelightbox-close:hover {
    background-color: rgba(255,255,255,0.2);
}

#imagelightbox-close:before,
#imagelightbox-close:after {
    width: 1.5px;
    background-color: #fff;
    content: '';
    position: absolute;
    top: 22%;
    bottom: 22%;
    left: 50%;
    margin-left: -1px;
}

#imagelightbox-close:before { transform: rotate(45deg);  }
#imagelightbox-close:after  { transform: rotate(-45deg); }

#imagelightbox-caption {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-style: normal;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.82);
    background: transparent;
    text-align: center;
    position: fixed;
    z-index: 10001;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px var(--gap-lg) 28px;
}

.imagelightbox-arrow {
    width: 50px;
    height: 100px;
    background-color: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    display: none;
    position: fixed;
    z-index: 10001;
    top: 50%;
    margin-top: -50px;
    cursor: pointer;
    transition: background-color var(--transition);
}

.imagelightbox-arrow:hover {
    background-color: rgba(255,255,255,0.14);
}

.imagelightbox-arrow-left  { left: 20px;  }
.imagelightbox-arrow-right { right: 20px; }

.imagelightbox-arrow:before {
    width: 0;
    height: 0;
    border: 0.85em solid transparent;
    content: '';
    display: inline-block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.imagelightbox-arrow-left:before {
    border-left: none;
    border-right-color: rgba(255,255,255,0.6);
    left: 50%;
    margin-left: -4px;
}

.imagelightbox-arrow-right:before {
    border-right: none;
    border-left-color: rgba(255,255,255,0.6);
    right: 50%;
    margin-right: -4px;
}

#imagelightbox-loading,
#imagelightbox-overlay,
#imagelightbox-close,
#imagelightbox-caption,
.imagelightbox-arrow {
    animation: fade-in .2s ease;
}

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

/* ── Responsive — Tablet ────────────────────────────────────── */
@media screen and (max-width: 900px) {
    /* On mobile the nav expands vertically — 120px is not enough */
    #hiddenMenu.visible {
        max-height: 500px;
    }

    #menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    #menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    #menu > li > a {
        justify-content: center;
        padding: 14px 20px;
    }

    .show-menu {
        display: block;
    }

    input[type=checkbox]:checked ~ #menu {
        display: flex;
    }

    #menu ul {
        position: static;
        box-shadow: none;
        border-top: none;
        background-color: rgba(0,0,0,0.2);
    }

    #menu ul li a {
        padding-left: 32px;
    }

    h1 {
        font-size: 1.9rem;
    }

    h2.standard {
        font-size: 1.6rem;
    }

    .gallery-grid img {
        height: 140px;
    }

    .exhibition-card {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--gap-md);
    }

    div#textdiv {
        padding: var(--gap-md);
    }

    #container {
        padding: var(--gap-md);
    }

    .button2 {
        width: 160px;
        padding: var(--gap-md);
    }

    .floated-figure {
        max-width: 45%;
    }
}

/* ── Responsive — Mobile ────────────────────────────────────── */
@media screen and (max-width: 480px) {
    .gallery-grid img {
        height: 110px;
    }

    .gallery-grid {
        gap: 12px;
    }

    .gallery-grid a {
        padding: 6px;
    }

    #imagelightbox-close {
        top: 14px;
        right: 14px;
    }

    .imagelightbox-arrow {
        width: 36px;
        height: 70px;
        margin-top: -35px;
    }

    .imagelightbox-arrow-left  { left: 8px;  }
    .imagelightbox-arrow-right { right: 8px; }

    .category-overview-grid {
        max-width: 100%;
        gap: var(--gap-xs);
    }

    #container figure {
        width: 140px;
    }

    #container figure img {
        height: 90px;
    }

    .floated-figure {
        max-width: 55%;
    }
}
