/*
 * Public responsive hardening layer
 * Loaded after page-family styles and production-polish.css.
 * Keeps all public routes usable from compact phones through large desktops.
 */

html,
body {
  max-width: 100%;
}

main,
section,
header,
footer,
nav,
aside {
  min-width: 0;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

iframe {
  border: 0;
}

input,
textarea,
select,
button {
  max-width: 100%;
}

.long-word,
.content-prose,
.article-body,
.service-content,
.contact-card,
.pa-footer,
.pa-navbar__drawer {
  overflow-wrap: anywhere;
}

/* Preserve the homepage service experience as one horizontal rail at every width. */
.home-services__grid {
  display: flex !important;
  grid-template-columns: none !important;
  flex-wrap: nowrap !important;
  width: auto;
  max-width: none;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.home-service-card,
.home-service-card--featured,
.home-service-card--wide {
  grid-column: auto !important;
  flex: 0 0 clamp(300px, 31vw, 410px) !important;
  width: auto;
  scroll-snap-align: start;
}

/* Desktop/tablet fluidity before the main mobile breakpoint. */
@media (max-width: 1200px) {
  :root {
    --pa-gutter: clamp(1.2rem, 3.2vw, 2.25rem);
  }

  .home-hero h1 {
    max-width: 850px;
  }

  .home-intro__statement,
  .content-prose,
  .article-header {
    max-width: 100%;
  }

  .home-trusted__card {
    width: clamp(235px, 26vw, 285px);
  }

  .pa-footer__main {
    grid-template-columns: 1.2fr .75fr .8fr 1fr;
  }
}

@media (max-width: 980px) {
  :root {
    --pa-gutter: clamp(1.1rem, 4vw, 2rem);
    --pa-section-space: clamp(4rem, 9vw, 5.5rem);
  }

  /* Global spacing and type */
  .pa-shell,
  .services-detailed .container,
  .cta-section .container,
  .page-header .header-content {
    width: min(calc(100% - (var(--pa-gutter) * 2)), var(--pa-container));
  }

  .pa-heading,
  .content-prose h2,
  .services-overview__copy h2,
  .services-directory__intro h2,
  .services-process__header h2,
  .services-advisory__copy h2 {
    text-wrap: balance;
  }

  /* Homepage */
  .home-hero {
    min-height: max(700px, 82svh);
  }

  .home-hero__content {
    padding-top: calc(var(--pa-navbar-height) + 4.75rem);
  }

  .home-hero h1 {
    max-width: 760px;
    font-size: clamp(3.4rem, 10vw, 5.9rem);
  }

  .home-hero__bottom {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-hero__actions {
    justify-content: flex-start;
  }

  .home-intro__grid,
  .home-feature__grid,
  .home-sectors__header {
    grid-template-columns: 1fr;
  }

  .home-intro__grid,
  .home-feature__grid,
  .home-sectors__header {
    gap: 1.75rem;
  }

  .home-principles {
    grid-template-columns: 1fr;
  }

  .home-principle,
  .home-principle + .home-principle {
    min-height: 0;
    padding: 1.5rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--pa-stone-200);
  }

  .home-principle:last-child {
    border-bottom: 0;
  }

  .home-trusted__header {
    grid-template-columns: 1fr auto;
  }

  .home-services__intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .home-services__intro-copy {
    justify-self: start;
  }

  .home-service-card,
  .home-service-card--featured,
  .home-service-card--wide {
    flex-basis: min(60vw, 390px) !important;
  }

  .home-feature__image,
  .home-feature__image img {
    min-height: 420px;
    height: 420px;
  }

  .home-sectors__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-insights__grid {
    grid-template-columns: 1fr;
  }

  /* About / Contact / shared content */
  .content-grid,
  .split-media,
  .contact-layout,
  .statement-band__grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    gap: 1.5rem;
  }

  .split-media {
    gap: 2rem;
  }

  .values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expertise-index__item {
    grid-template-columns: 48px minmax(0, 1fr) 28px;
  }

  .expertise-index__item p {
    display: none;
  }

  /* Services */
  .services-hero__bottom,
  .services-overview__grid,
  .services-directory__intro,
  .services-process__header,
  .services-advisory__grid {
    grid-template-columns: 1fr;
  }

  .service-panel,
  .service-panel:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .service-panel:nth-child(even) .service-panel__media {
    order: 0;
  }

  .services-process__grid {
    grid-template-columns: 1fr;
  }

  .service-detailed-item {
    grid-template-columns: 1fr;
  }

  .service-icon {
    min-height: 120px;
  }

  /* Insights / articles */
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-layout > aside {
    order: 2;
  }

  .insights-newsletter__inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .insights-newsletter form {
    width: 100%;
  }

  .insights-newsletter input {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Footer */
  .pa-footer__cta-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pa-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --pa-gutter: 1.1rem;
    --pa-section-space: 4.1rem;
  }

  body {
    font-size: 15.5px;
  }

  .pa-kicker {
    gap: .5rem;
    font-size: .66rem;
    letter-spacing: .13em;
  }

  .pa-kicker::before {
    width: 1.65rem;
  }

  .pa-heading {
    font-size: clamp(2.15rem, 10vw, 3.15rem);
  }

  .pa-lead {
    font-size: .98rem;
    line-height: 1.7;
  }

  .pa-button {
    min-height: 48px;
    padding: .8rem 1.05rem;
    font-size: .84rem;
  }

  /* Homepage hero */
  .home-hero {
    min-height: 690px;
  }

  .home-hero__media img {
    object-position: 58% center;
  }

  .home-hero__content {
    padding-top: calc(var(--pa-navbar-height) + 4.2rem);
    padding-bottom: 2.5rem;
  }

  .home-hero__eyebrow {
    max-width: 90%;
    font-size: .66rem;
    line-height: 1.5;
  }

  .home-hero h1 {
    max-width: 100%;
    font-size: clamp(3rem, 14vw, 4.35rem);
    line-height: .92;
  }

  .home-hero__bottom {
    margin-top: 1.75rem;
    gap: 1.35rem;
  }

  .home-hero__bottom p {
    font-size: .96rem;
    line-height: 1.68;
  }

  .home-hero__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-hero__actions .pa-button {
    width: 100%;
  }

  .home-intro__statement h2 {
    margin-bottom: 1.25rem;
    font-size: clamp(2.4rem, 11.5vw, 3.35rem);
  }

  .home-intro__statement p {
    font-size: .98rem;
    line-height: 1.72;
  }

  .home-principle h3 {
    font-size: 1.45rem;
  }

  .home-principle p {
    font-size: .9rem;
  }

  /* Trusted carousel */
  .home-trusted {
    padding-block: 3.75rem;
  }

  .home-trusted__header {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }

  .home-trusted__header h2 {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .home-trusted__controls {
    justify-content: flex-start;
  }

  .home-trusted__control {
    width: 42px;
    height: 42px;
  }

  .home-trusted__card {
    width: min(78vw, 275px);
    min-height: 180px;
    padding: 1.05rem;
  }

  .home-trusted__logo {
    min-height: 82px;
  }

  .home-trusted__logo img {
    max-width: 145px;
    max-height: 68px;
  }

  .home-trusted__card strong {
    font-size: 1.02rem;
  }

  /* Horizontal services */
  .home-services {
    padding-block: 4.25rem;
  }

  .home-services__intro {
    margin-bottom: 1.8rem;
  }

  .home-services__grid {
    gap: .8rem;
    margin-right: calc(-1 * var(--pa-gutter));
    padding-right: var(--pa-gutter);
    padding-bottom: .9rem;
  }

  .home-service-card,
  .home-service-card--featured,
  .home-service-card--wide {
    flex-basis: min(84vw, 320px) !important;
    min-height: 400px;
    border-radius: 16px;
  }

  .home-service-card__content {
    grid-template-columns: 32px minmax(0,1fr);
    min-height: 180px;
    gap: .75rem;
    padding: 1.2rem;
  }

  .home-service-card h3 {
    font-size: clamp(1.75rem, 8.5vw, 2.35rem);
  }

  .home-service-card:nth-child(4)::after {
    top: .9rem;
    right: .9rem;
    font-size: .55rem;
  }

  /* Why Proma / sectors / insights */
  .home-feature {
    padding-block: 4.25rem;
  }

  .home-feature__image,
  .home-feature__image img {
    min-height: 310px;
    height: 310px;
    border-radius: 16px;
  }

  .home-feature__points li {
    grid-template-columns: 30px minmax(0,1fr);
  }

  .home-sectors__grid,
  .home-insights__grid {
    grid-template-columns: 1fr;
  }

  .home-sector {
    min-height: auto;
    padding: 1.35rem;
  }

  .home-insight-card,
  .home-insight-card--secondary {
    min-height: 350px;
    border-radius: 16px;
  }

  .home-insight-card h3 {
    font-size: clamp(1.8rem, 9vw, 2.7rem);
  }

  /* Shared inner-page heroes */
  .content-hero,
  .services-hero,
  .insights-hero,
  .page-header {
    min-height: 500px;
  }

  .page-header {
    margin-top: 0;
    padding-top: calc(var(--pa-navbar-height) + 4rem);
  }

  .content-hero__inner,
  .services-hero__inner {
    padding-top: calc(var(--pa-navbar-height) + 4rem);
    padding-bottom: 3.25rem;
  }

  .content-hero h1,
  .services-hero h1,
  .insights-hero h1,
  .page-header h1 {
    font-size: clamp(2.75rem, 12.5vw, 4rem);
    line-height: .96;
  }

  .content-hero p,
  .services-hero__bottom p,
  .insights-hero p,
  .page-header p {
    font-size: .96rem;
    line-height: 1.68;
  }

  /* About / contact */
  .split-media__image,
  .split-media__image img {
    min-height: 340px;
    height: 340px;
    border-radius: 16px;
  }

  .statement-card {
    min-height: auto;
    padding: 2rem 1.25rem;
  }

  .statement-card h2 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .values-grid,
  .process-grid,
  .form-grid,
  .service-choice__options {
    grid-template-columns: 1fr;
  }

  .value-tile,
  .process-card {
    min-height: auto;
    padding: 1.25rem;
  }

  .value-tile span {
    margin-bottom: 1.6rem;
  }

  .form-field--full,
  .service-choice {
    grid-column: auto;
  }

  .contact-card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .contact-card h2 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .contact-map iframe {
    min-height: 260px;
  }

  .page-cta__inner,
  .services-cta__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-cta .pa-button,
  .services-cta .pa-button {
    width: 100%;
  }

  /* Service details and directory */
  .services-directory__list {
    gap: .8rem;
  }

  .service-panel,
  .service-panel__media,
  .service-panel__media img {
    min-height: 270px;
  }

  .service-panel {
    border-radius: 16px;
  }

  .service-panel__content {
    padding: 1.35rem;
  }

  .service-panel h3 {
    margin: 1.25rem 0 .75rem;
    font-size: clamp(1.9rem, 9vw, 2.7rem);
  }

  .service-panel__tag {
    max-width: 55%;
    white-space: normal;
    text-align: right;
  }

  .service-panel__media img {
    height: 270px;
  }

  .services-process__item {
    min-height: auto;
    padding: 1.3rem;
  }

  .services-process__item span {
    margin-bottom: 1.8rem;
  }

  .services-advisory__image,
  .services-advisory__image img {
    min-height: 320px;
    height: 320px;
    border-radius: 16px;
  }

  .service-detailed-item {
    border-radius: 14px;
  }

  .service-icon {
    min-height: 100px;
  }

  .service-content {
    padding: 1.3rem;
  }

  .service-content h3 {
    font-size: clamp(1.8rem, 8vw, 2.55rem);
  }

  .service-features {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 44px;
  }

  .cta-content h2 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .cta-button {
    width: 100%;
  }

  /* Insights and article */
  .insights-toolbar {
    overflow-x: auto;
  }

  .insights-filter {
    min-width: max-content;
    flex-wrap: nowrap;
    padding-bottom: .2rem;
  }

  .insight-card {
    min-height: 390px;
    padding: 1.35rem;
    border-radius: 16px;
  }

  .insight-card h2 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .insights-newsletter form {
    flex-direction: column;
  }

  .insights-newsletter input,
  .insights-newsletter button {
    width: 100%;
  }

  .article-shell {
    padding-top: calc(var(--pa-navbar-height) + 2.5rem);
  }

  .article-header {
    margin-bottom: 2.4rem;
  }

  .article-header h1 {
    font-size: clamp(2.6rem, 12vw, 4rem);
    line-height: .98;
  }

  .article-body {
    font-size: .98rem;
    line-height: 1.78;
  }

  .article-body h2 {
    font-size: clamp(1.8rem, 8vw, 2.55rem);
  }

  .article-body blockquote {
    margin: 1.8rem 0;
    padding: 1.2rem 1.25rem;
    font-size: 1.2rem;
  }

  /* Footer */
  .pa-footer__cta {
    padding-block: 3.5rem;
  }

  .pa-footer__cta h2 {
    font-size: clamp(2.35rem, 10vw, 3.25rem);
  }

  .pa-footer__main {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.75rem 0 2rem;
  }

  .pa-footer__brand p,
  .pa-footer__column a,
  .pa-footer__contact a,
  .pa-footer__contact span {
    font-size: .9rem;
  }

  .pa-footer__bottom {
    flex-direction: column;
    gap: .55rem;
  }
}

@media (max-width: 520px) {
  :root {
    --pa-gutter: 1rem;
    --pa-section-space: 3.75rem;
  }

  body {
    min-width: 0;
  }

  .home-hero {
    min-height: 650px;
  }

  .home-hero h1 {
    font-size: clamp(2.75rem, 15vw, 3.8rem);
  }

  .home-hero__media img {
    object-position: 62% center;
  }

  .home-trusted::before,
  .home-trusted::after {
    width: 22px;
  }

  .home-trusted__card {
    width: min(82vw, 268px);
  }

  .home-service-card,
  .home-service-card--featured,
  .home-service-card--wide {
    flex-basis: min(86vw, 305px) !important;
    min-height: 380px;
  }

  .content-hero,
  .services-hero,
  .insights-hero,
  .page-header {
    min-height: 470px;
  }

  .expertise-index__item {
    grid-template-columns: 36px minmax(0,1fr) 22px;
    gap: .6rem;
    padding: 1.15rem 0;
  }

  .expertise-index__item strong {
    font-size: 1.45rem;
  }

  .service-panel__top {
    gap: .6rem;
  }

  .service-panel__tag {
    max-width: 60%;
    padding: .38rem .55rem;
    font-size: .58rem;
  }

  .insights-filter span {
    display: none;
  }

  .contact-card,
  .process-card,
  .value-tile {
    border-radius: 12px;
  }

  .pa-footer__logo-frame {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
}

/* Short landscape phones: do not let fixed navigation consume the viewport. */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 980px) {
  .pa-navbar__drawer-body {
    padding-top: 1.2rem;
  }

  .pa-navbar__drawer-links > a {
    min-height: 54px;
    padding-block: .6rem;
  }

  .pa-navbar__drawer-label {
    font-size: 1.55rem;
  }

  .pa-navbar__cta-mobile {
    min-height: 48px;
    margin-top: 1rem;
  }

  .pa-navbar__drawer-meta {
    padding-block: .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-services__grid,
  .home-trusted__viewport,
  .insights-toolbar {
    scroll-behavior: auto !important;
  }
}
