/* ==========================================================================
   ADVENNO PREMIUM STRUCTURE - PHASE 3 (GLOBAL FOUNDATION SLICE)
   --------------------------------------------------------------------------
   Scope:
   - Shared shell/layout foundations only
   - Header/footer container consistency
   - Footer grid responsiveness and metadata row stability
   - No page-level redesign and no backend/business logic changes
   --------------------------------------------------------------------------
   Safety:
   - Opt-in classes only (.p3-*)
   - Minimal scoped !important only where legacy bundle already forces !important
   - No destructive overrides of legacy component behavior
   ========================================================================== */

:root {
  --p3-shell-max: var(--container-2xl, 1400px);
  --p3-shell-gutter: clamp(1rem, 1.8vw, 2rem);
  --p3-shell-gutter-compact: clamp(0.875rem, 3.8vw, 1.25rem);
  --p3-hero-top-space: clamp(4.9rem, 7.2vw, 6.1rem);
  --p3-hero-top-space-mobile: clamp(4.15rem, 10.5vw, 5rem);
  --p3-footer-meta-gap-x: clamp(1rem, 2vw, 2rem);
  --p3-footer-meta-gap-y: 0.65rem;
  --p3-footer-col-gap-lg: clamp(1.2rem, 3vw, 3rem);
  --p3-footer-link-gap: 0.42rem;
  --p3-footer-card-pad: 0.85rem;
}

/* Shared container shell for phased rollout */
.p3-shell {
  width: min(100%, calc(var(--p3-shell-max) + (2 * var(--p3-shell-gutter))));
  margin-inline: auto;
  padding-inline: var(--p3-shell-gutter);
}

/* Header: keep glass/visual behavior from legacy CSS, normalize width rhythm */
.p3-header .header-container.p3-shell {
  width: min(100%, var(--p3-shell-max));
  margin-inline: auto;
  padding-inline: clamp(0.875rem, 1.35vw, 1.5rem);
}

/* Footer: responsive columns without changing content/SEO structure */
.p3-footer .footer-grid.p3-footer-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 1.8fr) repeat(5, minmax(10rem, 1fr));
  gap: var(--p3-footer-col-gap-lg);
  align-items: start;
  text-align: left;
}

.p3-footer .footer-brand,
.p3-footer .footer-column,
.p3-footer .footer-links,
.p3-footer .footer-links li {
  min-width: 0;
}

.p3-footer .footer-description,
.p3-footer .footer-column h4,
.p3-footer .footer-links a,
.p3-footer .footer-copyright,
.p3-footer .p3-footer-meta a {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.p3-footer .footer-column h4 {
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

.p3-footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--p3-footer-link-gap);
}

.p3-footer .footer-links a {
  display: block;
  line-height: 1.45;
  white-space: normal;
}

/* Footer bottom links: remove inline-style dependency */
.p3-footer .p3-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--p3-footer-meta-gap-y) var(--p3-footer-meta-gap-x);
}

.p3-footer .p3-footer-bottom {
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 991px) {
  .p3-shell {
    padding-inline: var(--p3-shell-gutter-compact);
  }

  .p3-header .header-container.p3-shell {
    padding-inline: var(--p3-shell-gutter-compact);
  }

  .p3-footer .footer-grid.p3-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.25rem 1.1rem !important;
    text-align: left !important;
  }

  .p3-footer .footer-brand {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
  }

  .p3-footer .footer-social {
    justify-content: flex-start !important;
  }
}

@media (max-width: 767px) {
  .p3-footer .footer-grid.p3-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.95rem 0.85rem !important;
  }

  .p3-footer .footer-column {
    padding: var(--p3-footer-card-pad) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius-md, 10px);
    background: var(--bg-card, rgba(24, 31, 55, 0.85));
  }

  .p3-footer .footer-links {
    gap: 0.34rem;
  }

  .p3-footer .footer-links a {
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .p3-footer .p3-footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.7rem !important;
    text-align: center !important;
  }

  .p3-footer .p3-footer-meta {
    justify-content: center !important;
  }
}

@media (max-width: 480px) {
  .p3-footer .footer-grid.p3-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
  }

  .p3-footer .footer-column-services .footer-links,
  .p3-footer .footer-column-solutions .footer-links,
  .p3-footer .footer-column-company .footer-links {
    column-count: 2;
    column-gap: 0.8rem;
    gap: 0;
  }

  .p3-footer .footer-column-services .footer-links li,
  .p3-footer .footer-column-solutions .footer-links li,
  .p3-footer .footer-column-company .footer-links li {
    break-inside: avoid;
    margin-bottom: 0.22rem;
  }
}
