/* ==========================================================================
   HIBBA LIMITED - Responsive Styles
   Mobile-first breakpoints for hibba.com
   ========================================================================== */


/* --------------------------------------------------------------------------
   TABLET LANDSCAPE: 1024px and below
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {

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

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

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

  .process-step::after {
    display: none;
  }

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

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

  /* Nav links tighter on tablet */
  .main-nav {
    gap: 0;
  }

  .main-nav a {
    padding: var(--space-xs) var(--space-xs);
    font-size: var(--text-xs);
  }
}


/* --------------------------------------------------------------------------
   TABLET: 768px and below
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

  /* Layout */
  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

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

  /* Header */
  .main-nav {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .site-logo .logo-full {
    display: none;
  }

  .site-logo .logo-icon {
    display: block;
    height: 40px;
  }

  /* Mobile nav overlay */
  .mobile-nav-overlay a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }


  /* Download gate - full width on mobile */
  .download-gate {
    width: 95%;
    margin: var(--space-md);
    padding: var(--space-xl);
  }

  /* Hero */
  .hero {
    min-height: 70vh;
  }

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

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

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .page-hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }

  .page-hero h1 {
    font-size: var(--text-3xl);
  }

  .page-hero p {
    font-size: var(--text-sm);
    padding: 0 var(--space-sm);
  }

  /* Stub hero */
  .stub-hero {
    padding: var(--space-3xl) var(--space-md);
  }

  .stub-hero h1 {
    font-size: var(--text-3xl);
  }

  /* Stats */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-xl) 0;
  }

  .stat-number {
    font-size: var(--text-4xl);
  }

  .stat-item {
    padding: var(--space-sm);
  }

  .section--green .stat-label,
  .section--dark .stat-label {
    color: rgba(255, 255, 255, 0.85);
  }

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

  .process-step::after {
    display: none;
  }

  .process-step {
    text-align: left;
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-lg);
  }

  .process-step::before {
    font-size: var(--text-3xl);
    flex-shrink: 0;
    margin-bottom: 0;
  }

  /* Persona grid */
  .persona-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Forms - touch friendly */
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-input,
  .form-textarea,
  .form-select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .email-signup {
    flex-direction: column;
  }

  .email-signup .btn {
    width: 100%;
  }

  /* Buttons - touch friendly */
  .btn {
    min-height: 44px;
    padding: var(--space-sm) var(--space-lg);
  }

  .btn--lg {
    min-height: 48px;
    padding: var(--space-md) var(--space-xl);
  }

  /* Pricing */
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .pricing-card--featured {
    transform: none;
  }

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

  .footer-col:first-child,
  .footer-section:first-child {
    grid-column: 1 / -1;
  }

  .footer-social {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .footer-social a {
    width: 44px;
    height: 44px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .footer-bottom__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
  }

  .footer-bottom__links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Tool grid */
  .tool-grid {
    grid-template-columns: 1fr;
  }

  /* Stub features */
  .stub-features {
    grid-template-columns: 1fr;
  }

  /* Stub related */
  .stub-related {
    grid-template-columns: 1fr;
  }

  /* Project showcase */
  .project-card {
    aspect-ratio: 16 / 12;
  }

  /* Override aspect ratio for wide project cards */
  .project-card--wide {
    aspect-ratio: 16 / 10 !important;
  }

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

  /* Breadcrumb */
  .breadcrumb {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Button group */
  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  /* CTA section */
  .cta-section {
    padding: var(--space-3xl) var(--space-md);
  }

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

  .section-subtitle {
    font-size: var(--text-base);
    max-width: 100%;
  }

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

  /* Stub notify */
  .stub-notify {
    padding: var(--space-xl);
  }

  /* Service list - touch targets */
  .service-list li {
    padding: var(--space-sm) 0 var(--space-sm) var(--space-xl);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Footer links - touch targets */
  .footer-links li {
    margin-bottom: 0;
  }

  .footer-links li a,
  .footer-links li {
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  /* Lead text */
  .lead {
    font-size: var(--text-base);
  }

  /* Inline flex containers - force stacking on mobile */
  .flex-stack {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

}


/* --------------------------------------------------------------------------
   LARGE MOBILE: 640px and below
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {

  .container {
    padding: 0 var(--space-sm);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

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

  .page-hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .page-hero h1 {
    font-size: var(--text-2xl);
  }

  /* Tighter spacing on badge/accreditation rows at small widths */
  .badge-row {
    gap: var(--space-md) !important;
  }

  .cta-section {
    padding: var(--space-2xl) var(--space-sm);
  }

  .cta-section h2 {
    font-size: var(--text-2xl);
  }

  .cta-section p {
    font-size: var(--text-sm);
  }

  /* Process steps tighter */
  .process-step {
    padding: var(--space-md);
  }

  /* Section label smaller */
  .section-label {
    font-size: var(--text-xs);
  }
}


/* --------------------------------------------------------------------------
   SMALL MOBILE: 480px and below
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {

  .hero {
    min-height: 50vh;
  }

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

  .hero__content {
    padding: var(--space-xl) var(--space-sm);
  }

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

  .section {
    padding: var(--space-2xl) 0;
  }

  .container {
    padding: 0 var(--space-sm);
  }

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

  /* Stats single column on very small screens */
  .stats-bar {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .stat-number {
    font-size: var(--text-2xl);
  }

  .stat-item {
    padding: var(--space-xs) var(--space-sm);
  }

  .project-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
  }

  .project-stat {
    padding: var(--space-sm);
  }

  /* Footer stacks fully on small screens */
  .footer-grid,
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-col:first-child,
  .footer-section:first-child {
    grid-column: 1;
  }

  /* Smaller persona icon */
  .persona-card__icon {
    width: 48px;
    height: 48px;
    font-size: var(--text-xl);
  }

  /* Cards tighter */
  .tool-card {
    padding: var(--space-lg);
  }

  .pricing-card {
    padding: var(--space-lg);
  }

  .pricing-card__price {
    font-size: var(--text-4xl);
  }

  /* CTA section */
  .cta-section h2 {
    font-size: var(--text-xl);
  }

  /* Buttons tighter */
  .btn-group {
    gap: var(--space-xs);
  }

  .btn-group .btn {
    font-size: var(--text-sm);
    padding: var(--space-sm) var(--space-md);
  }

  /* Page hero minimal */
  .page-hero h1 {
    font-size: var(--text-xl);
  }

  .page-hero p {
    font-size: var(--text-xs);
  }

  /* Breadcrumb smaller */
  .breadcrumb {
    font-size: var(--text-xs);
  }

  /* Stub hero */
  .stub-hero h1 {
    font-size: var(--text-2xl);
  }
}


/* --------------------------------------------------------------------------
   DESKTOP: 1024px and above
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {

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

  /* Larger spacing for wide screens */
  .section {
    padding: var(--space-5xl) 0;
  }
}


/* --------------------------------------------------------------------------
   WIDE: 1200px and above
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) {

  .container {
    padding: 0 var(--space-2xl);
  }
}


/* --------------------------------------------------------------------------
   MOBILE STICKY CTA BAR
   -------------------------------------------------------------------------- */

.mobile-sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sticky-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
    padding-left: calc(var(--space-md) + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--space-md) + env(safe-area-inset-right, 0px));
    background: var(--color-white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    gap: var(--space-sm);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .mobile-sticky-cta.visible {
    transform: translateY(0);
  }

  .mobile-sticky-cta .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    min-height: 48px;
    font-size: var(--text-sm);
  }

  .mobile-sticky-cta .btn--secondary {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
  }

  .mobile-sticky-cta .btn--secondary svg {
    flex-shrink: 0;
  }

  /* Body padding added dynamically by main.js when sticky bar is visible */
}


