
/* Pensionado responsive correction layer - 2026-08-12.
   Loaded after the existing production styles; content and form submission logic are unchanged. */

html,
body {
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
svg,
canvas,
iframe {
  max-width: 100%;
}

main,
main section,
main article,
main form,
main form > *,
.section-shell,
.section-shell > *,
.form-row,
.form-row > * {
  min-width: 0;
}

main h1,
main h2,
main h3,
main h4,
main p,
main li,
main label,
main a,
main button,
.book-card,
.book-card * {
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 980px) {

  html {
    scroll-padding-top: calc(5.5rem + env(safe-area-inset-top));
  }

  main form,
  main form input,
  main form select,
  main form textarea,
  main form button,
  main form label {
    scroll-margin-top: calc(5.5rem + env(safe-area-inset-top));
  }

  /* Keep page-to-page navigation in normal document flow on touch-sized layouts.
     This prevents the fixed bar from covering copy, forms, or safe-area content. */
  .swipe-hint {
    position: relative !important;
    inset: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: calc(100% - 1.5rem) !important;
    max-width: 760px !important;
    margin: 1rem auto !important;
    transform: none !important;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  html,
  body {
    width: 100%;
    overflow-x: clip;
  }

  main,
  main > section,
  main section,
  main article,
  main form {
    max-width: 100%;
  }

  .section-shell {
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 720px) {
  .form-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
  }

  .contact-section form,
  main form {
    width: 100%;
    max-width: 100%;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .contact-section label,
  .contact-section .form-note,
  .contact-section .consent-label,
  main form label,
  main form .form-note,
  main form .consent-label {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .contact-section input:not([type="checkbox"]):not([type="radio"]),
  .contact-section select,
  .contact-section textarea,
  .contact-section button[type="submit"],
  main form input:not([type="checkbox"]):not([type="radio"]),
  main form select,
  main form textarea,
  main form button[type="submit"] {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 16px !important;
    line-height: 1.45;
  }

  .contact-section input:not([type="checkbox"]):not([type="radio"]),
  .contact-section select,
  .contact-section textarea,
  main form input:not([type="checkbox"]):not([type="radio"]),
  main form select,
  main form textarea {
    padding-top: .78rem;
    padding-bottom: .78rem;
  }

  .contact-section select,
  .contact-section select option,
  main form select,
  main form select option {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .contact-section textarea,
  main form textarea {
    min-height: 8.5rem;
    resize: vertical;
  }

  .contact-section .consent-label,
  main form .consent-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: .7rem;
  }

  .contact-section .consent-label input[type="checkbox"],
  main form .consent-label input[type="checkbox"] {
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    max-width: 1.15rem !important;
    height: 1.15rem;
    min-height: 1.15rem;
    flex: 0 0 1.15rem;
    margin: .18rem 0 0;
  }

  .contact-section .consent-label span,
  main form .consent-label span {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.5;
  }

  .contact-section button[type="submit"],
  main form button[type="submit"] {
    min-height: 48px;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .section-shell {
    width: calc(100% - 2rem) !important;
    max-width: calc(100% - 2rem) !important;
  }

  .book-card h2,
  .book-card strong,
  .book-card p,
  .book-card a {
    max-width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  html,
  body {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
  }

  main,
  main section,
  main form {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .contact-section,
  .books-section {
    padding-top: max(2.5rem, env(safe-area-inset-top));
    padding-bottom: max(5rem, calc(2.5rem + env(safe-area-inset-bottom)));
  }
}


@media (max-width: 900px) {
  .contact-section input:not([type="checkbox"]):not([type="radio"]),
  .contact-section select,
  .contact-section textarea,
  main form input:not([type="checkbox"]):not([type="radio"]),
  main form select,
  main form textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
    line-height: 1.45;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 980px) {
    html,
    body { overflow-x: hidden; }
  }
}
