/* 1. Lock in the Brand Colors across ALL modes */
/* ==========================================
   1. LIGHT MODE (Default)
========================================== */
:root,
[data-bs-theme="light"] {
    /* Replace these with your NEW darker, accessible color */
    --bs-primary: #3F3FD5; 
    --bs-primary-rgb: 63, 63, 213; 
    --bs-primary-text-emphasis: #3F3FD5;
    
    /* Link colors */
    --bs-link-color: #3F3FD5; /* Usually matches primary */
    --bs-link-hover-color: #5c0202; /* Your original dark red hover color */
}

/* ==========================================
   2. DARK MODE
========================================== */
[data-bs-theme="dark"] {
    /* The lighter, highly visible color we set up for dark mode */
    --bs-primary: #6868DE; 
    --bs-primary-rgb: 104, 104, 222; 
    --bs-primary-text-emphasis: #BEBEF3; 
    
    /* Links need to be readable on dark backgrounds too! */
    --bs-link-color: #6ea8fe; 
    --bs-link-hover-color: #9ec5fe; /* A slightly lighter shade for hover in dark mode */
}



/* 2. Brute-force Text Links */
a, 
[data-bs-theme="dark"] a {
    color: var(--bs-link-color) !important;
}
a:hover, 
[data-bs-theme="dark"] a:hover {
    color: var(--bs-link-hover-color) !important;
}

/* 3. Brute-force Primary Buttons */
.btn-primary, 
[data-bs-theme="dark"] .btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}
.btn-primary:hover, 
[data-bs-theme="dark"] .btn-primary:hover {
    background-color: var(--bs-link-hover-color) !important;
    border-color: var(--bs-link-hover-color) !important;
}

/* 4. Brute-force Outline Buttons (News Teasers) */
.btn-outline-primary, 
[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover, 
[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
}

/* 5. Brute-force Pagination Colors (Light & Dark Mode) */
.pagination .page-link,
[data-bs-theme="light"] .pagination .page-link,
[data-bs-theme="dark"] .pagination .page-link {
    color: var(--bs-primary) !important;
}

.pagination .page-link:hover,
[data-bs-theme="light"] .pagination .page-link:hover,
[data-bs-theme="dark"] .pagination .page-link:hover {
    color: var(--bs-link-hover-color) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.pagination .active .page-link,
[data-bs-theme="light"] .pagination .active .page-link,
[data-bs-theme="dark"] .pagination .active .page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* Ensure the disabled state (like 'Previous' on page 1) looks faded */
.pagination .disabled .page-link,
[data-bs-theme="light"] .pagination .disabled .page-link,
[data-bs-theme="dark"] .pagination .disabled .page-link {
    color: #6c757d !important; 
    background-color: transparent !important;
}


@media (min-width: 992px) {
    .navbar .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0; 
    }
}


/* Force single column for components placed inside narrow grid columns */
.theme-col-narrow .row-cols-sm-2 > *,
.theme-col-narrow .row-cols-md-2 > *,
.theme-col-narrow .row-cols-lg-2 > * {
    flex: 0 0 auto !important;
    width: 100% !important;
}

/* --- TYPO3 Standard Content Element Overrides for Bootstrap 5 --- */

/* 1. Ensure all standard TYPO3 images act like Bootstrap .img-fluid */
.ce-textpic img, 
.ce-gallery img, 
.ce-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem; /* Gives images a modern, subtle rounded corner */
}

/* 2. Add some breathing room around in-text images */
.ce-textpic .ce-gallery[data-ce-columns] {
    margin-bottom: 1.5rem;
    margin-right: 1.5rem;
}

/* 3. Style standard TYPO3 tables to look like Bootstrap tables */
.ce-table table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
    vertical-align: top;
    border-color: var(--bs-border-color);
}
.ce-table table th, .ce-table table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

/* --- TYPO3 Standard Content Element Overrides for Bootstrap 5 --- */

/* 1. Ensure all standard TYPO3 images act like Bootstrap .img-fluid */
.ce-textpic img, 
.ce-gallery img, 
.ce-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem; /* Gives images a modern, subtle rounded corner */
}

/* 2. Add some breathing room around in-text images */
.ce-textpic .ce-gallery[data-ce-columns] {
    margin-bottom: 1.5rem;
    margin-right: 1.5rem;
}

/* 3. Style standard TYPO3 tables to look like Bootstrap tables */
.ce-table table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
    vertical-align: top;
    border-color: var(--bs-border-color);
}
.ce-table table th, .ce-table table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

