/* Gemeinsame Handy-Optimierung – bewusst zuletzt eingebunden. */
@media (max-width: 700px) {
    html {
        font-size: 17px;
        scroll-padding-top: 5.25rem;
    }

    body {
        line-height: 1.65;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(9, 18, 42, 0.34);
        backdrop-filter: blur(2px);
    }

    .container {
        width: min(100% - 1.25rem, var(--container-width));
    }

    .section {
        padding: 2.75rem 0;
    }

    .section-heading {
        margin-bottom: 1.6rem;
    }

    .section-heading h2 {
        font-size: clamp(2rem, 9vw, 2.65rem);
    }

    main h1 {
        font-size: clamp(2.35rem, 11vw, 3.25rem);
        line-height: 1.02;
        overflow-wrap: anywhere;
    }

    main h2,
    main h3 {
        overflow-wrap: anywhere;
    }

    .site-header,
    html.site-preload .site-header {
        min-height: 4.9rem;
    }

    .header-inner {
        min-height: 4.9rem;
        gap: 0.75rem;
    }

    .brand {
        gap: 0.7rem;
    }

    .brand-logo {
        width: 3.25rem;
        height: 3.25rem;
    }

    .brand-text {
        font-size: 1.15rem;
        white-space: nowrap;
    }

    .nav-toggle {
        min-width: 3.25rem;
        min-height: 3.25rem;
        padding: 0.55rem 0.8rem;
        touch-action: manipulation;
    }

    .nav-toggle-label {
        font-size: 1rem;
    }

    .site-nav {
        position: fixed;
        z-index: 61;
        top: 5.35rem;
        right: 0.65rem;
        left: 0.65rem;
        max-height: calc(100dvh - 6rem);
        overflow-y: auto;
        padding: 0.55rem;
        border-radius: 1.3rem;
        box-shadow: 0 24px 65px rgba(9, 18, 42, 0.25);
    }

    .nav-list {
        gap: 0;
    }

    .nav-list > li {
        width: 100%;
    }

    .nav-list > li:not(:last-child) {
        border-bottom: 1px solid rgba(13, 24, 54, 0.08);
    }

    .nav-list a {
        width: 100%;
        min-height: 3.3rem;
        padding: 0.75rem 0.85rem;
        border-radius: 0.8rem;
        font-size: 1.04rem;
        line-height: 1.25;
        touch-action: manipulation;
    }

    .nav-list a:hover,
    .nav-list a:focus-visible,
    .nav-list a.is-active {
        background: rgba(234, 122, 24, 0.09);
    }

    .button,
    button.button {
        min-height: 3.25rem;
        padding: 0.85rem 1.15rem;
        font-size: 1rem;
        touch-action: manipulation;
    }

    .text-link {
        min-height: 2.75rem;
        align-items: center;
    }

    .tag {
        min-height: 2.2rem;
        padding-inline: 0.75rem;
        font-size: 0.88rem;
    }

    main input:not([type="checkbox"]):not([type="radio"]),
    main select {
        min-height: 3.5rem;
        font-size: 1rem;
    }

    main textarea {
        min-height: 9rem;
        font-size: 1rem;
    }

    .feature-card,
    .promo-banner,
    .person-card,
    .quote-card,
    .vyp-form-card,
    .card-info-box,
    .study-overview-card,
    .about-overview-card {
        border-radius: 1.4rem;
    }

    .feature-card__content,
    .promo-banner,
    .quote-card,
    .person-card__body {
        padding: 1.25rem;
    }

    .feature-card__content h3,
    .person-card__body h3 {
        font-size: 1.25rem;
    }

    .promo-banner__actions,
    .promo-banner__actions .button {
        width: 100%;
    }

    .hero-section,
    .medien-hero,
    .exam-hero,
    .lva-hero,
    .study-overview-hero,
    .about-overview-hero,
    .team-hero,
    .about-hero,
    .card-hero,
    .events-hero,
    .vyp-hero,
    .erreicht-hero,
    .legal-hero {
        padding-top: 2.75rem;
        padding-bottom: 2.5rem;
    }

    .hero-grid,
    .exam-hero__grid,
    .lva-hero__grid,
    .card-hero__grid,
    .about-hero__grid {
        gap: 1.75rem;
    }

    .hero-text,
    .medien-hero__text,
    .exam-hero__text,
    .events-hero__text,
    .vyp-hero__text,
    .team-hero__text,
    .about-overview-hero__text,
    .card-hero__lead {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .hero-actions,
    .exam-hero__actions,
    .card-hero__actions,
    .about-hero__actions {
        gap: 0.7rem;
    }

    .hero-actions .button,
    .exam-hero__actions .button,
    .card-hero__actions .button,
    .about-hero__actions .button {
        flex: 1 1 9rem;
    }

    .hero-visual img {
        border-radius: 1.4rem;
    }

    .feature-card--news .feature-card__image {
        min-height: 19rem;
    }

    .team-preview-grid,
    .media-grid {
        gap: 1.15rem;
    }

    .vyp-form-card {
        padding: 1.1rem;
    }

    .vyp-suggestions,
    .curriculum-suggestions {
        max-height: min(22rem, 48dvh);
    }

    .vyp-suggestion,
    .curriculum-suggestion,
    .lva-result {
        min-height: 3.25rem;
        padding: 0.85rem;
        font-size: 1rem;
    }

    .site-footer {
        padding: 3rem 0 2rem;
    }

    .footer-grid,
    .footer-grid--enhanced {
        gap: 2rem;
    }

    .footer-nav a,
    .footer-legal a,
    .footer-brand a {
        display: inline-flex;
        min-height: 2.75rem;
        align-items: center;
    }

    .pdf-modal {
        padding: 0;
    }

    .pdf-modal__dialog {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .pdf-modal__header {
        gap: 0.8rem;
        padding: 0.85rem 3.9rem 0.85rem 0.75rem;
    }

    .pdf-modal__header h2 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .pdf-modal__close {
        top: 0.7rem;
        right: 0.7rem;
        width: 3.2rem;
        height: 3.2rem;
        font-size: 2rem;
    }

    .pdf-modal__actions {
        display: grid;
        grid-template-columns: 3.2rem minmax(4.5rem, 1fr) 3.2rem 3.2rem 3.2rem;
        width: 100%;
        gap: 0.45rem;
    }

    .pdf-viewer-button {
        min-width: 0;
        min-height: 3.2rem;
        padding: 0.65rem 0.5rem;
        font-size: 1rem;
    }

    .pdf-modal__page-indicator {
        min-width: 0;
        align-self: center;
    }

    #pdf-open-new-tab {
        grid-column: 1 / 4;
    }

    #pdf-download {
        grid-column: 4 / 6;
    }

    .pdf-modal__body {
        padding: 0.3rem;
    }

    .pdf-viewer-stage {
        padding: 0.15rem;
        overscroll-behavior: contain;
    }

    /* Auf schmalen Displays darf die Desktop-Flexbasis nicht zur Höhe werden. */
    .team-directory-section.section {
        padding-top: 1.25rem;
    }

    .team-toolbar {
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .team-search-wrap {
        flex: 0 0 auto;
        width: 100%;
    }

    .team-filter-wrap {
        margin-bottom: 1.5rem;
    }

    /* Die Card-Abschnitte liegen mobil direkt hintereinander. */
    .card-hero {
        padding-bottom: 1.1rem;
    }

    .card-filter-section.section {
        padding: 0.55rem 0 0.85rem;
    }

    .card-filter-bar {
        gap: 0.65rem;
    }

    .card-partners-section.section {
        padding-top: 0.75rem;
    }

    /* Eigenständig scrollbar, aber ohne abgeschnittene mehrzeilige LVA-Titel. */
    .lva-result-list {
        grid-auto-rows: max-content;
        align-content: start;
        max-height: min(30rem, 58dvh);
        overflow-y: auto;
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        scrollbar-gutter: stable;
        padding: 0.15rem 0.25rem 0.75rem 0;
    }

    .lva-result {
        display: block;
        height: auto;
        min-height: 3.5rem;
        overflow: visible;
        white-space: normal;
    }

    .lva-result strong {
        display: block;
        line-height: 1.35;
        overflow: visible;
    }

    .lva-detail {
        scroll-margin-top: 5.35rem;
    }
}

@media (max-width: 380px) {
    html {
        font-size: 16.5px;
    }

    .brand-text {
        font-size: 1.05rem;
    }

    .hero-actions,
    .exam-hero__actions,
    .card-hero__actions,
    .about-hero__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-actions .button,
    .exam-hero__actions .button,
    .card-hero__actions .button,
    .about-hero__actions .button {
        width: 100%;
    }
}

@media (hover: none) and (pointer: coarse) {
    .feature-card:hover,
    .promo-banner:hover,
    .person-card:hover,
    .quote-card:hover,
    .hero-visual:hover img {
        transform: none;
    }
}
