/* WSC – AVS Antonov Verein Schweiz
 * One-pager design: sticky nav, hero, alternating sections, footer.
 */
@font-face {
    font-family: 'Source Sans 3 Variable';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../Fonts/source-sans-3-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
    --avs-blue: #1c3f6e;
    --avs-blue-dark: #122b4d;
    --avs-sky: #7fb2e5;
    --avs-gold: #ac8f53;
    --avs-sand: #f4efe6;
    --avs-text: #26303b;
    --avs-muted: #6b7684;
    --avs-max: 72rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 7.5rem;
}

body {
    margin: 0;
    font-family: 'Source Sans 3 Variable', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--avs-text);
    background: #fff;
    line-height: 1.6;
}

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

a {
    color: var(--avs-blue);
}

/* ---------- Navigation ---------- */
.avs-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 6px rgba(16, 34, 60, 0.12);
}

.avs-nav__inner {
    max-width: var(--avs-max);
    margin: 0 auto;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.avs-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-right: auto;
}

.avs-nav__brand-abbr {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--avs-blue);
}

.avs-nav__brand-logo {
    height: 5.5rem;
    width: auto;
    border-radius: 50%;
}

.avs-nav__brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--avs-blue);
}

.avs-nav__menu {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.avs-nav__menu a {
    text-decoration: none;
    color: var(--avs-text);
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.avs-nav__menu a:hover,
.avs-nav__menu a.is-active {
    text-decoration: underline;
    text-decoration-color: var(--avs-gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.avs-nav__menu a.is-active {
    font-weight: 600;
}

.avs-nav__toggle,
.avs-nav__toggle-input {
    display: none;
}

@media (max-width: 52rem) {
    .avs-nav__brand-name {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .avs-nav__brand-logo {
        height: 3rem;
    }

    html {
        scroll-padding-top: 4.5rem;
    }

    .avs-nav__toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 0.5rem;
    }

    .avs-nav__toggle span {
        width: 22px;
        height: 2px;
        background: var(--avs-blue);
        display: block;
    }

    .avs-nav__menu {
        display: none;
        width: 100%;
        flex-direction: column;
    }

    .avs-nav__toggle-input:checked ~ .avs-nav__menu {
        display: flex;
    }
}

/* ---------- Hero ---------- */
.avs-hero {
    position: relative;
    min-height: min(78vh, 44rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(160deg, var(--avs-blue) 0%, var(--avs-blue-dark) 100%);
}

.avs-hero__media,
.avs-hero__media img,
.avs-hero__media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* video fades in over the poster image once it actually plays */
.avs-hero__video {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.avs-hero__video.is-playing {
    opacity: 1;
}

.avs-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 24, 44, 0.25) 0%, rgba(12, 24, 44, 0.65) 100%);
}

.avs-hero__content {
    position: relative;
    text-align: center;
    color: #fff;
    padding: 4rem 1.25rem;
    max-width: 46rem;
}

.avs-hero__headline {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.15;
    margin: 0 0 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.avs-hero__subheadline {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    margin: 0 0 1.75rem;
    color: #e5edf7;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.avs-hero__cta {
    display: inline-block;
    background: #fff;
    color: var(--avs-blue);
    font-weight: 700;
    text-decoration: none;
    padding: 0.85rem 1.75rem;
    border-radius: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.avs-hero__cta:hover {
    transform: translateY(-2px);
    background-color: var(--avs-gold);
    color: #fff;
}

/* ---------- Sections ---------- */
.avs-section {
    padding: 3.5rem 1rem;
}

.avs-section:nth-of-type(even) {
    background: var(--avs-sand);
}

.avs-section__inner {
    max-width: var(--avs-max);
    margin: 0 auto;
}

.avs-section__title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: var(--avs-blue);
    margin: 0 0 1.5rem;
    position: relative;
    padding-bottom: 0.6rem;
}

.avs-section__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 4rem;
    height: 4px;
    border-radius: 2px;
    background: var(--avs-gold);
}

.avs-section h3 {
    color: var(--avs-blue);
    margin-top: 2rem;
}

/* Content element spacing inside sections */
.avs-section .frame {
    margin-bottom: 1.5rem;
}

/* Tables (technical data, prices) */
.avs-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 2rem;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(16, 34, 60, 0.1);
}

.avs-main table td,
.avs-main table th {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #e8ecf1;
    text-align: left;
    vertical-align: top;
}

.avs-main table tr:last-child td {
    border-bottom: 0;
}

.avs-main table td:first-child {
    font-weight: 600;
    color: var(--avs-blue);
    white-space: nowrap;
}

/* Buttons in content */
.avs-btn {
    display: inline-block;
    background: var(--avs-blue);
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
    border-radius: 2rem;
    transition: background 0.15s ease;
}

.avs-btn:hover {
    background: var(--avs-gold);
    color: #fff !important;
}

/* Slightly smaller buttons inside the narrow Flugzeuge text columns;
   margins let two adjacent buttons sit apart and wrap nicely */
#flugzeuge .ce-bodytext .avs-btn {
    margin: 0.25rem 0.75rem 0.25rem 0;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
}

/* Termine: two columns — booking text left, film right */
#termine .avs-section__inner {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 2.5rem;
    align-items: start;
}

