/* mobile.css
   Enthält alle mobil- und tablet-spezifischen Styles, die zuvor in styles.css standen.
   Diese Datei wird in den HTML-Dateien nur für kleinere Viewports geladen.
*/

/* Timeline responsive */
@media (max-width: 992px) {
  .timeline-container {
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .timeline {
    padding: 4rem 0;
  }

  .timeline-container {
    padding: 2rem 0;
  }

  .timeline-line {
    left: 30px;
    width: 4px;
  }

  .timeline-item {
    margin-bottom: 4rem;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    width: calc(100% - 90px);
    margin-left: 90px;
    margin-right: 0;
    text-align: left;
    transform-origin: left center;
  }

  .timeline-item:nth-child(odd) .timeline-content::after,
  .timeline-item:nth-child(even) .timeline-content::after {
    left: -62px;
    right: auto;
    width: 20px;
    height: 20px;
  }

  .timeline-date {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.95rem;
  }

  .timeline-content {
    padding: 20px;
  }

  .timeline-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    width: calc(100% - 70px);
    margin-left: 70px;
    padding: 15px;
  }

  .timeline-item:nth-child(odd) .timeline-content::after,
  .timeline-item:nth-child(even) .timeline-content::after {
    left: -52px;
    width: 16px;
    height: 16px;
    top: 20px;
  }

  .timeline-date {
    padding: 5px 10px;
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .timeline-content p {
    font-size: 0.95rem;
    margin-bottom: 15px;
  }

  .timeline-image-placeholder {
    height: 150px;
    font-size: 0.9rem;
  }
}

/* Responsive (global) */
@media (max-width: 1200px) {
  .container { padding: 0 15px; }
  .nav-container { padding: 15px 20px; }
  .hero-text h1 { font-size: 3.5rem; }
  .hero-subline { font-size: 1.3rem; }
  .market-grid,
  .market-grid-career,
  .business-grid,
  .figures-grid,
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .agrar-hero .hero-text,
  .agrar-hero .hero-images { float: none; max-width: 100%; }

  .agrar-hero .hero-images {
    margin-top: 2rem;
    gap: 1rem;
    grid-template-areas:
      "img1 img2"
      "img3 img4";
  }

  .agrar-hero .hero-images img:nth-child(1),
  .agrar-hero .hero-images img:nth-child(3),
  .agrar-hero .hero-images img:nth-child(4) { transform: translateY(0); }

  .agrar-hero .hero-images img:nth-child(2) {
    transform: translateY(0);
    grid-row: span 1;
    height: auto;
  }

  .agrar-hero .hero-images img:hover { transform: scale(1.05); }

  .faq-content { flex-direction: column; }
  .expert-grid { grid-template-columns: 1fr; }
  .action-content,
  .tip-content { flex-direction: column; }
  .footer-content { flex-direction: column; gap: 30px; }
  .footer-left,
  .footer-right { flex: 0 0 100%; }
  .contact-container { flex-direction: column; }
  .contact-form-column,
  .contact-info-column { flex: 0 0 100%; }
  .contact-divider { display: none; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-names-grid { grid-template-columns: repeat(2, 1fr); }
  .statements-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .agrar-hero .hero-images {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    grid-template-areas:
      "img2"
      "img1"
      "img3"
      "img4";
  }

  /* Mobile nav + misc */
  .nav-menu li:focus-within .dropdown-menu { max-height: 300px; }
  .agrar-hero .hero-images img { max-height: 250px; }
  .agrar-hero .hero-images img:nth-child(2) { max-height: 350px; }

  .nav-menu {
    position: fixed;
    top: 0; right: -100%; left: auto; width: 100%; height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    flex-direction: column; align-items: center;
    padding: 90px 0 40px; transition: right 0.3s ease; z-index: 999;
  }
  .nav-menu.active { right: 0; }
  .nav-menu li { margin-bottom: 20px; text-align: center; width: 100%; }
  .nav-actions { margin-right: 10px; }
  .nav__search-btn { margin-left: auto; }
  .nav-actions .shop-btn { display: none; }
  .mobile-shop-item { display: block; margin-top: 20px; }
  .mobile-shop-btn {
    display: inline-block; margin: 0 auto; background-color: white; color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--accent); width: 80%;
  }
  .mobile-shop-btn::after { color: var(--primary); }
  .mobile-shop-btn:hover { background-color: #f5f5f5; color: var(--primary); transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
  .mobile-shop-btn:hover::after { color: var(--primary); transform: translateX(3px); }

  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; width: 100%; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background-color: rgba(255,255,255,0.95); }
  .nav-menu li:hover .dropdown-menu, .nav-menu li.open .dropdown-menu { max-height: 300px; }
  .mobile-menu-toggle { display: block; }
  .mobile-menu-toggle span { display: none; }
  .slider-btn { display: none; }

  /* Hide hero content on mobile across all pages */
  .hero-content { display: none; }

  .slider-wrapper { overflow-x: scroll; }

  .main-headline { font-size: 2.5rem !important; }
  .teaser-text { font-size: 1.2rem; }

  .market-grid,
  .market-grid-career,
  .business-grid,
  .figures-grid,
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }

  .business-card { height: 200px; }
  .figure-number { font-size: 2.8rem; }
  .figure-label { font-size: 1rem; }
  .action-content { gap: 20px; }
  .action-text h2 { font-size: 1.8rem; }
  .expert-tip .tip-content { gap: 20px; }
  .tip-image { width: 100%; }
  .tip-text h2 { font-size: 1.8rem; }

  .photos-grid { grid-template-columns: repeat(6, 1fr); gap: 0; }
  .photo-item.portrait,
  .photo-item.landscape { grid-column: span 6; height: 300px; }
  .gallery-title { font-size: 2rem; }

  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
  .footer-bottom nav { flex-wrap: wrap; justify-content: center; }

  .contact-filter { flex-direction: row; overflow-x: auto; padding-bottom: 1rem; justify-content: flex-start; }
  .filter-btn { flex: 0 0 auto; white-space: nowrap; }

  /* Ensure hero media fills the hero without gaps on mobile */
  .video-background img,
  .video-background video { width: 100%; height: 100%; object-fit: cover; object-position: center; }

  /* Make hero taller on mobile/tablet */
  .hero-section { height: 65vh; min-height: 0; width: 100%; }
  .hero-content { height: 65vh; min-height: 0; }

  /* Über uns: fixed hero height on mobile */
  body.ueber-uns .hero-section { height: 320px; min-height: 320px; }
  body.ueber-uns .hero-content { height: 320px; min-height: 320px; }

  /* Reduce spacing between hero and Market Areas on mobile */
  .market-areas { padding-top: 0.5rem; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 2.5rem; }
  .hero-subline { font-size: 1rem; }
  .section-title { font-size: 2rem; }

  .hero-section { height: 65vh; min-height: 0; width: 100%; }
  .hero-content { height: 65vh; min-height: 0; padding-left: 15px; padding-right: 15px; }

  .nav-container { padding: 12px 15px; }
  .nav-logo img { max-height: 85px; height: auto; width: auto; }
  .nav-actions .shop-btn { font-size: 0.9rem; padding: 8px 12px; }

  .action-text h2 { font-size: 1.5rem; }
  .action-text ul { margin-bottom: 20px; }
  .cta-button { width: 100%; text-align: center; }

  .business-card { height: 180px; }
  .business-overlay { padding: 15px; }
  .business-overlay h3 { font-size: 1.2rem; }
  .business-overlay p { font-size: 0.9rem; }

  .product-image { height: 160px; }
  .product-content { padding: 15px; }
  .product-content h3 { font-size: 1.1rem; }

  .expert-badge { padding: 5px 10px; font-size: 0.8rem; }
  .tip-text h2 { font-size: 1.5rem; }

  .newsletter-form,
  .newsletter-form-career { flex-direction: column; gap: 10px; }
  .newsletter-input,
  .newsletter-input-career { width: 100%; border-radius: var(--radius); }
  .newsletter-btn,
  .newsletter-btn-career { width: 100%; border-radius: var(--radius); }

  .footer-content { text-align: center; }
  .footer-column { margin-bottom: 20px; }

  .form-row { flex-direction: column; gap: 0; }
  .contact-form-column,
  .contact-info-column { padding: 24px 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .filter-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .submit-btn { width: 100%; }
}

/* Newsletter: stack input and button on tablets and smaller, fix button alignment */
@media (max-width: 768px) {
  .newsletter-content { width: 100%; padding-left: 16px; padding-right: 16px; }
  .newsletter-form { flex-direction: column; align-items: stretch; gap: 10px; width: 100%; }
  .newsletter-input { width: 100%; border-radius: var(--radius); box-sizing: border-box; }
  .newsletter-btn { width: 100%; border-radius: var(--radius); align-self: stretch; text-align: center; box-sizing: border-box; }

  /* Step 2 submit alignment on mobile/tablet */
  .form-row { flex-direction: column; gap: 0; }
  .submit-btn { width: 100%; }
}

/* Index (home): hide Market Areas descriptions on mobile */
@media (max-width: 768px) {
  .market-areas .market-card p { display: none; }
}

/* Home page (index): remove spacing between hero and Market Areas on mobile */
@media (max-width: 768px) {
  body.home .market-areas { padding-top: 0; }
}

/* Karriere: Benefits mobile overrides */
@media (max-width: 576px) {
  body.karriere .benefits-carousel { min-height: 0; }
  body.karriere .benefits-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  body.karriere .benefit-card { padding: 0.75rem; }
  body.karriere .benefit-card h3 { font-size: 1rem; margin-bottom: 0; }
  body.karriere .benefit-card p { display: none; }
  body.karriere .benefit-icon img { width: 48px; height: 48px; }
}
@media (max-width: 380px) {
  body.karriere .benefits-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Warum Obereder responsive adjustments */
@media (max-width: 600px) {
  .warum-obereder .values-grid { grid-template-columns: 1fr; }
}


/* Footer mobile adjustments: center everything and reduce logo sizes */
@media (max-width: 1024px) {
  /* Center content blocks in the footer on tablets and smaller */
  .footer-content { align-items: center; }
  .footer-left { text-align: center; }
  .footer-right { justify-content: center; gap: 24px; flex-wrap: wrap; }
  .footer-column { text-align: center; }
}

@media (max-width: 768px) {
  /* Smaller logos on mobile (base), overridden by variant below) */
  .footer-left .logo { height: 72px; }
  .footer-left .castrol-logo { height: 56px; }

  /* Reorder footer columns so that "Kontaktieren Sie uns" appears directly under the logos */
  .footer-right { display: flex; flex-direction: column-reverse; align-items: center; }
  .footer-right .footer-column { flex: 0 0 100%; text-align: center; }

  /* Stack and center the footer bottom area (base) */
  .footer-bottom { flex-direction: column; align-items: center; gap: 12px; text-align: center; }
  .footer-bottom nav { justify-content: center; flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 480px) {
  /* Extra small phones: make logos even smaller */
  .footer-left .logo { height: 60px; }
  .footer-left .castrol-logo { height: 48px; }
}

/* Mobile Social FAB (floating action button) */
/* Hidden by default (desktop); shown on mobile */
.social-fab { display: none; }

@media (max-width: 768px) {
  /* Hide the existing sidebar on mobile */
  .social-sidebar { display: none !important; }

  .social-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    z-index: 1100;
    display: block;
    pointer-events: none; /* children re-enable */
  }

  .social-fab__btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    border: none;
    outline: none;
    pointer-events: auto;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .social-fab__btn:active { transform: scale(0.96); }
  .social-fab__btn:hover { background: var(--accent-hover); }

  /* The three dots icon */
  .social-fab__dots,
  .social-fab__dots::before,
  .social-fab__dots::after {
    display: block;
    content: '';
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
  }
  .social-fab__dots { position: relative; }
  .social-fab__dots::before { position: absolute; left: -10px; top: 0; }
  .social-fab__dots::after { position: absolute; right: -10px; top: 0; }

  /* List container */
  .social-fab__list {
    position: absolute;
    right: 0;
    bottom: 64px; /* 56 + 8 gap */
    display: grid;
    gap: 10px;
    pointer-events: none; /* enable on open */
  }

  .social-fab__item { transform: translateY(10px); opacity: 0; transition: transform 220ms ease, opacity 220ms ease; }

  .social-fab__link {
    width: 48px; height: 48px; border-radius: 50%; background: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    pointer-events: auto; /* when visible */
  }
  .social-fab__link img { width: 24px; height: 24px; display: block; }

  /* Open state */
  .social-fab.open .social-fab__list { pointer-events: auto; }
  .social-fab.open .social-fab__item { opacity: 1; transform: translateY(0); }

  /* Staggered animation for vertical stack */
  .social-fab.open .social-fab__item:nth-child(1) { transition-delay: 0ms; }
  .social-fab.open .social-fab__item:nth-child(2) { transition-delay: 40ms; }
  .social-fab.open .social-fab__item:nth-child(3) { transition-delay: 80ms; }
}


/* Footer mobile enhancements per requirements */
@media (max-width: 768px) {
  /* Stack and center everything in the footer */
  .footer-content { flex-direction: column; align-items: center; text-align: center; gap: 24px; }
  .footer-left { text-align: center; }
  .footer-right { display: flex; flex-direction: column-reverse; align-items: center; gap: 20px; }
  .footer-right .footer-column { flex: 0 0 100%; text-align: center; }

  /* Logo sizing: smaller and responsive */
  .footer-left .logo { max-width: 150px; height: auto; }
  .footer-left .castrol-logo { max-width: 110px; height: auto; margin-top: 12px; display: inline-block; }

  /* Typography: readable text and clearer headings */
  .footer { font-size: 15px; }
  .footer .footer-column h4 { font-size: 18px; font-weight: 700; }

  /* Whitespace between blocks */
  .footer-column { margin-bottom: 20px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .footer-bottom nav { justify-content: center; flex-wrap: wrap; }

  /* Hours table centered */
  .footer .hours-table { margin: 0 auto; }

  /* Hide social icons on mobile to free space */
  .footer-social { display: none !important; }
}

@media (max-width: 480px) {
  /* Extra small devices: keep Obereder logo larger as requested */
  .footer-left .logo { max-width: 160px; }
  .footer-left .castrol-logo { max-width: 95px; }
  .footer { font-size: 14px; }
  .footer .footer-column h4 { font-size: 18px; }
}


/* Mobile footer: align logos left/right and align with first/last links; enlarge Obereder logo */
@media (max-width: 768px) {
  /* Make the logos row span the full container and align to edges */
  .footer .footer-content { align-items: stretch; }
  .footer .footer-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left; /* ensure left logo is truly left-aligned */
  }
  .footer .footer-left .logo { max-width: 180px; height: auto; }
  .footer .footer-left .castrol-logo { max-width: 100px; height: auto; }

  /* Footer links: first row shows Impressum (left) and Versand & Lieferung (right) */
  .footer .footer-bottom { align-items: stretch; }
  .footer .footer-bottom nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    gap: 12px 0;
  }
  /* Default: other links go to next row and are centered */
  .footer .footer-bottom nav a { order: 1; flex: 0 0 100%; text-align: center; }
  /* Place these two in the first row, left and right aligned */
  .footer .footer-bottom nav a[href="impressum.html"],
  .footer .footer-bottom nav a[href="versand.html"] {
    order: 0;
    flex: 0 0 50%;
  }
  .footer .footer-bottom nav a[href="impressum.html"] { text-align: left; }
  .footer .footer-bottom nav a[href="versand.html"] { text-align: right; }
}


/* Mobile override: center the Kontakt column (last in DOM) on small screens */
@media (max-width: 768px) {
  .footer .footer-right .footer-column:last-child { text-align: center; }
}


/* Mobile touch targets and form accessibility (WCAG-friendly) */
@media (max-width: 768px) {
  /* Generic button styles */
  button,
  .btn,
  .cta-button,
  .mobile-shop-btn,
  input[type="submit"],
  .shop-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px; /* prevent iOS zoom */
    line-height: 1.2;
    touch-action: manipulation;
  }

  /* Spacing between adjacent buttons */
  .btn + .btn,
  button + button,
  .cta-button + .cta-button { margin-left: 8px; }
  .btn,
  button,
  .cta-button,
  .mobile-shop-btn,
  input[type="submit"] { margin-bottom: 10px; }

  /* Visual feedback */
  .btn:active,
  button:active,
  .cta-button:active,
  .mobile-shop-btn:active,
  input[type="submit"]:active { transform: translateY(1px); }

  .btn:focus-visible,
  button:focus-visible,
  .cta-button:focus-visible,
  .mobile-shop-btn:focus-visible,
  input[type="submit"]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 60%, white);
    outline-offset: 2px;
  }

  /* Form controls */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  input[type="password"],
  select,
  textarea {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 16px; /* prevent iOS zoom */
  }

  /* Labels clickable and spaced */
  label { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; }
  .form-group, .form-row, .form-field { margin-bottom: 14px; }

  /* Checkboxes and radios larger and touch-friendly */
  input[type="checkbox"],
  input[type="radio"] {
    width: 24px; height: 24px;
    accent-color: var(--accent);
  }
  /* Ensure click area around small inputs */
  label:has(input[type="checkbox"]),
  label:has(input[type="radio"]) {
    padding: 8px 10px;
    border-radius: 8px;
  }

  /* Icon links: ensure tappable area */
  .icon-button,
  .social-sidebar__icon,
  .footer-social a,
  .nav-actions a {
    min-width: 44px; min-height: 44px;
    padding: 10px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}


