/* Mobile / tablet layout — loaded after inline page styles */

/* ── Shared nav (main, news, privacy) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0 auto;
  background: var(--white, #fff);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

nav.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-overlay[hidden] {
  display: none !important;
}

.nav-overlay:not([hidden]) {
  display: block;
}

body.nav-menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  nav {
    padding: 1rem 1.25rem !important;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(17.5rem, 88vw);
    margin: 0 !important;
    padding: 5rem 1.5rem 2rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: rgba(14, 30, 53, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-left: 1px solid rgba(201, 168, 76, 0.2);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
  }

  nav.nav-open .nav-links {
    transform: translateX(0);
  }

  .nav-links a {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem !important;
  }

  .nav-links .nav-lang {
    margin-top: 1rem;
    padding-top: 0.5rem;
    justify-content: flex-start;
  }
}

/* ── Shared footer ── */
@media (max-width: 768px) {
  footer {
    flex-direction: column !important;
    text-align: center;
    padding: 1.75rem 1.25rem !important;
    gap: 1.25rem;
  }

  .footer-right {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
  }

  .footer-legal {
    margin-right: 0 !important;
    justify-content: center;
  }
}

/* ── Main landing (wizen_kodukas.html) ── */
@media (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* News: give secondary column more room before single-column stack */
@media (max-width: 1180px) and (min-width: 901px) {
  .news-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .news-featured {
    min-height: 28rem !important;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr !important;
  }

  /* .hero already adds top padding for the fixed nav */
  .hero-content {
    padding: 1.25rem 1.5rem 2.5rem !important;
  }

  .hero-right {
    padding: 0 1.5rem 2.5rem !important;
    min-height: 0 !important;
    /* Same cap drives image + stats width (see --hero-media-width on parent) */
    --hero-media-max-h: min(52vh, 26rem) !important;
  }

  .hero-team-wrap {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: unset !important;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 9vw, 3.25rem) !important;
  }

  #services,
  #news,
  #partners,
  #contact {
    padding: 4rem 1.5rem !important;
  }

  .services-header {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin-bottom: 3rem !important;
  }

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

  .news-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem;
    margin-bottom: 2.5rem !important;
  }

  .news-grid {
    grid-template-columns: 1fr !important;
  }

  .news-featured {
    min-height: 0 !important;
    padding: 2rem 1.5rem !important;
  }

  .news-item {
    flex-direction: column !important;
    padding: 1.1rem 1.1rem !important;
  }

  .news-item-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
    max-height: min(12.5rem, 42vw);
  }

  .news-featured .news-featured-img {
    max-height: min(30rem, 58vh) !important;
    aspect-ratio: 16 / 10;
  }

  .news-meta {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .partners-header {
    margin-bottom: 3rem !important;
  }

  .partners-grid {
    grid-template-columns: 1fr !important;
  }

  .partner-card {
    grid-template-columns: 1fr !important;
  }

  .partner-photo-col {
    width: 100% !important;
    min-height: 220px;
  }

  .partner-photo-link {
    min-height: 220px;
  }

  .partner-info {
    padding: 1.75rem 1.5rem !important;
    border-left: none !important;
    border-top: 1px solid rgba(14, 30, 53, 0.06);
  }

  .contact-inner {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }

  #contact::before {
    font-size: clamp(6rem, 28vw, 12rem) !important;
    right: -1rem !important;
  }

  .contact-form-row {
    flex-direction: column !important;
  }

  .contact-info-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.35rem;
  }

  .contact-info-key {
    min-width: 0 !important;
  }

  .section-title {
    font-size: clamp(1.85rem, 6vw, 2.8rem) !important;
  }

  .news-modal {
    padding: 1rem !important;
    align-items: flex-end !important;
  }

  .news-modal-inner {
    max-height: 90vh;
    padding: 1.75rem 1.25rem !important;
  }
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Hero stats: full-width rows on very narrow viewports */
@media (max-width: 520px) {
  .hero-stat-block {
    grid-template-columns: 1fr !important;
  }
}

/* ── News listing page ── */
@media (max-width: 768px) {
  .news-page {
    padding: 5rem 1rem 3rem !important;
  }

  .news-page-title {
    font-size: clamp(1.75rem, 7vw, 2.25rem) !important;
  }

  .news-list-item {
    flex-direction: column !important;
    padding: 1.5rem 1.15rem !important;
    gap: 1rem !important;
  }

  .news-list-item img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    max-height: none !important;
  }

  .news-article h1 {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }
}

/* ── Privacy page ── */
@media (max-width: 768px) {
  .privacy-page {
    padding: 5.5rem 1rem 3rem !important;
  }

  .privacy-inner h1 {
    font-size: clamp(1.65rem, 6vw, 2rem) !important;
  }
}
