/* =========================================================
   TeamElektro Lern-App
   Netzwerkgrundlagen
   responsive.css
   ========================================================= */


/* =========================================================
   1. NOTEBOOK / KLEINERE DESKTOPS
   ========================================================= */

@media (max-width: 1100px) {

    .hero-container {
        grid-template-columns:
            minmax(0, 1.35fr)
            minmax(280px, 0.75fr);

        gap: 40px;
    }

    .chapter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .chapter-layout {
        grid-template-columns:
            minmax(0, 1fr)
            240px;

        gap: 28px;
    }
}


/* =========================================================
   2. TABLET
   ========================================================= */

@media (max-width: 900px) {

    .content-container,
    .hero-container,
    .footer-container,
    .navigation-container,
    .page-hero-container {
        width: min(calc(100% - 32px), var(--max-width));
    }


    /* -----------------------------------------------------
       HERO
       ----------------------------------------------------- */

    .hero {
        padding: 70px 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .hero-content {
        max-width: 800px;
    }

    .hero-info-card {
        max-width: 600px;
    }


    /* -----------------------------------------------------
       CHAPTER CONTENT
       ----------------------------------------------------- */

    .chapter-layout {
        display: block;
    }

    .chapter-sidebar {
        position: static;

        margin-bottom: 28px;
    }

    .chapter-sidebar-nav {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    /* -----------------------------------------------------
       IMAGE GRID
       ----------------------------------------------------- */

    .image-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    /* -----------------------------------------------------
       DOCUMENTS
       ----------------------------------------------------- */

    .document-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   3. MOBILE / TABLET PORTRAIT
   ========================================================= */

@media (max-width: 760px) {

    body {
        font-size: 15.5px;
    }


    /* -----------------------------------------------------
       GENERAL
       ----------------------------------------------------- */

    .content-container,
    .hero-container,
    .footer-container,
    .page-hero-container {
        width: min(calc(100% - 28px), var(--max-width));
    }


    /* -----------------------------------------------------
       HERO
       ----------------------------------------------------- */

    .hero {
        padding: 55px 0 60px;
    }

    .hero h1 {
        font-size: clamp(2.4rem, 11vw, 3.6rem);
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-actions {
        align-items: stretch;
    }

    .hero-actions .button {
        flex: 1;
        min-width: 190px;
    }

    .hero-info-card {
        padding: 24px;
    }


    /* -----------------------------------------------------
       PROGRESS
       ----------------------------------------------------- */

    .progress-section {
        padding-top: 35px;
    }

    .progress-card {
        padding: 24px;
    }

    .progress-card-header {
        align-items: center;
    }

    .progress-percentage {
        font-size: 1.65rem;
    }


    /* -----------------------------------------------------
       CHAPTER OVERVIEW
       ----------------------------------------------------- */

    .chapter-overview {
        padding: 60px 0;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .chapter-card {
        min-height: 0;
    }

    .chapter-number {
        min-height: 76px;

        font-size: 2rem;
    }


    /* -----------------------------------------------------
       LEARNING PATH
       ----------------------------------------------------- */

    .learning-path-section {
        padding: 60px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }


    /* -----------------------------------------------------
       RESOURCES
       ----------------------------------------------------- */

    .resource-section {
        padding: 60px 0;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    .resource-card {
        padding: 27px;
    }


    /* -----------------------------------------------------
       PAGE HERO
       ----------------------------------------------------- */

    .page-hero {
        padding: 50px 0;
    }

    .page-hero h1 {
        font-size: clamp(2rem, 9vw, 3rem);
    }


    /* -----------------------------------------------------
       CHAPTER MAIN
       ----------------------------------------------------- */

    .chapter-main {
        padding: 45px 0 65px;
    }

    .content-section {
        padding: 25px;
    }

    .chapter-sidebar-nav {
        grid-template-columns: 1fr;
    }


    /* -----------------------------------------------------
       TERM CARDS
       ----------------------------------------------------- */

    .term-grid {
        grid-template-columns: 1fr;
    }


    /* -----------------------------------------------------
       IMAGES
       ----------------------------------------------------- */

    .image-grid {
        grid-template-columns: 1fr;
    }


    /* -----------------------------------------------------
       CHAPTER NAVIGATION
       ----------------------------------------------------- */

    .chapter-navigation {
        flex-direction: column;
    }

    .chapter-nav-link {
        width: 100%;
        max-width: none;
    }

    .chapter-nav-link.next {
        margin-left: 0;
    }


    /* -----------------------------------------------------
       FOOTER
       ----------------------------------------------------- */

    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        justify-content: flex-start;
    }
}


/* =========================================================
   4. SMARTPHONE
   ========================================================= */

@media (max-width: 560px) {

    /* -----------------------------------------------------
       GENERAL
       ----------------------------------------------------- */

    .content-container,
    .hero-container,
    .footer-container,
    .page-hero-container {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .section-heading {
        margin-bottom: 28px;
    }

    .section-heading h2,
    .progress-card h2,
    .resource-card h2 {
        font-size: 1.65rem;
    }


    /* -----------------------------------------------------
       BUTTONS
       ----------------------------------------------------- */

    .button {
        width: 100%;
    }


    /* -----------------------------------------------------
       HERO
       ----------------------------------------------------- */

    .hero {
        padding: 45px 0 50px;
    }

    .hero-badge {
        margin-bottom: 17px;

        font-size: 0.7rem;
    }

    .hero h1 {
        margin-bottom: 14px;

        font-size: clamp(2.2rem, 12vw, 3rem);
    }

    .hero-subtitle {
        margin-bottom: 14px;

        font-size: 1.08rem;
    }

    .hero-description {
        margin-bottom: 24px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .button {
        min-width: 0;
    }


    /* -----------------------------------------------------
       HERO INFO
       ----------------------------------------------------- */

    .hero-info-card {
        padding: 21px;
    }

    .info-card-title {
        margin-bottom: 20px;

        font-size: 1.4rem;
    }

    .info-stat {
        padding: 12px 14px;
    }


    /* -----------------------------------------------------
       PROGRESS
       ----------------------------------------------------- */

    .progress-card {
        padding: 21px;
    }

    .progress-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .progress-percentage {
        font-size: 1.5rem;
    }

    .progress-bar {
        height: 12px;
    }


    /* -----------------------------------------------------
       CHAPTER CARDS
       ----------------------------------------------------- */

    .chapter-content {
        padding: 21px;
    }

    .chapter-number {
        padding: 16px 20px;
    }


    /* -----------------------------------------------------
       FEATURE CARDS
       ----------------------------------------------------- */

    .feature-card {
        padding: 22px;
    }


    /* -----------------------------------------------------
       PAGE HERO
       ----------------------------------------------------- */

    .page-hero {
        padding: 42px 0;
    }

    .page-hero p {
        font-size: 0.98rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }


    /* -----------------------------------------------------
       CONTENT SECTIONS
       ----------------------------------------------------- */

    .content-section {
        padding: 21px;
        border-radius: var(--radius);
    }

    .learning-objectives,
    .info-box,
    .practice-box,
    .memory-box,
    .exam-box,
    .warning-box {
        padding: 19px;
    }


    /* -----------------------------------------------------
       TABLES
       ----------------------------------------------------- */

    th,
    td {
        min-width: 125px;
        padding: 11px 12px;

        font-size: 0.84rem;
    }

    .table-wrapper {
        margin-right: -4px;
        margin-left: -4px;
    }


    /* -----------------------------------------------------
       FORMULAS
       ----------------------------------------------------- */

    .formula-box {
        padding: 18px 12px;
    }

    .formula {
        font-size: 1.15rem;
    }


    /* -----------------------------------------------------
       CODE
       ----------------------------------------------------- */

    pre {
        padding: 16px;

        font-size: 0.82rem;
    }


    /* -----------------------------------------------------
       QUIZ CTA
       ----------------------------------------------------- */

    .quiz-cta {
        padding: 25px;
    }


    /* -----------------------------------------------------
       DOCUMENTS
       ----------------------------------------------------- */

    .document-card {
        padding: 22px;
    }


    /* -----------------------------------------------------
       LIGHTBOX
       ----------------------------------------------------- */

    .lightbox {
        padding: 15px;
    }

    .lightbox-image {
        max-height: 78vh;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;

        width: 40px;
        height: 40px;
    }


    /* -----------------------------------------------------
       FOOTER
       ----------------------------------------------------- */

    .site-footer {
        padding: 30px 0;
    }

    .footer-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-logo {
        max-width: 125px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}


/* =========================================================
   5. VERY SMALL SMARTPHONES
   ========================================================= */

@media (max-width: 380px) {

    .content-container,
    .hero-container,
    .footer-container,
    .page-hero-container {
        width: min(calc(100% - 20px), var(--max-width));
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-info-card,
    .progress-card,
    .resource-card,
    .content-section {
        padding: 18px;
    }

    .chapter-content {
        padding: 18px;
    }

    .chapter-number {
        min-height: 68px;

        font-size: 1.8rem;
    }

    .feature-card {
        padding: 19px;
    }

    .chapter-navigation {
        gap: 12px;
    }
}


/* =========================================================
   6. LANDSCAPE SMARTPHONE
   ========================================================= */

@media (
    max-height: 500px
) and (
    orientation: landscape
) {

    .hero {
        padding: 40px 0;
    }

    .page-hero {
        padding: 35px 0;
    }

    .lightbox-image {
        max-height: 72vh;
    }
}


/* =========================================================
   7. TOUCH DEVICES
   ========================================================= */

@media (hover: none) {

    .chapter-card:hover,
    .button:hover,
    .chapter-nav-link:hover {
        transform: none;
    }

    .image-card:hover img {
        transform: none;
    }

    .nav-link,
    .chapter-link,
    .footer-links a {
        min-height: 44px;
    }
}


/* =========================================================
   8. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =========================================================
   9. HIGH CONTRAST SUPPORT
   ========================================================= */

@media (prefers-contrast: more) {

    :root {
        --border: #8997a5;
        --border-blue: #4f82b3;
    }

    .chapter-card,
    .content-section,
    .progress-card,
    .feature-card,
    .resource-card,
    .document-card {
        border-width: 2px;
    }

    .nav-link.active {
        outline: 2px solid var(--team-blue);
    }
}


/* =========================================================
   10. PRINT OPTIMIZATION
   ========================================================= */

@media print {

    @page {
        margin: 15mm;
    }

    body {
        font-size: 11pt;
        line-height: 1.45;
    }

    .hero,
    .page-hero {
        padding: 20px 0;

        color: #000000;
        background: #ffffff;
    }

    .hero h1,
    .page-hero h1 {
        color: #000000;
    }

    .hero-description,
    .page-hero p {
        color: #000000;
    }

    .chapter-layout {
        display: block;
    }

    .image-grid,
    .term-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .content-section,
    .image-card,
    .technical-image {
        break-inside: avoid;
    }
}