/*
 * GDfB Geoportal 3.0
 * Startseite mit fachlicher Geodatenübersicht.
 */

/* Grundaufbau */

#portal-main {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

.portal-content-inner {
    box-sizing: border-box;
    width: min(1440px, calc(100% - 64px));
    margin: 0 auto;
}


/* Kartenvorschau */

#portal-map-section {
    position: relative;
    width: 100%;
    height: 440px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #e5eaed;
}

#portal-map-section #masterportal-root {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Abschnittsüberschriften */

.portal-section-heading {
    max-width: 840px;
    margin-bottom: 26px;
}

.portal-section-heading.compact {
    margin-bottom: 18px;
}

.portal-section-kicker {
    display: block;
    margin-bottom: 7px;
    color: #a32035;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-section-heading h2 {
    margin: 0 0 8px;
    color: #243746;
    font-size: 27px;
    line-height: 1.2;
}

.portal-section-heading p {
    margin: 0;
    color: #66747d;
    font-size: 15px;
    line-height: 1.5;
}


/* Geodaten und Informationen */

#portal-data-section {
    box-sizing: border-box;
    padding: 22px 0 26px;
    background: #ffffff;
}

.portal-data-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portal-data-card {
    box-sizing: border-box;
    min-width: 0;
    min-height: 108px;

    display: grid;
    grid-template-columns:
        44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    padding: 14px;

    border: 1px solid #d9e0e4;
    border-radius: 8px;

    background: #ffffff;
    color: #243746;

    text-decoration: none;

    box-shadow:
        0 2px 8px rgba(34, 54, 66, 0.07);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.portal-data-card:hover,
.portal-data-card:focus-visible {
    transform: translateY(-2px);
    border-color: #aab7bf;
    box-shadow:
        0 5px 14px rgba(34, 54, 66, 0.12);
}

.portal-data-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    color: #ffffff;
}

.portal-data-icon svg {
    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-data-icon.bohrdaten {
    background: #063b76;
}

.portal-data-icon.geologie {
    background: #a32035;
}

.portal-data-icon.hydro {
    background: #15759b;
}

.portal-data-icon.geothermie {
    background: #d36b22;
}

.portal-data-icon.boden {
    background: #6f6a45;
}

.portal-data-icon.weitere {
    background: #5e4387;
}

.portal-data-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.portal-data-content strong {
    color: #233846;
    font-size: 15px;
    line-height: 1.25;
}

.portal-data-content small {
    color: #697780;
    font-size: 13px;
    line-height: 1.4;
}

.portal-data-arrow {
    color: #7b8991;
    font-size: 22px;
}


/* Weitere Angebote */

#portal-offers-section {
    box-sizing: border-box;
    padding: 28px 0 38px;

    border-top: 1px solid #dde2e5;

    background: #f4f6f7;
}

.portal-offers-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portal-offer-card {
    box-sizing: border-box;

    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 72px;

    padding: 14px 16px;

    border: 1px solid #d8dee2;
    border-radius: 6px;

    background: #ffffff;
    color: #253846;

    text-decoration: none;
}

.portal-offer-card:hover,
.portal-offer-card:focus-visible {
    border-color: #adb8bf;
    background: #fafbfb;
}

.portal-offer-icon {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #e8edf0;
    color: #243746;
}

.portal-offer-icon svg {
    width: 21px;
    height: 21px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-offer-text {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-offer-text strong {
    font-size: 14px;
}

.portal-offer-text small {
    color: #748088;
    font-size: 12px;
    line-height: 1.3;
}

.portal-offer-card.is-disabled {
    opacity: 0.65;
    cursor: default;
}


/* Tablet */

@media (max-width: 1050px) {

    .portal-content-inner {
        width: min(100% - 40px, 1440px);
    }

    .portal-data-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .portal-offers-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* Smartphone */

@media (max-width: 700px) {

    .portal-content-inner {
        width: calc(100% - 28px);
    }

    #portal-map-section {
        height: 340px;
    }

    #portal-data-section {
        padding: 24px 0 28px;
    }

    .portal-section-heading {
        margin-bottom: 18px;
    }

    .portal-section-kicker {
        font-size: 11px;
    }

    .portal-section-heading h2 {
        font-size: 21px;
    }

    .portal-section-heading p {
        font-size: 14px;
    }

    .portal-data-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-data-card {
        min-height: 94px;
        grid-template-columns:
            44px minmax(0, 1fr) 18px;
        gap: 12px;
        padding: 14px;
    }

    .portal-data-icon {
        width: 42px;
        height: 42px;
    }

    .portal-data-icon svg {
        width: 24px;
        height: 24px;
    }

    .portal-data-content strong {
        font-size: 15px;
    }

    .portal-data-content small {
        font-size: 12px;
    }

    #portal-offers-section {
        padding: 22px 0 28px;
    }

    .portal-offers-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .portal-offer-card {
        min-height: 62px;
        padding: 12px 14px;
    }
}

/* Farben der dynamischen Fachbereiche */

.portal-data-icon.bohrdaten {
    background: #063b76;
}

.portal-data-icon.geologie {
    background: #a32035;
}

.portal-data-icon.hydrogeologie {
    background: #15759b;
}

.portal-data-icon.geothermie {
    background: #d36b22;
}

