/**
 * BRG Wels - Custom Styles
 * Erweiterungen zur Website-Überarbeitung 2026
 */

/* ==========================================================================
   1. HEADER SEARCH
   ========================================================================== */

/* Mobile: Search icon next to hamburger */
.main-header .header-search {
    display: block;
    float: right;
    margin-top: 15px;
    margin-right: 24px;
}

.main-header .header-search .header-search-toggle {
    color: #888;
    padding: 0;
    width: 30px;
    height: 30px;
}

.main-header .header-search .header-search-toggle svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 1019px) {
    .main-header .header-search .header-search-form {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #f5f5f5;
        padding: 10px 15px;
        margin-left: 0;
        max-width: none;
        border-bottom: 1px solid #ddd;
    }

    .main-header .header-search .header-search-form.is-open {
        max-width: none;
        width: 100%;
    }

    .main-header .header-search .header-search-form input[type="search"] {
        width: 100%;
    }
}

/* Desktop: Search icon left of nav items, search field inline */
@media (min-width: 1020px) {
    .main-header .header-search {
        display: flex;
        align-items: center;
        position: absolute;
        right: 720px;
        bottom: 0;
        height: 80px;
        z-index: 100;
        float: none;
        margin: 0;
    }

    .main-header .header-search .header-search-toggle {
        color: #e8761b;
    }

    .main-header.shrink .header-search {
        height: 80px;
    }
}

.header-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #e8761b;
    font-size: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.header-search-toggle:hover {
    opacity: 0.7;
}

