/* LK Fastener top-level page corrections
   Loaded last so legacy page-specific rules cannot override these fixes. */

/* Desktop hero ruler: Products, Projects and About use the exact same
   container, spacing and typography. Keep these selectors grouped so the
   three top-level heroes cannot drift apart again. */
@media (min-width: 769px) {
  .products-page,
  .projects-page,
  .about-page {
    box-sizing: border-box !important;
    width: min(1500px, calc(100% - 64px)) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 58px 0 96px !important;
  }

  .products-page .products-hero.page-hero,
  .projects-page .projects-hero.page-hero,
  .about-page .about-page-hero.page-hero {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 860px !important;
    margin: 0 auto 42px !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .products-page .page-hero-badge,
  .projects-page .page-hero-badge,
  .about-page .page-hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: max-content !important;
    min-height: 30px !important;
    margin: 0 0 13px !important;
    padding: 6px 13px !important;
    border: 1px solid rgba(20, 99, 185, 0.16) !important;
    border-radius: 999px !important;
    background: rgba(229, 239, 252, 0.72) !important;
    color: #2c5d96 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
  }

  .products-page .products-hero.page-hero h1,
  .projects-page .projects-hero.page-hero h1,
  .about-page .about-page-hero.page-hero h1 {
    margin: 0 0 12px !important;
    color: #173b6b !important;
    font-size: clamp(42px, 3vw, 54px) !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    text-align: center !important;
  }

  .products-page .products-hero.page-hero p,
  .projects-page .projects-hero.page-hero p,
  .about-page .about-page-hero.page-hero p {
    width: 100% !important;
    max-width: 780px !important;
    min-height: 3.3em !important;
    margin: 0 auto !important;
    color: #63748c !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
    text-align: center !important;
  }

  /* Keep all lower About sections inside the same controlled content width. */
  .about-page > section,
  .about-page .about-hero-bento,
  .about-page .about-stats-strip,
  .about-page .about-gallery-section,
  .about-page .about-section,
  .about-page .about-dark-cta {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .about-page .about-bento-grid,
  .about-page .about-card-grid {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Mobile: retain only a compact centered title and short description.
   The eyebrow badge is hidden to save space. */
@media (max-width: 768px) {
  .products-page > .products-hero.page-hero,
  .projects-page > .projects-hero.page-hero,
  .about-page > .about-page-hero.page-hero,
  .contact-page > .contact-hero.page-hero {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto 30px !important;
    padding: 14px 8px 8px !important;
    overflow: visible !important;
    text-align: center !important;
  }

  .products-page .page-hero-badge,
  .projects-page .page-hero-badge,
  .about-page .page-hero-badge,
  .contact-page .page-hero-badge {
    display: none !important;
  }

  .products-page > .products-hero.page-hero h1,
  .projects-page > .projects-hero.page-hero h1,
  .about-page > .about-page-hero.page-hero h1,
  .contact-page > .contact-hero.page-hero h1 {
    margin: 0 0 10px !important;
    color: #173b6b !important;
    font-size: clamp(30px, 8vw, 38px) !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em !important;
    text-align: center !important;
  }

  .products-page > .products-hero.page-hero p,
  .projects-page > .projects-hero.page-hero p,
  .about-page > .about-page-hero.page-hero p,
  .contact-page > .contact-hero.page-hero p {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    color: #6e87a9 !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
    text-align: center !important;
  }

  .products-page,
  .projects-page,
  .about-page,
  .contact-page {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 22px 16px 64px !important;
  }

  .products-page .products-list,
  .projects-page .projects-list,
  .about-page .about-hero-bento,
  .contact-page .contact-layout {
    margin-top: 0 !important;
  }

  /* About mobile: prevent the feature card from overflowing or feeling stretched. */
  .about-page .about-hero-bento {
    width: 100% !important;
    max-width: 100% !important;
    padding: 30px 22px !important;
    border-radius: 24px !important;
    gap: 28px !important;
  }

  .about-page .about-hero-text h2 {
    font-size: clamp(34px, 10vw, 44px) !important;
    line-height: 1.08 !important;
  }

  .about-page .about-hero-text p {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  .about-page .about-actions {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .about-page .about-hero-image img {
    width: 100% !important;
    height: auto !important;
    max-height: 360px !important;
    object-fit: cover !important;
  }
}

/* =========================================================
   FINAL MOBILE CORRECTIONS
   Rebuild the About feature panel as a safe one-column layout.
   The shared menu treatment now lives in mobile.css so every page receives it.
   ========================================================= */
@media (max-width: 768px) {
  /* About feature card: force a clean vertical flow with no overlap. */
  .about-page .about-hero-bento {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 auto 28px !important;
    padding: 30px 22px 22px !important;
    gap: 26px !important;
    overflow: hidden !important;
    border-radius: 24px !important;
  }

  .about-page .about-hero-text,
  .about-page .about-hero-image {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  .about-page .about-label {
    display: block !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.04em !important;
  }

  .about-page .about-hero-text h1,
  .about-page .about-hero-text h2 {
    max-width: 100% !important;
    margin: 12px 0 18px !important;
    font-size: clamp(34px, 9.4vw, 43px) !important;
    line-height: 1.06 !important;
    letter-spacing: -0.035em !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  .about-page .about-hero-text p {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
    overflow-wrap: break-word !important;
  }

  .about-page .about-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 22px 0 0 !important;
    gap: 10px !important;
  }

  .about-page .about-primary-btn,
  .about-page .about-secondary-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 12px 10px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .about-page .about-hero-image {
    order: 2 !important;
  }

  .about-page .about-hero-image img {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 18px !important;
    transform: none !important;
  }
}

@media (max-width: 390px) {
  .about-page .about-actions {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   ABOUT HERO — PREMIUM STOREFRONT TREATMENT
   Uses a dedicated wide crop so the photo fills the panel
   naturally without the non-premium "contained image" gaps.
   ========================================================= */
@media (min-width: 769px) {
  .about-page .about-hero-bento {
    grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr) !important;
    gap: 48px !important;
    min-height: 500px !important;
    padding: 46px 46px 46px 52px !important;
    border-radius: 30px !important;
    background:
      radial-gradient(circle at 82% 16%, rgba(31, 111, 196, 0.34), transparent 35%),
      linear-gradient(135deg, #082f5f 0%, #103f75 55%, #0b4c8d 100%) !important;
    box-shadow: 0 30px 75px rgba(8, 47, 95, 0.24) !important;
    overflow: hidden !important;
  }

  .about-page .about-hero-text {
    position: relative !important;
    z-index: 2 !important;
  }

  .about-page .about-hero-text h2 {
    margin: 16px 0 24px !important;
    font-size: clamp(42px, 3.35vw, 58px) !important;
    line-height: 1.06 !important;
    letter-spacing: -0.035em !important;
  }

  .about-page .about-hero-text p {
    max-width: 540px !important;
    font-size: 16px !important;
    line-height: 1.72 !important;
  }

  .about-page .about-actions {
    margin-top: 30px !important;
  }

  .about-page .about-primary-btn,
  .about-page .about-secondary-btn {
    min-height: 52px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 28px !important;
    border-radius: 12px !important;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease !important;
  }

  .about-page .about-primary-btn:hover,
  .about-page .about-secondary-btn:hover {
    transform: translateY(-2px) !important;
  }

  .about-page .about-primary-btn:hover {
    box-shadow: 0 12px 28px rgba(37, 226, 111, 0.26) !important;
  }

  .about-page .about-hero-image {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 408px !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: #0c3767 !important;
    box-shadow: 0 26px 55px rgba(0, 16, 42, 0.34) !important;
  }

  .about-page .about-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
  }

  .about-page .about-hero-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: scale(1.002) !important;
    transition: transform 700ms cubic-bezier(.2,.7,.2,1) !important;
  }

  .about-page .about-hero-bento:hover .about-hero-image img {
    transform: scale(1.025) !important;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .about-page .about-hero-bento {
    grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr) !important;
    gap: 32px !important;
    padding: 38px !important;
  }

  .about-page .about-hero-image {
    height: 360px !important;
  }
}

@media (max-width: 768px) {
  .about-page .about-hero-image img {
    content: url("../images/LK-hero.webp") !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}

/* =========================================================
   DESKTOP STOREFRONT FULL-FIT CORRECTION
   Match the image frame to the 16:9 storefront asset so the
   complete building is visible without empty side bars.
   Mobile rules above remain unchanged.
   ========================================================= */
@media (min-width: 1101px) {
  .about-page .about-hero-bento {
    grid-template-columns: minmax(390px, 0.78fr) minmax(620px, 1.22fr) !important;
    min-height: 590px !important;
    gap: 46px !important;
    padding: 48px 46px 48px 52px !important;
    align-items: center !important;
  }

  .about-page .about-hero-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    align-self: center !important;
  }

  .about-page .about-hero-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }

  .about-page .about-hero-bento:hover .about-hero-image img {
    transform: scale(1.012) !important;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .about-page .about-hero-bento {
    min-height: 520px !important;
    align-items: center !important;
  }

  .about-page .about-hero-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }

  .about-page .about-hero-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
  }
}
