/* ============================================================
   ANNE ÇOCUK KULÜBÜ — Responsive Layer
   Loaded AFTER style.css — all rules are additive overrides.
   Breakpoints: 1440 / 1280 / 1024 / 992 / 768 / 576 / 480 / 430 / 390 / 360
   ============================================================ */

/* ── 1440px ─────────────────────────────────────────────────── */
@media (max-width: 1440px) {
  .container { max-width: 1200px; }
}

/* ── 1280px ─────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .events-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ── 1024px ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav: hamburger kicks in earlier than 900px */
  .site-nav { display: none !important; }
  .mobile-menu-btn { display: flex !important; }

  .events-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .blog-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ack-official-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── 992px ──────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .footer-inner { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .exp-grid { grid-template-columns: 1fr 1fr !important; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── 768px ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 48px 0 !important; }

  /* Grids → 2 col */
  .events-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
  .blog-grid { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .ack-official-grid { grid-template-columns: 1fr !important; }

  /* Expert section → stacked */
  .exp-grid { grid-template-columns: 1fr !important; }
  .exp-grid-right {
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 14px !important;
    padding-bottom: 8px;
  }
  .exp-grid-right > * {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
  .exp-card-featured { min-height: auto !important; }

  /* Detail page layouts (inline style overrides) */
  .det-layout { grid-template-columns: 1fr !important; gap: 28px !important; }
  .det-sidebar { position: static !important; }

  /* Filter bars → horizontal scroll */
  .filter-bar,
  .filter-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .filter-bar::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar { display: none; }

  /* Touch targets */
  .nav-link, .filter-chip, .filter-pill, .btn, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Typography tighten */
  .section-title { font-size: clamp(1.25rem, 4vw, 1.75rem) !important; }

  /* Event card images */
  .event-card-img { height: 150px !important; }

  /* Hero / page-hero compact */
  .page-hero { padding: 40px 0 !important; }

  /* Section header inline: stack on mobile */
  .section-header-inline {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

/* ── 576px ──────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .footer-inner { grid-template-columns: 1fr !important; gap: 24px !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .cities-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Blog card image */
  .blog-card-img { height: 160px !important; }

  /* Dev contributions grid (detail pages) */
  .dev-grid { grid-template-columns: 1fr !important; }
  .related-grid { grid-template-columns: 1fr !important; }

  /* Comment form row */
  .comment-form-row { grid-template-columns: 1fr !important; }

  /* Archive cards grid */
  .cards-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* FAQ 2-column → 1-column */
  .faq-block { grid-template-columns: 1fr !important; }
}

/* ── 480px ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 36px 0 !important; }

  .events-grid { grid-template-columns: 1fr !important; }
  .event-card-img { height: 180px !important; }

  /* Strip / marquee */
  .featured-strip .strip-inner { font-size: .72rem; }

  /* Header compact */
  .site-logo img { height: 34px !important; }

  /* Hero */
  .hero-title { font-size: 1.6rem !important; }
  .hero-desc { font-size: .875rem !important; }

  /* Stats row compact */
  .stat-number { font-size: 1.5rem !important; }
}

/* ── 430px ──────────────────────────────────────────────────── */
@media (max-width: 430px) {
  .exp-grid-right > * { flex: 0 0 240px; }
  .city-card-body { padding: 10px 12px !important; }
  .city-card-name { font-size: .9rem !important; }
}

/* ── 390px ──────────────────────────────────────────────────── */
@media (max-width: 390px) {
  .container { padding: 0 14px; }
  .event-card-body { padding: 12px !important; }
  .blog-card-body { padding: 14px !important; }
  .filter-chip, .filter-pill { padding: 6px 12px !important; font-size: .72rem !important; }
  .mobile-nav-panel { width: 100% !important; max-width: 100vw !important; }
}

/* ── 360px ──────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .cities-grid { grid-template-columns: 1fr !important; }
  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.15rem !important; }
  .exp-grid-right > * { flex: 0 0 220px; }
}

/* ── Safe Area Insets (notched phones) ──────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .mobile-nav-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Global overflow prevention ────────────────────────────── */
html, body { overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; }
table { overflow-x: auto; display: block; }
pre, code { overflow-x: auto; word-break: break-word; }

/* ── Text overflow safety (Turkish long-word protection) ───── */
h1, h2, h3, h4, h5, h6,
.card-title, .blog-card-title, .event-card-title,
.arch-card-title, .exp-card-title, .det-hero-title,
.city-card-name, .lp-hero h1, .section-title {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.card-excerpt, .blog-card-excerpt, .arch-card-desc,
.event-card-excerpt, .exp-card-desc {
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card title safe truncation (2 lines max) */
.card-title, .blog-card-title, .event-card-title,
.arch-card-title, .exp-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Excerpt safe truncation (3 lines max) */
.card-excerpt, .blog-card-excerpt, .arch-card-desc {
  -webkit-line-clamp: 3;
}

/* Prevent CTA / button text overflow */
.btn, .btn-primary, .btn-secondary, .filter-chip, .filter-pill,
.admin-btn, .comment-submit, .expert-cta-btn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Badge labels — prevent wrapping */
.tag, .badge, .det-badge, .arch-badge, .age-badge,
.arch-age-badge, .status-badge, .sidebar-badge {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Footer link safety */
.footer-link, .footer-bottom-link, .footer-links a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Header nav items — prevent collision */
.nav-link {
  white-space: nowrap;
  flex-shrink: 0;
}

/* FAQ summary — safe wrapping */
.faq-q, .faq-item summary {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Expert name/title — prevent overflow */
.expert-name, .expert-title, .arch-expert-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Section header inline — prevent CTA collision */
.section-header-inline {
  flex-wrap: wrap;
  gap: 12px;
}

/* Card container — prevent child escape */
.event-card, .blog-card, .arch-card, .exp-card,
.city-card, .lp-card, .rel-card, .comment-card {
  min-width: 0;
  overflow: hidden;
}

/* ── Horizontal scroll snap helpers ────────────────────────── */
.scroll-snap-x {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 14px;
}
.scroll-snap-x::-webkit-scrollbar { display: none; }
.scroll-snap-x > * { scroll-snap-align: start; flex-shrink: 0; }
