/* CED India v2 responsive and accessibility guardrails.
   This layer preserves the existing visual language while making every template
   resilient to narrow screens, long content, keyboard use and reduced motion. */

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { min-width: 0; overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
main, section, article, aside, header, footer, .container, .row, [class*="col-"] { min-width: 0; }
p, li, a, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* Predictable, usable controls across mouse, touch and keyboard. */
button, .btn, [class*="-btn"], [class*="-link"], input[type="submit"] {
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
  touch-action: manipulation;
}
a, button, input, textarea, select { -webkit-tap-highlight-color: rgba(2,123,73,.16); }
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid #f5b942;
  outline-offset: 3px;
  border-radius: 4px;
}

/* WordPress editor content must never break the page. */
.ced-entry-content, .ced-wp-content, .entry-content { max-width: 100%; }
.ced-entry-content table, .ced-wp-content table, .entry-content table { display: block; max-width: 100%; overflow-x: auto; }
.ced-entry-content pre, .ced-wp-content pre, .entry-content pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }
.ced-entry-content iframe, .ced-wp-content iframe, .entry-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }

/* Prevent cards and slider controls from clipping at intermediate widths. */
.hero-content, .hero-copy, .hero-actions, .section-head, .footer-grid,
.events-grid, .ced-programmes-grid, .activity-grid, .news-slider { min-width: 0; }
.hero-actions, .section-actions, .train-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.ns-arrow, .hero-arrow, .back-to-top, .ticker-control { min-width: 44px; flex: 0 0 44px; }
.hub-card, .ced-news-card, .ced-event-card, .ced-programme-card { height: 100%; }

@media (max-width: 1100px) {
  html { scroll-padding-top: 78px; }
  .header-inner { min-height: 70px; gap: .75rem; }
  .header-brand { min-width: 0; }
  .brand-logo { max-width: clamp(120px, 30vw, 170px); height: auto; }
  .primary-nav { overflow-y: auto; overscroll-behavior: contain; }
  .primary-nav .menu { width: 100%; }
  .primary-nav .menu a, .primary-nav .submenu-toggle { min-height: 48px; width: 100%; }
  .primary-nav .submenu { position: static; max-width: 100%; }
}

@media (max-width: 767px) {
  html { scroll-padding-top: 70px; }
  .container { width: 100%; padding-inline: clamp(16px, 5vw, 24px); }
  .topbar { display: none; }
  .site-header { top: 0; }
  .header-cta { display: none; }
  .hero { min-height: min(780px, 100svh); }
  .hero-content { padding-inline: clamp(16px, 5vw, 24px); }
  .hero-title, .hero-heading { font-size: clamp(2rem, 10vw, 3.4rem); }
  .hero-actions, .section-actions, .train-cta { align-items: stretch; }
  .hero-actions .btn, .section-actions .btn, .train-cta .btn { width: 100%; }
  .ns-arrow { position: static; }
  .news-slider { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: .5rem; align-items: center; }
  .ns-viewport { grid-column: 1 / -1; grid-row: 1; }
  .ns-prev { grid-column: 1; grid-row: 2; }
  .ns-dots { grid-column: 2; grid-row: 2; }
  .ns-next { grid-column: 3; grid-row: 2; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .foot-legal { flex-wrap: wrap; }
  .social-rail { display: none; }
}

@media (max-width: 420px) {
  .container { padding-inline: 15px; }
  .brand-logo { max-width: 128px; }
  .hero-actions .btn, .section-actions .btn, .train-cta .btn { padding-inline: 1rem; }
  .ced-news-meta, .event-extra-info { align-items: flex-start; flex-direction: column; }
}

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

@media print {
  .topbar, .site-header, .social-rail, .back-to-top, .page-loader, .footer-bg-image { display: none; }
  body { color: #000; background: #fff; }
  a { color: inherit; text-decoration: underline; }
}
