/* ============================================================
   ADMIN.CSS — Frontend + Block Editor Vorschau
   ============================================================ */

/* ============================================================
   1. CUSTOM PROPERTIES (TOKENS)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Plus+Jakarta+Sans:wght@500;700;800&display=swap');

:root {
    /* Farben (from theme.json tokens but as variables for CSS usage) */
    --color-primary:       #DD183B;
    --color-primary-dark:  #CC1939;
    --color-surface-dark:  #0F172A;
    --color-gray-dark:     #3A3A3A;
    --color-surface-light: #FFEDE6;
    --color-surface:       #FFFFFF;
    --color-accent-peach:  #FFD1BF;
    --color-surface-black: #140609;
    --color-text:          #222222;

    /* Typografie */
    --font-heading:  "Plus Jakarta Sans", sans-serif;
    --font-body:     "Manrope", sans-serif;

    /* Spacing */
    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  2rem;
    --space-lg:  3.5rem;
    --space-xl:  6rem;
    --space-2xl: 10rem;

    /* Layout */
    --content-width: 740px;
    --wide-width:    1200px;
}

/* ============================================================
   2. RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video              { max-width: 100%; display: block; height: auto; }
a                       { color: inherit; text-decoration: none; }

/* ============================================================
   3. BASE
   ============================================================ */
body {
    font-family: var(--font-body);
    font-size:   1rem;
    line-height: 1.65;
    color:       var(--color-text);
    background:  var(--color-surface);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.15;
    color: var(--color-surface-dark);
    margin-bottom: var(--space-sm);
}

p {
    margin-bottom: var(--space-sm);
}

/* ============================================================
   4. LAYOUT (FULL-WIDTH BREAKOUT GRID)
   ============================================================ */
.section-editor--content {
    display: grid;
    grid-template-columns: 
        [full-start] minmax(var(--space-md, 20px), 1fr) 
        [content-start] min(100% - calc(2 * var(--space-md, 20px)), 1200px) [content-end] 
        minmax(var(--space-md, 20px), 1fr) [full-end];
}

.section-editor--content > * {
    grid-column: content;
}

.section-editor--content > .alignfull {
    grid-column: full;
    width: 100%;
}

.section-editor--content > .alignwide {
    grid-column: full-start / full-end;
    max-width: 1400px;
    justify-self: center;
    width: 100%;
}

/* Container Utility */
.container {
    width:     100%;
    max-width: var(--wide-width);
    margin:    0 auto;
    padding:   0 var(--space-md);
}

/* Flex Columns */
.columns {
    display:   flex;
    gap:       var(--space-md);
    flex-wrap: wrap;
}

.columns > * { flex: 1 1 280px; }
.columns--2 > * { flex: 1 1 calc(50% - var(--space-md)); }
.columns--3 > * { flex: 1 1 calc(33.333% - var(--space-md)); }
.columns--4 > * { flex: 1 1 calc(25% - var(--space-md)); }

/* ============================================================
   5. COMPONENTS & SPECIFIC PATTERNS
   ============================================================ */

/* Button */
.wp-block-button__link {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border-radius: 999px; /* Pill shape */
    padding: 0.75rem 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    transition: background-color 0.3s ease;
    display: inline-block;
}
.wp-block-button__link:hover {
    background-color: var(--color-primary-dark);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-surface);
    width: 100%;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header__logo img {
    height: 40px;
    width: auto;
}
.site-header__nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-md);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Hero */
.hero {
    position: relative;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}
.hero--full { min-height: 90vh; }
.hero--small { min-height: 40vh; }

.hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6); /* Dark overlay */
    z-index: 1;
}
.hero__content {
    position: relative;
    z-index: 2;
    color: var(--color-surface);
    max-width: 800px;
}
.hero__content h1 {
    color: var(--color-surface);
    font-size: clamp(3rem, 6vw, 4.5rem);
    margin-bottom: var(--space-sm);
}

