/* ============================================================
   PT Infrastruktur Cerdas Nusantara — Responsive Stylesheet
   responsive.css
   ============================================================ */

/* ----------------------------------------------------------
   Breakpoints:
   1200px  — Desktop / Large
    992px  — Laptop / Medium Desktop
    768px  — Tablet
    576px  — Mobile Large
    360px  — Mobile Small
   ---------------------------------------------------------- */

/* ----------------------------------------------------------
   1200px — Large Desktop Adjustments
   ---------------------------------------------------------- */
@media (max-width: 1200px) {
  :root {
    --font-size-5xl: 3rem;
    --font-size-4xl: 2.5rem;
    --font-size-3xl: 2rem;
  }

  .container {
    padding-inline: var(--space-8);
  }

  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .footer-main {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-8);
  }

  .hero__title {
    font-size: 2.75rem;
  }
}

/* ----------------------------------------------------------
   992px — Tablet / Laptop
   ---------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2.25rem;
    --font-size-3xl: 1.875rem;
    --space-20: 4rem;
    --space-16: 3.5rem;
    --space-24: 5rem;
    --space-32: 6rem;
  }

  /* Navigation — switch to mobile menu */
  .main-nav,
  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  /* Grids */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .hero__visual {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-block: calc(var(--header-height) + var(--space-12)) var(--space-16);
  }

  .hero__subtitle { max-width: 100%; }

  .hero-stats__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stat:nth-child(2) { border-right: none; }

  /* About */
  .about-split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .about-split--reverse .about-split__media {
    order: 0;
  }

  /* Process */
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .process-steps::before {
    display: none;
  }

  .process-step {
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
  }

  .process-step__number {
    margin: 0;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    font-size: var(--font-size-lg);
  }

  /* Footer */
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-main > *:first-child {
    grid-column: 1 / -1;
  }

  /* Feature Grid */
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stat Banner */
  .stat-banner {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-banner__item:nth-child(2) { border-right: none; }

  /* SJUT Flow */
  .sjut-flow {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .sjut-flow__arrow {
    transform: rotate(90deg);
    justify-content: center;
    padding-bottom: 0;
    padding-top: var(--space-1);
  }

  .sjut-flow__node {
    flex-direction: row;
    align-items: center;
    min-width: auto;
  }

  .sjut-flow__box {
    max-width: 100%;
  }
}

/* ----------------------------------------------------------
   768px — Tablet
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.25rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --space-20: 3.5rem;
    --space-16: 3rem;
  }

  .container {
    padding-inline: var(--space-5);
  }

  /* Grid */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-stats__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Feature */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Page Hero */
  .page-hero__title {
    font-size: var(--font-size-3xl);
  }

  /* Section title */
  .section-title {
    font-size: var(--font-size-2xl);
  }

  /* Partner grid */
  .partner-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-main > *:first-child {
    grid-column: 1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Stat banner */
  .stat-banner {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Buttons */
  .btn-group {
    flex-direction: column;
    align-items: flex-start;
  }

  /* CTA Section */
  .cta-section {
    padding: var(--space-16) var(--space-5);
  }

  .cta-section__title {
    font-size: var(--font-size-2xl);
  }

  /* Filter bar */
  .filter-bar {
    gap: var(--space-2);
  }

  /* Search */
  .search-bar {
    max-width: 100%;
  }

  /* Back to top */
  .back-to-top {
    bottom: var(--space-5);
    right: var(--space-5);
  }
}

/* ----------------------------------------------------------
   576px — Mobile Large
   ---------------------------------------------------------- */
@media (max-width: 576px) {
  :root {
    --font-size-5xl: 1.875rem;
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.375rem;
    --font-size-xl:  1.25rem;
    --space-20: 3rem;
    --space-16: 2.5rem;
    --space-12: 2.5rem;
  }

  .container {
    padding-inline: var(--space-4);
  }

  /* Hero */
  .hero {
    padding-block: calc(var(--header-height) + var(--space-8)) var(--space-12);
  }

  .hero__title {
    font-size: var(--font-size-3xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-base);
  }

  .hero__badge {
    font-size: var(--font-size-xs);
  }

  .hero-stats__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stat {
    padding: var(--space-4) var(--space-3);
  }

  /* Buttons — full-width only on non-small variants */
  .btn:not(.btn--sm):not(.btn--icon) {
    width: 100%;
    justify-content: center;
  }

  .btn-group .btn {
    width: auto;
    flex: 1;
  }

  /* Feature grid */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* Stats banner */
  .stat-banner {
    grid-template-columns: 1fr 1fr;
    padding: var(--space-6);
    gap: var(--space-3);
  }

  .stat-banner__item {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: var(--space-4) var(--space-2);
  }

  .stat-banner__item:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.12);
  }

  .stat-banner__item:nth-last-child(-n+2) {
    border-bottom: none;
  }

  /* Section header */
  .section-header--center .btn-group {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Page hero */
  .page-hero {
    padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-10);
  }

  .page-hero__title {
    font-size: var(--font-size-2xl);
  }

  /* Footer */
  .footer-legal {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  /* Cards */
  .card {
    padding: var(--space-6);
  }

  .service-card {
    padding: var(--space-6);
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  /* SJUT Component Grid */
  .grid-auto {
    grid-template-columns: 1fr;
  }

  /* Partner grid */
  .partner-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----------------------------------------------------------
   360px — Mobile Small
   ---------------------------------------------------------- */
@media (max-width: 360px) {
  :root {
    --font-size-3xl: 1.375rem;
    --font-size-2xl: 1.25rem;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .site-logo__name {
    display: none;
  }

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

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

  .filter-btn {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-3);
  }
}

/* ----------------------------------------------------------
   Print Styles
   ---------------------------------------------------------- */
@media print {
  .site-header,
  .back-to-top,
  .mobile-nav,
  .nav-toggle {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: black;
  }

  .section {
    padding-block: 1rem;
  }

  .btn { display: none; }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
}

/* ----------------------------------------------------------
   Focus styles for keyboard nav
   ---------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus outline for mouse users when not needed */
:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------------------------
   Overflow & Horizontal scroll prevention
   ---------------------------------------------------------- */
html, body {
  overflow-x: hidden;
}

/* Tables on small screens */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

th, td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
}

th {
  font-weight: var(--font-weight-semibold);
  color: var(--color-navy);
  background: var(--color-bg-light);
}

td { color: var(--color-text-light); }

tr:hover td { background: var(--color-bg-light); }
