/* ============================================================
   WTS BYG — Mobile Optimisation v3
   Full responsive overhaul for all screen sizes
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   BASE — Font smoothing, tap, scroll
   ══════════════════════════════════════════════════════════ */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }
html { scroll-behavior: smooth; }
.btn { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════════════════════
   NAVBAR — Mobile
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar { height: 60px; padding: 0 1rem; }
  .navbar__inner { gap: 0; justify-content: space-between; }
  .nav-logo-img { height: 38px; width: auto; }
  .nav-links { display: none !important; }
  .nav-actions { display: none !important; }
  .hamburger { display: flex !important; }

  .mobile-menu { top: 60px; padding: 1.5rem 1.25rem 3rem; }
  .mobile-menu .nav-link {
    font-size: 1.15rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: block;
  }
  .mobile-menu .btn-primary {
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
  }
}

/* ══════════════════════════════════════════════════════════
   HERO — Home page (full height)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero {
    justify-content: center !important;
    align-items: stretch !important;
    min-height: 100svh;
    padding-top: 60px;
  }
  .hero__content {
    padding-top: 3rem !important;
    padding-bottom: 4rem !important;
    padding-inline: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
  }
  .hero__grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
  }
  .hero__right { display: none !important; }
  .hero__left {
    gap: 1.5rem;
    align-items: flex-start !important;
    text-align: left !important;
    width: 100%;
  }
  .hero__badge { font-size: 0.72rem; padding: 0.45rem 0.85rem; }
  .hero__heading {
    font-size: clamp(2.4rem, 10vw, 3.2rem) !important;
    line-height: 1.1;
    text-align: left !important;
  }
  .hero__sub {
    font-size: 1rem;
    line-height: 1.65;
    text-align: left !important;
    max-width: 100% !important;
  }
  .hero__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    width: 100%;
  }
  .hero__actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero__heading { font-size: clamp(2.1rem, 11vw, 2.8rem) !important; }
  .hero__sub { font-size: 0.95rem !important; }
}

/* ══════════════════════════════════════════════════════════
   HERO — Short (ydelser pages)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero--short { min-height: 60vw; padding-top: 60px; }
  .hero--short .hero__content {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
    padding-inline: 1.25rem !important;
  }
  .hero--short .hero__heading {
    font-size: clamp(1.9rem, 9vw, 2.6rem) !important;
  }
  .hero--short .hero__badge { font-size: 0.68rem; }
  .hero--short .hero__actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.6rem !important;
  }
  .hero--short .hero__actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}

/* ══════════════════════════════════════════════════════════
   TRUST BAR
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .trust-bar { padding: 1.25rem 1rem; }
  .trust-bar__inner {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 0.75rem 1.5rem !important;
    align-items: flex-start !important;
  }
  .trust-item { width: calc(50% - 0.75rem); align-items: flex-start; }
  .trust-item__icon { width: 32px; height: 32px; flex-shrink: 0; }
  .trust-item__text { font-size: 0.78rem; }
  .trust-item__text strong { font-size: 0.82rem; }
  .trust-divider { display: none !important; }
}

@media (max-width: 380px) {
  .trust-item { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   SECTIONS + CONTAINERS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .section { padding-block: clamp(2.5rem, 6vw, 4rem); }
  .container { padding-inline: 1.25rem; }
  .section-header { margin-bottom: 1.75rem; }
  .section-header p { font-size: 0.9rem; }

  .headline-xl { font-size: clamp(1.9rem, 8vw, 3rem) !important; }
  .headline-lg { font-size: clamp(1.65rem, 7vw, 2.5rem) !important; }
  .headline-md { font-size: clamp(1.4rem, 6vw, 2rem) !important; }
  .headline-sm { font-size: clamp(1.15rem, 5vw, 1.6rem) !important; }

  .eyebrow { font-size: 0.68rem !important; letter-spacing: 0.1em !important; }
  .grad-text { background-size: 200% 100%; }
}

/* ══════════════════════════════════════════════════════════
   SERVICES GRID
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
}
@media (min-width: 480px) and (max-width: 640px) {
  .services-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  .service-card { padding: 1.25rem 1rem !important; gap: 0.75rem !important; }
  .service-card__icon-wrap { width: 44px !important; height: 44px !important; }
  .service-card__title { font-size: 0.95rem !important; }
  .service-card__desc { font-size: 0.82rem !important; }
  .service-card__link { opacity: 1 !important; transform: none !important; font-size: 0.8rem; }
}

/* ══════════════════════════════════════════════════════════
   SPLIT SECTIONS (about / feature sections)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .split { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .split--reverse .split__media,
  .split--reverse .split__text { order: 0 !important; }
  .split__media { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; }
  .split__media img { width: 100%; height: 100%; object-fit: cover; }
  .split__text { gap: 1rem; }
  .split__media-badge {
    bottom: 0.75rem; right: 0.75rem;
    padding: 0.6rem 0.85rem;
    min-width: 90px;
    font-size: 0.75rem;
  }
  .split__media-badge .num { font-size: 1.4rem; }

  .feature-item { gap: 0.6rem; }
  .feature-item__text { font-size: 0.85rem; }
  .feature-item__check { width: 18px; height: 18px; flex-shrink: 0; }
}

/* ══════════════════════════════════════════════════════════
   CARDS (glass)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .card-glass { padding: 1.25rem !important; border-radius: 14px !important; }
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS (hero right panel - hidden on mobile, but show on tablet)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero__right { display: none !important; }
}

/* ══════════════════════════════════════════════════════════
   CITY TAGS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .city-tags { gap: 0.4rem; }
  .city-tag { font-size: 0.78rem !important; padding: 0.45rem 0.7rem !important; }
}

/* ══════════════════════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .faq-trigger { padding: 1rem 1.1rem; }
  .faq-trigger__q { font-size: 0.9rem; }
  .faq-body__content { padding: 0 1.1rem 1rem !important; font-size: 0.88rem !important; }
}

/* ══════════════════════════════════════════════════════════
   CTA BANNER
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cta-banner__content {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    gap: 1.5rem !important;
    padding-block: 2.5rem !important;
  }
  .cta-banner__text h2 { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  .cta-banner__text p { font-size: 0.9rem !important; }
  .cta-banner__actions {
    justify-content: center !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  .cta-banner__actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 0.9rem 1.25rem;
  }
}

/* ══════════════════════════════════════════════════════════
   CERT CAROUSEL
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cert-section { padding: 1.25rem 0; }
  .cert-section__label { font-size: 0.65rem; }
  .cert-badge--logo { width: 120px !important; height: 76px !important; padding: 0.75rem 1rem !important; }
  .cert-track { gap: 1.25rem !important; animation-duration: 14s !important; }
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .footer { padding-top: 2.5rem; }
  .footer__grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .footer__brand p { font-size: 0.85rem; line-height: 1.6; }
  .footer__col-title { font-size: 0.7rem !important; margin-bottom: 0.6rem !important; }
  .footer__links { gap: 0.4rem !important; }
  .footer__link { font-size: 0.88rem; }
  .footer__bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    font-size: 0.78rem;
  }
  .footer__legal { gap: 1rem; flex-wrap: wrap; font-size: 0.78rem; }
  .footer__certs { gap: 0.75rem; padding: 1rem 1.25rem 1.5rem; flex-wrap: wrap; }
  .footer__cert-logo { height: 28px; }
}

/* ══════════════════════════════════════════════════════════
   BREADCRUMB
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  nav.breadcrumb { padding-top: calc(60px + 0.5rem) !important; padding-bottom: 0.4rem; }
  .breadcrumb__list { gap: 0.2rem !important; }
  .breadcrumb__item { font-size: 0.72rem !important; }
}

/* ══════════════════════════════════════════════════════════
   FORMS — Prevent iOS zoom on input focus
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select { font-size: 16px !important; width: 100%; }

  /* Stack 2-col form grids on mobile */
  .kontakt-form-grid,
  form > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   TABLET (769–1024px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr !important; }
  .hero__right { display: none !important; }
  .hero__content { padding-top: 3rem !important; padding-bottom: 4rem !important; }
  .services-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .footer__grid { grid-template-columns: 1fr 1fr !important; gap: 2rem !important; }
  .split { gap: 2.5rem !important; }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP ONLY
   ══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .hero { justify-content: center; }
  .hero__content {
    padding-top: clamp(4rem, 8vw, 9rem);
    padding-bottom: clamp(4rem, 8vw, 9rem);
  }
  .hero__grid { align-items: center; }
  .services-grid { align-items: stretch; }
  .card-glass.service-card { height: 100%; }
  .split { gap: clamp(3rem, 6vw, 6rem); }
}

