/* Mobile Specific Overrides for Homepage */

@media (max-width: 1024px) {
  .hero-container, .two-col-layout { gap: 3rem; }
  .hero-content h1 { font-size: 3.2rem; }
  .team-grid { gap: 2rem; }
}

@media (max-width: 992px) {
  /* Collapse Grid Layouts for Tablet */
  .hero-container, .two-col-layout { grid-template-columns: 1fr; gap: 3.5rem; }
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
  
  /* Restructured Team Grid for Tablet */
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  
  /* Consistent rhythmic padding for tablet */
  .home-hero, .pain-points, .services-overview, .local-expertise, .our-process, .trust-eeat, .team-section { padding: 80px 0; }
  
  .hero-content h1 { font-size: 2.8rem; }
  .hero-subtitle { max-width: 100%; }
}

@media (max-width: 768px) {
  /* Full Mobile Stack (1 Column) */
  .process-grid, .services-grid, .team-grid { grid-template-columns: 1fr; gap: 2rem;}
  .home-hero, .pain-points, .services-overview, .local-expertise, .our-process, .trust-eeat, .team-section { padding: 60px 0; }

  .hero-content h1 { font-size: 2.4rem; }
  .section-title { font-size: 2.2rem; }

  .about-story-logo {
    width: clamp(150px, 52vw, 180px);
  }

  /* Typography adjustments for narrow screens */
  .hero-subtitle, .section-intro, .local-text p, .trust-text p { font-size: 1.1rem; }

  /* Full width buttons */
  .hero-actions { flex-direction: column; width: 100%; gap: 1rem; }
  .btn { width: 100%; text-align: center; }

  /* Centering on mobile for better balance */
  .content-block::before { margin: 0 auto 1.5rem auto; }
  .content-block svg { margin: 0 auto 1.5rem auto; }
  .content-block h3, .process-step h3 { text-align: center; }
  .content-block p, .process-step p { text-align: left; }
  .process-step { align-items: center; }

  /* Swap order for trust section so image is below text on mobile */
  .trust-eeat .two-col-layout { display: flex; flex-direction: column-reverse; }

  /* Reduce image placeholder heights for mobile readability */
  .image-placeholder-large, .image-placeholder-medium, .image-placeholder-tall { min-height: 280px; padding: 1rem; }
  
  /* Manage glowing background overflows on small screens */
  .bg-glow { width: 400px; height: 400px; filter: blur(40px); }
  .hero-visual::before { width: 100%; height: 100%; }
}

/* Service layout mobile stacking fixes */
@media (max-width: 768px) {
  .split-layout { grid-template-columns: 1fr; gap: 2rem; }
  .svc-hero { padding: 80px 0 60px; }
  .svc-hero-content h1 { font-size: 2.4rem; }
  .minimal-grid,
  .timeline-layout { grid-template-columns: 1fr; }
  .faq-question { padding: 1.25rem 1.25rem 1.25rem 1.25rem; padding-right: 3rem; }
  .faq-answer { padding: 0 1.25rem 1.25rem 1.25rem; }
}

