/* =========================================================
   Legacy responsive compatibility layer.

   Page-family rules have been migrated into their owning
   stylesheets. This file now contains only shared header,
   footer and unresolved compatibility rules.
   ========================================================= */

/* =========================================================
   Legacy responsive compatibility layer.

   Gallery and Events are owned by gallery.css and events.css.
   Do not restore those selectors to this file.
   ========================================================= */

/* =========================================================
   Gallery and Event responsive rules are owned by their
   component stylesheets. Do not reintroduce them here.
   ========================================================= */

/* =========================================================
   FYAH MAWI — MOBILE RESPONSIVE PASS
   Loaded after the existing global styles.
   ========================================================= */

.mobile-menu-toggle {
  display: none;
}

/* =========================================================
   Tablet and mobile header
   ========================================================= */

@media (max-width: 960px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    position: relative;
    z-index: 1000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.6rem;
    align-items: center;
    min-height: 4.5rem;
    padding: 0.65rem 0.85rem;
    background: #050505;
  }

  .site-header .brand {
    min-width: 0;
  }

  .site-header .brand-badge {
    width: 2.35rem;
    height: auto;
  }

  .site-header .brand-copy {
    min-width: 0;
  }

  .site-header .brand-mark {
    font-size: clamp(1rem, 5vw, 1.45rem);
    white-space: nowrap;
  }

  .site-header .brand-tagline {
    font-size: 0.48rem;
    letter-spacing: 0.25em;
    white-space: nowrap;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    min-width: 2.75rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #0a0a0a;
    color: #fff;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    border-color: #b8e600;
    color: #b8e600;
  }

  .mobile-menu-toggle__label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
  }

  .mobile-menu-toggle__icon {
    display: grid;
    gap: 0.27rem;
    width: 1.25rem;
  }

  .mobile-menu-toggle__icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition:
      transform 180ms ease,
      opacity 180ms ease;
  }

  .mobile-menu-toggle[aria-expanded="true"]
  .mobile-menu-toggle__icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded="true"]
  .mobile-menu-toggle__icon span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle[aria-expanded="true"]
  .mobile-menu-toggle__icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Place the cart beside the menu button. */

  .header-actions {
    display: contents;
  }

  .site-header__cart {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    margin: 0;
  }

  /* Social links and account links move into the opened panel. */

  .header-socials {
    grid-column: 1 / -1;
    grid-row: 4;
    display: none;
    justify-content: center;
    padding: 1rem 0 0.25rem;
  }

  .movement-link {
    display: none;
  }

  /* Mobile navigation panel. */

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    width: calc(100% + 1.7rem);
    margin: 0.65rem -0.85rem -0.65rem;
    padding: 0.4rem 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    background: #080808;
  }

  .site-header.is-menu-open .main-nav {
    display: grid;
  }

  .site-header.is-menu-open .header-socials {
    display: flex;
  }

  .main-nav ul,
.main-nav .menu {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .main-nav li {
    width: 100%;
    margin: 0;
  }

  .main-nav a {
    display: flex;
    width: 100%;
    min-height: 3.15rem;
    align-items: center;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0.075em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
    color: #b8e600;
  }

  .site-header.is-menu-open {
    box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.7);
  }

  .site-header__cart .cart-block--contents {
    position: fixed;
    z-index: 1100;
    top: 4.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
  }
}

/* =========================================================
   Phone layout
   ========================================================= */

@media (max-width: 640px) {
  :root {
    --fm-mobile-gutter: 1rem;
    --fm-mobile-section-space: 4rem;
  }

  body {
    font-size: 16px;
  }
  .main-content,
.layout-content {
    min-width: 0;
  }

  /*
   * Remove desktop container widths.
   * Existing sections retain their identity but use the phone width.
   */

  .page-wrapper,
.layout-container,
.region-content,
.fm-page,
.fm-section,
.section-inner,
.container {
    max-width: 100%;
  }

  /* Hero height correction. */

  .hero,
.contact-hero {
    min-height: 0 !important;
    height: auto !important;
  }

  .hero {
    padding-block: clamp(3.5rem, 17vw, 5.5rem) !important;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 14vw, 4.5rem);
    line-height: 0.9;
  }

  /* Consistent section spacing. */

  .main-content section {
    scroll-margin-top: 5rem;
  }

  .fm-section {
    padding-block: var(--fm-mobile-section-space);
  }

  /* =======================================================
     Equal card media
     ======================================================= */

  #music article img,