/* Slide in animation for inner pages hero */
.hero--slide-in .hero__content h1,
.hero--slide-in .hero__content p {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.hero--slide-in.is-animated .hero__content h1 {
    opacity: 1;
    transform: translateX(0);
}
.hero--slide-in.is-animated .hero__content p {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

/* Hero Features (Bottom row) */
.hero-features {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    border-top: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    margin: 0 !important;
}
.hero-features .columns {
    gap: 0;
}
.hero-feature-item {
    position: relative;
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    color: var(--color-surface);
    border-right: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}
.hero-feature-item:hover {
    background: rgba(0,0,0,0.5);
}
.hero-feature-item:last-child {
    border-right: none;
}
.hero-feature-item img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}
.hero-feature-item a {
    color: var(--color-surface);
    text-decoration: none;
}
.hero-feature-item a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
}

/* Stats Split Pattern */
.stats-split {
    padding: var(--space-xl) 0;
    background: #F4F5F7; /* Light gray background */
}
.stats-split__left h2 {
    font-size: 2.5rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-box {
    background: var(--color-surface-dark);
    color: var(--color-surface);
    padding: var(--space-lg) var(--space-md);
    text-align: center;
}
.stat-box.highlight {
    background: var(--color-primary);
}
.stat-box .stat-number {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 800;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
}

/* Services Grid Pattern */
.services-grid {
    padding: var(--space-xl) 0;
    background: var(--color-surface);
}
.service-card {
    display: flex;
    flex-direction: column;
}
.service-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: var(--space-sm);
}
.service-card h3 {
    font-size: 1.5rem;
}
.service-card a {
    color: var(--color-primary);
    font-weight: 700;
    margin-top: auto;
    display: inline-block;
    padding-top: var(--space-xs);
}
.service-card a:hover {
    color: var(--color-primary-dark);
}

/* Certificates Grid */
.certificates-grid {
    background: #EAEAEA;
    padding: var(--space-xl) 0;
}
.cert-box {
    background: var(--color-surface);
    padding: var(--space-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border-top: 4px solid var(--color-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Logos Grid */
.logos-grid {
    padding: var(--space-xl) 0;
    background: var(--color-surface);
}
.logos-grid .columns {
    align-items: center;
    justify-content: center;
}
.logos-grid img {
    max-height: 60px;
    width: auto;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* Benefits Grid */
.benefits-grid {
    padding: var(--space-xl) 0;
    background: var(--color-surface);
}
.benefit-item {
    margin-bottom: var(--space-md);
}
.benefit-item h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.benefit-item h3::before {
    content: "→";
    display: inline-block;
    color: var(--color-primary);
    font-weight: bold;
}

/* Bottom CTA */
.cta-bottom {
    position: relative;
    padding: var(--space-2xl) 0;
    background-image: var(--cta-image);
    background-size: cover;
    background-position: center;
    text-align: center;
    color: var(--color-surface);
}
.cta-bottom::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
}
.cta-bottom .container {
    position: relative;
    z-index: 2;
}
.cta-bottom h2 {
    color: var(--color-surface);
    font-size: 3rem;
}

/* Footer */
.site-footer {
    background: var(--color-surface-black);
    color: rgba(255,255,255,0.7);
    padding: var(--space-xl) 0 var(--space-md);
    font-size: 0.9rem;
}
.site-footer h4 {
    color: var(--color-surface);
    font-size: 1.2rem;
}
.site-footer a:hover {
    color: var(--color-surface);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    text-align: center;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: var(--color-surface);
    border: none;
    border-radius: 4px; /* Square with slight rounding */
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 0;
}
.scroll-top span {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-90deg);
}
.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
}
.scroll-top:hover {
    background-color: var(--color-primary-dark);
}

/* ============================================================
   6. MEDIA QUERIES
   ============================================================ */
@media (max-width: 768px) {
    /* Columns → stacked */
    .columns--2 > *,
    .columns--3 > *,
    .columns--4 > * { flex: 1 1 100%; }

    .hero-features {
        position: static;
        background: var(--color-surface-dark);
    }
    .hero-feature-item {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   7. BLOCK EDITOR OVERRIDES
   ============================================================ */
.editor-styles-wrapper {
    font-family: var(--font-body);
    color:       var(--color-text);
}

.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
    font-family: var(--font-heading);
}