/* Market Areas: enforce 2-column grid on tablet/mobile and equal-height cards */
@media (max-width: 992px) {
  /* Ensure exactly two tiles per row */
  .market-areas .market-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  /* Make the link cards stretch to equal heights and center content */
  .market-areas .market-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
  }

  /* Slightly larger icon for clarity on mobile */
  .market-areas .market-icon img {
    width: 56px;
    height: 56px;
  }
}

/* Very small devices: keep two columns but reduce gap to fit nicely */
@media (max-width: 420px) {
  .market-areas .market-grid { gap: 14px; }
}




/* Karriere: Job Openings mobile adjustments - make the job tile a bit taller on phones */
@media (max-width: 576px) {
  body.karriere .job-header {
    padding-top: 24px; /* was 15px; increase vertical padding to make tile taller */
    padding-bottom: 24px;
    min-height: 72px; /* ensure overall taller hit area */
  }
}


/* Market pages hero image mobile scaling: ensure header images scale in width and are not cropped */
@media (max-width: 768px) {
  /* Reset fixed viewport hero on mobile for market pages */
  body.kfz .hero-section,
  body.nfz .hero-section,
  body.agrar .hero-section,
  body.industrie .hero-section,
  body.kontakt .hero-section {
    height: auto;
    min-height: 0;
  }

  body.kfz .video-background,
  body.nfz .video-background,
  body.agrar .video-background,
  body.industrie .video-background,
  body.kontakt .video-background {
    position: relative; /* was absolute in desktop */
    width: 100%;
    height: auto;
    top: auto;
    left: auto;
  }

  body.kfz .video-background img,
  body.nfz .video-background img,
  body.agrar .video-background img,
  body.industrie .video-background img,
  body.kontakt .video-background img {
    width: 100%;
    height: auto; /* let height scale with width */
    object-fit: contain; /* avoid cropping on small screens */
    display: block; /* remove inline-gap */
  }

  /* Optional: soften overlay so image remains visible as height changes */
  body.kfz .video-overlay,
  body.nfz .video-overlay,
  body.agrar .video-overlay,
  body.industrie .video-overlay,
  body.kontakt .video-overlay { height: 100%; }

  /* Ensure hero sits below fixed navbar on mobile */
  .hero-section,
  .karriere-hero {
    margin-top: 84px; /* push content under fixed navbar */
  }
}


