/* ==========================================================================
   ZAST Custom Stylesheet
   ========================================================================== */

/* Fonts */

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-BlackItalic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-BlackItalic.woff') format('woff');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-Black.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-Italic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-Italic.woff') format('woff');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-BoldItalic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-BoldItalic.woff') format('woff');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-SemiBold.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-Light.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-Regular.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-SemiBoldItalic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-SemiBoldItalic.woff') format('woff');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-ExtraLightItalic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-ExtraLightItalic.woff') format('woff');
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-LightItalic.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-LightItalic.woff') format('woff');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-Bold.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../Fonts/SourceSansPro-ExtraLight.woff2') format('woff2'),
        url('../Fonts/SourceSansPro-ExtraLight.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

/* Max page width: cap at xl breakpoint (1140px) */

.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl,
.frame-container-default {
    max-width: 1140px !important;
}

/* Typography */

body, h1, h2, h3, h4, h5, p, div {
    font-family: "Source Sans Pro", sans-serif !important;
}

/* Sections */

.section {
    padding-top: 2em !important;
    padding-bottom: 2em !important;
}

/* v16: .frame wraps content elements, frame-type-* still used */
.frame.frame-type-uploads {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.frame.frame-type-div {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Footer */
/* v16: section.footer-section.footer-section-content contains footer columns */

section.footer-section-content a,
.footer-section-content .footer-navigation-link {
    color: white !important;
}

/* Global: no underline on links */

a {
    text-decoration: none !important;
}

/* Uploads / File Links */
/* v9: ul.media-list li -> v16: ul.filelink-list .filelink-item */

ul.filelink-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8em 1.2em;
    align-items: start;
}

/* Override Bootstrap Package default: .filelink-item + .filelink-item { margin-top: 1rem }
   Not needed in grid layout — spacing is handled by grid gap */
ul.filelink-list .filelink-item + .filelink-item {
    margin-top: 0;
}

@media (max-width: 991px) {
    ul.filelink-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    ul.filelink-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479px) {
    ul.filelink-list { grid-template-columns: 1fr; }
}

ul.filelink-list .filelink-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.4em;
    min-width: 0;
}

ul.filelink-list .filelink-item .filelink-media {
    flex-shrink: 0;
}

/* Replace outline icon with filled file icon, align bottom to text baseline */
ul.filelink-list .filelink-item .filelink-fileicon {
    color: var(--bs-link-color, #468aca);
    font-size: 1.3em;
    line-height: 1;
    vertical-align: baseline;
}

/* Override icon: hide font glyph, show filled file SVG in link color */
ul.filelink-list .filelink-item .filelink-fileicon .bootstrappackageicon-file::before {
    content: "";
    display: none;
}

ul.filelink-list .filelink-item .filelink-fileicon .bootstrappackageicon-file {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    vertical-align: baseline;
}

/* Heading: filename and filesize on one line, same font size */
ul.filelink-list .filelink-item .filelink-heading {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.4em;
}

/* v9: span.uploads-filename -> v16: span.filelink-filename */

span.filelink-filename {
    font-size: 18px !important;
}

span.filelink-filesize {
    font-size: 18px !important;
    white-space: nowrap;
}

/* Gallery grayscale effect */
/* v9: div.gallery-row div.col-* -> v16: .gallery-row .gallery-item */

.page-8 .gallery-row .gallery-item {
    -webkit-filter: grayscale(1) opacity(70%);
    filter: grayscale(1) opacity(70%);
    transition: filter 0.3s ease;
}

.page-8 .gallery-row .gallery-item:hover {
    -webkit-filter: grayscale(0) opacity(100%);
    filter: grayscale(0) opacity(100%);
}

.page-8 .gallery-row .gallery-item:nth-child(5n) {
    margin-right: 100px;
}

/* ==========================================================================
   Navigation – match zast.de styling
   ========================================================================== */

/* Colors apply to all breakpoints */
.navbar-mainnavigation {
    --bs-navbar-color: #8c8c8c;
    --bs-navbar-hover-color: #333;
    --bs-navbar-active-color: #333;
    box-shadow: none !important;
}

/* Uppercase nav items (all breakpoints) */
.navbar-mainnavigation .navbar-nav .nav-link {
    text-transform: uppercase;
    font-family: "Source Sans Pro", sans-serif;
}

/* Breadcrumb flush against navbar bottom */
.breadcrumb-section {
    border-top: 1px solid #eee;
}

/* Hide breadcrumb on homepage */
.pagelevel-0 .breadcrumb-section {
    display: none;
}

/* Breadcrumb & footer link styles now covered by global a rule */

/* ==========================================================================
   Desktop only (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {
    /* Navbar height: 140px to match zast.de */
    .navbar-mainnavigation {
        --mainnavigation-nav-height: 140px !important;
    }

    /* Larger logo to match zast.de (~253x91) */
    .navbar-mainnavigation .navbar-brand-logo-normal,
    .navbar-mainnavigation .navbar-brand-logo-inverted {
        height: 91px !important;
        width: auto !important;
    }

    /* Push nav items to the right */
    .navbar-mainnavigation .navbar-collapse {
        flex-basis: auto !important;
        flex-grow: 1 !important;
        justify-content: flex-end !important;
    }
    .navbar-mainnavigation .navbar-collapse .navbar-nav {
        width: auto !important;
        flex-grow: 0 !important;
    }

    /* Hide dropdown toggle chevrons (zast.de hides carets on desktop) */
    .navbar-mainnavigation .nav-link-toggle {
        display: none !important;
    }

    /* Make the main nav link trigger the dropdown instead */
    .navbar-mainnavigation .nav-item.nav-style-simple > .nav-link-main {
        cursor: pointer;
    }

    /* Show dropdown on hover only if it has content */
    .navbar-mainnavigation .nav-item:hover > .dropdown-menu-simple {
        display: block;
    }

    /* Nav item spacing */
    .navbar-mainnavigation .navbar-nav {
        gap: 0 !important;
    }
    .navbar-mainnavigation .navbar-nav .nav-link.nav-link-main {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Invisible hover bridge above dropdown */
    .navbar-mainnavigation .dropdown-menu-simple::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: calc((var(--mainnavigation-nav-height) - var(--mainnavigation-link-height)) / 2);
    }

    /* Dropdown opens at navbar bottom edge */
    .navbar-mainnavigation .dropdown-menu {
        top: calc(100% + (var(--mainnavigation-nav-height) - var(--mainnavigation-link-height)) / 2) !important;
    }

    /* Top highlight bar: extend to top edge of page */
    .navbar-mainnavigation .nav-link.nav-link-main:before {
        top: calc(-1 * (var(--mainnavigation-nav-height) - var(--mainnavigation-link-height)) / 2) !important;
        left: var(--mainnavigation-link-padding-x) !important;
        right: var(--mainnavigation-link-padding-x) !important;
        bottom: auto !important;
        height: 4px !important;
        background: #468aca !important;
        border: none !important;
        transform: unset !important;
        width: auto !important;
        opacity: 0;
        transition: opacity 0.25s ease-in-out !important;
    }
    .navbar-mainnavigation .nav-link:not(.nav-link-toggle):hover:before,
    .navbar-mainnavigation .nav-link:not(.nav-link-toggle):focus-visible:before {
        opacity: 0.5 !important;
    }
    .navbar-mainnavigation .nav-link:not(.nav-link-toggle).active:before,
    .navbar-mainnavigation .nav-link:not(.nav-link-toggle).show:before {
        opacity: 1 !important;
    }

    /* Dropdown menu styling */
    .navbar-mainnavigation .dropdown-menu {
        font-size: 0.8em !important;
        border: 1px solid #eee;
        border-radius: 0;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    }
    .navbar-mainnavigation .dropdown-menu .nav-link:hover,
    .navbar-mainnavigation .dropdown-menu .nav-link:focus {
        color: #fff !important;
        background-color: #468aca;
    }
    .navbar-mainnavigation .dropdown-menu .nav-link.active {
        color: #fff !important;
        background-color: #468aca;
    }
    .navbar-mainnavigation .dropdown-menu .nav-link {
        color: #333;
        text-transform: none;
        transition: color 0.15s ease, background-color 0.15s ease;
    }
}