#termine .avs-section__title {
    grid-column: 1 / -1;
}

#termine .frame {
    margin-bottom: 0;
}

@media (max-width: 52rem) {
    #termine .avs-section__inner {
        grid-template-columns: 1fr;
        row-gap: 2rem;
    }
}

/* Termine film: clickable poster, compact — roughly the height of the text column */
#termine .wsc-video-poster img,
#termine .ce-gallery video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 26rem;
    margin: 0 auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(16, 34, 60, 0.18);
}

/* Video poster link with play badge */
.wsc-video-poster {
    position: relative;
    display: block;
    width: fit-content;
    margin: 0 auto;
}

.wsc-video-poster__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(18, 43, 77, 0.75);
    transition: background 0.15s ease, transform 0.15s ease;
}

.wsc-video-poster__play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.7rem 0 0.7rem 1.15rem;
    border-color: transparent transparent transparent #fff;
}

.wsc-video-poster:hover .wsc-video-poster__play {
    background: var(--avs-gold);
    transform: translate(-50%, -50%) scale(1.08);
}

.wsc-video-poster__label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0.9rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Lightbox video sizing (matches the image constraints) */
.wsc-lightbox__video {
    max-width: 92vw;
    max-height: 84vh;
    border-radius: 0.25rem;
}

/* breathing room above the gallery button in the text column */
#termine .ce-bodytext .avs-btn {
    margin-top: 1.75rem;
}

/* Two-column text+image content elements (textmedia "beside text, no wrap") */
.avs-section .ce-textpic.ce-intext.ce-nowrap {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2rem;
    align-items: start;
}

.avs-section .ce-textpic.ce-intext.ce-nowrap .ce-gallery {
    margin: 0;
}

.avs-section .ce-textpic.ce-left.ce-intext.ce-nowrap {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.avs-section .ce-textpic.ce-left.ce-intext.ce-nowrap .ce-gallery {
    order: -1;
}

.avs-section .ce-gallery figure.image {
    margin: 0;
}

.avs-section .ce-gallery img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(16, 34, 60, 0.18);
}

.avs-section .image-caption {
    font-size: 0.85rem;
    color: var(--avs-muted);
    margin-top: 0.5rem;
    text-align: center;
}

#bild-des-monats .image-caption {
    font-size: 1.05rem;
}

/* Full-width image band (e.g. Bild des Monats) */
.avs-section .ce-image.ce-above .ce-gallery {
    margin: 0;
}

.avs-section .ce-image.ce-above img {
    width: 100%;
    height: auto;
}

@media (max-width: 52rem) {
    .avs-section .ce-textpic.ce-intext.ce-nowrap,
    .avs-section .ce-textpic.ce-left.ce-intext.ce-nowrap {
        grid-template-columns: 1fr;
    }

    .avs-section .ce-textpic.ce-left.ce-intext.ce-nowrap .ce-gallery {
        order: 0;
    }
}

/* Verein section: club logo beside text — narrow image column, round crop */
#verein .ce-textpic.ce-left.ce-intext.ce-nowrap {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    align-items: start;
}

#verein .ce-gallery img {
    border-radius: 50%;
    box-shadow: none;
}

@media (max-width: 52rem) {
    #verein .ce-textpic.ce-left.ce-intext.ce-nowrap {
        grid-template-columns: 1fr;
    }

    #verein .ce-gallery {
        max-width: 14rem;
        margin: 0 auto;
    }
}

/* Flugzeuge section: two equal columns, one aircraft per column.
   Editor-proof layout: relies only on the stable TYPO3 frame skeleton
   (header + ce-textpic > ce-gallery / ce-bodytext) — never on hand-authored
   markup inside the RTE bodytext. Only ce-textpic is dissolved
   (display: contents) so gallery and bodytext become flex siblings of the
   header, allowing image → headline → text order. The grid stretches both
   frames to equal height; margin-top:auto pushes each tech-data table
   (the last bodytext block, bare <table> or CKEditor figure.table alike)
   to the column bottom, so both tables align. */
