/**
 * Mobile / tablet responsive layer.
 * Loaded last — only adjusts layouts below desktop breakpoints.
 */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

/* Missing utility fallbacks used in templates */
.w-\[128px\] {
  width: 128px;
}
.h-\[107px\] {
  height: 107px;
}
.max-h-\[80px\] {
  max-height: 80px;
}
.max-h-\[40px\] {
  max-height: 40px;
}

@media (min-width: 1280px) {
  .xl\:text-42 {
    font-size: 42px;
  }
}

/* Tablet and below (<1024px) */
@media (max-width: 1023px) {
  .hero_inner {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.5rem;
  }

  .hero_newsletter {
    display: block !important;
    width: 100%;
  }

  .hero_newsletter .newsletter-form {
    max-width: 100%;
  }

  .cas_hero > .flex,
  .cas_hero .flex.flex-col.lg\:flex-row {
    align-items: stretch;
  }

  .cas_thumb {
    width: 100%;
    max-width: 180px;
    height: auto;
    min-height: 92px;
    aspect-ratio: 128 / 107;
  }

  .lc_cas_logo {
    width: 100%;
    max-width: 180px;
    margin-left: auto;
    margin-right: auto;
    height: auto !important;
    min-height: 92px;
    aspect-ratio: 128 / 107;
  }

  .cas_hero_cta {
    width: 100%;
    text-align: center;
  }

  .cas_hero_cta .btn {
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .lc_cas_actions {
    width: 100%;
  }

  .lc_bonus {
    text-align: center !important;
  }

  .single-sidebar {
    width: 100%;
  }

  .wp-editor table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wp-editor iframe,
  .wp-editor embed,
  .wp-editor video {
    max-width: 100%;
  }

  .wp-editor pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }
}

/* Phone (<640px) */
@media (max-width: 639px) {
  .container-main {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hero {
    margin-top: -60px;
    padding-top: calc(60px + 1.75rem) !important;
    padding-bottom: 2rem !important;
  }

  .hero h1,
  .archive-header h1,
  article h1.text-32 {
    font-size: clamp(1.55rem, 7vw, 1.95rem);
    line-height: 1.2;
  }

  .hero_content p {
    font-size: 15px;
  }

  .hero_pills {
    margin-top: 1.25rem;
  }

  .pill-scroller {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-bottom: 6px;
  }

  .pill {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 0.55rem 0.95rem;
  }

  .search-form {
    flex-direction: column;
    gap: 0.5rem;
  }

  .search-field,
  .search-submit {
    width: 100%;
    border-radius: 5px !important;
  }

  .lc_cas {
    gap: 0.85rem;
    padding: 0.85rem !important;
  }

  .lc_cas_body h3 {
    font-size: 17px;
  }

  .lc_cas_actions .flex {
    flex-direction: column;
    width: 100%;
  }

  .lc_cas_actions .btn {
    width: 100%;
  }

  /* Legacy casino list markup used on some pages (e.g. /online-kasiino/) */
  .lc_cas.flex-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.85rem;
    padding: 0.85rem !important;
  }

  .lc_cas.flex-row > .lc_thumb,
  .lc_cas.flex-row > .lc_main,
  .lc_cas.flex-row > .lc_highlights,
  .lc_cas.flex-row > .lc_bonus,
  .lc_cas.flex-row > .lc_buttons {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
  }

  .lc_cas.flex-row > .lc_thumb {
    max-width: 180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .lc_cas.flex-row .lc_bonus,
  .lc_cas.flex-row .lc_buttons {
    text-align: center !important;
  }

  .lc_cas.flex-row .lc_buttons .btn {
    width: 100% !important;
  }

  .lc_cas.flex-row .lc_highlights {
    padding-left: 1rem !important;
  }

  .lc_cas.flex-row .bonus {
    font-size: clamp(1.15rem, 5.2vw, 1.35rem) !important;
    line-height: 1.25;
  }

  .cas_info {
    padding: 0.85rem !important;
    gap: 0.85rem !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cas_info_block ul.grid-cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cc_grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .cas_hero h1 {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
  }

  .home-content {
    margin-top: -0.75rem;
  }

  .newsletter-form {
    padding: 1rem !important;
  }

  .kasiino-pagination {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .kasiino-popup__content {
    padding: 1.25rem 1rem 1rem;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }

  .kasiino-popup__title {
    font-size: 1.25rem;
  }

  .kasiino-notification-bar__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0.5rem;
    padding-right: 2.5rem;
  }

  .kasiino-notification-bar__cta {
    width: 100%;
    text-align: center;
  }

  .cas_info_block h3 {
    font-size: 15px;
  }

  .cas_hero,
  .home-editor {
    padding: 1rem !important;
  }

  .kasiino-section-items .grid.sm\:grid-cols-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .footer_top {
    gap: 1.25rem;
  }

  .footer_col_title {
    padding: 0.35rem 0;
  }

  .footer_badges {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .footer_bottom p {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
  }
}

/* Small tablet (640–1279px) */
@media (min-width: 640px) and (max-width: 1279px) {
  .footer_top.grid-cols-1.sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero_inner {
    gap: 2rem;
  }
}
