/* ==========================================================================
   Responsividade
   ========================================================================== */

.header__menu {
  display: none;
}

@media (max-width: 1120px) {
  .hero__chip--1 {
    left: 0;
  }

  .hero__chip--2 {
    right: 0;
  }

  .pro-teaser__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .editor__layout,
  .reader__layout {
    grid-template-columns: 1fr;
  }

  .reader__toc {
    position: static;
    max-height: 260px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    max-width: 680px;
    margin: 0 auto;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .hero__actions,
  .hero__stats {
    justify-content: center;
  }

  .hero__art {
    order: -1;
    min-height: clamp(300px, 58vw, 420px);
  }

  .hero__character {
    width: min(78%, 340px);
  }

  .hero__scroll {
    display: none;
  }
}

@media (max-width: 960px) {
  .header__menu {
    display: inline-flex;
  }

  .site-header__inner {
    flex-wrap: wrap;
    padding-block: var(--space-3);
    row-gap: var(--space-2);
  }

  .nav {
    order: 4;
    width: 100%;
    margin-left: 0;
    display: none;
  }

  .nav.is-open {
    display: block;
    padding-top: var(--space-2);
    animation: modalIn 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .nav.is-open .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: rgba(9, 12, 32, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
  }

  .nav.is-open .nav__link {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .header__search.is-open .header__search-input {
    width: clamp(150px, 40vw, 240px);
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .book-detail__grid {
    grid-template-columns: 1fr;
  }

  .book-detail__cover {
    max-width: 220px;
    margin-inline: auto;
  }

  .profile-head {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-head__name {
    justify-content: center;
  }

  .profile-head__avatar {
    margin: 0 auto;
  }

  .profile-head__stats,
  .profile-head__actions {
    justify-content: center;
  }

  .reader__footer {
    flex-wrap: wrap;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }

  .section {
    margin-bottom: var(--space-6);
  }

  .section__head {
    align-items: flex-start;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .author-grid,
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .filters__row {
    flex-direction: column;
    align-items: stretch;
  }

  .filters select {
    width: 100%;
  }

  .filters__row--chips {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: var(--space-2);
    mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    scrollbar-width: none;
  }

  .filters__row--chips::-webkit-scrollbar {
    display: none;
  }

  .filters__row--chips .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .cta,
  .panel,
  .reader__content {
    padding: var(--space-4);
  }

  .pro-teaser {
    padding: var(--space-5);
  }

  .form-actions .button {
    flex: 1;
  }

  .notifications {
    right: var(--space-3);
    left: var(--space-3);
    width: auto;
  }

  .reader__fab {
    right: var(--space-3);
    bottom: var(--space-3);
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .empty-state {
    padding: var(--space-6) var(--space-3);
  }

  .hero {
    padding-bottom: clamp(56px, 12vw, 88px);
  }

  .hero__title {
    font-size: clamp(2.1rem, 1.4rem + 7vw, 3rem);
  }

  .hero__chip {
    font-size: 0.76rem;
    padding: 8px 12px;
  }

  .hero__chip--1 {
    bottom: 8%;
    left: 0;
  }

  .hero__chip--2 {
    top: 6%;
    right: 0;
  }

  .hero__float {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .hero__actions .button {
    flex: 1 1 100%;
    justify-content: center;
  }

  .hero__stats {
    gap: var(--space-4);
  }

  .hero__stat strong {
    font-size: 1.4rem;
  }

  .cta__actions,
  .hero__actions {
    width: 100%;
  }

  .cta__actions .button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .brand span {
    font-size: 0.98rem;
  }

  .header__actions .button--ghost {
    display: none;
  }

  .hero__float--3 {
    display: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .reader__toc,
  .reader__header,
  .reader__footer,
  .reader__fab,
  .toast-host {
    display: none !important;
  }

  .reader__content {
    border: 0;
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}
