/*
 * DietByApeksha responsive layer
 * Bootstrap-style breakpoints without adding a third-party CSS dependency.
 * Loaded after style.css so it safely normalizes all public pages.
 */

:root {
  --mobile-gutter: clamp(.9rem, 4vw, 1.25rem);
  --header-height-mobile: 68px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  min-width: 0;
}

main,
section,
article,
aside,
header,
footer,
nav,
.container,
.hero-inner,
.footer-grid,
.services-grid,
.why-grid,
.process-steps,
.testimonials-grid,
.packages-grid,
.blog-grid {
  min-width: 0;
}

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

video,
iframe,
embed,
object {
  display: block;
}

iframe {
  width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

textarea {
  width: 100%;
}

p,
li,
a,
span,
strong,
small,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: anywhere;
}

pre,
code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
}

/* Responsive data and rich-content elements */
table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.blog-content,
.blog-content * {
  max-width: 100%;
}

.blog-content img,
.blog-content video,
.blog-content iframe,
.blog-content table {
  margin-inline: auto;
}

.blog-content ul,
.blog-content ol {
  padding-left: 1.25rem;
}

.blog-content ul { list-style: disc; }
.blog-content ol { list-style: decimal; }

/* Keep card content from forcing horizontal overflow */
.service-card,
.package-card,
.testimonial-card,
.blog-card,
.why-card,
.enquiry-form-wrap,
.contact-visual-card,
.image-card {
  min-width: 0;
}

.btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  justify-content: center;
  line-height: 1.35;
}

/* Tablet navigation: the desktop menu is too wide well before 768px */
@media (max-width: 1100px) {
  .site-header .nav-inner {
    position: relative;
    min-height: var(--header-height-mobile);
    gap: .75rem;
    padding-block: .55rem;
  }

  .site-header .logo {
    min-width: 0;
    max-width: calc(100% - 58px);
  }

  .site-header .site-logo-img {
    max-width: min(210px, 62vw);
    max-height: 50px;
  }

  .nav-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(45, 106, 79, .16);
    border-radius: 10px;
    background: rgba(45, 106, 79, .05);
    flex-shrink: 0;
  }

  .nav-toggle span {
    transform-origin: center;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100dvh - var(--header-height-mobile));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .06);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .14);
    padding: .65rem;
    z-index: 1001;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav > ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
  }

  .main-nav li,
  .main-nav a {
    width: 100%;
  }

  .main-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: .7rem .85rem;
    border-radius: 9px;
    font-size: .95rem;
  }

  .main-nav .dropdown {
    display: none !important;
    position: static;
    min-width: 0;
    margin: .15rem 0 .4rem;
    padding: .25rem 0 .25rem .7rem;
    background: transparent;
    border: 0;
    border-left: 2px solid rgba(45, 106, 79, .15);
    border-radius: 0;
    box-shadow: none;
  }

  .main-nav .has-dropdown.open > .dropdown {
    display: block !important;
  }

  .main-nav .dropdown a {
    min-height: 42px;
    font-size: .9rem;
  }

  .header-cta {
    display: none;
  }
}

