/**
 * ConsultaDeSaldo — Responsive Styles
 * Mobile-first media queries.
 *
 * Breakpoints:
 *  sm  — 640px
 *  md  — 768px
 *  lg  — 1024px
 *  xl  — 1280px
 *
 * Load order: variables.css → components.css → responsive.css
 *
 * @package ConsultaDeSaldo
 */

/* ================================================================
   BASE / MOBILE (default — no media query needed)
   ================================================================
   All component defaults in components.css are written mobile-first.
   Overrides below progressively enhance for wider viewports.
   ================================================================ */

/* ================================================================
   SM — 640px and up
   ================================================================ */

@media (min-width: 640px) {

  /* Typography */
  h1 { font-size: 2.25rem; }

  /* Hero */
  .hero-search h1 {
    font-size: 2.75rem;
  }

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

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

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

  /* Service detail meta: 2-col grid */
  .service-detail__meta {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Blog post title */
  .blog-post__title {
    font-size: 2.25rem;
  }

  /* Footer grid: 2 cols */
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Filter bar: single row */
  .filter-bar {
    flex-wrap: nowrap;
    align-items: center;
  }

  /* Page 404 improvements */
  .page-404__links {
    gap: var(--space-md);
  }
}

/* ================================================================
   MD — 768px and up
   ================================================================ */

@media (min-width: 768px) {

  /* Typography */
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }

  /* Header — show nav & header search, hide hamburger */
  .menu-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
  }

  .header-search {
    display: flex;
  }

  .mobile-nav {
    display: none !important;
  }

  /* Header height */
  .site-header__inner {
    height: 72px;
  }

  /* Hero */
  .hero-search {
    padding-block: calc(var(--space-3xl) * 1.25);
  }

  .hero-search h1 {
    font-size: 3rem;
  }

  .hero-search__subtitle {
    font-size: 1.125rem;
  }

  /* Services grid — 3 columns */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Category grid — 3 columns */
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Blog post */
  .blog-post__title {
    font-size: 2.5rem;
  }

  .blog-post__header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

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

  /* Pagination: show more links */
  .pagination__link--hide-sm {
    display: inline-flex;
  }

  /* Filter bar — always single row */
  .filter-bar {
    flex-wrap: nowrap;
  }

  /* Section spacing */
  .section {
    padding-block: var(--space-3xl);
  }
}

/* ================================================================
   LG — 1024px and up
   ================================================================ */

@media (min-width: 1024px) {

  /* Typography */
  h1 { font-size: 2.75rem; }

  /* Service detail — 2 column layout */
  .service-detail {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
  }

  /* Category grid — 4 columns */
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Services grid: stays at 3 on lg */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hero search — bigger input width */
  .hero-search__form {
    max-width: 640px;
  }

  .hero-search h1 {
    font-size: 3.25rem;
  }

  /* Header search wider */
  .header-search__input {
    width: 260px;
  }

  /* Blog post: larger prose */
  .blog-post__content {
    font-size: 1.125rem;
  }

  /* Service detail meta — 3-col grid */
  .service-detail__meta {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer */
  .site-footer {
    padding-top: var(--space-3xl);
  }

  /* AdSense sidebar: sticky with offset for header */
  .adsense-zone--sidebar {
    top: 88px;
  }

  /* Directory archive: filter bar + grid side by side */
  .directory-archive__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-xl);
    align-items: start;
  }

  .directory-archive__filters {
    position: sticky;
    top: 88px;
  }

  .filter-bar--vertical {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar--vertical .filter-bar__label {
    margin-bottom: 2px;
  }
}

/* ================================================================
   XL — 1280px and up
   ================================================================ */

@media (min-width: 1280px) {

  /* Typography: max sizes */
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.375rem; }

  /* Hero: generous padding */
  .hero-search {
    padding-block: calc(var(--space-3xl) * 1.5);
  }

  .hero-search h1 {
    font-size: 3.5rem;
  }

  .hero-search__subtitle {
    font-size: 1.25rem;
  }

  /* Container padding */
  .container {
    padding-inline: var(--space-xl);
  }

  /* Section spacing */
  .section {
    padding-block: calc(var(--space-3xl) * 1.25);
  }

  /* Card grid: slight gap increase */
  .services-grid,
  .search-results__grid {
    gap: var(--space-xl);
  }

  /* Category grid gap */
  .category-grid {
    gap: var(--space-xl);
  }

  /* Blog post: wider prose */
  .blog-post__content {
    font-size: 1.125rem;
    line-height: 1.8;
  }

  /* Header search */
  .header-search__input {
    width: 300px;
  }

  /* Service detail: more comfortable spacing */
  .service-detail {
    gap: var(--space-3xl);
  }

  /* Footer: wider brand column */
  .site-footer__grid {
    grid-template-columns: 2.5fr 1fr 1fr;
    gap: var(--space-3xl);
  }
}

/* ================================================================
   PRINT STYLES
   ================================================================ */

@media print {

  .site-header,
  .site-footer,
  .adsense-zone,
  .filter-bar,
  .pagination,
  .hero-search__quick-links,
  .breadcrumb-bar,
  .menu-toggle {
    display: none !important;
  }

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

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .service-detail {
    grid-template-columns: 1fr;
  }

  .card-servicio {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   HIGH CONTRAST / FORCED COLORS
   ================================================================ */

@media (forced-colors: active) {
  .card-servicio__status-dot,
  .hero-search__form,
  .btn,
  .badge {
    forced-color-adjust: none;
  }
}