#flugzeuge .avs-section__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
    align-items: stretch;
}

#flugzeuge .avs-section__title {
    grid-column: 1 / -1;
}

#flugzeuge .frame {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#flugzeuge .frame .ce-textpic.ce-center.ce-above {
    display: contents;
}

#flugzeuge .frame .ce-gallery {
    order: 1;
    margin: 0 0 1.25rem;
}

#flugzeuge .frame > header {
    order: 2;
}

#flugzeuge .frame > header h3 {
    margin: 0 0 0.5rem;
}

#flugzeuge .frame .ce-bodytext {
    order: 3;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#flugzeuge .ce-bodytext > p {
    margin: 0 0 1rem;
}

/* The tech-data table is the last bodytext block; margin-top:auto sinks it
   to the bottom of the equal-height columns. Matches both a bare <table>
   and CKEditor's <figure class="table"> wrapper. */
#flugzeuge .ce-bodytext > table,
#flugzeuge .ce-bodytext > figure.table {
    margin: auto 0 0;
}

#flugzeuge .ce-bodytext > figure.table > table {
    margin: 0;
}

/* Identical image size in both columns: uniform 4:3 frame, photos may crop slightly */
#flugzeuge .ce-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

@media (max-width: 52rem) {
    /* One column, natural flow: the frames keep their internal
       image → headline → text → table flex order; margin-top:auto is inert
       because the frame is no longer stretched. */
    #flugzeuge .avs-section__inner {
        grid-template-columns: 1fr;
        row-gap: 2rem;
    }
}

/* Shop section: three columns — two books (cover on top), then Boutique */
#shop .avs-section__inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

#shop .avs-section__title {
    grid-column: 1 / -1;
}

/* Category group headings: «Bücher» spans the two book columns, «Boutique» the third */
#shop .avs-section__inner > .frame-type-header:first-of-type {
    grid-column: 1 / 3;
}

#shop .avs-section__inner > .frame-type-header + .frame-type-header {
    grid-column: 3;
}

#shop .frame-type-header {
    margin-bottom: 0;
}

#shop .frame-type-header h3 {
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--avs-blue);
}

#shop .frame {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

#shop .frame .ce-textpic.ce-center.ce-above {
    display: contents;
}

#shop .frame .ce-gallery {
    order: 1;
    margin: 0 0 1.25rem;
}

#shop .frame > header {
    order: 2;
}

#shop .frame > header h3 {
    margin-top: 0;
}

#shop .frame .ce-bodytext {
    order: 3;
}

/* Book covers: same visual size despite different aspect ratios (no cropping) */
#shop .ce-gallery img {
    height: 17rem;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 60rem) {
    #shop .avs-section__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* reset the desktop column pinning of the two group headers —
       a pinned grid-column: 3 would otherwise force implicit columns */
    #shop .avs-section__inner > .frame-type-header:first-of-type,
    #shop .avs-section__inner > .frame-type-header + .frame-type-header {
        grid-column: auto;
    }

    /* stacked order: Bücher heading → both books → Boutique heading → boutique content */
    #shop .avs-section__inner > .frame-type-header:first-of-type {
        order: 1;
    }

    #shop .avs-section__inner > .frame-type-textmedia {
        order: 2;
    }

    #shop .avs-section__inner > .frame-type-header + .frame-type-header {
        order: 3;
    }

    #shop .avs-section__inner > .frame-type-text {
        order: 4;
    }

    #shop .ce-gallery img {
        height: 14rem;
    }
}

/* ---------- Kontakt section: three columns (address / contact / links) ---------- */
#kontakt .avs-section__inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 2rem;
}

#kontakt .avs-section__title {
    grid-column: 1 / -1;
}

#kontakt .frame {
    margin-bottom: 0;
}

@media (max-width: 52rem) {
    #kontakt .avs-section__inner {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
    }
}

/* Two-column info layout helper */
.avs-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 2rem;
}

/* ---------- Footer ---------- */
.avs-footer {
    background: var(--avs-blue-dark);
    color: #cfdae8;
    margin-top: 0;
}

.avs-footer a {
    color: #fff;
}

.avs-footer__legal {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: #8ba0bb;
}

/* ---------- Gallery page adjustments ---------- */
.avs-main {
    min-height: 50vh;
}

/* ---------- Viewport blend-in (reveal.js) ----------
   html.js-reveal is only set by JS when IntersectionObserver is available;
   without it, nothing is hidden. Keep the effect subtle. */
html.js-reveal .reveal-init {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js-reveal .reveal-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js-reveal .reveal-init,
    html.js-reveal .reveal-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