/* Large tablets */
@media (max-width: 991.98px) {
  .container {
    max-width: 100%;
    padding-inline: clamp(1rem, 3vw, 1.5rem);
  }

  .hero {
    padding: 3.25rem 0;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .hero-content {
    max-width: 720px;
  }

  .hero-image {
    order: -1;
    width: min(100%, 560px);
    max-width: 560px;
    margin-inline: auto;
  }

  .hero-image img {
    width: 100%;
  }

  .section {
    padding: 4rem 0;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }

  .services-grid,
  .why-grid,
  .testimonials-grid,
  .packages-grid,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  /* Public pages use desktop grids in inline style attributes. */
  [style*="display:grid"][style*="grid-template-columns:3fr 2fr"],
  [style*="display: grid"][style*="grid-template-columns: 3fr 2fr"],
  [style*="display:grid"][style*="grid-template-columns:2fr 3fr"],
  [style*="display: grid"][style*="grid-template-columns: 2fr 3fr"],
  [style*="display:grid"][style*="grid-template-columns:3fr 1fr"],
  [style*="display: grid"][style*="grid-template-columns: 3fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 2rem !important;
  }

  [style*="position:sticky"],
  [style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }
}

/* Phones and portrait tablets */
@media (max-width: 767.98px) {
  :root {
    --radius-xl: 22px;
  }

  body {
    line-height: 1.65;
  }

  .container {
    padding-inline: var(--mobile-gutter);
  }

  h1 { font-size: clamp(1.9rem, 9vw, 2.55rem); }
  h2 { font-size: clamp(1.5rem, 7vw, 2.05rem); }
  h3 { font-size: clamp(1.12rem, 5vw, 1.45rem); }

  .section,
  .about-redesign-section,
  .about-clean-section,
  .about-intro-v2-section,
  .about-model-v2-section,
  .about-philosophy-v2-section,
  .about-specializations-v2-section,
  .about-testimonials-v2-section {
    padding: 2.75rem 0 !important;
  }

  .page-hero,
  .about-page-hero,
  .about-page-hero-v2 {
    padding: 2.5rem 0 2.1rem !important;
  }

  .page-hero p,
  .hero-sub,
  .section-subtitle {
    font-size: 1rem;
  }

  .section-subtitle {
    margin-bottom: 1.75rem;
  }

  .hero {
    padding: 2.35rem 0 2.75rem;
  }

  .hero-inner {
    gap: 1.5rem;
  }

  .hero-image {
    width: min(100%, 430px);
    max-width: 100%;
  }

  .hero-image img,
  .home-about-img,
  .service-page-media img,
  .visual-banner img,
  .why-visual img,
  .fertility-visual img,
  .contact-visual-card img {
    max-height: none !important;
  }

  .hero-cta,
  .about-action-row,
  .about-action-v2-row {
    gap: .75rem;
  }

  .trust-badges {
    gap: .5rem;
  }

  .badge {
    flex: 1 1 calc(50% - .5rem);
    justify-content: center;
    min-width: 0;
    text-align: center;
  }

  .services-grid,
  .why-grid,
  .process-steps,
  .testimonials-grid,
  .packages-grid,
  .blog-grid,
  .footer-grid,
  .startup-fit-grid,
  .platform-card-grid,
  .platform-feature-grid,
  .about-platform-card-grid,
  .about-credentials-grid,
  .about-model-v2-grid,
  .about-intro-v2-grid,
  .about-model-v2-top,
  .about-philosophy-v2-card,
  .about-clean-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .services-grid,
  .why-grid,
  .process-steps,
  .testimonials-grid,
  .packages-grid,
  .blog-grid {
    gap: 1rem;
  }

  .service-card,
  .package-card,
  .testimonial-card,
  .blog-card-body,
  .enquiry-form-wrap {
    padding: 1.25rem;
  }

  .service-card-img-wrap {
    margin: -1.25rem -1.25rem 1rem;
  }

  .footer-brand {
    grid-column: auto;
  }

  .site-footer {
    padding-top: 2.75rem;
  }

  .footer-grid {
    gap: 1.75rem;
    padding-bottom: 2.25rem;
  }

  .footer-col,
  .footer-brand {
    min-width: 0;
  }

  .social-links {
    flex-wrap: wrap;
  }

  .cta-banner {
    padding: 2.75rem 0;
  }

  .cta-banner p {
    margin-bottom: 1.4rem;
  }

  .enquiry-form-wrap {
    width: 100%;
    max-width: 100%;
  }

  .form-control,
  input,
  select,
  textarea {
    font-size: 16px; /* prevents iOS form zoom */
  }

  .breadcrumb {
    flex-wrap: wrap;
    line-height: 1.45;
  }

  .blog-share-actions,
  .blog-sidebar-share-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .blog-share-btn,
  .blog-sidebar-share-actions a,
  .blog-sidebar-share-actions button {
    width: 100%;
  }

  /* Normalize all remaining inline CSS grids on phones. */
  [style*="display:grid"][style*="grid-template-columns"],
  [style*="display: grid"][style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Compact 4-number statistic rows remain useful as two columns. */
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  .about-stats-v2-grid,
  .about-stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
  }

  [style*="padding:4rem"],
  [style*="padding: 4rem"],
  [style*="padding:3rem"],
  [style*="padding: 3rem"],
  [style*="padding:2.5rem"],
  [style*="padding: 2.5rem"] {
    padding: 1.25rem !important;
  }

  .startup-hint-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .about-clean-profile,
  .about-profile-panel,
  .about-profile-v2-card {
    position: static !important;
    top: auto !important;
  }

  .about-profile-panel,
  .about-profile-v2-card {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100% !important;
  }

  .about-content-flow,
  .about-platform-section,
  .platform-card-section,
  .about-philosophy-redesign {
    width: 100% !important;
    max-width: 100% !important;
  }

  .whatsapp-float {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
}

/* Small phones */
@media (max-width: 575.98px) {
  .site-header .site-logo-img {
    max-width: min(170px, 58vw);
    max-height: 44px;
  }

  .hero-cta,
  .cta-banner .container > div[style*="display:flex"],
  .about-action-row,
  .about-action-v2-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn,
  .cta-banner .btn,
  .about-action-row .btn,
  .about-action-v2-row .btn,
  .enquiry-form-wrap .btn,
  .package-card .btn {
    width: 100%;
  }

  .badge {
    flex-basis: 100%;
  }

  .service-card,
  .package-card,
  .testimonial-card,
  .enquiry-form-wrap,
  .startup-fit-panel,
  .startup-hint-card,
  .platform-card-section,
  .about-platform-section {
    border-radius: 16px !important;
  }

  .page-hero .section-label {
    max-width: 100%;
  }

  .about-stats-v2-grid,
  .about-stats-strip,
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .blog-content {
    font-size: 1rem !important;
    line-height: 1.75 !important;
  }

  .blog-content h2 { font-size: 1.5rem; }
  .blog-content h3 { font-size: 1.25rem; }

  /* Blog author box uses inline flex. */
  article > div[style*="display:flex"][style*="align-items:center"][style*="margin-top:3rem"] {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

@media (max-width: 359.98px) {
  .container {
    padding-inline: .75rem;
  }

  .site-header .site-logo-img {
    max-width: 145px;
  }

  .about-stats-v2-grid,
  .about-stats-strip,
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Reduced-motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