/* Mobile navigation/footer refinements */
@media (max-width: 768px) {
  .site-nav {
    position: static;
    top: auto;
    inset: auto;
    z-index: auto;
  }

  .site-header {
    height: auto;
  }

  .site-nav .nav-inner {
    padding: 0.5rem 1rem 0.55rem;
    gap: 0.55rem;
    align-items: center;
  }

  .site-nav .brand {
    max-width: calc(100% - 5rem);
  }

  .site-nav .brand-logo {
    width: clamp(220px, 68vw, 320px);
    max-width: 100%;
    max-height: 86px;
    height: auto;
  }

  .site-nav .menu-toggle {
    display: inline-flex;
    margin-left: auto;
    min-height: 2.45rem;
    min-width: 2.7rem;
    padding: 0.52rem 0.74rem;
  }

  .site-nav .nav-panel {
    display: none;
    margin-top: 0.3rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(20, 46, 73, 0.12);
  }

  .site-nav .nav-panel.is-open {
    display: block;
  }

  .site-nav .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .site-nav .nav-links a,
  .site-nav .services-toggle {
    width: 100%;
    display: flex;
  }

  .site-nav .nav-item-services {
    display: grid;
    grid-template-columns: minmax(0, max-content) auto;
    align-items: center;
    column-gap: 0.12rem;
    width: 100%;
  }

  .site-nav .nav-item-services > a {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-width: 0;
    min-height: 2.8rem;
    padding-right: 0.42rem;
  }

  .site-nav .services-toggle {
    width: auto;
    min-width: 2.85rem;
    min-height: 2.8rem;
    padding: 0.58rem 0.72rem;
    justify-content: center;
  }

  .site-nav .services-caret {
    font-size: 1.28rem;
    line-height: 1;
  }

  .site-nav .nav-item-services.is-open > a,
  .site-nav .nav-item-services.is-open .services-toggle {
    background: rgba(241, 158, 59, 0.14);
    border-color: rgba(241, 158, 59, 0.32);
  }

  .site-nav .services-mega-menu {
    position: static;
    top: auto;
    left: auto;
    grid-column: 1 / -1;
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 0;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
  }

  .site-nav .nav-item-services.is-open .services-mega-menu,
  .site-nav .services-mega-menu.is-open {
    margin-top: 0.35rem;
    padding: 0.72rem;
    gap: 0.62rem;
    max-height: min(64vh, 30rem);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .site-nav .service-link {
    display: flex;
    align-items: flex-start;
    padding: 0.8rem 0.82rem;
    color: var(--navy);
    opacity: 1;
    visibility: visible;
  }

  .site-nav .service-link svg {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
  }

  .site-nav .service-text {
    display: grid;
    color: var(--navy);
  }

  .site-nav .service-text strong {
    display: block;
    color: var(--navy);
  }

  .site-nav .service-text small {
    display: block;
    color: #4f5d6d;
  }

  .site-nav .nav-phone {
    margin-top: 0.5rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.48rem 0.82rem;
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .site-footer .footer-inner {
    gap: 1.8rem;
    padding-top: 2.4rem;
    padding-bottom: 2.1rem;
  }
}

@media (max-width: 768px) {
  .home-hero {
    padding-top: 40px;
  }

  .home-hero .hero-container {
    display: flex;
    flex-direction: column;
  }

  .home-hero .hero-content {
    text-align: center;
    max-width: 100%;
  }

  .home-hero .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  .home-hero .hero-actions {
    justify-content: center;
    align-items: center;
  }

  .home-hero .hero-visual {
    width: 100%;
  }

  .home-hero .hero-office-video {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
  }

  .team-section .team-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    justify-items: center;
  }

  .team-section .team-card {
    width: 100%;
    max-width: 34rem;
    margin-inline: auto;
  }

  .team-section .team-image {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center top;
    display: block;
  }

  .team-section .team-card-content {
    padding: 1.4rem 1.25rem 1.45rem;
    width: 100%;
  }

  .team-section .team-card h3,
  .team-section .team-card p {
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

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


/* Mobile typography cleanup (Jekyll site only) */
@media (max-width: 768px) {
  .home-hero .hero-content h1,
  .svc-hero-content h1,
  .page-hero-inner h1,
  .hero-container h1 {
    font-size: clamp(1.68rem, 5.3vw, 2.1rem);
    line-height: 1.11;
    max-width: 24ch;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
  }

  .home-hero .hero-subtitle,
  .svc-hero-content p,
  .page-hero .section-intro,
  .hero-subtitle {
    font-size: 1.03rem;
    line-height: 1.65;
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: pretty;
  }

  .home-hero .hero-content h1 {
    margin-bottom: 1.15rem;
  }

  .home-hero .hero-subtitle {
    margin-bottom: 2rem;
  }

  .home-hero .section-title,
  .svc-hero .section-title,
  .page-hero .section-title {
    font-size: clamp(2rem, 6.6vw, 2.3rem);
    line-height: 1.2;
    max-width: 20ch;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
  }

  .hero-actions,
  .page-actions {
    justify-content: center;
    align-items: center;
  }

  .hero-actions .btn,
  .page-actions .btn {
    width: min(100%, 22rem);
  }

  .team-section .team-card h3 { font-size: 1.32rem; line-height: 1.25; }
  .team-section .team-card p { font-size: 1rem; line-height: 1.65; }

  /* Cross-page mobile layout consistency */
  .hero-container,
  .hero-content,
  .svc-hero-content,
  .svc-hero {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-content h1,
  .svc-hero-content h1,
  .page-hero-inner h1 {
    line-height: 1.16;
    max-width: 21ch;
  }

  .svc-hero-subtitle,
  .hero-subtitle,
  .page-hero .section-intro {
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.62;
  }

  .svc-hero-actions,
  .hero-actions {
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
  }

  .svc-hero-actions .btn,
  .hero-actions .btn {
    width: min(100%, 22rem);
  }

  .minimal-grid,
  .services-grid,
  .timeline-layout,
  .process-grid,
  .faq-list,
  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .minimal-panel,
  .service-card,
  .page-card,
  .trust-card,
  .content-block,
  .editorial-item,
  .timeline-step,
  .process-step,
  .faq-item,
  .team-card {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .content-block,
  .service-card,
  .page-card,
  .trust-card,
  .timeline-step,
  .process-step,
  .team-card-content {
    padding: 1.25rem;
  }

  .minimal-panel svg,
  .service-card svg,
  .page-card svg,
  .trust-card svg,
  .content-block svg,
  .editorial-item svg,
  .timeline-step svg,
  .process-step svg,
  .team-card svg {
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .minimal-panel h3,
  .service-card h3,
  .page-card h3,
  .trust-card h3,
  .content-block h3,
  .editorial-item h3,
  .timeline-step h3,
  .process-step h3,
  .faq-question,
  .team-card-content h3 {
    font-size: clamp(1.15rem, 4.3vw, 1.35rem);
    line-height: 1.32;
    text-align: center;
  }

  .minimal-panel p,
  .service-card p,
  .page-card p,
  .trust-card p,
  .content-block p,
  .editorial-item p,
  .timeline-step p,
  .process-step p,
  .faq-item p,
  .team-card-content p {
    font-size: 0.98rem;
    line-height: 1.62;
    text-align: center;
  }

  .content-block h3,
  .content-block p,
  .editorial-item h3,
  .editorial-item p,
  .timeline-step h3,
  .timeline-step p,
  .process-step h3,
  .process-step p {
    text-align: center;
  }

  .editorial-list {
    padding-left: 0;
    padding-right: 0;
  }

  .split-layout,
  .timeline-layout,
  .process-grid,
  .minimal-grid {
    width: 100%;
    max-width: 100%;
  }

  .timeline-step,
  .process-step {
    min-height: auto;
    row-gap: 0.45rem;
    text-align: center;
    align-items: center;
    justify-items: center;
    padding: 1rem 1rem 1.1rem;
  }

  .timeline-step > *,
  .process-step > * {
    margin-left: auto;
    margin-right: auto;
  }

  .process-step-number,
  .timeline-step-number {
    display: block;
    margin: 0 auto 0.45rem;
    text-align: center;
  }

  .timeline-number,
  .step-number,
  .minimal-panel .step-number,
  .process-step .step-number,
  .timeline-step .timeline-number {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .faq-question {
    font-size: 0.95rem;
    line-height: 1.34;
  }

  .faq-item,
  .faq-card,
  .faq-accordion-item,
  .service-card,
  .page-card,
  .team-card,
  .trust-card,
  .content-block {
    overflow-wrap: anywhere;
  }

  .faq-answer {
    font-size: 0.96rem;
    line-height: 1.58;
    text-align: center;
  }

  .faq-card,
  .faq-accordion-item,
  .faq-item {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-grid .team-image,
  .team-section .team-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
  }

  .split-layout > *,
  .svc-hero-content,
  .hero-content,
  .content-block,
  .editorial-item,
  body,
  .home-hero,
  .svc-hero,
  .page-hero,
  main,
  section,
  .split-layout,
  .service-card,
  .page-card,
  .trust-card,
  .timeline-step,
  .process-step {
    overflow-x: hidden;
  }

  /* Service pages: unified mobile rhythm */
  .svc-hero {
    padding: 64px 0 52px;
  }

  .svc-hero .split-layout {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    align-items: start;
  }

  .svc-hero-content {
    order: 1;
    max-width: 42rem;
    text-align: center;
  }

  .svc-hero-content h1 {
    font-size: clamp(1.78rem, 6vw, 2.22rem);
    line-height: 1.14;
    max-width: 22ch;
    margin-inline: auto;
    text-wrap: balance;
  }

  .svc-hero-subtitle,
  .svc-hero-content .section-intro {
    max-width: 60ch;
    margin-inline: auto;
    text-align: center;
  }

  .svc-hero-actions {
    justify-content: center;
    align-items: center;
  }

  .svc-hero-visual {
    order: 0;
    width: 100%;
    max-width: 22rem;
    margin: 0 auto 0.35rem;
    justify-self: center;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    overflow: visible;
  }

  .svc-hero-visual::before {
    width: clamp(210px, 68vw, 300px);
    height: clamp(210px, 68vw, 300px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 48%, transparent 72%);
    filter: blur(34px);
  }

  .svc-hero-visual-card {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    margin: 0 auto;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    overflow: visible;
  }

  .svc-hero-icon,
  .svc-hero-visual img,
  .svc-hero-fallback-image {
    width: clamp(220px, 76vw, 300px);
    max-width: 82%;
    height: auto;
    max-height: none;
    margin-inline: auto;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    object-fit: contain;
  }

  .svc-hero-icon {
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0 70%, rgba(0, 0, 0, 0.86) 80%, transparent 97%);
    mask-image: radial-gradient(ellipse at center, #000 0 70%, rgba(0, 0, 0, 0.86) 80%, transparent 97%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }

  .services-main .section-title,
  .svc-local .section-title,
  .svc-hero .section-title,
  .services-main h2.section-title {
    display: block;
    text-align: center;
    margin-inline: auto;
  }

  .services-main .section-title::after,
  .svc-local .section-title::after,
  .svc-hero .section-title::after,
  .services-main h2.section-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .services-main .section-intro,
  .svc-local .section-intro {
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  .split-layout,
  .timeline-layout,
  .minimal-grid,
  .services-grid,
  .editorial-list {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .editorial-item,
  .timeline-step,
  .minimal-panel,
  .service-card,
  .faq-item {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding: 1.15rem;
  }

  .timeline-step,
  .timeline-content,
  .timeline-content h3,
  .timeline-content p {
    text-align: center;
  }

  .timeline-step {
    align-items: center;
    justify-items: center;
  }

  .timeline-number,
  .timeline-step .timeline-number,
  .step-number,
  .process-step-number,
  .timeline-step-number {
    margin: 0 auto 0.55rem;
    text-align: center;
  }

  .svc-local .split-layout {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .svc-local-content {
    text-align: center;
    margin-inline: auto;
  }

  .svc-local-visual {
    order: 2;
    width: 100%;
    justify-self: center;
  }

  .svc-local-visual img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    object-position: center;
  }
}

@media (max-width: 480px) {
  .site-nav .nav-inner {
    padding: 0.45rem 0.85rem 0.5rem;
  }

  .site-nav .brand-logo {
    width: clamp(220px, 68vw, 320px);
    max-width: 100%;
    max-height: 86px;
    height: auto;
  }

  .site-nav .menu-toggle {
    min-height: 2.3rem;
    padding: 0.48rem 0.68rem;
  }

  .site-nav .nav-phone {
    min-height: 2.25rem;
    font-size: 0.9rem;
  }

  .team-section .team-card {
    max-width: 100%;
  }

  .team-section .team-card-content {
    padding: 1.25rem 1.05rem 1.35rem;
  }

  .home-hero .hero-content h1,
  .svc-hero-content h1,
  .page-hero-inner h1,
  .hero-container h1 {
    font-size: clamp(1.58rem, 7.1vw, 1.92rem);
    max-width: 22ch;
    line-height: 1.1;
  }

  .section-title {
    font-size: clamp(1.95rem, 7.2vw, 2.15rem);
    max-width: 17ch;
  }

  .home-hero .hero-subtitle,
  .svc-hero-content p,
  .page-hero .section-intro,
  .hero-subtitle,
  .section-intro,
  .local-text p,
  .trust-text p,
  .team-card-content p {
    font-size: 0.98rem;
    line-height: 1.62;
  }
}
