/* ==========================================================================
   ZINARI — Premium Agency WordPress Theme
   Responsive Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Breakpoints:
   - Large desktop:  > 1200px (default)
   - Desktop:        <= 1200px
   - Tablet:         <= 992px
   - Mobile large:   <= 768px
   - Mobile small:   <= 576px
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   1. Desktop — max-width: 1200px
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  /* Typography scale */
  h1 {
    font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  }

  h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  }

  /* Containers */
  .container-wide {
    max-width: 100%;
  }

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

  /* Sections */
  .section {
    padding: var(--space-4xl) 0;
  }

  .section-lg {
    padding: 7rem 0;
  }

  /* Footer */
  .footer__grid {
    gap: var(--space-2xl);
  }

  /* Stats */
  .stat__number {
    font-size: clamp(2rem, 3.5vw, 3rem);
  }
}

/* --------------------------------------------------------------------------
   2. Tablet — max-width: 992px
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Spacing adjustments */
  :root {
    --header-height: 70px;
  }

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

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

  /* Navigation — hidden on tablet */
  .main-nav__list {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Mobile Navigation Overlay */
  .mobile-nav {
    position: fixed;
    inset: 0;
    background-color: var(--color-wine);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--transition-base),
      visibility var(--transition-base);
  }

  .mobile-nav--active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav__list {
    text-align: center;
    margin-bottom: var(--space-2xl);
  }

  .mobile-nav__item {
    margin-bottom: var(--space-md);
  }

  .mobile-nav__link {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-white);
    display: inline-block;
    padding: var(--space-sm) 0;
    opacity: 0.85;
    transition:
      opacity var(--transition-base),
      transform var(--transition-base);
  }

  .mobile-nav__link:hover,
  .mobile-nav__link--active {
    opacity: 1;
  }

  /* Stagger animation for mobile nav items */
  .mobile-nav--active .mobile-nav__item {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
  }

  .mobile-nav--active .mobile-nav__item:nth-child(1) { animation-delay: 0.05s; }
  .mobile-nav--active .mobile-nav__item:nth-child(2) { animation-delay: 0.1s; }
  .mobile-nav--active .mobile-nav__item:nth-child(3) { animation-delay: 0.15s; }
  .mobile-nav--active .mobile-nav__item:nth-child(4) { animation-delay: 0.2s; }
  .mobile-nav--active .mobile-nav__item:nth-child(5) { animation-delay: 0.25s; }
  .mobile-nav--active .mobile-nav__item:nth-child(6) { animation-delay: 0.3s; }
  .mobile-nav--active .mobile-nav__item:nth-child(7) { animation-delay: 0.35s; }
  .mobile-nav--active .mobile-nav__item:nth-child(8) { animation-delay: 0.4s; }

  .mobile-nav__cta {
    margin-top: var(--space-lg);
  }

  .mobile-nav__lang {
    margin-top: var(--space-xl);
  }

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

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

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

  .hero--page {
    min-height: 45vh;
    padding-top: calc(var(--header-height) + var(--space-3xl));
    padding-bottom: var(--space-3xl);
  }

  /* Section headers */
  .section-header {
    margin-bottom: var(--space-2xl);
  }

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

  .footer__brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  /* Steps — vertical on tablet */
  .steps--horizontal {
    grid-template-columns: 1fr;
    max-width: 600px;
  }

  .steps--horizontal .step {
    flex-direction: row;
    text-align: left;
  }

  .steps--horizontal .step__marker {
    margin: 0;
  }

  /* CTA inline — stack */
  .cta-inline {
    flex-direction: column;
    text-align: center;
    gap: var(--space-lg);
  }

  /* Stats divider — remove on tablet */
  .stat--bordered {
    border-right: none;
    border-bottom: 1px solid var(--color-gray-medium);
    padding-bottom: var(--space-lg);
  }

  .stat--bordered:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .section--wine .stat--bordered {
    border-color: rgba(245, 226, 182, 0.2);
  }

  /* Language switcher in header */
  .lang-switcher--header {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile Large — max-width: 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: clamp(2rem, 6vw, 2.75rem);
  }

  h2 {
    font-size: clamp(1.625rem, 5vw, 2.25rem);
  }

  h3 {
    font-size: clamp(1.375rem, 4vw, 1.75rem);
  }

  .lead {
    font-size: 1.0625rem;
  }

  blockquote {
    font-size: 1.25rem;
  }

  /* Containers */
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--space-lg);
  }

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

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

  /* Grids — stack on mobile */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-gap-lg {
    gap: var(--space-xl);
  }

  /* Buttons — full width option */
  .btn {
    padding: 0.8rem 1.75rem;
  }

  .btn-lg {
    padding: 1rem 2.25rem;
  }

  .btn--mobile-full {
    width: 100%;
  }

  /* Hero */
  .hero {
    min-height: 90vh;
    padding: var(--space-4xl) 0;
  }

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

  .hero__subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-xl);
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .hero--page {
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  /* Service cards */
  .service-card {
    padding: var(--space-xl);
  }

  /* Case cards */
  .case-card--featured {
    aspect-ratio: 4 / 3;
  }

  .case-card--featured .case-card__title {
    font-size: 1.5rem;
  }

  /* Review cards */
  .review-card {
    padding: var(--space-xl);
  }

  .review-card__text {
    font-size: 1rem;
  }

  /* Team cards */
  .team-card__image-wrap {
    aspect-ratio: 1;
  }

  /* Steps — vertical */
  .steps::before {
    left: 20px;
  }

  .step {
    gap: var(--space-lg);
    padding-bottom: var(--space-2xl);
  }

  .step__marker {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step__title {
    font-size: 1.25rem;
  }

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

  .site-footer {
    padding: var(--space-3xl) 0 var(--space-lg);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  /* CTA block */
  .cta-block {
    padding: var(--space-2xl) var(--space-xl);
    border-radius: var(--radius-md);
  }

  .cta-block__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-block__actions .btn {
    width: 100%;
    max-width: 300px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  /* Accordion */
  .accordion__trigger {
    font-size: 1.1rem;
    padding: var(--space-md) 0;
  }

  /* Logo grid */
  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .logo-grid__item img {
    max-height: 32px;
  }

  /* Modal */
  .modal {
    padding: var(--space-2xl);
    margin: var(--space-md);
  }

  /* Notice bar */
  .notice-bar .container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  /* Pagination */
  .pagination__link {
    width: 38px;
    height: 38px;
    font-size: 0.8125rem;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    font-size: 0.75rem;
  }

  /* Scroll to top — adjust position */
  .scroll-top {
    right: var(--space-md);
    bottom: var(--space-md);
    width: 42px;
    height: 42px;
  }
}

/* --------------------------------------------------------------------------
   4. Mobile Small — max-width: 576px
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  /* Typography — tighter */
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.125rem;
  }

  body {
    font-size: 0.9375rem;
    line-height: 1.65;
  }

  .lead {
    font-size: 1rem;
  }

  /* Spacing — tighter */
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--space-md);
  }

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

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

  /* Buttons — touch friendly (min 48px height) */
  .btn {
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 0.8125rem;
  }

  .btn-sm {
    min-height: 40px;
    padding: 0.5rem 1.25rem;
  }

  /* Hero */
  .hero {
    min-height: 100svh;
  }

  .hero__title {
    margin-bottom: var(--space-md);
  }

  .hero__subtitle {
    font-size: 0.9375rem;
    line-height: 1.7;
  }

  .hero__decoration {
    display: none;
  }

  /* Mobile nav — smaller text */
  .mobile-nav__link {
    font-size: 1.625rem;
  }

  /* Service cards */
  .service-card {
    padding: var(--space-lg);
  }

  .service-card__title {
    font-size: 1.25rem;
  }

  .service-card__number {
    font-size: 2.5rem;
  }

  /* Case cards — taller on small mobile */
  .case-card {
    aspect-ratio: 3 / 4;
  }

  .case-card__title {
    font-size: 1.25rem;
  }

  /* Review cards */
  .review-card {
    padding: var(--space-lg);
  }

  .review-card__quote-mark {
    font-size: 3rem;
  }

  .review-card__text {
    font-size: 0.9375rem;
  }

  /* Team */
  .team-card__name {
    font-size: 1.125rem;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .stat__number {
    font-size: 2rem;
  }

  .stat__label {
    font-size: 0.8125rem;
  }

  /* Steps */
  .step {
    gap: var(--space-md);
  }

  .step__marker {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }

  .steps::before {
    left: 18px;
  }

  .step__title {
    font-size: 1.125rem;
  }

  .step__text {
    font-size: 0.875rem;
  }

  /* Why-us items */
  .why-us-item {
    gap: var(--space-md);
  }

  .why-us-item__number {
    font-size: 2rem;
    min-width: 36px;
  }

  .why-us-item__icon {
    width: 40px;
    height: 40px;
  }

  .why-us-item__title {
    font-size: 1.125rem;
  }

  .why-us-item__text {
    font-size: 0.875rem;
  }

  /* Section header */
  .section-header {
    margin-bottom: var(--space-xl);
  }

  .section-header__description {
    font-size: 0.9375rem;
  }

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

  .cta-block__title {
    font-size: 1.5rem;
  }

  .cta-block__text {
    font-size: 0.9375rem;
  }

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

  .cta-inline__title {
    font-size: 1.25rem;
  }

  /* Footer */
  .site-footer {
    padding: var(--space-2xl) 0 var(--space-md);
  }

  .footer__heading {
    margin-bottom: var(--space-md);
  }

  /* Accordion */
  .accordion__trigger {
    font-size: 1rem;
    gap: var(--space-md);
  }

  .accordion__content {
    font-size: 0.875rem;
  }

  /* Forms — touch friendly */
  .form-input,
  .form-textarea,
  .form-select {
    padding: 0.8rem 1rem;
    font-size: 1rem; /* prevents zoom on iOS */
    min-height: 48px;
  }

  .form-label {
    font-size: 0.8125rem;
  }

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

  .logo-grid__item img {
    max-height: 28px;
  }

  /* Tags */
  .tag {
    padding: 0.3rem 0.75rem;
    font-size: 0.6875rem;
  }

  /* Modal */
  .modal {
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-md);
  }

  .modal__icon {
    width: 52px;
    height: 52px;
  }

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

  .contact-card__value {
    font-size: 0.875rem;
  }

  /* Pagination */
  .pagination {
    gap: 2px;
  }

  .pagination__link {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   5. Visibility Utilities
   -------------------------------------------------------------------------- */

/* Hide on specific breakpoints */
@media (max-width: 992px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .hide-mobile-sm {
    display: none !important;
  }
}

/* Show only on specific breakpoints */
.show-tablet,
.show-mobile,
.show-mobile-sm {
  display: none !important;
}

@media (max-width: 992px) {
  .show-tablet {
    display: block !important;
  }
}

@media (max-width: 768px) {
  .show-mobile {
    display: block !important;
  }
}

@media (max-width: 576px) {
  .show-mobile-sm {
    display: block !important;
  }
}

/* --------------------------------------------------------------------------
   6. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .site-header,
  .site-footer,
  .hamburger,
  .mobile-nav,
  .scroll-top,
  .notice-bar,
  .modal-overlay {
    display: none !important;
  }

  .section {
    padding: 1rem 0;
  }

  .container,
  .container-narrow,
  .container-wide {
    max-width: 100%;
    padding: 0;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666 !important;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

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

/* --------------------------------------------------------------------------
   7. High-DPI / Retina Adjustments
   -------------------------------------------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .separator,
  .section-header__line {
    height: 1px;
  }
}

/* --------------------------------------------------------------------------
   8. Landscape Phone Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }

  .hero--page {
    min-height: auto;
  }

  .mobile-nav {
    overflow-y: auto;
    padding: var(--space-4xl) var(--space-xl);
    justify-content: flex-start;
  }

  .mobile-nav__link {
    font-size: 1.375rem;
  }
}

/* --------------------------------------------------------------------------
   9. Safe Area (notched devices)
   -------------------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .site-footer {
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }

  .notice-bar {
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  }

  .scroll-top {
    right: calc(var(--space-xl) + env(safe-area-inset-right));
    bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }

  @media (max-width: 768px) {
    .scroll-top {
      right: calc(var(--space-md) + env(safe-area-inset-right));
      bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
    }
  }
}
