/**
 * One page width everywhere, the homepage's: content up to 1520px wide,
 * 40px on the sides (24px on mobile), so header, content and footer always
 * start on the same line. Loaded after the other theme files.
 *
 * Covers Belgrade's own containers (".container-xl" around regions and the
 * main content), the checkout, the cart page and basic pages.
 */

:root {
  --museo-shell-max: 1520px;
  --museo-shell-gutter: 40px;
}

@media (max-width: 767.98px) {
  :root {
    --museo-shell-gutter: 24px;
  }
}

/* Belgrade containers → the site width. */
main[role="main"] > .main-container,
.region-highlighted > .container-xl,
.region-help > .container-xl {
  width: min(100%, var(--museo-shell-max));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--museo-shell-gutter);
  padding-left: var(--museo-shell-gutter);
}

main[role="main"] > .main-container > .row {
  margin-right: 0;
  margin-left: 0;
}

main[role="main"] > .main-container > .row > * {
  padding-right: 0;
  padding-left: 0;
}

/* The breadcrumb is already inside the container: no width of its own. */
.region-highlighted .museo-breadcrumb-block {
  width: auto;
  padding: 20px 0 0;
}

/* ── Basic pages (privacy, cookie, terms…) ── */
.museo-text-page {
  max-width: 760px;
  margin: 0;
  padding: 24px 0 96px;
}

.museo-text-page__title {
  margin: 0 0 32px;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.museo-text-page__body h2 {
  margin: 40px 0 12px;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.museo-text-page__body p,
.museo-text-page__body li {
  color: var(--fg-muted);
  font-size: 17px;
  line-height: 1.6;
}

/* ── Checkout ── (style.css gives main[role=main] max-width: 100%) */
.museo-checkout-page main.museo-checkout-page__main {
  width: min(100%, var(--museo-shell-max));
  max-width: none;
  margin: 0 auto;
  padding: 48px var(--museo-shell-gutter) 96px;
}

/* Mobile (review of 27/10/2026): the order summary bar sits right under
   the header, and at the bottom there is room for the whole fixed bar with
   the main button, whatever its height (js/checkout.js sets
   --museo-checkout-bar-height: step 2 has the terms line too). */
@media (max-width: 991.98px) {
  .museo-checkout-page main.museo-checkout-page__main {
    padding-top: 0;
    padding-bottom: calc(var(--museo-checkout-bar-height, 160px) + 32px);
  }
}

.museo-checkout-header .museo-checkout-header__bar {
  width: min(100%, var(--museo-shell-max));
  padding-right: var(--museo-shell-gutter);
  padding-left: var(--museo-shell-gutter);
}

/* ── Cart page: same start line as the other pages ── */
.museo-cart-page {
  width: min(100%, var(--museo-shell-max));
  margin: 0 auto;
  padding: 40px var(--museo-shell-gutter) 96px;
}

.museo-cart-page .museo-cart-form {
  max-width: 640px;
}

/* ── Login / register (the account pages are redone in step 8) ── */
.museo-auth {
  width: min(100%, var(--museo-shell-max));
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--museo-shell-gutter);
  padding-left: var(--museo-shell-gutter);
}

/* ── Buttons: never bold (Belgrade sets 600 on .btn) ── */
.btn.museo-btn,
.museo-btn {
  font-weight: 400;
}

/* No half-white background (it was made for a full-width layout). */
.museo-auth-page main,
.user-authenticate main {
  background: var(--bg-page);
}

@media (max-width: 767.98px) {
  .museo-cart-page__title {
    font-size: 36px;
  }

  .museo-cart-page .museo-cart-form__body,
  .museo-cart-page .museo-cart-form__foot {
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* ── Logged-in users: room for Drupal's admin toolbar ──
 * Drupal publishes its height as --drupal-displace-offset-top (0 for
 * visitors): everything fixed or sticky starts below it. */
:root {
  --museo-offset-top: var(--drupal-displace-offset-top, 0px);
}

.museo-header,
.museo-checkout-header {
  top: var(--museo-offset-top);
}

.museo-cart-panel__veil,
.museo-cart-panel__sheet {
  top: var(--museo-offset-top);
}

.museo-order-summary,
.museo-checkout__aside {
  top: calc(112px + var(--museo-offset-top));
}

html {
  scroll-padding-top: calc(104px + var(--museo-offset-top));
}

@media (max-width: 991.98px) {
  .museo-menu-mobile:not([hidden]) {
    top: calc(var(--museo-header-height, 64px) + var(--museo-offset-top));
  }

  .museo-cart-panel__sheet {
    top: var(--museo-offset-top);
  }

  .museo-checkout__aside {
    top: auto;
  }
}

/* Cart page on a phone (review 28/10/2026): the page container already has
   its side margin, a second one left 222px for the rows. */
@media (max-width: 575.98px) {
  .museo-cart-page {
    padding-right: 0;
    padding-left: 0;
  }
}

/* Cart page (review 28/10/2026): the page of "Modifica" in the payment.
   "Torna al pagamento" above the title; on a computer centred, the tickets
   on the left and total + button on the right, like the payment page (it
   was a narrow card on the left of an empty page). */
.museo-cart-page__back {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 0;
  color: var(--fg-default);
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 992px) {
  .museo-cart-page {
    width: min(100%, 1100px);
  }

  .museo-cart-page .museo-cart-form--page {
    max-width: none;
  }

  .museo-cart-page .museo-cart-form--page > form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
  }

  .museo-cart-page .museo-cart-form--page .museo-cart-form__body {
    padding-top: 12px;
    padding-bottom: 12px;
    border-right: 1px solid var(--border-rule);
  }

  .museo-cart-page .museo-cart-form--page .museo-cart-form__foot {
    position: sticky;
    top: calc(var(--museo-header-height, 88px) + 24px);
    border-top: 0;
  }
}
