/**
 * Responsive overrides — loaded after style.css
 * Breakpoints: 1199 | 991 | 767 | 575 | 399
 */

:root {
  --site-gutter: clamp(16px, 4vw, 48px);
  --section-space-y: clamp(36px, 5vw, 56px);
  --touch-min: 44px;
}

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

/* Media defaults — preserve object-fit fill where needed */
img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

.features-section .card-img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

.skills-section .skill-icon {
  max-width: 38px;
  height: 38px;
  object-fit: contain;
}

.faculty-photo {
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-card img {
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}

.recognition-section .recognition-container {
  padding-left: 12px !important;
  padding-right: 12px !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Legacy block overrides — keep section-specific styles winning */
.features-container,
.msc-container,
.impact-banner .container,
.skills-section .skills-container,
.difference-container,
.faculty-container,
.know-more-section .know-more-container,
.know-more-section .container,
.recognition-container,
.faq-section .faq-container,
.enquire-section .enquire-container {
  padding-left: var(--site-gutter);
  padding-right: var(--site-gutter);
}

/* Header logos live inside hero-section — no separate header block */
.hero-section .hero-header {
  padding: 8px 0 0;
}

/* Hero aligns with header — fixed padding, no fluid gutter */
.hero-section {
  --hero-edge-left: 16px;
  --hero-edge-right: 32px;
}

.hero-section .hero-container {
  max-width: 1320px;
  --bs-gutter-x: 0;
  padding-left: var(--hero-edge-left);
  padding-right: var(--hero-edge-right);
}

@media screen and (min-width: 1200px) {
  .hero-section {
    --hero-edge-left: 40px;
    --hero-edge-right: 48px;
  }
}

/* Hero desktop layout is content-driven in style.css — no viewport-height rules,
   transform offsets, or height-based DPI breakpoints, so the section scales
   proportionally across Windows 100%/125%/150% display scaling. */

/* Fluid section titles */
.section-title,
.features-title,
.msc-heading,
.impact-section-title,
.difference-title,
.faq-section .section-title,
.enquire-heading {
  font-size: clamp(1.75rem, 4.2vw, 2.8125rem);
}

.skills-section .skills-section-title {
  background: linear-gradient(90deg, #1a237e 0%, #4527a0 42%, #00acc1 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.faq-section .faq-title,
.know-more-section .know-more-title {
  font-size: clamp(1.75rem, 4.2vw, 2.8125rem);
}

/* Accessibility: focus & touch targets */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.features-arrow:focus-visible,
.faculty-arrow:focus-visible,
.accordion-button:focus-visible {
  outline: 2px solid #00bcd4;
  outline-offset: 2px;
}

.btn-enroll,
.btn-hero-submit,
.features-arrow,
.faculty-arrow,
.submit-btn {
  min-height: var(--touch-min);
}

/* Tablet & mobile hero — desktop (≥992px) layout unchanged */
@media screen and (max-width: 991px) {
  .hero-section {
    min-height: auto !important;
  }

  .hero-section .hero-container {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    gap: 0 !important;
    justify-content: flex-start !important;
  }

  .hero-main {
    margin-top: 0 !important;
    min-height: auto;
    padding-bottom: 1.5rem;
  }

  .hero-bg-circuit {
    background-size: 100% auto;
    background-position: center bottom;
  }

  .hero-student-img {
    max-height: clamp(18rem, 72vw, 26rem);
    transform: none;
    object-position: center bottom;
  }

  .hero-info-bar {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #e8eaf6 !important;
  }

  .hero-right {
    top: 0 !important;
    max-width: min(420px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  .hero-section .hero-enquiry-card {
    transform: none !important;
  }

  .hero-student-stack {
    width: 100% !important;
    max-width: min(34rem, 100%) !important;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-globe-wrap {
    width: 74%;
    bottom: -14%;
    transform: translateX(-50%);
  }
}

/* Hero — clip section on mobile; desktop center image stays fully visible */
.hero-section {
  overflow: hidden !important;
  isolation: isolate;
  z-index: 10;
}

@media screen and (max-width: 991px) {
  .hero-student-stack,
  .hero-student-figure,
  .hero-center {
    overflow: hidden;
  }
}

@media screen and (min-width: 992px) {
  .hero-center,
  .hero-student-stack {
    overflow: visible !important;
  }
}

.hero-center {
  max-width: 100%;
}

/* Feature cards — match main style.css heights; keep rounded corners */
.features-section .feature-card {
  height: 550px;
  border-radius: 32px !important;
  overflow: hidden;
}

.features-slide {
  border-radius: 32px !important;
  overflow: hidden;
}

/* MSC image — no forced min-height on smaller viewports */
@media screen and (max-width: 1199px) {
  .msc-feature-img {
    min-height: auto;
  }

  .msc-inner {
    gap: 32px;
  }

  .msc-heading {
    font-size: 40px;
  }

  .features-slider-viewport {
    grid-auto-columns: calc((100% - 16px) / 2);
  }

  .features-section .feature-card {
    height: 530px;
    border-radius: 32px !important;
  }
}

/* Mid layouts — FAQ & enquire stack */
@media screen and (max-width: 1240px) {
  .impact-banner {
    min-height: auto;
    padding: 48px 0;
  }

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

  .enquire-section .enquire-card {
    grid-template-columns: 1fr;
  }

  .enquire-info-panel {
    min-height: auto;
    padding: 2rem 1.5rem 2.5rem;
  }

  .enquire-form-panel {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .enquire-npf-scroll {
    max-height: 420px;
  }

  .enquire-section .form-container > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .enquire-section .info-section {
    padding: 24px var(--site-gutter) 32px;
    text-align: center;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  section {
    padding-top: var(--section-space-y);
    padding-bottom: var(--section-space-y);
  }

  .hero-section,
  .impact-section,
  .msc-section,
  .tuition-section,
  .skills-section,
  .recognition-section,
  .know-more-section,
  .difference-section,
  .faculty-section,
  .faq-section,
  .enquire-section {
    padding-top: 0;
    padding-bottom: 0;
  }

  .features-section {
    padding: 56px 0 56px !important;
  }

  .hero-section {
    --hero-edge-left: 16px;
    --hero-edge-right: 16px;
  }

  .hero-section .hero-container {
    padding-left: var(--hero-edge-left);
    padding-right: var(--hero-edge-right);
  }

  .hero-header {
    padding: 6px 0 6px;
  }

  .hero-student-stack {
    max-width: min(32rem, 100%);
    padding-bottom: 1.25rem;
    transform: translateX(0);
    margin-left: auto;
    margin-right: auto;
  }

  .hero-student-img {
    transform: none;
    object-position: center bottom;
  }

  .hero-globe-wrap {
    bottom: -14%;
    max-width: 100%;
    width: 74%;
    transform: translateX(-50%);
  }

  .hero-section .hero-title {
    font-size: clamp(1.55rem, 6vw, 2.05rem) !important;
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }

  .hero-section .hero-title-line {
    white-space: nowrap;
  }

  .hero-right {
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  .hero-enquiry-card {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-npf-scroll {
    max-height: 360px;
  }

  .btn-enroll {
    width: 100%;
    max-width: 320px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .features-section {
    padding: 52px 0 48px;
  }

  .features-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .msc-section {
    padding: 40px 0;
  }

  .msc-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .know-more-section {
    padding: 40px 0;
    text-align: center;
  }

  .know-more-content {
    text-align: center;
  }

  .know-more-text {
    margin-left: auto;
    margin-right: auto;
  }

  .difference-section {
    padding: 40px 0 48px;
  }

  .difference-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .difference-title {
    font-size: clamp(1.375rem, 5.5vw, 1.875rem);
    margin-bottom: 24px;
    line-height: 1.3;
  }

  .difference-table-card {
    border-radius: 24px;
  }

  .faculty-section {
    padding: 40px 0 48px;
  }

  .faculty-slider-wrap {
    padding: 0 40px;
  }

  .faq-section {
    padding: 40px 0 48px;
  }

  .faq-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .enquire-section {
    padding: 36px 0 40px;
  }

  .enquire-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .skills-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-section .hero-title-gradient {
    font-size: clamp(1.5rem, 5.8vw, 2rem) !important;
    overflow: visible;
  }

  .hero-section .hero-subtitle {
    font-size: clamp(0.8rem, 3.2vw, 0.95rem) !important;
  }

  .hero-student-img {
    max-height: clamp(15rem, 60vw, 21rem) !important;
  }

  .hero-center {
    margin-bottom: 0;
    max-width: min(30rem, 94%);
  }

  .hero-info-bar {
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #e8eaf6 !important;
  }

  .hero-info-item {
    flex: 1 1 50%;
    min-width: 0;
    color: #1a237e;
    border-right: 1px solid rgba(26, 35, 126, 0.12);
  }

  .hero-info-item:nth-child(2n) {
    border-right: none;
  }

  .features-slider-wrap {
    padding: 0 clamp(36px, 10vw, 44px);
  }

  .features-section .feature-card {
    height: 500px;
    border-radius: 28px !important;
  }

  .features-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    margin-bottom: 28px;
  }

  .features-slider-viewport {
    grid-auto-columns: min(88%, 340px);
  }

  .difference-table thead th:first-child,
  .difference-table tbody td:first-child {
    width: auto;
    min-width: 88px;
  }

  .difference-table thead th,
  .difference-table tbody td {
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
  }

  .difference-table-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .impact-section-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .impact-header {
    padding: 36px 16px 24px;
  }

  .impact-banner {
    padding: 40px 0;
  }

  .impact-cards-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .impact-box {
    min-height: auto;
  }

  .msc-inner {
    gap: 28px;
  }

  .msc-heading {
    font-size: clamp(1.75rem, 5.5vw, 2.375rem);
  }

  .msc-tagline {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
  }

  .msc-body,
  .msc-programme-label {
    font-size: clamp(0.9375rem, 3.2vw, 1.0625rem);
  }

  .skills-section {
    padding: 40px 0 48px;
  }

  .skills-section-title {
    font-size: clamp(1.75rem, 5vw, 2rem);
    margin-bottom: 28px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .skill-card-title {
    font-size: 18px;
    padding-top: 0;
    min-height: 2.6em;
  }

  .skill-card-desc {
    font-size: 14px;
  }

  .features-title {
    font-size: clamp(1.75rem, 5vw, 2rem);
  }

  .faculty-photo-frame {
    width: min(100%, 156px);
    height: min(100%, 156px);
    aspect-ratio: 1;
  }

  .recognition-container {
    padding-left: var(--site-gutter);
    padding-right: var(--site-gutter);
  }

  .recognition-grid {
    padding-left: 4px;
    padding-right: 4px;
  }

  .accordion-button {
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
    font-size: clamp(0.875rem, 3.5vw, 1.0625rem);
    padding: 14px 16px;
  }

  .enquire-heading {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    margin-bottom: 1.25rem;
  }

  .enquire-card {
    border-radius: 28px;
    flex-direction: column;
  }

  .enquire-form-panel,
  .enquire-info-panel {
    width: 100%;
  }

  .enquire-form-panel {
    padding: 1.25rem 1rem 1rem;
  }

  .enquire-info-panel {
    padding: 1.75rem 1.25rem 2rem;
    text-align: center;
  }

  .enquire-info-panel .info-section {
    align-items: center;
    text-align: center;
  }

  .enquire-npf-scroll {
    max-height: 380px;
  }

  .enquire-info-panel .info-section h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    line-height: 1.35;
  }

  .msc-feature-img {
    min-height: auto !important;
    max-height: none;
  }

  .msc-content-top {
    padding-right: 0;
    text-align: center;
  }

  .msc-image-top,
  .msc-image-bottom {
    order: -1;
  }

  .know-more-cta {
    width: 100%;
    max-width: 320px;
  }

  .hero-phone-field {
    flex-wrap: wrap;
  }

  .hero-phone-field select {
    min-width: 72px;
  }
}

/* Small phones */
@media screen and (max-width: 575px) {
  .features-section {
    padding: 44px 0 52px !important;
  }

  .features-section .feature-card {
    height: 480px !important;
    border-radius: 24px !important;
  }

  .features-slider-viewport {
    grid-auto-columns: 88%;
  }

  .features-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .hero-section .hero-title {
    font-size: clamp(1.3rem, 6.5vw, 1.65rem) !important;
  }

  .hero-section .hero-title-gradient {
    font-size: clamp(1.25rem, 6.2vw, 1.6rem) !important;
  }

  .header-logos {
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(8px, 3vw, 14px);
  }

  .header-logo-img {
    max-height: clamp(3.25rem, 12vw, 4rem);
  }

  .header-logo-jcds-main {
    max-height: clamp(3.75rem, 14vw, 4.75rem) !important;
  }

  .header-logo-jcds-icon {
    width: clamp(3.25rem, 16vw, 4rem);
    height: clamp(3.25rem, 16vw, 4rem);
    max-height: clamp(3.25rem, 16vw, 4rem);
    max-width: clamp(3.25rem, 16vw, 4rem);
  }

  .header-logo-jcds-text {
    max-height: clamp(3rem, 14vw, 3.75rem);
    max-width: min(58vw, 15rem);
  }

  .hero-student-img {
    max-height: clamp(13rem, 64vw, 18rem) !important;
  }

  .hero-info-item {
    flex: 1 1 100%;
    border-right: none !important;
    border-bottom: 1px solid rgba(26, 35, 126, 0.12);
    color: #1a237e;
    padding: 0.625rem 0.5rem;
  }

  .hero-info-item:last-child {
    border-bottom: none;
  }

  .recognition-section .recognition-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .features-slider-wrap {
    padding: 0 32px;
  }

  .features-arrow {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .rec-card-small {
    width: min(78vw, 208px);
    height: clamp(210px, 42vh, 236px);
  }

  .rec-card-main {
    width: min(88vw, 264px);
    height: clamp(280px, 48vh, 340px);
  }

  .hero-consent span {
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .hero-enquiry-form input,
  .hero-enquiry-form select {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* Very small phones */
@media screen and (max-width: 399px) {
  .hero-student-stack {
    max-width: 100%;
  }

  .btn-enroll {
    width: 100%;
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  .features-arrow {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

/* Landscape phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero-main {
    gap: 16px;
  }

  .hero-student-stack {
    max-width: min(320px, 45vw);
  }

  .hero-student-img {
    transform: none;
    object-position: center bottom;
  }

  .hero-globe-wrap {
    bottom: -20%;
  }
}

/* Large desktops & ultrawide — cap content width */
/* On wide viewports let the other sections grow, but keep the HERO pinned to
   its 1320px container. This makes the 100% view render the hero at the same
   size it uses at 125% scaling — so the banner "fits as it is like 125%"
   instead of enlarging and loosening on a wide (100%) monitor. */
@media screen and (min-width: 1600px) {
  .features-container,
  .msc-container,
  .skills-section .skills-container,
  .difference-container,
  .faculty-container,
  .faq-section .faq-container,
  .enquire-section .enquire-container {
    max-width: 1520px;
  }
}

@media screen and (min-width: 1920px) {
  .features-container,
  .msc-container,
  .skills-section .skills-container,
  .difference-container,
  .faculty-container,
  .faq-section .faq-container,
  .enquire-section .enquire-container {
    max-width: 1600px;
  }
}

/* Enquire section — remove forced empty space */
.enquire-section {
  min-height: auto !important;
}

.enquire-section .form-container {
  min-height: auto !important;
}

/* Footer */
.site-footer {
  background: #f3eef8;
  padding: clamp(20px, 4vw, 32px) var(--site-gutter);
  border-top: 1px solid #eee;
}

.site-footer p {
  margin: 0;
  font-size: clamp(0.75rem, 2.5vw, 0.9375rem);
  line-height: 1.5;
  color: #333;
}

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