/* ══════════════════════════════════════════════════════════
   HOVER ANIMATIONS — Desktop only
   ══════════════════════════════════════════════════════════ */
@media (hover: hover) {
  .card-glass {
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.3s cubic-bezier(0.16,1,0.3,1),
                background 0.3s ease, border-color 0.3s ease;
  }
  .card-glass:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12) !important;
  }
  .city-tag {
    transition: background 0.18s, color 0.18s, border-color 0.18s,
                transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  }
  .city-tag:hover { transform: translateY(-2px); }
  .stat-card {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), background 0.3s ease;
  }
  .stat-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.11); }
}

/* ══════════════════════════════════════════════════════════
   REVEAL ANIMATIONS
   ══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1),
              transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }
.reveal--delay-5 { transition-delay: 400ms; }

.reveal-left {
  opacity: 0; transform: translateX(-24px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1),
              transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

/* Badge pulse */
.hero__badge { animation: badge-pulse 4s ease-in-out infinite; }
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
  50%      { box-shadow: 0 0 0 8px rgba(245,166,35,0.06); }
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-scale {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .hero__badge, .hero__badge-dot, .cert-track { animation: none !important; }
  .cert-track { transform: none !important; }
}

/* Scroll cue hidden globally via style.css */

/* ══════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════ */
@media print {
  .navbar, .mobile-menu, .hero__scroll-cue, .cta-banner, .cert-section { display: none !important; }
  .hero { min-height: auto; padding: 1rem 0; }
}