/* Market pages: enforce 430x320 hero image box on mobile */
@media (max-width: 768px) {
  /* Center the hero media container and constrain to 430x320 (or scale down on very narrow screens) */
  body.kfz .video-background,
  body.nfz .video-background,
  body.agrar .video-background,
  body.industrie .video-background,
  body.kontakt .video-background {
    position: relative; /* ensure overlay can cover the image */
    width: min(430px, 100%);
    height: 320px; /* fixed mobile height as requested */
    margin: 0 auto; /* center within full-width hero */
  }

  /* Make the media fill the box without distortion */
  body.kfz .video-background img,
  body.nfz .video-background img,
  body.agrar .video-background img,
  body.industrie .video-background img,
  body.kfz .video-background video,
  body.nfz .video-background video,
  body.agrar .video-background video,
  body.industrie .video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill the 430x320 box */
    display: block;
  }

  /* Ensure the tinted overlay matches the exact box */
  body.kfz .video-overlay,
  body.nfz .video-overlay,
  body.agrar .video-overlay,
  body.industrie .video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}


/* Home: further reduce spacing before Expert Tip on mobile */
@media (max-width: 768px) {
  body.home .product-slider + .expert-tip { padding-top: 0; }
}


/* Home hero: ensure text overlays video on mobile and add subtle dark overlay for readability */
@media (max-width: 768px) {
  body.home .hero-content { display: flex; align-items: center; justify-content: center; }
  body.home .video-overlay { background: rgba(0, 0, 0, 0.25); }
  /* Make home hero overlay text as large as on karriere header video */
  body.home .main-headline { font-size: 5rem !important; line-height: 0.95; }
}


