/* ── Hamburger toggle elements ──────────────────────────────
   The checkbox drives open/close; the label is the visible button.
   Both are hidden on desktop (> 1400px).
─────────────────────────────────────────────────────────── */

.menu-checkbox {
    display: none;              /* never rendered — only drives :checked state */
}

.menu-hamburger {
    display: none;              /* hidden on desktop, shown in media query below */
}


/* ════════════════════════════════════════════════════════════
   BREAKPOINT 1: ≤ 1400px
   Menu starts colliding with page content here, so switch to
   the hamburger layout while keeping desktop content widths.
════════════════════════════════════════════════════════════ */

@media (max-width: 1400px) {

    /* Remove the desktop pull-up that was needed for the side menu */
    .page-container {
        transform: none;
        margin-bottom: 80px;
    }

    /* ── Hamburger menu ──────────────────────────────────── */

    .menu {
        position: fixed;
        top: 14px;
        right: 14px;
        left: auto;
        margin-left: 0;
        z-index: 1000;
        background: rgba(255, 253, 246, 0.97);
        border: 1px solid rgba(217, 146, 25, 0.3);
        border-radius: 10px;
        box-shadow: 0 3px 18px rgba(0, 0, 0, 0.14);
        padding: 11px 14px;
        max-width: 82vw;
    }

    /* Show the label as the toggle button */
    .menu-hamburger {
        display: block;
        cursor: pointer;
        text-align: right;
        user-select: none;
        line-height: 1;
    }

    /* ☰ icon — shown when menu is closed */
    .menu-hamburger::after {
        content: '☰';
        font-size: 26px;
        color: rgb(217, 146, 25);
    }

    /* ✕ icon — shown when checkbox is checked (menu open) */
    .menu-checkbox:checked + .menu-hamburger::after {
        content: '✕';
    }

    /* Nav list hidden by default */
    .menu > ul {
        display: none;
        padding-left: 0;
        margin: 10px 0 0 0;
        max-height: 72vh;
        overflow-y: auto;
    }

    /* Show nav list when checkbox is checked */
    .menu-checkbox:checked ~ ul {
        display: block;
    }

    /* Sub-items (nested ul) always visible once parent ul is open */
    .menu ul ul {
        display: block;
        padding-left: 18px;
    }

    .menu ul li {
        margin-bottom: 8px;
    }

    .menu ul li a {
        font-size: 15px;
    }

    /* Remove old ::before hamburger icon (no longer needed) */
    .menu::before {
        content: none;
        display: none;
    }

}


/* ════════════════════════════════════════════════════════════
   BREAKPOINT 2: ≤ 768px
   Full mobile layout: content width, padding, font sizes,
   tables, images, cover grid.
════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Layout ──────────────────────────────────────────── */

    .page-container {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 0 24px 0 35px;    /* extra left padding to clear the decorative border */
    }

    /* ── Decorative border ───────────────────────────────── */

    .extra-border {
        width: 89%;
        top: -40px;
        
        bottom: 0;
    }

    .extra1 {
        transform: translateX(8px) translateY(14px);
    }

    .extra2 {
        transform: translateX(17px) translateY(5px);
    }


    /* ── Cover section ───────────────────────────────────── */

    .cover {
        margin-top: 55px;
    }

    .imgwrapper {
        margin: 20px 0;
        display: flex;
        justify-content: center;
        gap: 6px;
    }

    /* Show only the first 4 images per row (c1–c4, c8–c11) */
    .c5, .c6, .c7,
    .c12, .c13, .c14 {
        display: none;
    }

    .coverimg {
        flex: 1;
        max-width: 90px;
        height: 72px;
        margin: 0;
    }

    .abstract {
        line-height: 26px;
        font-size: 15px;
    }


    /* ── Apply button ────────────────────────────────────── */

    .apply-button {
        width: auto;
        max-width: 240px;
        font-size: 16px;
    }


    /* ── Headings ────────────────────────────────────────── */

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 18px;
    }

    h4 {
        font-size: 27px;
        margin-top: 60px;
    }

    h5 {
        font-size: 21px;
        margin-top: 40px;
    }

    p, ul, li, td, th {
        font-size: 14px;
        line-height: 24px;
    }

    .abstract {
        font-size: 15px;
        line-height: 26px;
    }


    /* ── Tables (schedule / timetable) ──────────────────── */

    .timetable {
        width: 100%;
    }

    .timetable tr {
        display: block;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e0ddd5;
    }

    .timetable th {
        display: block;
        text-wrap: wrap;
        padding-right: 0;
        padding-bottom: 4px;
        font-weight: 600;
    }

    .timetable td {
        display: block;
        padding-bottom: 6px;
    }


    /* ── Philosopher & book list ─────────────────────────── */

    .philosophenliste tr,
    .buchliste tr {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
        border-bottom: 1px solid #e0ddd5;
        padding-bottom: 24px;
        margin-bottom: 10px;
    }

    .philosophenliste th,
    .buchliste th {
        display: block;
        padding-right: 0;
        flex-shrink: 0;
    }

    .philosophenliste td,
    .buchliste td {
        display: block;
        padding-bottom: 0;
    }

    .pimage {
        width: 72px;
    }

    .buchliste img {
        width: 75px;
        margin-bottom: 0;
    }


    /* ── iframe map ──────────────────────────────────────── */

    iframe {
        height: 300px;
    }


    /* ── Section separator ───────────────────────────────── */

    .anhang-seperator {
        margin: 90px 0;
    }

    .anhang-seperator div {
        width: 200px;
    }

    /* ── Bewerbungsformular ──────────────────────────────── */

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .geburtsdatum-row {
        gap: 8px;
    }

    .bew-form input[type="text"],
    .bew-form input[type="email"],
    .bew-form input[type="number"],
    .bew-form select,
    .bew-form textarea {
        font-size: 16px; /* prevents iOS auto-zoom on focus */
    }

    .checkbox-item,
    .radio-item {
        font-size: 14px;
    }

}
