/* =========================================================
   Base variables
   ========================================================= */
:root {
    --container: 72rem;
    --content-width: 60rem;

    --text: #222;
    --muted: #666;
    --border: #ddd;
    --bg: #f6f6f6;
    --bg-header: #fff;

    --font-size-body: 1.125rem;
    --font-size-small: 0.95rem;
    --font-size-h1: 3rem;
    --font-size-h2: 2.5rem;
    --font-size-h3: 1.5rem;
    --font-size-h4: 1.125rem;

    --line-height-body: 1.7;
    --line-height-heading: 1.2;
}

/* =========================================================
   Fonts
   ---------------------------------------------------------
   Self-hosted Inconsolata font used across the site.
   ========================================================= */
@font-face {
    font-family: "Inconsolata";
    src: url("/fonts/Inconsolata-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inconsolata";
    src: url("/fonts/Inconsolata-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   Reset and global defaults
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inconsolata", monospace;
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    color: var(--text);
    background: var(--bg);
}

h1,
h2,
h3,
h4 {
    line-height: var(--line-height-heading);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: var(--font-size-h4);
}

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

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

/* =========================================================
   Layout
   ========================================================= */
.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

main {
    padding: 3rem 0;
}

/* =========================================================
   Site header and footer
   ========================================================= */
.site-header {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
}

.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.site-nav,
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.site-nav a,
.site-footer a {
    text-decoration: none;
}

.site-nav,
.site-footer,
.site-footer nav {
    font-size: var(--font-size-small);
}

/* =========================================================
   Navigation states
   ========================================================= */
.site-nav a {
    display: inline-block;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition:
            color 0.2s ease,
            border-color 0.2s ease,
            opacity 0.2s ease;
}

.site-nav a:hover {
    border-bottom-color: var(--text);
    opacity: 0.75;
}

.site-nav a.is-active {
    font-weight: 700;
    border-bottom-color: var(--text);
}

.site-footer a:hover {
    text-decoration: underline;
}

/* =========================================================
   Generic page content
   ========================================================= */
.page-header {
    margin-bottom: 1.5rem;
}

.page-content {
    max-width: var(--content-width);
}

.page-content h2,
.page-content h3,
.page-content h4 {
    margin-top: 2rem;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    margin-bottom: 0.75rem;
}

.page-content p,
.page-content ul,
.page-content ol {
    margin-bottom: 1rem;
}

.page-content img {
    display: block;
    margin: 1rem 0;
}

.page-content a,
.member-card-footer a,
.site-footer a {
    text-underline-offset: 0.15em;
}

/* =========================================================
   Image-text content blocks
   ---------------------------------------------------------
   Reusable inline image + text layout for content pages.
   ========================================================= */
.image-text {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin: 2rem 0;
}

.image-text--right {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
}

.image-text--right .image-text-media {
    order: 2;
}

.image-text--right .image-text-content {
    order: 1;
}

.image-text-media img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
}

.image-text-content > *:first-child {
    margin-top: 0;
}

.image-text-content > *:last-child {
    margin-bottom: 0;
}

/* =========================================================
   Cards grid
   ---------------------------------------------------------
   Reusable card grid with image, title and text.
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
}

.card-media {
    padding: 1rem;
}

.card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: var(--bg);
}

.card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 1rem 1rem;
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: var(--font-size-h4);
}

.card-text {
    font-size: var(--font-size-small);
}

.card-text > *:first-child {
    margin-top: 0;
}

.card-text > *:last-child {
    margin-bottom: 0;
}

/* =========================================================
   Timeline
   ---------------------------------------------------------
   Chronological content with alternating entries on desktop
   and single-column layout on mobile.
   ========================================================= */
.timeline {
    position: relative;
    max-width: 1100px;
    margin: 3rem 0;
    padding: 0.5rem 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--border);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 2.25rem 2.5rem;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 1.4rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    z-index: 2;
}

.timeline-item:nth-child(odd)::before {
    right: -6px;
}

.timeline-item:nth-child(even)::before {
    left: -6px;
}

.timeline-content {
    position: relative;
    background: var(--bg-header);
    border: 1px solid var(--border);
    padding: 1.4rem 1.5rem 1.25rem;
}

.timeline-year {
    display: inline-block;
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.timeline-text {
    font-size: var(--font-size-small);
}

.timeline-text > *:first-child {
    margin-top: 0;
}

.timeline-text > *:last-child {
    margin-bottom: 0;
}

/* =========================================================
   Homepage sections
   ========================================================= */
.home-hero,
.home-intro {
    max-width: var(--content-width);
}


.home-intro {
    padding-bottom: 1rem;
}

.home-intro h1 {
    margin-top: 0;
}

.kuratorium,
.gallery-section {
    margin-top: 3rem;
}

/* =========================================================
   Homepage hero
   ---------------------------------------------------------
   Intro section with title and animated tagline.
   ========================================================= */
.home-hero {
    padding-bottom: 1rem;
}

.home-hero h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.home-hero-tagline {
    margin: 0;
    font-size: var(--font-size-h3);
    color: var(--muted);
}

.typing-cursor {
    display: inline-block;
    margin-left: 0.1em;
    animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
    0%,
    50% {
        opacity: 1;
    }

    50.01%,
    100% {
        opacity: 0;
    }
}

/* =========================================================
   Kuratorium
   ========================================================= */
.kuratorium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.member-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
}

.member-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.member-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem;
}

.member-card-body {
    flex: 1;
}

.member-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.member-role {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.member-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.member-card-footer a {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
}

.member-card-footer a:hover {
    text-decoration: underline;
}

/* =========================================================
   Gallery
   ========================================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* =========================================================
   Lightbox
   ========================================================= */
body.lightbox-open {
    overflow: hidden;
}

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    width: min(90vw, 1000px);
    max-height: 90vh;
    margin: 5vh auto;
    padding: 0;
}

.lightbox-content img {
    display: block;
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    background: var(--bg);
}

.lightbox-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--bg);
    color: #000;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   Responsive rules
   ========================================================= */
@media (max-width: 900px) {
    :root {
        --font-size-body: 1rem;
        --font-size-h1: 2rem;
        --font-size-h2: 1.5rem;
        --font-size-h3: 1.25rem;
        --font-size-h4: 1.125rem;
    }

    main {
        padding: 2rem 0;
    }

    .kuratorium-grid,
    .gallery-grid,
    .image-text,
    .image-text--right,
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .image-text--right .image-text-media,
    .image-text--right .image-text-content {
        order: initial;
    }

    .timeline {
        margin: 2rem 0;
    }

    .timeline::before {
        left: 0.9rem;
        transform: none;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding: 0 0 1.5rem 2.5rem;
    }

    .timeline-item::before {
        top: 1.35rem;
        left: 0.55rem !important;
        right: auto !important;
    }

    .timeline-content {
        padding: 1.2rem 1.25rem 1.1rem;
    }
}
