/* ==========================================================================
   Mobil / tablet (< 900px) – tényleges reszponzív layout, fix rem, nincs overflow
   ========================================================================== */

@media (max-width: 899px) {
  html:has(body.page-sheet) {
    overflow-x: clip;
  }

  body.page-sheet {
    overflow-x: clip;
    max-width: 100vw;
  }

  .page-sheet {
    font-size: 16px !important;
    --sheet: 100%;
    --pad: 1.25rem;
    --col-l: 100%;
    --col-r: 100%;
    --photo-h: auto;
    overflow-x: clip;
  }

  .page-sheet .page-shell,
  .page-sheet .sheet {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    overflow-x: clip;
  }

  .page-sheet img {
    max-width: 100%;
    height: auto;
  }

  .page-sheet .sheet-top__photo img,
  .page-sheet .sheet-person__photo img {
    max-width: none;
    height: 100%;
    object-fit: cover;
  }

  /* ---- Hero mobil: fejléckép felül, logó rá, szöveg alatta ---- */
  body.page-sheet:not(.page-home) .sheet-top {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, auto);
    margin: 0;
    padding: 0;
  }

  body.page-sheet:not(.page-home) .sheet-top__left,
  body.page-sheet:not(.page-home) .sheet-top__hero {
    display: contents;
  }

  body.page-sheet:not(.page-home) .sheet-top__photo {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
    order: unset;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-height: clamp(12rem, 48vw, 22rem);
    aspect-ratio: 1100 / 573;
  }

  body.page-sheet:not(.page-home) .sheet-top__logo {
    grid-column: 1;
    grid-row: 1;
    z-index: 4;
    align-self: start;
    justify-self: start;
    width: 8.625rem;
    margin: 0 !important;
    padding: 1.25rem;
    background: transparent;
  }

  body.page-sheet:not(.page-home) .sheet-top__photo .menu-toggle {
    z-index: 5;
  }

  body.page-sheet:not(.page-home) .sheet-top__title {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    z-index: 3;
    margin: 1.25rem 0 0 !important;
    padding: 0 1.25rem;
    max-width: none;
    font-size: 2.25rem;
    color: var(--ink-heading);
    background: #fff;
  }

  body.page-sheet:not(.page-home) .sheet-top__subtitle,
  body.page-sheet:not(.page-home) .sheet-top__taglines {
    grid-column: 1;
    grid-row: 3;
    position: relative;
    z-index: 3;
    margin: 1rem 0 0 !important;
    padding: 0 1.25rem;
    max-width: none;
    font-size: 1.125rem;
    color: #575756;
    background: #fff;
  }

  body.page-sheet:not(.page-home) .sheet-top__intro {
    grid-column: 1;
    grid-row: 4;
    position: relative;
    z-index: 3;
    margin: 1rem 0 0 !important;
    padding: 0 1.25rem 1.5rem;
    max-width: none;
    color: #575756;
    background: #fff;
  }

  body.page-sheet:not(.page-home) .sheet-top__left-prose {
    grid-column: 1;
    grid-row: 5;
    margin: 0;
    padding: 2rem 1.25rem;
    width: 100% !important;
  }

  body.page-sheet:not(.page-home) .sheet-top__right-prose {
    grid-column: 1;
    grid-row: 6;
    order: unset;
    padding: 0 1.25rem 2.5rem !important;
  }

  body.page-sheet:not(.page-home) .sheet-top:not(:has(.sheet-top__right-prose)) .sheet-top__intro {
    grid-row: 4;
  }

  body.page-sheet:not(.page-home) .sheet-top:not(:has(.sheet-top__left-prose)):not(:has(.sheet-top__right-prose)) .sheet-top__intro {
    padding-bottom: 2.5rem;
  }

  .sheet-section--tint {
    position: relative;
    box-shadow: 0 0 0 100vmax #fdfaf9;
    clip-path: inset(0 -100vmax);
  }

  /* ---- Szekciók ---- */
  .sheet-section {
    padding: 2.5rem 1.25rem;
  }

  .sheet-section__title {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .sheet-section__lead {
    font-size: 1.0625rem;
    line-height: 1.45;
    max-width: none;
  }

  .sheet-section__label {
    font-size: 0.75rem;
  }

  .sheet-prose,
  .sheet-list {
    font-size: 0.9375rem;
    max-width: none;
  }

  .sheet-two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* ---- Csapat ---- */
  .sheet-team {
    padding-block: 2.5rem;
    padding-inline: 0;
    width: 100%;
    max-width: 100%;
  }

  .sheet-team__inner {
    width: 100%;
    max-width: 100%;
    padding-inline: 1.25rem;
  }

  .sheet-team__title {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .sheet-team__lead {
    font-size: 1.0625rem;
    line-height: 1.5;
    max-width: none;
    margin-bottom: 2.5rem;
  }

  .sheet-team__row,
  .sheet-team__row--two,
  .sheet-team__row--2,
  .sheet-team__row--3 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2.5rem;
    padding-inline: 0;
    margin-left: 0 !important;
    margin-inline: 0;
    justify-content: stretch;
    justify-items: stretch;
  }

  .sheet-person {
    width: 100%;
    max-width: none;
  }

  .sheet-person--horiz {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    width: 100%;
  }

  .sheet-person__name {
    font-size: 1rem;
  }

  .sheet-person__role {
    font-size: 0.875rem;
  }

  .sheet-person__bio {
    font-size: 0.8125rem;
    line-height: 1.6;
    max-width: none !important;
  }

  .sheet-person__photo {
    width: 6.5rem;
    height: 8.125rem;
  }

  /* ---- CTA / footer: tartalom reszponzív, háttér edge-to-edge ---- */
  .sheet-cta,
  .page-sheet .sheet-cta {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    grid-template-columns: unset !important;
    min-height: 0 !important;
    width: 100%;
    max-width: 100%;
    padding: 2.5rem 1.25rem !important;
    text-align: center;
  }

  .page-sheet:not(.page-home) .sheet-cta {
    box-shadow: 0 0 0 100vmax var(--cta-bg, #d5ccbc);
    clip-path: inset(0 -100vmax);
  }

  .sheet-cta__headline {
    font-size: 1.75rem;
    line-height: 1.28;
    border-right: 0;
    padding-right: 0;
    text-align: center;
    width: 100%;
  }

  .sheet-cta__headline span {
    text-align: center;
  }

  .sheet-cta__body {
    padding-left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .sheet-cta__text {
    font-size: 0.9375rem;
    max-width: none;
    text-align: center;
  }

  .sheet-cta .btn {
    font-size: 0.875rem;
    height: auto;
    min-height: 3rem;
    min-width: 0;
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
  }

  .page-sheet .sheet-footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    gap: 2rem;
    padding: 2.5rem 1.25rem !important;
    font-size: 0.875rem;
    line-height: 1.35;
  }

  .page-sheet:not(.page-home) .sheet-footer {
    box-shadow: 0 0 0 100vmax #292422;
    clip-path: inset(0 -100vmax);
  }

  .page-sheet .sheet-footer__col {
    width: 100%;
    text-align: center;
    margin-left: 0 !important;
  }

  .page-sheet .sheet-footer__logo {
    width: var(--footer-logo-w);
    max-width: var(--footer-logo-w);
    margin-inline: auto;
  }

  .page-sheet .sheet-footer__logo img {
    max-height: var(--footer-logo-h);
    object-fit: contain;
  }

  /* ---- Főoldal stats (hero: home.css) ---- */
  .sheet-stats {
    padding: 2.5rem 1.25rem;
    width: 100%;
    box-shadow: none !important;
    clip-path: none !important;
  }

  .sheet-stats__title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .sheet-stat__value {
    font-size: 2rem;
  }

  .sheet-stat__label {
    font-size: 0.8125rem;
  }
}

/* Tablet csapat: 2 oszlop */
@media (min-width: 600px) and (max-width: 899px) {
  .sheet-team__row--3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sheet-team__row--3 .sheet-person:last-child {
    grid-column: 1 / -1;
  }

  .sheet-team__row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