.header-search-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-search-form {
    display: none;
    align-items: center;
    margin-left: 8px;
    overflow: hidden;
    max-width: 0;
    transition: max-width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.header-search-form.is-open {
    display: flex;
    max-width: 250px;
    opacity: 1;
}

.header-search-form input[type="search"] {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    width: 220px;
    background: #fff;
}

.header-search-form input[type="search"]:focus {
    border-color: #e8761b;
}

.header-search-form button[type="submit"] {
    display: none;
}

/* Mobile search: hidden on desktop, shown in mobile nav */
.header-search-mobile {
    display: none;
}

@media (max-width: 1019px) {
    .header-search-mobile {
        display: block;
        padding: 15px 20px;
        border-top: 1px solid #ddd;
        margin-top: 15px;
    }

    .header-search-mobile input[type="search"] {
        width: 100%;
        padding: 10px 14px;
        border: 2px solid #e0e0e0;
        border-radius: 4px;
        font-size: 16px;
        font-family: inherit;
        outline: none;
        box-sizing: border-box;
    }

    .header-search-mobile input[type="search"]:focus {
        border-color: #e8761b;
    }
}

/* ==========================================================================
   2. SEARCH RESULTS PAGE
   ========================================================================== */

.search-results-page {
    padding: 40px 0;
}

.search-results-page .search-results-header {
    margin-bottom: 30px;
}

.search-results-page .search-results-header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.search-results-page .search-results-count {
    color: #666;
    font-size: 0.95em;
}

.search-results-page .search-results-form {
    margin-bottom: 40px;
    max-width: 500px;
}

.search-results-page .search-results-form input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.search-results-page .search-results-form input[type="search"]:focus {
    border-color: #e8761b;
}

.search-result-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h2 {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.search-result-item h2 a {
    color: #333;
    text-decoration: none;
}

.search-result-item h2 a:hover {
    color: #e8761b;
}

.search-result-item .search-result-excerpt {
    color: #555;
    line-height: 1.6;
}

.search-result-item .search-result-meta {
    font-size: 0.85em;
    color: #999;
    margin-top: 6px;
}

.search-no-results {
    text-align: center;
    padding: 60px 20px;
}

.search-no-results h2 {
    margin-bottom: 15px;
}

.search-no-results p {
    color: #666;
    margin-bottom: 25px;
}

/* ==========================================================================
   3. 404 PAGE
   ========================================================================== */

.content-404 {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.content-404 .error-code {
    font-size: 6em;
    font-weight: 700;
    color: #e8761b;
    line-height: 1;
    margin-bottom: 10px;
}

.content-404 h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #333;
}

.content-404 p {
    color: #666;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.content-404 .error-search {
    max-width: 400px;
    margin: 0 auto 30px;
}

.content-404 .error-search input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.content-404 .error-search input[type="search"]:focus {
    border-color: #e8761b;
}

.content-404 .error-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.content-404 .error-links a {
    color: #e8761b;
    text-decoration: none;
    font-weight: 600;
}

.content-404 .error-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   4. BLOG SIDEBAR - FILTERS DEFAULT OPEN
   ========================================================================== */

/* JS handles opening filters by default via custom.js initSidebarFilters() */

/* ==========================================================================
   5. TEXT-IMAGE BLOCK - CLICKABLE IMAGE LINK
   ========================================================================== */

.ti-img-link {
    display: block;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ti-img-link:hover {
    opacity: 0.85;
}

/* ==========================================================================
   6. TEXT-VIDEO BLOCK
   ========================================================================== */

.text-video {
    overflow: visible;
}

.tv-content {
    flex-direction: row-reverse;
}

@media (min-width: 1020px) {
    .tv-content {
        align-items: flex-start;
        display: flex;
    }

    .tv-content.inverted {
        flex-direction: row;
    }

    .tv-content.inverted .tv-text {
        margin-left: 30px;
        margin-right: 0;
    }
}

.tv-video {
    margin: 0 auto 15px;
}

@media (min-width: 600px) {
    .tv-video {
        width: 60%;
    }
}

@media (min-width: 1020px) {
    .tv-video {
        margin: 0;
        width: 40%;
    }
}

.tv-video-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}

.tv-video-wrap iframe,
.tv-video-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tv-video-wrap video {
    object-fit: cover;
    background: #000;
}

.tv-text {
    line-height: 1.6;
}

@media (min-width: 1020px) {
    .tv-text {
        margin-right: 30px;
        width: calc(60% - 30px);
    }
}

/* ==========================================================================
   7. ICON-ROW BLOCK
   ========================================================================== */

.icon-row.content-block,
.content-block + .icon-row.content-block {
    overflow: visible;
    padding: 50px 20px !important;
    background: #f8f8f8;
}

.icon-row .ir-items {
    max-width: 1300px;
    margin: 0 auto;
}

.ir-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

@media (min-width: 600px) {
    .ir-items {
        gap: 25px;
    }
}

@media (min-width: 1020px) {
    .ir-items {
        gap: 30px;
    }
}

.ir-item {
    text-align: center;
    flex: 0 0 calc(25% - 15px);
    min-width: 60px;
    max-width: 100px;
}

@media (max-width: 599px) {
    .ir-item {
        flex: 0 0 calc(25% - 12px);
        max-width: 75px;
    }
}

.ir-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s, transform 0.2s;
}

.ir-link:hover {
    opacity: 0.8;
    transform: translateY(-3px);
}

.ir-icon {
    margin: 0 auto 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 600px) {
    .ir-icon {
        width: 46px;
        height: 46px;
    }
}

@media (min-width: 1020px) {
    .ir-icon {
        width: 52px;
        height: 52px;
    }
}

.ir-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ir-icon-font {
    font-size: 30px;
    color: #e8761b;
}

@media (min-width: 600px) {
    .ir-icon-font {
        font-size: 34px;
    }
}

@media (min-width: 1020px) {
    .ir-icon-font {
        font-size: 38px;
    }
}

.ir-label {
    display: block;
    font-size: 0.7em;
    line-height: 1.3;
    color: #555;
    word-break: break-word;
}

@media (min-width: 600px) {
    .ir-label {
        font-size: 0.75em;
    }
}

/* ==========================================================================
   8. TARGET-GROUP-LINKS — VIDEO SUPPORT
   ========================================================================== */

.tgl-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tgl-video.is-playing {
    opacity: 1;
}

/* Text bleibt über dem Video */
.tgl-link .tgl-text {
    z-index: 2;
}

/* Mobile: Video immer sichtbar und autoplay */
@media (max-width: 1019px) {
    .tgl-video.is-playing {
        opacity: 1;
    }
}

/* ==========================================================================
   9. QUICK LINKS — POSITION ADJUSTMENT
   ========================================================================== */

@media (min-width: 1020px) {
    .quick-links {
        top: 240px !important;
    }
}

/* ==========================================================================
   10. LATEST POSTS CAROUSEL
   ========================================================================== */

.latest-posts.content-block {
    padding: 40px 0 !important;
    max-width: 1300px;
    margin: 0 auto;
}

.lp-title {
    text-align: center;
    font-size: 1.6em;
    margin: 0 0 25px;
    color: #333;
    font-weight: 400;
}

.lp-carousel {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.lp-track-wrapper {
    overflow: hidden;
    flex: 1;
}

.lp-track {
    display: flex;
    transition: transform 0.4s ease;
}

.lp-slide {
    flex: 0 0 25%;
    padding: 0 10px;
    box-sizing: border-box;
}

@media (max-width: 1019px) {
    .lp-slide { flex: 0 0 33.333%; }
}

@media (max-width: 767px) {
    .lp-slide { flex: 0 0 50%; }
    .lp-carousel { padding: 0 35px; }
}

@media (max-width: 479px) {
    .lp-slide { flex: 0 0 100%; }
}

.lp-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.lp-link:hover .lp-post-title {
    color: #e8761b;
}

.lp-link:hover .lp-readmore {
    color: #e8761b;
}

.lp-image-wrap {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.lp-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.lp-link:hover .lp-image {
    transform: scale(1.03);
}

.lp-date {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e8761b;
    color: #fff;
    font-size: 0.75em;
    padding: 3px 8px;
    border-radius: 2px;
}

.lp-post-title {
    font-size: 0.95em;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 0 6px;
    color: #333;
    transition: color 0.2s;
}

.lp-readmore {
    font-size: 0.8em;
    color: #e8761b;
    transition: color 0.2s;
}

.lp-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999;
    flex-shrink: 0;
    transition: color 0.2s;
}

.lp-arrow:hover {
    color: #e8761b;
}

.lp-arrow svg {
    width: 36px;
    height: 36px;
}

.lp-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.lp-arrow:disabled:hover {
    color: #999;
}

/* --- "Alle Beiträge ansehen"-Slide am Ende des Carousels --- */
.lp-slide-more .lp-more-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
    text-decoration: none;
    color: #e8761b;
    gap: 14px;
}

.lp-slide-more .lp-more-arrow {
    width: 64px;
    height: auto;
    color: #e8761b;
    transition: transform 0.2s ease;
}

.lp-slide-more .lp-more-link:hover .lp-more-arrow {
    transform: translateX(6px);
}

.lp-slide-more .lp-more-text {
    font-weight: 700;
    font-size: 1em;
    color: #e8761b;
}

/* --- Bildungsportal Icon (eigenes SVG statt Fontello-Glyph) --- */
.icon-bildungsportal::before,
.aicon-bildungsportal::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url("../images/bildungsportal.svg") no-repeat center / contain;
            mask: url("../images/bildungsportal.svg") no-repeat center / contain;
    vertical-align: middle;
}

