/*
 * Theme Name: AutoGreiss GmbH Theme
 * Author: Kevin Kuzmanic
 * Description: #Prod – Responsive Dynamic Layout - FORCED SCALING
 * Version: 3.0 (Full Resize Mode)
 */

:root {
  --blue-dark: #1d2131;
  --footer-bg: #000000;
  --blue-hero-bg: #13294b;
  --white: #ffffff;
  --gray-light: #f5f6f7;
  --gray-border: #e7e9ec;
  --black: #000000;
  --font-main: Arial, Helvetica, sans-serif;
  --bluebg-greiss: #1973b9;

  /* DESKTOP DEFAULTS (Standard Clamps for PC) */
  --fs-base: clamp(14px, 1.3vw, 18px);
  --fs-small: clamp(0.8rem, 1vw, 1rem);
  --fs-medium: clamp(1rem, 1.6vw, 1.3rem);
  --fs-large: clamp(1.4rem, 2.4vw, 2rem);
  --fs-xlarge: clamp(2rem, 4vw, 3.5rem);
}

/* Universal */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  font-size: var(--fs-base);
}
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  background: var(--gray-light);
  color: var(--black);
  font-family: var(--font-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 135px;
}

a {
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-small);
}
a:hover {
  text-decoration: underline;
}

/* =========================================
   HEADER & TOP BAR
   ========================================= */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  background-color: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: top 0.3s ease;
  display: flex;
  flex-direction: column;
}

.main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: height 0.3s ease;
}

header.site-header.shrink .main-header-content {
  height: 50px;
}

header.site-header .logo-text {
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  color: var(--black);
  white-space: nowrap;
}
header.site-header .logo-sub {
  font-weight: 400;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: var(--blue-dark);
  letter-spacing: 0.04em;
}

.site-logo {
  width: 300px;
  margin: 0;
  display: block;
  transition: width 0.3s ease;
}

header.site-header.shrink .site-logo {
  width: 200px;
}

.top-bar {
  background-color: var(--blue-dark);
  color: var(--white);
  padding: 0 1rem;
  font-size: var(--fs-small);
  width: 100%;
  box-sizing: border-box;
  transition: height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  height: 35px;
  opacity: 1;
  display: flex;
  align-items: center;
}

header.site-header.shrink .top-bar {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.top-bar-left a,
.social-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: normal;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.top-bar-left a:hover,
.social-links a:hover {
  opacity: 0.8;
}

.social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
}

.top-bar-icon {
    height: 1em;
    width: auto;
    fill: var(--bluebg-greiss);
}

.top-bar-left .top-bar-icon {
    margin-right: 8px;
}

/* =========================================
   NAVIGATION
   ========================================= */
.site-nav {
  display: flex;
}
.site-nav ul.menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}
.site-nav ul.menu li {
  margin: 0;
}
.site-nav ul.menu li a {
  color: var(--blue-dark);
  font-weight: 600;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  text-transform: uppercase;
  text-decoration: none;
  user-select: none;
  padding: 10px 5px;
  position: relative;
  transition: color 0.3s ease;
}

.site-nav ul.menu li a:hover,
.site-nav ul.menu li a:focus {
  text-decoration: none;
  outline: none;
  color: var(--bluebg-greiss);
}

.site-nav ul.menu li a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--bluebg-greiss);
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}

.site-nav ul.menu li a:hover::after {
  transform: scaleX(1);
}

.site-nav ul.menu .current-menu-item a {
  color: var(--bluebg-greiss);
  font-weight: 700;
}
.site-nav ul.menu .current-menu-item a::after {
  transform: scaleX(1);
}

/* =========================================
   CONTENT AREAS
   ========================================= */
.hero-section {
  background-color: var(--blue-hero-bg);
  color: var(--white);
  padding: clamp(4rem, 10vw, 6rem) 2rem clamp(3rem, 8vw, 5rem);
  text-align: center;
  user-select: none;
}
.hero-section h1 {
  font-size: var(--fs-xlarge);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-section h2 {
  font-weight: 400;
  font-size: var(--fs-medium);
  margin: 1rem 0 3rem;
  letter-spacing: 0.05em;
}
.hero-section button.cta {
  background: var(--white);
  border: none;
  color: var(--blue-hero-bg);
  font-size: clamp(0.9rem, 2.2vw, 1.25rem);
  font-weight: 700;
  padding: clamp(10px, 2vw, 14px) clamp(28px, 4vw, 42px);
  border-radius: 30px;
  cursor: pointer;
  text-transform: uppercase;
  user-select: none;
  transition: background-color 0.2s ease;
}
.hero-section button.cta:hover,
.hero-section button.cta:focus {
  background-color: #e6e6e6;
  outline: none;
}

main.content-area {
  background: var(--white);
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  padding: 0;
  margin: 0;
}
main.content-area > * {
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

.content-section {
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}
.content-section:last-child {
  border-bottom: none;
}
.content-section h2 {
  color: var(--blue-dark);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}
.content-section p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
  color: var(--black);
}

.iframe-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 1600px;
  overflow: hidden;
}
.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
footer.site-footer {
  background: var(--footer-bg);
  color: var(--white);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  text-align: center;
  user-select: none;
}