.portal-data-icon.boden_ingenieurgeologie {
    background: #6f6a45;
}

.portal-data-icon.messnetz_farge {
    background: #087a38;
}

.portal-data-icon.untergrundmodell_3d {
    background: #5e4387;
}

.portal-data-icon.weitere_fachdaten {
    background: #53636d;
}

/* Kompakte Darstellung der Startseitenangebote */

.portal-data-card {
    min-height: 88px;
    padding: 10px 12px;
    gap: 10px;
}

.portal-data-icon {
    width: 36px;
    height: 36px;
}

.portal-data-icon svg {
    width: 21px;
    height: 21px;
}

.portal-data-content h3,
.portal-data-title-row h3,
.portal-data-content strong {
    font-size: 14px;
}

.portal-data-content p,
.portal-data-content small {
    font-size: 11px;
    line-height: 1.3;
}

.portal-data-link {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 11px;
}

#portal-offers-section {
    padding-top: 18px;
    padding-bottom: 22px;
}

.portal-offer-card {
    min-height: 54px;
    padding: 9px 11px;
    gap: 9px;
}

.portal-offer-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.portal-offer-icon svg {
    width: 17px;
    height: 17px;
}

.portal-offer-content h3,
.portal-offer-text strong {
    font-size: 13px;
}

.portal-offer-content p,
.portal-offer-text small {
    font-size: 11px;
    line-height: 1.25;
}

.portal-offer-link {
    padding: 3px 7px;
    font-size: 11px;
}

/* ==========================================================
   Mobile Korrektur Startseiten-Header
   ========================================================== */

@media (max-width: 760px) {

    #portal-agency-name,
    #portal-brand-divider,
    #portal-text,
    #portal-title,
    #portal-subtitle,
    #portal-header-links {
        display: none !important;
    }

    #portal-header-top {
        min-height: 82px !important;
        height: 82px !important;
        padding: 8px 16px !important;
    }

    #portal-branding {
        width: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    #portal-logo {
        width: 190px !important;
        height: 64px !important;
        object-fit: contain !important;
        object-position: left center !important;
    }

    #portal-header-bottom {
        min-height: 60px !important;
        height: 60px !important;
        padding: 8px 16px !important;
    }

    #portal-search {
        width: 100% !important;
        margin: 0 !important;
    }

    #portal-search-input {
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
}

/* Mobil auf der Portal-Startseite keine Werkzeuge anzeigen */

@media (max-width: 575.98px) {

    body.gdfb-startseite
    .toggle-button-secondaryMenu,

    body.gdfb-startseite
    #gdfb-mobile-tools-button {
        display: none !important;
    }

}

/* Mobil auf der Portal-Startseite auch den Menüschalter ausblenden */

@media (max-width: 575.98px) {

    body.gdfb-startseite
    .toggle-button-mainMenu {
        display: none !important;
    }

}

/*
 * Zusätzlicher Informationslink beim 3D-Untergrundmodell.
 * Der primäre Link "Daten anzeigen" bleibt unverändert.
 */
.portal-data-info-link {
    display: block;
    margin-top: 8px;
    font-size: 0.92rem;
    text-decoration: underline;
    width: fit-content;
}

.portal-data-info-link:hover,
.portal-data-info-link:focus {
    text-decoration-thickness: 2px;
}



/*
 * ==========================================================
 * 3D-Untergrundmodell:
 * zwei direkte Einstiege für 2D-Karten und 3D-Modell
 * ==========================================================
 */

.portal-data-actions-3d {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.portal-data-actions-3d .portal-data-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.portal-data-info-link {
    display: inline-block;
    margin-top: 7px;
}


/*
 * Auf sehr schmalen Displays dürfen die beiden Schaltflächen
 * untereinander stehen.
 */
@media (max-width: 520px) {

    .portal-data-actions-3d {
        flex-direction: column;
        align-items: flex-start;
    }

}


/* GDfB: BreGIBS-Rundlogo ohne Hintergrundkasten */
.portal-data-icon.geothermie {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.portal-data-icon.geothermie img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}



/* GDFB-TESTPHASE-HINWEIS */

.gdfb-testphase-status {
    position: relative;
    margin: 0 0 28px 0;
    padding-top: 34px;
}

.gdfb-testphase-badge {
    position: absolute;
    top: 0;
    right: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 12px;

    border-radius: 4px;

    background: #b51f36;
    color: #ffffff;

    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

.gdfb-testphase-hinweis {
    display: flex;
    gap: 14px;
    align-items: baseline;

    padding: 14px 18px;

    border-left: 4px solid #b51f36;
    background: #fff7df;

    color: #293746;

    line-height: 1.5;
}

.gdfb-testphase-hinweis strong {
    flex: 0 0 auto;

    color: #9f1d30;
    font-weight: 700;
}

.gdfb-testphase-hinweis span {
    display: block;
}


/* Mobile Darstellung */

@media (max-width: 768px) {

    .gdfb-testphase-status {
        margin-bottom: 22px;
        padding-top: 32px;
    }

    .gdfb-testphase-hinweis {
        display: block;
        padding: 13px 15px;
    }

    .gdfb-testphase-hinweis strong {
        display: block;
        margin-bottom: 5px;
    }

    .gdfb-testphase-badge {
        font-size: 0.72rem;
        padding: 4px 9px;
    }
}