#videos article img,
#gallery article img,
.view-music img,
.view-videos img {
    display: block;
    width: 100% !important;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }

  /* Gallery portraits must never become extra-tall. */

  #gallery .views-row {
    overflow: hidden;
  }

  #gallery .views-row img {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    object-fit: cover !important;
  }

  .view-videos img,
#videos article img {
    aspect-ratio: 16 / 9;
  }

  .view-videos .views-field-body,
.view-videos .views-field-body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .site-shell button,
.button {
    min-height: 3rem;
  }

  /* Footer. */

  .site-footer {
    padding-inline: var(--fm-mobile-gutter);
  }

  .site-footer__inner,
.footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .site-footer input[type="email"] {
    width: 100%;
  }
}

/* Respect users who prefer less motion. */

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-toggle__icon span {
    transition: none;
  }
}

/* =========================================================
   Mobile consistency corrections
   ========================================================= */

@media (max-width: 640px) {
  html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  /*
   * One consistent mobile gutter.
   * Prevent sections from touching/overflowing the right edge.
   */
  .region-content,
.fm-page,
.contact-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .contact-page > section {
    box-sizing: border-box;
    width: calc(100% - 2rem);
    max-width: none;
    margin-right: auto;
    margin-left: auto;
  }

  .contact-hero {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  /*
   * Prevent children, cards and rendered fields from exceeding their parent.
   */
  .views-element-container,
.view,
.view-content,
.views-row,
.main-content article,
.field,
.field__item {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  /*
   * Unified header:
   * logo | cart | menu
   */
  .site-header {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) 2.75rem 2.75rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .site-header .brand {
    overflow: hidden;
  }

  .site-header__cart,
.mobile-menu-toggle {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
  }

  /*
   * Social icons should never appear in the closed mobile header.
   * They appear only when the menu is open.
   */
  .site-header .header-socials {
    display: none !important;
  }

  .site-header.is-menu-open .header-socials {
    display: flex !important;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 0.55rem;
    width: 100%;
    padding: 0.85rem 0 0.25rem;
  }

  .site-header.is-menu-open .header-socials .social-link {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
  }

  /*
   * Make the menu panel obey the same viewport/gutter width.
   */
  .main-nav {
    box-sizing: border-box;
    width: calc(100% + 1.5rem);
    max-width: calc(100% + 1.5rem);
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .view-music .views-field-field-cover-image,
.view-music .views-field-field-product-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #090909;
  }

  .view-music .views-field-field-cover-image img,
.view-music .views-field-field-product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  /*
   * Form/footer controls should respect the right gutter.
   */
  .site-footer,
.site-footer__inner,
.site-footer form,
.site-footer input,
.site-footer button {
    box-sizing: border-box;
    max-width: 100%;
  }

  .site-footer input[type="email"] {
    width: 100%;
  }
}

/* =========================================================
   Releases / Shop mobile alignment
   Matches the 16px gutter used by Music and Videos.
   ========================================================= */

@media (max-width: 640px) {
  .fm-storefront-main .main-content,
.fm-storefront-main .drupal-content,
.fm-storefront-main .drupal-content > div,
.fm-storefront-main #block-fyah-mawi-content,
.fm-storefront-main #block-fyah-mawi-content > .theme-block-content,
.fm-storefront-main .views-element-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-right: 0;
    padding-left: 0;
  }

  .fm-storefront-main .js-pager__items {
    box-sizing: border-box;
    width: 100%;
    margin: 1.5rem 0 0;
    padding: 0;
  }
}

/* =========================================================
   Releases / Shop final mobile polish
   ========================================================= */

@media (max-width: 640px) {
  /* Reduce the excessive space above and inside the Store hero. */
  .fm-storefront-main .main-content {
    padding-top: 0;
  }

  /* Keep the pager aligned with the catalogue. */
  .fm-storefront-main nav[aria-labelledby="pagination-heading"] {
    width: 100%;
    margin-top: 2rem;
  }
}

/* Store route: remove generic page constraints before applying its gutter. */
@media (max-width: 640px) {
  .fm-storefront-main,
.fm-storefront-main > .drupal-content {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
}

/* =========================================================
   Homepage biography teaser
   Keeps the homepage concise while preserving the full Artist page.
   ========================================================= */

@media (max-width: 640px) {
  .fm-biography-teaser {
    position: relative;
    max-height: 10.5rem;
    overflow: hidden;
  }

  .fm-biography-teaser::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3rem;
    pointer-events: none;
    background:
      linear-gradient(
        to bottom,
        rgba(7, 8, 7, 0),
        rgba(7, 8, 7, 0.98)
      );
  }
}