/* --------------------------------------------------------------------------
   LANDSCAPE PHONES
   -------------------------------------------------------------------------- */

@media (max-height: 500px) and (orientation: landscape) {

  .hero {
    min-height: 100vh;
  }

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

  .hero__content {
    padding: var(--space-lg) var(--space-md);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .page-hero {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  /* Stats in a row on landscape */
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
  }

  .stat-number {
    font-size: var(--text-2xl);
  }

  /* Keep grids side-by-side in landscape */
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile sticky CTA thinner in landscape */
  .mobile-sticky-cta {
    padding: var(--space-xs) var(--space-md);
  }

  .mobile-sticky-cta .btn {
    min-height: 40px;
    font-size: var(--text-xs);
  }
}


/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {

  .site-header,
  .nav-toggle,
  .mobile-nav-overlay,
  .site-footer,
  .btn,
  .email-signup,
  .stub-badge,
  .chatbot-launcher,
  .chatbot-widget,
  .social-bar,
  .download-gate-overlay,
  .mobile-sticky-cta,
  .ac-search-drop,
  .ac-search-scrim {
    display: none !important;
  }

  .header-spacer {
    height: 0;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .hero {
    min-height: auto;
    background: none !important;
    color: #000;
  }

  .hero__title,
  .hero__subtitle {
    color: #000;
  }

  .section--dark,
  .section--green {
    background: none;
    color: #000;
  }

  .section--dark h1,
  .section--dark h2,
  .section--dark h3,
  .section--dark h4,
  .section--green h1,
  .section--green h2,
  .section--green h3,
  .section--green h4 {
    color: #000;
  }
}