footer.site-footer a {
    color:var(--white);
    font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    text-align: center;
    user-select: none;
}

footer.site-footer a:hover {
    color: #FFFFFF;
    font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    text-align: center;
    user-select: none;
}

/* =========================================
   MOBILE MENU (HAMBURGER)
   ========================================= */
.nav-toggle { display: none; }
.nav-toggle-label {
  position: absolute;
  top: 55px;
  right: 20px;
  height: 25px;
  width: 30px;
  cursor: pointer;
  display: none;
  user-select: none;
  z-index: 1001;
  transition: top 0.3s ease;
}
header.site-header.shrink .nav-toggle-label {
    top: 12px;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: #000;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  position: relative;
  transition: all 0.3s ease;
}
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle-label span::before { top: -8px; }
.nav-toggle-label span::after { top: 8px; }

.nav-toggle:checked + .nav-toggle-label span { background: transparent; }
.nav-toggle:checked + .nav-toggle-label span::before { transform: rotate(45deg); top: 0; }
.nav-toggle:checked + .nav-toggle-label span::after { transform: rotate(-45deg); top: 0; }

@media (max-width: 768px) {
  .nav-toggle-label { display: block; }
  .site-nav {
    position: fixed;
    background: white;
    height: 100vh;
    width: 70%;
    top: 0;
    right: -100%;
    flex-direction: column;
    padding: 80px 20px 20px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    z-index: 1000;
  }
  .nav-toggle:checked ~ .site-nav { right: 0; }
  .site-nav ul.menu { flex-direction: column; gap: 0; width: 100%; }
  .site-nav ul.menu li { margin: 0; text-align: center; }
  .site-nav ul.menu li a {
    display: block;
    font-size: 1.1rem;
    padding: 18px 10px;
    border-radius: 5px;
  }
  .site-nav ul.menu li a::after { display: none; }
  .site-nav ul.menu li a:hover {
    background-color: var(--gray-light);
    color: var(--bluebg-greiss);
  }
  .site-nav ul.menu .current-menu-item a {
    background-color: var(--bluebg-greiss);
    color: var(--white);
    font-weight: 700;
  }
}

@media (max-width: 1024px) {
  nav.site-nav ul { gap: 1.5rem; }
}

/* ==========================================================================
   MOBILE FORCE SCALING ENGINE (THE FIX)
   ========================================================================== */

@media only screen and (max-width: 782px) {

    /* 1. OVERRIDE VARIABLES TO PURE VIEWPORT WIDTH (VW) */
    /* This removes the safety clamp and forces linear shrinking */
    :root {
        --fs-base: 3.5vw !important;  
        --fs-small: 2.5vw !important;
        --fs-medium: 3.5vw !important;
        --fs-large: 5vw !important;
        --fs-xlarge: 7vw !important;
    }

    /* 2. SCALE HEADER & PADDING */
    body {
        padding-top: 25vw !important; 
    }
    
    .main-header-content {
        height: 15vw !important; 
    }
    
    .site-logo {
        width: 40vw !important; 
    }

    /* 3. APPLY SCALING TO ALL TEXT ELEMENTS GLOBALLY */
    /* This overrides any pixel settings in blocks */
    body, p, li, a, span, div, figcaption {
        font-size: var(--fs-base) !important;
        line-height: 1.3 !important;
    }

    h1 { font-size: var(--fs-xlarge) !important; }
    h2 { font-size: var(--fs-large) !important; }
    h3 { font-size: var(--fs-medium) !important; }

    /* 4. FORCE MEDIA & TEXT BLOCK TO STAY SIDE-BY-SIDE (NO STACKING) */
    .wp-block-media-text.is-stacked-on-mobile,
    .wp-block-media-text {
        display: flex !important;
        flex-direction: row !important; /* Force side-by-side */
        flex-wrap: nowrap !important; /* Prevent wrapping */
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 2vw !important;
    }

    /* Force Image to 50% width exactly */
    .wp-block-media-text__media {
        width: 50% !important;
        flex: 0 0 50% !important; /* Don't grow, don't shrink, stay 50% */
        margin: 0 !important;
    }
    
    .wp-block-media-text__media img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: cover;
    }

    /* Force Text Content to 50% width exactly */
    .wp-block-media-text__content {
        width: 50% !important;
        flex: 0 0 50% !important;
        padding: 1.5vw !important; /* Padding shrinks with screen */
        overflow: hidden !important;
    }
    
    /* Specific overrides inside the block to ensure scaling */
    .wp-block-media-text__content p,
    .wp-block-media-text__content li {
        font-size: 3vw !important; /* Explicitly scale this text */
        margin-bottom: 1em !important;
    }
    
    .wp-block-media-text__content h1,
    .wp-block-media-text__content h2,
    .wp-block-media-text__content h3 {
        font-size: 4vw !important;
        margin-top: 0 !important;
        margin-bottom: 0.5em !important;
    }
    
    /* 5. FIX PADDINGS FOR CONTENT SECTIONS */
    .hero-section, 
    .content-section {
        padding: 5vw 3vw !important; /* Convert padding to vw */
    }
    
    button.cta {
        padding: 2vw 4vw !important;
        font-size: var(--fs-small) !important;
    }
}
