/**
 * Phone-first layout pass. Desktop rules stay in main/home/pages.
 * Applied at 768px and below unless noted.
 */

@media (max-width: 768px) {
  :root {
    --ba-header-h: 56px;
    --ba-container-home: min(100%, calc(100% - 1.5rem));
  }

  html {
    scroll-padding-top: calc(var(--ba-header-h) + 12px);
  }

  .home-container,
  .site-footer__inner,
  .newsletter-band__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .announce-bar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .announce-bar p {
    overflow-wrap: anywhere;
    line-height: 1.4;
  }

  .site-header {
    z-index: 140;
  }

  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-drawer {
    z-index: 130;
    padding: calc(var(--ba-header-h) + 2.75rem) 1rem 1.5rem;
    overflow: auto;
  }

  .mobile-drawer nav {
    background: #fff;
    border-radius: 16px;
    padding: 0.35rem 1rem 1rem;
    max-height: min(80dvh, calc(100dvh - 6rem));
    overflow: auto;
  }

  .mobile-drawer__list {
    margin-bottom: 0.35rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }

  .mobile-drawer__list a,
  .mobile-drawer .header-link--block {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .mobile-drawer__list .current-menu-item a,
  .mobile-drawer__list .current_page_item a {
    color: var(--ba-orange);
  }

  .mobile-drawer .btn {
    min-height: 48px;
    width: 100%;
    margin-top: 0.5rem;
  }

  .mobile-drawer .btn--outline {
    background: #fff;
    color: var(--ba-navy);
    border-color: var(--ba-navy);
  }

  .mobile-drawer .header-link--block {
    justify-content: center;
    font-weight: 800;
  }

  /* Homepage mobile: autoplay video, no scroll-scrub pin / spacer. */
  .hero,
  .hero.hero--motion,
  .hero.hero--motion.hero--reduced-motion,
  .hero.hero--motion.hero--no-pin {
    --hero-scroll-extra: 0;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    background: transparent;
  }

  .hero.hero--motion::after {
    display: none;
    content: none;
    height: 0;
  }

  .hero.hero--motion .hero__sticky,
  .hero.hero--motion.hero--reduced-motion .hero__sticky,
  .hero.hero--motion.hero--no-pin .hero__sticky {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--ba-navy);
    overflow: hidden;
  }

  .hero.hero--motion .hero__media {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: min(42svh, calc(100svh - 15.5rem));
    background: var(--ba-navy);
    flex: 0 1 auto;
  }

  .hero.hero--motion .hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: none;
    object-fit: contain;
    object-position: center center;
    background: var(--ba-navy);
    z-index: 2;
  }

  .hero.hero--motion .hero__frames {
    display: none;
  }

  .hero.hero--motion .hero__frames-start,
  .hero.hero--motion .hero__poster,
  .hero.hero--motion .hero__poster-img {
    object-fit: contain;
    object-position: center center;
    background: var(--ba-navy);
    z-index: 1;
  }

  .hero.hero--motion .hero__overlay {
    display: none;
  }

  .hero.hero--motion .hero__content,
  .hero.hero--motion .hero__content--scroll {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    background: var(--ba-navy);
    color: var(--ba-white);
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .hero__title {
    font-size: clamp(1.65rem, 9vw, 2.15rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero__title-line {
    display: block;
  }

  .hero__subtitle,
  .hero__intro,
  .hero__actions {
    max-width: none;
  }

  .hero__subtitle {
    font-size: 1rem;
    line-height: 1.4;
    max-width: none;
  }

  .hero__intro p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .hero__eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero__actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .hero:not(.hero--motion) {
    min-height: 0;
  }

  .hero:not(.hero--motion) .hero__content {
    padding: 1.25rem 1rem 1.5rem;
  }

  .why-choose__title,
  .home-visit__title,
  .home-reviews__title,
  .home-tickets__title,
  .home-parties__title,
  .section__headline,
  .page-title,
  .subpage-content h1 {
    font-size: clamp(1.45rem, 7.2vw, 2rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  p,
  li {
    overflow-wrap: break-word;
  }

  /* Image grids: 4 → 2×2, 6 → 2×3. Pricing/reviews stay one column. */
  .why-showcase__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .why-showcase__card,
  .home-attraction-card,
  .feature-card,
  .park-card {
    min-width: 0;
    max-width: 100%;
  }

  .why-showcase__body {
    padding: 0.65rem 0.7rem 0.8rem;
  }

  .why-showcase__title {
    font-size: 0.92rem;
    overflow-wrap: anywhere;
  }

  .why-showcase__text {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .home-attractions__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .home-attraction-card__body {
    padding: 0.7rem 0.7rem 0.85rem;
    gap: 0.3rem;
  }

  .home-attraction-card__title {
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }

  .home-attraction-card__excerpt {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .home-reviews__cards,
  .home-tickets__grid,
  .home-parties__grid {
    grid-template-columns: 1fr;
  }

  .home-ticket-card,
  .attraction-card,
  .offer-card,
  .home-review-card {
    min-width: 0;
    max-width: 100%;
  }

  .feature-grid,
  .park-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .feature-card {
    min-height: 0;
  }

  .feature-card__copy {
    padding: 0.7rem 0.65rem 0.6rem;
  }

  .feature-card__copy h3 {
    font-size: 0.95rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .park-card h3 {
    font-size: clamp(0.92rem, 3.6vw, 1.1rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .park-card__copy {
    gap: 0.35rem 0.5rem;
    padding: 0.65rem 0.1rem 0.2rem;
    min-width: 0;
  }

  .park-card__copy p {
    font-size: 0.75rem;
    line-height: 1.35;
    min-width: 0;
  }

  .park-card .icon-arrow {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .utility-rail.home-tickets__utilities {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 0;
    padding: 0.4rem;
  }

  .home-tickets__utilities .utility-rail__item.utility-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    width: 100%;
    min-height: 56px;
    padding: 0.85rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.25;
    letter-spacing: 0;
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
  }

  .home-tickets__utilities .utility-link__text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .home-tickets__utilities .utility-link__icon,
  .home-tickets__utilities .utility-link__icon-img,
  .home-tickets__utilities .utility-link__icon .ba-icon,
  .home-parties__feature-icon,
  .home-parties__feature-icon .ba-icon,
  .footer-enquiry__quick-icon .ba-icon,
  .site-footer__contact-icon .ba-icon,
  .site-footer__col--connect .site-footer__social-link .ba-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    aspect-ratio: 1;
    border-radius: 50%;
  }

  .home-tickets__utilities .utility-link__icon {
    border-radius: 0;
    background: transparent;
  }

  .home-review-card__quote {
    -webkit-line-clamp: 8;
  }

  .home-reviews__care {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .home-reviews__care-photo {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .home-visit__layout {
    grid-template-columns: 1fr;
  }

  .home-visit__gallery {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 0.7rem;
  }

  .home-visit__gallery-large {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .home-visit__gallery-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 0.7rem;
  }

  .home-visit__gallery-item {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .home-visit__img {
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .btn {
    min-height: 48px;
  }

  .btn--sm {
    min-height: 44px;
  }

  .inner-hero--fullbleed {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .inner-hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .inner-hero--tall,
  .inner-hero--medium,
  .inner-hero--short,
  .inner-hero--contact-banner.inner-hero--medium {
    min-height: 0;
  }

  .inner-hero__media {
    position: relative;
    min-height: 220px;
    aspect-ratio: 16 / 10;
    flex: 0 0 auto;
  }

  .inner-hero__overlay {
    background: linear-gradient(180deg, transparent 55%, rgba(18, 24, 38, 0.35) 100%);
  }

  .inner-hero__content {
    position: relative;
    padding: 1.15rem 1rem 1.5rem;
    background: var(--ba-navy);
    max-width: none;
  }

  .inner-hero__title {
    font-size: clamp(1.6rem, 8.5vw, 2.2rem);
    line-height: 1.08;
    max-width: none;
    overflow-wrap: anywhere;
  }

  .inner-hero__subtitle {
    max-width: none;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .inner-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .inner-hero__content .btn {
    width: 100%;
    min-height: 48px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    max-width: 100%;
  }

  .newsletter-form__input,
  .welcome-popup__input,
  .contact-form input,
  .contact-form textarea,
  .contact-form select,
  .footer-enquiry input,
  .footer-enquiry textarea,
  .footer-enquiry select {
    font-size: 16px;
    min-height: 48px;
  }

  .footer-enquiry__layout,
  .site-footer__grid,
  .contact-layout,
  .plan-visit__grid,
  .packages-row {
    grid-template-columns: 1fr;
  }

  .site-footer__grid {
    gap: 1.5rem;
  }

  .welcome-popup {
    padding: 12px;
    align-items: flex-start;
  }

  .welcome-popup__dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: min(92dvh, 100%);
  }

  .welcome-popup__close,
  .ba-modal__close {
    width: 44px;
    height: 44px;
  }

  .welcome-popup__visual {
    min-height: 120px;
    max-height: 28dvh;
  }

  .ba-modal__panel {
    max-height: min(90dvh, 100%);
    overflow: auto;
  }

  .compare-wrap,
  .compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .compare-table {
    min-width: 640px;
    display: table;
  }

  .compare-table thead {
    display: table-header-group;
  }

  .compare-table tr {
    display: table-row;
    margin: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .compare-table td,
  .compare-table th {
    display: table-cell;
  }

  .filter-bar,
  .menu-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .filter-bar [data-filter],
  .menu-tabs [data-menu-tab] {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .newsletter-float {
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .hero__title {
    font-size: clamp(1.5rem, 8.6vw, 1.95rem);
  }

  .announce-bar {
    font-size: 0.64rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 320px) {
  .why-showcase__grid,
  .home-attractions__grid,
  .feature-grid,
  .park-grid,
  .home-visit__gallery-stack {
    gap: 0.65rem;
  }

  .why-showcase__title,
  .home-attraction-card__title,
  .feature-card__copy h3 {
    font-size: 0.86rem;
  }

  .why-showcase__text,
  .home-attraction-card__excerpt,
  .park-card__copy p {
    font-size: 0.72rem;
  }

  .site-header__inner {
    width: calc(100% - 1rem);
  }

  .hero.hero--motion .hero__content {
    padding: 0.85rem 0.75rem 1rem;
  }

  .btn {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 768px) and (max-height: 700px) {
  .hero.hero--motion .hero__media {
    max-height: min(34svh, calc(100svh - 13.5rem));
  }

  .hero.hero--motion .hero__content,
  .hero.hero--motion .hero__content--scroll {
    padding: 0.55rem 0.85rem 0.7rem;
  }

  .hero__title {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem);
    margin-bottom: 0.45rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }

  .hero__intro {
    margin-bottom: 0.7rem;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .hero.hero--motion {
    --hero-scroll-extra: 0;
  }

  .hero.hero--motion .hero__media {
    max-height: min(46svh, calc(100svh - 10.5rem));
    aspect-ratio: 16 / 9;
  }

  .welcome-popup__visual {
    display: none;
  }

  .mobile-drawer {
    padding-top: 4.5rem;
  }
}