/* --- UNIFIED FULL-WIDTH HERO & KEN BURNS --- */
.hero-wrapper .carousel, 
.hero-wrapper .carousel-inner {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

/* 1. Enforce Landscape Aspect Ratio */
.ken-burns-slide {
    position: relative;
    width: 100vw;
    aspect-ratio: 16 / 9; /* Locks in landscape proportions on mobile! */
    max-height: 60vh;
    min-height: 300px;
    /* REMOVED display: flex; here so it stops fighting Bootstrap's fade animation */
    overflow: hidden;
}

/* 2. Dark Gradient Overlay */
.ken-burns-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

/* 3. Strip TYPO3 Wrappers */
.ken-burns-slide .ce-outer,
.ken-burns-slide .ce-inner,
.ken-burns-slide .ce-row,
.ken-burns-slide .ce-column,
.ken-burns-slide .frame,
.ken-burns-slide .ce-textpic,
.ken-burns-slide .ce-gallery, /* Added the missing comma here! */
.ken-burns-slide figure {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* 4. The Image */
.ken-burns-slide img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    z-index: 1 !important;
    animation: kenBurnsZoom 15s ease-out infinite forwards; 
    transform-origin: center center !important; 
}

@keyframes kenBurnsZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* 5. Target the TYPO3 Image Caption (Title & Description) */
.ken-burns-slide figcaption,
.ken-burns-slide .ce-bodytext,
.ken-burns-slide header {
    /* Changed to Absolute to permanently lock it in place */
    position: absolute !important; 
    top: 15% !important; /* Positions it 'Above' */
    left: 50% !important; 
    transform: translateX(-50%) !important; /* Centers it perfectly horizontally */
    z-index: 5 !important;
    width: 90%; /* Leaves safe space on mobile edges */
    max-width: 800px;
    text-align: center;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ken-burns-slide figcaption *,
.ken-burns-slide .ce-bodytext *,
.ken-burns-slide header * {
    color: #ffffff !important;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

/* Make the Image Title (first paragraph in caption) pop */
.ken-burns-slide figcaption p:first-child,
.ken-burns-slide figcaption strong {
    font-size: 2.5rem;
    font-weight: 700;
}

/* 6. Transform links inside Captions into neat Buttons */
.ken-burns-slide figcaption a,
.ken-burns-slide .ce-bodytext a {
    display: inline-block !important;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem !important;
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 0.375rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    width: auto !important; 
    position: relative;
    z-index: 10;
}
.ken-burns-slide figcaption a:hover {
    background-color: #ffffff !important;
    color: var(--bs-primary) !important;
}

/* --- Mobile Swipeable News Row (Opt-in via Backend) --- */
@media (max-width: 991.98px) {
    .news-mobile-slider .row {
        display: flex !important;
        flex-wrap: nowrap !important; /* Forces a single horizontal line */
        overflow-x: auto !important;  /* Turns on horizontal scrolling */
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1.5rem; /* Room for shadows */
        scrollbar-width: none;  /* Firefox scrollbar hiding */
    }
    .news-mobile-slider .row::-webkit-scrollbar {
        display: none; /* Chrome/Safari scrollbar hiding */
    }
    
    /* Target the columns and force them to break out of the screen */
    .news-mobile-slider .row > * {
        flex: 0 0 85% !important;
        max-width: 85% !important;
        width: 85% !important;
        min-width: 85% !important; /* THE IOS FIX */
        flex-shrink: 0 !important; /* THE MAGIC FIX: Stops Firefox/Safari from squishing the cards */
        scroll-snap-align: center;
    }
}

/* --- Mobile Menu (Hamburger) Adjustments --- */
@media (max-width: 991.98px) {
    .navbar-collapse .navbar-nav .nav-link {
        font-size: 1.25rem !important; /* Makes the text significantly larger */
        padding-top: 0.8rem !important; /* Increases the tap area */
        padding-bottom: 0.8rem !important;
        border-bottom: 1px solid rgba(138, 3, 3, 0.1); /* Optional: Adds a faint separator line */
    }
    /* Remove the border from the last item so it looks clean */
    .navbar-collapse .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}


/* --- Override Bootstrap's Default Blue in Dropdowns --- */
.dropdown-item.active, 
.dropdown-item:active {
    background-color: #f4f4f4 !important; /* Clean off-white / light gray */
    color: rgb(63, 69, 132) !important; /* Your primary brand color for the text */
    font-weight: 500; /* Just a touch bolder so it stands out as active */
}

/* Hover effect */
.dropdown-item:hover, 
.dropdown-item:focus {
    background-color: #e9ecef !important; /* Slightly darker gray on hover */
    color: rgb(63, 69, 132) !important;
}

/* Hide captions by default and push them down slightly */
.carousel-item .carousel-caption {
    opacity: 0;
    transform: translateY(20px);
    /* Fade takes 1.5s (duration), but waits 0.6s (delay) before starting */
    transition: opacity 2s ease-out 1s, transform 2s ease-out 1s;
}

/* When the slide becomes active, trigger the fade and slide up */
.carousel-item.active .carousel-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Eradicate the Mindshape Green - Full Palette Override */
body .cookie-consent-container {
    /* Base color*/
    --color-primary: #0056b3; 
    
    /* Darker shade for hover states */
    --color-dark-primary-10: #004a99;
    
    /* Even darker shade for active clicks */
    --color-dark-primary: #003366; 
    
    /* 50% transparent version (usually used for focus rings) */
    /* 0, 86, 179 is the exact RGB equivalent of #0056b3 */
    --color-hsla-primary-50: rgba(0, 86, 179, 0.5); 
}
