/* 
   ACCESSIBILITY PALETTE MAPPING (WCAG 2.2 AA)
   Primary: #1C60AD | White: #FFFFFF | Black: #000000 | Light Gray: #EEEEEE | Dark Gray: #666666
*/

@font-face {
    font-display: swap;
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 300;
    src: url('../fonts/roboto-mono-v31-latin-300.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/roboto-mono-v31-latin-regular.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/roboto-mono-v31-latin-700.woff2') format('woff2');
}

:root {
    --primary: #1C60AD;
    --white: #FFFFFF;
    --black: #000000;
    --light-gray: #EEEEEE;
    --dark-gray: #666666;
    --font-main: "Roboto Mono", monospace;
}

/* Global Reset & Basic Accessibility */
html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--white);
    /* White BG -> Black Text (21:1) */
    color: var(--black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Global Square Design Reset */
*,
*::before,
*::after,
.btn,
.form-control,
.card,
.accordion-item,
.modal-content,
.alert,
.rounded-0,
.rounded-1,
.rounded-2,
.rounded-3,
.rounded-4,
.rounded-circle,
.rounded-pill {
    border-radius: 0;
}

/* Typography Compliance */
.text-xl {
    font-size: 1.5rem;
}

h1 {
    color: var(--black);
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

h2,
h3,
h4,
h5,
h6 {
    color: var(--black);
    font-weight: 700;
    line-height: 1.2;
}

p,
li {
    max-width: 75ch;
    -moz-hyphens: auto;
    -o-hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Textmarker Highlight Effect */
.mark,
mark {
    color: #333;
    padding: 0 .3em;
    background: linear-gradient(100deg, rgba(251, 234, 107, 0) 1%, #fbea6b 2.5%, rgba(251, 234, 107, .5) 5.7%, rgba(251, 234, 107, .25) 93%, rgba(251, 234, 107, .71) 95%, rgba(251, 234, 107, 0) 98%), linear-gradient(182deg, rgba(251, 234, 107, 0), rgba(251, 234, 107, .3) 8%, rgba(251, 234, 107, 0) 15%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.text-center p,
.text-center li {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* Custom Styled Lists Mapping */
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul li,
ol li {
    display: flex;
    justify-content: flex-start;
    /* Default to start for readability */
    align-items: flex-start;
    gap: 0.4em;
    margin-bottom: 0.5rem;
}

.text-center ul li,
.text-center ol li {
    justify-content: center;
}

/* UL: Arrow only for text items */
ul li::before {
    content: "";
}

ul li:not(:has(a.button)):not(:has(.button)):not(:has(a))::before {
    content: "›";
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
}

/* OL: Custom numbering */
ol {
    counter-reset: item;
}

ol li {
    counter-increment: item;
}

ol li::before {
    content: counter(item) ".";
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
}

/* Action Links: Primary on White (6.5:1 Contrast) */
a {
    color: var(--primary) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
}

a:hover {
    color: var(--black);
}

.footer-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .footer-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Footer Gradient Divider */
.footer-gradient-divider {
    border: 0;
    height: 6px;
    display: block;
    width: 100%;
    margin: 0;
    background-image: linear-gradient(to right bottom, #000000, #281621, #412848, #474078, #1c60ad);
}

@keyframes caretBlink {
    50% { opacity: 0; }
}

.type-caret {
    display: inline-block;
    width: 1px;
    height: 1em;
    background: currentColor;
    margin-left: 2px;
    animation: caretBlink 1s step-end infinite;
}

/* Focus Indicator: High Contrast Outline for Accessibility */
*:focus-visible {
    outline: 2px solid var(--white) !important;
    box-shadow: 0 0 0 4px var(--black) !important;
}

/* Visually hide elements but keep them for screen readers */
.screen-reader {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Show skip-nav links on keyboard focus */
.screen-reader-focusable:focus-visible {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    width: auto;
    height: auto;
    clip: auto;
    padding: 1rem 2rem;
    background-color: var(--white);
    color: var(--black);
    text-decoration: none;
    font-weight: bold;
    border: 3px solid var(--primary);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Sections Mapping (mapping old bg colors to black/white/gray) */
.hero-section,
.about-section,
.bg-dark {
    background-color: var(--black) !important;
    /* Black BG -> White Text (21:1) */
    color: var(--white) !important;
}

.hero-section h1,
.hero-section h2,
.hero-section p,
.about-section h2,
.about-section p,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3 {
    color: var(--white) !important;
}

.text-primary,
.text-primary-custom {
    color: var(--primary) !important;
}



/* Header & Logo Styles */
.site-header {
    width: 100%;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

/* Optional: Für Startseite overlay */
.site-header.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
}

.header-logo {
    min-width: 200px; /* Mindestbreite 200px */
    flex-shrink: 0; /* Verhindert das Schrumpfen/Zerdrücken */
    display: block;
}

.header-logo a {
    text-decoration: none;
    color: var(--black);
    display: block;
}

.header-logo img {
    width: 200px;
    height: auto;
    display: block;
}

/* Wenn CTA im Header existiert */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.hero-image-container {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.hero-image-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* About / Projekte Section Fix */
.about-section {
    background-color: var(--black) !important;
}

.about-content-col {
    background-color: var(--black);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 5;
    /* Ensure it stays above anything else */
}

.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 0 !important;
    border: 3px solid var(--primary) !important;
    margin: 0 auto 1.5rem;
    color: var(--primary) !important;
    font-size: 2.22rem;
    background-color: var(--white) !important;
}

/* Secondary Areas */
.bg-light,
footer.bg-white {
    background-color: var(--light-gray) !important;
    /* Gray BG -> Black Text (17.5:1) */
}

/* Muted Text: Dark Gray on White (4.54:1 Contrast) */
.text-muted,
.text-secondary {
    color: var(--dark-gray) !important;
}

/* Utility class used in dark footer areas: keep readable contrast */
.text-white-50 {
    color: rgba(255, 255, 255, 0.82) !important;
}

/* In Dark Sections, Muted is Light Gray on Black (17.5:1) */
.hero-section .text-secondary,
.about-section .text-secondary {
    color: var(--light-gray) !important;
}

/* UI Components: Buttons */
.btn-agency {
    min-width: 250px;
    padding: 1rem 1.5rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

/* Exclude Header/Small Buttons from fixed width */
.btn-sm.btn-agency {
    min-width: auto;
    padding: 0.5rem 1rem !important;
}

.btn-agency-primary,
.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    border: 3px solid var(--primary);
    font-weight: 700;
}

.btn-agency-primary:hover,
.btn-primary:hover {
    background-color: var(--white);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-agency-outline-light {
    background-color: transparent;
    border: 3px solid var(--white);
    color: var(--white);
}

.btn-agency-outline-light:hover {
    background-color: var(--white);
    color: var(--primary);
}

.btn-agency-outline-dark {
    background-color: transparent;
    border: 3px solid var(--black);
    color: var(--black);
}

.btn-agency-outline-dark:hover {
    background-color: var(--black);
    color: var(--white);
}

/* Cards & Feature Boxes */
.feature-box {
    background-color: var(--light-gray) !important;
    border: 2px solid var(--black) !important;
    color: var(--black) !important;
    padding: 3rem !important;
    /* Increased padding */
    border-radius: 0 !important;
}

.icon-circle {
    background-color: var(--white) !important;
    border: 3px solid var(--primary) !important;
    color: var(--primary) !important;
}

/* Forms Accessibility */
.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--black) !important;
}

.bfsg-card {
    background-color: var(--black) !important;
    border: 2px solid var(--white) !important;
    color: var(--white) !important;
    border-radius: 0 !important;
}

/* Service Cards (Inspired by Reference) */
.service-card {
    background-color: var(--light-gray) !important;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: left;
    transition: background-color 0.3s ease;
    border: none;
    position: relative;
    /* Added for badge positioning */
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.service-card:hover {
    background-color: #e5e5e5 !important;
}

.service-icon-box {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0;
    /* Initially hidden for animation */
}

/* Animation Triggered by .is-visible class (added via JS) */
.is-visible .service-icon-box {
    animation: iconFadeInUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes iconFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Delay for each column in the grid */
.is-visible .col-md-4:nth-child(1) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(1) {
    animation-delay: 0.1s;
}

.is-visible .col-md-4:nth-child(2) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(2) {
    animation-delay: 0.2s;
}

.is-visible .col-md-4:nth-child(3) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(3) {
    animation-delay: 0.3s;
}

.is-visible .col-md-4:nth-child(4) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(4) {
    animation-delay: 0.4s;
}

.is-visible .col-md-4:nth-child(5) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(5) {
    animation-delay: 0.5s;
}

.is-visible .col-md-4:nth-child(6) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(6) {
    animation-delay: 0.6s;
}

.is-visible .col-md-4:nth-child(7) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(7) {
    animation-delay: 0.7s;
}

.is-visible .col-md-4:nth-child(8) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(8) {
    animation-delay: 0.8s;
}

.is-visible .col-md-4:nth-child(9) .service-icon-box,
.reveal-grid.is-visible .reveal-item:nth-child(9) {
    animation-delay: 0.9s;
}

.reveal-item {
    opacity: 0;
}

.reveal-grid.is-visible .reveal-item {
    animation: iconFadeInUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.service-card .headline {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    color: var(--black) !important;
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.service-card ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--dark-gray);
    display: block;
}

.service-card ul li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.service-card .more-link {
    margin-top: auto;
    color: var(--primary);
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-card .more-link:hover {
    color: var(--black);
}

.header-tagline {
    display: block;
    font-size: 0.7rem;
    font-weight: 300;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
    opacity: 0.8;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    html {
        font-size: 15px; /* Reduzierte Basis-Schriftgröße für Mobile */
    }

    /* Header Anpassungen für Mobile */
    .site-header .container {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .header-logo {
        min-width: 200px; /* Auch mobil Mindestbreite beibehalten */
    }

    h1 {
        font-size: 1.5rem !important; /* Weiter verkleinert (ca. 22.5px) */
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }

    h2 {
        font-size: 1.3rem !important; /* Verkleinert auf ca. 19.5px */
        margin-bottom: 1rem;
    }

    h3 {
        font-size: 1.15rem !important; /* Verkleinert auf ca. 17px */
    }
    
    h4, h5, h6 {
        font-size: 1rem !important; /* Basisgröße */
    }

    .text-xl {
        font-size: 1.1rem !important;
    }

    /* Reduzierte Paddings für Container und Boxen */
    .hero-content {
        padding: 3rem 1.5rem !important;
    }

    .feature-box {
        padding: 1.5rem !important;
    }

    .service-card {
        padding: 1.5rem !important;
    }

    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Kleinere Icons auf Mobile */
    .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
        border-width: 2px !important;
    }

    /* Buttons mobil optimiert */
    .btn-agency {
        width: 100%;
        display: flex;
        margin-bottom: 0.5rem;
        padding: 0.8rem 1rem !important;
    }
    .header-actions .btn-agency {
        width: auto;
        min-width: 140px;
        margin-bottom: 0;
    }
    
    /* Abstände zwischen Listenelementen verringern */
    ul li, ol li {
        margin-bottom: 0.5rem;
    }
    
    /* Service Icon Box kleiner */
    .service-icon-box {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
}