/* ══════════════════════════════════════════════════════════
   FAQ — Disable sticky sidebar on mobile (causes overlap)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* The FAQ left column (title + phone) must not stick on mobile/tablet */
  .split__text[style*="position:sticky"],
  .split__text[style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }

  /* Also cover any inline sticky applied directly */
  [style*="position:sticky"] .faq-list,
  [style*="position: sticky"] .faq-list {
    position: relative !important;
    top: auto !important;
  }

  /* Stack the FAQ split layout vertically on mobile */
  .split.split--reverse {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  /* FAQ list takes full width */
  .faq-list {
    flex: unset !important;
    width: 100% !important;
  }
}

/* FAQ sticky sidebar — desktop only */
@media (min-width: 1025px) {
  .faq-sticky-col {
    position: sticky !important;
  }
}
@media (max-width: 1024px) {
  .faq-sticky-col {
    position: relative !important;
    top: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ADDITIONAL MOBILE FIXES v2
   ══════════════════════════════════════════════════════════ */

/* Blog cards & referencer grids — force single column on small phones */
@media (max-width: 480px) {
  [style*="minmax(320px"] ,
  [style*="minmax(300px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Kontakt form: stack name/phone fields on mobile */
@media (max-width: 640px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Kontakt split — ensure stacked on mobile */
@media (max-width: 768px) {
  .split[style*="align-items:flex-start"] {
    grid-template-columns: 1fr !important;
  }
  /* Contact info cards — prevent text overflow */
  .split__media {
    width: 100% !important;
    min-width: unset !important;
  }
}

/* ydelser hero — left-align on mobile (CTAs centered via comprehensive-fixes) */
@media (max-width: 768px) {
  .ydelser-hero__inner {
    align-items: flex-start !important;
    text-align: left !important;
  }
  .ydelser-hero__title {
    font-size: clamp(2.1rem, 9vw, 3rem) !important;
    max-width: 100% !important;
    text-align: left !important;
  }
  .ydelser-hero__sub {
    text-align: left !important;
    max-width: 100% !important;
    font-size: 0.95rem !important;
  }
  .ydelser-hero .eyebrow {
    justify-content: flex-start !important;
  }
}

/* Services grid on ydelser pages — force single column on very small screens */
@media (max-width: 480px) {
  [style*="minmax(220px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Short hero pages — left-align text on mobile */
@media (max-width: 768px) {
  .hero--short .hero__left {
    align-items: flex-start !important;
    text-align: left !important;
  }
  .hero--short .hero__heading {
    text-align: left !important;
  }
  .hero--short .hero__sub {
    text-align: left !important;
    max-width: 100% !important;
  }
}

/* Prevent horizontal overflow site-wide */
@media (max-width: 768px) {
  body { overflow-x: hidden !important; }
  .container,
  .section,
  .hero__content,
  .footer { max-width: 100vw !important; }
}

/* Om-os stat numbers grid — auto-fit on very small screens */
@media (max-width: 400px) {
  [style*="minmax(180px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Blog article pages — readable prose width on mobile */
@media (max-width: 768px) {
  article,
  .prose,
  .blog-content {
    font-size: 1rem !important;
    line-height: 1.75 !important;
  }
}

/* Lokationer pages short hero alignment — keep section headers centered (they are mid-page, not hero) */
@media (max-width: 768px) {
  .section-header {
    text-align: center !important;
  }
  .section-header .eyebrow {
    justify-content: center !important;
    margin-inline: auto !important;
  }
}