/* ==========================================================================
   11. STICKY BANNER / TAGESAKTUELLES
   ========================================================================== */

/* --- Desktop: fixed card bottom-left --- */
.sticker-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: #e8761b;
    border-radius: 10px;
    box-shadow: 0 6px 28px rgba(232, 118, 27, 0.45);
    max-width: 300px;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
    animation: sticker-pulse 2s ease-in-out 3;
}

@keyframes sticker-pulse {
    0%, 100% { box-shadow: 0 6px 28px rgba(232, 118, 27, 0.45); }
    50% { box-shadow: 0 6px 36px rgba(232, 118, 27, 0.7); }
}

.sticker-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.sticker-banner.is-hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.sticker-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    padding: 2px 6px;
}

.sticker-close:hover {
    color: #fff;
}

.sticker-content {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.sticker-content:hover {
    opacity: 0.9;
}

.sticker-image {
    width: 100%;
    overflow: hidden;
}

.sticker-image img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.sticker-text {
    padding: 14px 35px 14px 16px;
}

.sticker-title {
    display: block;
    font-size: 1.05em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sticker-desc {
    display: block;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.sticker-countdown {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8em;
    font-weight: 700;
    color: #e8761b;
    background: #fff;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Mobile toggle button - hidden on desktop */
.sticker-mobile-toggle {
    display: none;
}

/* --- Mobile --- */
@media (max-width: 1019px) {
    .sticker-banner {
        bottom: 15px;
        left: 15px;
        max-width: 280px;
        display: none;
    }

    .sticker-banner.is-open {
        display: block;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .sticker-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 9998;
        width: 50px;
        height: 50px;
        background: #e8761b;
        color: #fff;
        border: none;
        border-radius: 0 6px 0 0;
        box-shadow: none;
        cursor: pointer;
        padding: 0;
    }

    .sticker-mobile-toggle svg {
        width: 26px;
        height: 26px;
    }

    .sticker-mobile-toggle.is-hidden {
        display: none;
    }
}
