/* =====================================================================
   aircrew2026 – Ergänzungen zum Original-CSS
   Desktop bleibt 1:1 wie aircrew_fallschirm.
   Alles unter 980px ist neu (Tablet/Handy).
   ===================================================================== */

/* ---------- Desktop: Ersatz für entfernte Inline-Konstrukte ---------- */
#navtoggle { display: none; }

#right .box_noback .contact {
    margin: 0 0 10px 10px;
    width: 177px;
    border-spacing: 1px;
    color: inherit;
}
#right .box_noback .contact td { padding: 0; line-height: normal; vertical-align: top; }
#right .box_noback .contact td:first-child { width: 45px; }

#right .box_noback .social { margin: 21px 0 0 10px; }
#right .box_noback .social a { display: inline-flex; align-items: center; gap: 8px; }
#right .box_noback .social img { float: none; margin: 0; }

/* feste Kastenhöhen – früher als Inline-Styles im Markup */
#left .box-left        { height: 154px; }
#right .box-menu       { min-height: 45px; padding-bottom: 2px; box-sizing: border-box; }
#right .box-modules    { height: 193px; }
#right .box-syndicate  { height: 130px; }

/* Abstand wie im alten Template (dort durch einen leeren <p> mit 16px Padding) */
#right .box-user3 { padding: 16px 0 0; }

/* Phoca-Galerie-Modul: dessen CSS lädt nach dem Template – Rahmenabstände wie bisher auf 0 */
#right #phocagallery-module-ri .pg-cv-box-mod-ri { margin: 0; padding: 0; }
/* Abstand wie im alten Template (dort durch leeren <p> + <br clear>) */
#right .box-user1 { clear: both; padding: 29px 0 0 8px; }

/* früher <img src="pix.gif"> in .hdots */
.hdots { overflow: hidden; }

/* Joomla-Systemmeldungen im alten Look */
#system-message-container .alert {
    margin: 0 0 15px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #6387BB;
    font-size: 11px;
}

/* ---------- Tablet & Handy ---------- */
@media (max-width: 979px) {

    html { -webkit-text-size-adjust: 100%; }

    body {
        font-size: 15px;
        background-size: auto;
    }

    #page {
        width: auto;
        background-size: 966px auto;
        background-position: left top;
    }

    /* Kopf: Foto bleibt, Elemente fließen statt absolut positioniert */
    #header {
        position: relative;
        height: auto;
        min-height: 160px;
        padding: 10px 12px 12px;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    #navback, #subnavback { display: none; }

    #logo,
    #search_area {
        position: static;
        top: auto;
        left: auto;
    }

    #logo { order: 1; flex: 1 1 auto; }
    #logo img { width: 140px; height: auto; }

    #navtoggle {
        order: 2;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        padding: 8px 12px;
        border: 0;
        background: rgba(175, 199, 226, .9);
        color: #063A79;
        font: bold 14px/1 Arial, Helvetica, sans-serif;
        cursor: pointer;
    }
    .navtoggle-bar,
    .navtoggle-bar::before,
    .navtoggle-bar::after {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        position: relative;
    }
    .navtoggle-bar::before,
    .navtoggle-bar::after { content: ""; position: absolute; left: 0; }
    .navtoggle-bar::before { top: -6px; }
    .navtoggle-bar::after  { top:  6px; }

    #navcover {
        order: 3;
        position: static;
        width: 100%;
        display: none;
        background: rgba(175, 199, 226, .95);
        padding: 6px 0;
    }
    body.nav-open #navcover { display: block; }

    #mainnav,
    #subnav {
        position: static;
        width: auto;
        margin: 0;
        padding: 0 12px;
    }
    #subnav { border-top: 1px solid rgba(255,255,255,.6); margin-top: 6px; padding-top: 6px; }

    #mainnav ul, #subnav ul { margin: 0; padding: 0; }
    #mainnav li, #subnav li,
    ul.mod-menu li, ul.menu li, ul.menu-nav li {
        display: block;
        padding: 0;
    }
    #mainnav a, #subnav a {
        display: block;
        padding: 9px 0;
        font-size: 15px;
    }

    #search_area { order: 4; width: 100%; }
    #flags { width: auto; height: auto; }

    /* Inhalt: eine Spalte, Inhalt zuerst */
    #main {
        display: flex;
        flex-direction: column;
        background-image: none;
        min-height: 0;
        height: auto !important;
    }
    #left { display: none; }

    #maincontent {
        order: 1;
        width: auto;
        margin-left: 0;
        background: #fff;
    }
    #right {
        order: 2;
        float: none;
        width: auto;
        padding: 0 8px;
    }
    #right .box,
    #right .box_noback { height: auto !important; }
    #right .box { padding: 8px 0; }
    #right .box_noback { margin: 0; padding: 12px 0 16px; }
    #menue_rechts ul.nav { width: auto; }

    .clearfloat { display: none; }

    #breadcrumbs { padding: 10px 16px 14px; }
    #breadcrumbs ul { display: flex; flex-wrap: wrap; align-items: baseline; }
    #breadcrumbs li { float: none; }
    #breadcrumbs li, #breadcrumbs a, #breadcrumbs span { font-size: 15px; line-height: 1.5; }
    #content { padding: 0 16px 30px; }

    /* Lesbare Schriftgrößen */
    #content p, #content td, #content li,
    #content a, #content a:link, #content a:visited,
    a, a:link, a:visited,
    #right .box p, #right .box_noback p, #right .box_noback td {
        font-size: 15px;
        line-height: 1.5;
    }
    #content h1 { font-size: 20px; line-height: 1.3; }
    #content h2 { font-size: 18px; line-height: 1.3; }

    /* Bilder & Tabellen dürfen nicht überlaufen */
    #content img {
        max-width: 100%;
        height: auto;
    }
    #content img[style*="float"],
    #content img[align] {
        max-width: 45%;
    }
    #content table { max-width: 100%; }
    #content .table-wrap,
    #content table { display: block; overflow-x: auto; }
    #content iframe, #content video { max-width: 100%; }
    /* Bilder in Layout-Tabellen (z. B. Logos nebeneinander) */
    #content td img { max-width: 40vw; height: auto; }

    select, textarea, input { font-size: 16px; }

    #right .box_noback .contact { width: auto; }
    #right .box_noback .contact td:first-child { width: 70px; }

    #footer { display: none; }
}

@media (max-width: 479px) {
    #page { background-size: 700px auto; }
    #header { min-height: 120px; }
    #content img[style*="float"],
    #content img[align] {
        float: none !important;
        display: block;
        max-width: 100%;
        margin: 10px 0;
    }
}