/* Responsive adjustments */
@media (max-width: 1200px) {
    .modern-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        grid-auto-rows: 220px;
    }
}

@media (max-width: 992px) {
    .modern-gallery {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        grid-auto-rows: 200px;
    }
}

@media (max-width: 768px) {
    /* Mobile: switch collage to horizontal swipe carousel */
    .modern-gallery {
        display: flex;
        flex-direction: row;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch; /* momentum scrolling on iOS */
        -ms-overflow-style: none; /* IE/Edge */
        scrollbar-width: none; /* Firefox */
        padding: 10px 12px 18px;
    }
    .modern-gallery::-webkit-scrollbar { display: none; }
    .modern-gallery .gallery-item,
    .modern-gallery .gallery-item-large,
    .modern-gallery .gallery-item-wide,
    .modern-gallery .gallery-item-tall {
        flex: 0 0 85%; /* show one image + a peek */
        height: 60vh; /* big mobile image */
        max-height: 520px;
        min-height: 260px;
        scroll-snap-align: start;
        grid-column: auto;
        grid-row: auto;
    }
    .modern-gallery .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        touch-action: pan-x; /* enable horizontal swipe on mobile */
    }
    /* Progress dots hidden on mobile per requirement */
    .career-gallery-progress {
        display: none;
    }
    .career-gallery-progress .career-dot {
        width: 3px; height: 3px;
        border-radius: 999px;
        background: rgba(15,30,60,0.28);
        transition: transform var(--dur-med) var(--ease-standard), background-color var(--dur-med) var(--ease-standard);
    }
    .career-gallery-progress .career-dot.is-active {
        background: rgba(15,30,60,0.66);
        transform: scale(1.1);
    }
}

