/* ============================================================
   Tambourkorps Hengsbeck — main stylesheet

   The full logo SVG (with its embedded resize script) is loaded
   via <object> as a fixed full-viewport frame. The actual page
   content sits on top, padded to clear the J-frame edges.

   Brand colors (already in the SVG itself):
     #006633  HENGSBECK text (green)
     #666666  TAMBOURKORPS text + emblem
     #808080  "seit 1925" script
     #000000  J-frame banner
   ============================================================ */

:root {
    --green:        #006633;
    --green-dark:   #004d26;
    --green-light:  #e8f2ec;
    --grey:         #666666;
    --grey-light:   #f5f5f5;
    --text:         #222222;
    --white:        #ffffff;

    --font-serif:   Georgia, 'Times New Roman', Times, serif;
    --font-sans:    system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

    --max-content:  900px;

    /* Padding to keep page content clear of the J-frame edges.
       The SVG's logical frame area (in its 438×509 viewBox at the
       native size) reserves the top 48px for the bar+offset and the
       right 48px for the vertical, with a 214px bottom-right curve.
       Since the SVG scales to viewport, these padding values are
       approximate — they keep content visually clear. */
    /* Overall logo zoom — change this to scale the WHOLE pennant
       (frame + text + emblem + seit 1925) uniformly. */
    --logo-zoom: 0.55;

    --frame-top:    50px;
    --frame-right:  180px;   /* room for the emblem+text on the right (after zoom) */
    --frame-bottom: 70px;
    --frame-left:   24px;
}

/* ── Reset ───────────────────────────────────────────────── */

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

html { font-size: 16px; height: 100%; }

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    min-height: 100%;
    position: relative;
}

/* ── Page frame (the logo SVG) ───────────────────────────── */

/* The logo SVG, applied as a fixed full-viewport frame.
   Demo pattern: container is sized larger than viewport, then scaled
   down via CSS transform. This shrinks the WHOLE logo (frame + content
   + seit 1925) uniformly. */
.page-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100vw / var(--logo-zoom));
    height: calc(100vh / var(--logo-zoom));
    transform: scale(var(--logo-zoom));
    transform-origin: top left;
    pointer-events: none;
    z-index: 0;
}

/* The <object> element has no intrinsic block formatting; the SVG
   inside fills it. */

/* ── Page content layer ──────────────────────────────────── */

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left);
    display: flex;
    flex-direction: column;
}

/* ── Typography ──────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    line-height: 1.25;
    color: var(--text);
}

h1 { font-size: 2rem;    color: var(--green); margin-bottom: 1rem; }
h2 { font-size: 1.5rem;  margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p  { margin-bottom: 1rem; }

a  { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--green-dark); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

/* ── Header & navigation ─────────────────────────────────── */

.site-header {
    padding: 1rem 0 2rem;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.main-nav a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--green);
    background: var(--green-light);
    text-decoration: none;
}

/* ── Submenu (Wir → …) ───────────────────────────────────── */
.main-nav .has-submenu {
    position: relative;
}

.main-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--grey-light);
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    padding: 0.25rem;
    z-index: 20;
    gap: 0;
}

.main-nav .has-submenu:hover > .submenu,
.main-nav .has-submenu:focus-within > .submenu {
    display: flex;
}

.main-nav .submenu a {
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ── Main content ────────────────────────────────────────── */

.site-main {
    flex: 1;
    padding: 1rem 0;
}

.main-inner {
    max-width: var(--max-content);
    margin: 0 auto;
}

/* Inhaltsbilder responsiv halten (Vorstand-Portraits haben eigene Größe) */
.main-inner img:not(.vorstand-photo) {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 4px;
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
    padding: 1.5rem 0 0;
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--grey);
    border-top: 1px solid var(--grey-light);
}

.footer-name {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--green);
}

.footer-nav {
    display: flex;
    gap: 1rem;
}

.footer-nav a {
    color: var(--grey);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--green);
    text-decoration: underline;
}

.footer-copy { margin-left: auto; }

/* ── Responsive ──────────────────────────────────────────── */

/* Tablet / kleinere Desktops */
@media (max-width: 1024px) {
    :root {
        --logo-zoom:    0.45;
        --frame-top:    45px;
        --frame-right:  140px;
        --frame-bottom: 65px;
        --frame-left:   20px;
    }
}

/* Smartphone */
@media (max-width: 700px) {
    :root {
        --logo-zoom:    0.32;
        --frame-top:    36px;
        --frame-right:  90px;
        --frame-bottom: 55px;
        --frame-left:   16px;
    }

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

    #nav-list.open {
        display: flex;
    }

    /* Submenus expand inline (accordion) on mobile, indented */
    .main-nav .submenu {
        display: flex;
        position: static;
        border: none;
        box-shadow: none;
        min-width: 0;
        padding: 0 0 0 1rem;
        background: transparent;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Sehr schmale Smartphones (< 380px) */
@media (max-width: 380px) {
    :root {
        --logo-zoom:    0.26;
        --frame-right:  70px;
    }
}

/* ============================================================
   Vorstand — Mitglieder-Raster
   ============================================================ */
.vorstand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 2.5rem;
}

.vorstand-member {
    text-align: center;
}

.vorstand-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--green-light);
    margin: 0 auto 0.6rem;
    display: block;
}

.vorstand-role {
    color: var(--grey);
    font-size: 0.9rem;
    margin: 0;
}

.vorstand-name {
    color: var(--green);
    font-weight: 700;
    margin: 0.1rem 0 0;
}

/* ============================================================
   Blog / Aktuelles
   ============================================================ */
.page-title {
    color: var(--green);
    margin-bottom: 1rem;
}

.blog-intro {
    margin-bottom: 1.5rem;
    color: var(--grey);
}

/* Post-Liste */
.post-list {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.post-card {
    display: flex;
    gap: 1.25rem;
    border: 1px solid var(--grey-light);
    border-radius: 6px;
    overflow: hidden;
    background: var(--white);
}

.post-card-media {
    flex: 0 0 220px;
    display: block;
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--grey);
    margin-bottom: 0.4rem;
}

.post-cat {
    background: var(--green-light);
    color: var(--green-dark);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

.post-card-title {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.post-card-title a {
    color: var(--text);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--green);
}

.post-card-summary {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.post-card-more {
    margin-top: auto;
    align-self: flex-start;
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}

.post-card-more:hover {
    text-decoration: underline;
}

/* Einzelner Beitrag */
.post-single .post-title {
    color: var(--green);
    margin: 0.3rem 0 1rem;
}

.post-single .post-meta {
    font-size: 0.85rem;
}

.post-back {
    margin-top: 2rem;
}

.post-back a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}

/* Startseite / Jugend-Teaser Überschriften */
.section-heading {
    color: var(--green);
    border-top: 1px solid var(--grey-light);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.pagination .page-list {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination a,
.pagination .current {
    display: block;
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--green);
    border: 1px solid var(--grey-light);
}

.pagination .current {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.pagination .page-prev,
.pagination .page-next {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 700px) {
    .post-card {
        flex-direction: column;
    }
    .post-card-media {
        flex-basis: auto;
        max-height: 200px;
    }
}