@media (max-width: 576px) {
    .modern-gallery {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 150px;
        grid-gap: 8px;
        padding: 8px;
    }

    .gallery-caption h3 {
        font-size: 1rem;
    }

    .gallery-caption p {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .tip-content {
        flex-direction: column;
    }

    .image-wrapper {
        height: 300px;
    }

    .expert-badge {
        top: 15px;
        left: 15px;
    }

    .tip-text {
        padding: 30px;
    }

    .tip-text h2 {
        margin-left: 0; /* align with paragraph left edge on smaller screens */
        text-align: left;
    }
}

/* Home page mobile left alignment overrides */
@media (max-width: 768px) {
  /* Ensure ALL homepage texts are left-aligned on mobile */
  body.home .hero-content,
  body.home .hero-text {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  body.home .hero-text .main-headline,
  body.home .hero-text .teaser-text {
    text-align: left !important;
  }

  /* Market areas cards */
  body.home .market-card {
    text-align: left !important;
  }

  /* Landing/intro copy */
  body.home .landing-text,
  body.home .landing-title,
  body.home .landing-subtitle,
  body.home .landing-description {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Action area/banner */
  body.home .action-area .action-content {
    text-align: left !important;
    align-items: flex-start !important;
  }
  body.home .action-area .action-text,
  body.home .action-area .action-headline,
  body.home .action-area .action-body {
    text-align: left !important;
  }

  /* Business areas overlay text */
  body.home .business-areas .business-overlay {
    text-align: left !important;
  }

  /* Key figures */
  body.home .key-figures .figures-grid {
    text-align: center !important;
  }

  /* Product slider cards */
  body.home .product-card,
  body.home .product-content,
  body.home .product-content h3,
  body.home .product-content p {
    text-align: left !important;
  }

  /* Expert tip */
  body.home .expert-tip .tip-content {
    align-items: flex-start !important;
  }
  body.home .expert-tip .tip-text {
    text-align: left !important;
    align-items: flex-start !important;
  }
}


/* Mobile-specific centering fixes */
@media (max-width: 768px) {
  /* Center only the Market Areas H3 on mobile */
  body.home .market-areas .market-card h3 {
    text-align: center !important;
  }
}


/* Contact names grid: keep two columns on mobile */
@media (max-width: 768px) {
  .contact-names-grid { grid-template-columns: repeat(2, 1fr); }
}
