/* ═══════════════════════════════════════════════
   Bookverse – Responsive / Desktop Styles
   Mobile bleibt unverändert. Nur ≥768px hier.
   Wird NACH theme/components.css geladen.
   ═══════════════════════════════════════════════ */

/* ─── Base: Book Hero Body Wrapper ───────────── */
.book-hero__body {
  width: 100%;
}

/* ─── Tablet ≥768px ─────────────────────────── */
@media (min-width: 768px) {

  /* Layout: Wider content area */
  .app-main {
    max-width: 720px;
    padding: var(--space-lg) var(--space-xl) calc(var(--nav-height) + var(--safe-area-bottom) + var(--space-lg));
  }

  .header-content {
    max-width: 720px;
  }

  /* Modal: Centered dialog statt Bottom Sheet */
  .modal {
    bottom: auto;
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 520px;
    width: calc(100% - 3rem);
    border-radius: var(--radius-xl);
    padding-bottom: var(--space-lg);
    animation: modal-center-in var(--duration-normal) var(--ease-out);
  }

  .modal__handle {
    display: none;
  }

  @keyframes modal-center-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  /* Book Grid: Larger tiles */
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-lg);
  }

  /* Stats Grid */
  .stats-grid {
    gap: var(--space-md);
  }

  /* Typography */
  .page-title {
    font-size: var(--text-3xl);
  }

  /* Book Hero: Larger cover */
  .book-hero__cover {
    width: 180px;
    height: 270px;
  }

  /* Auth */
  .auth-page {
    min-height: 70vh;
  }

  .auth-form {
    max-width: 420px;
  }
}

/* ─── Desktop ≥1024px ───────────────────────── */
@media (min-width: 1024px) {

  /* ── Scrollbar ─────────────────────────────── */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
  }

  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: var(--radius-full);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
  }

  /* ── App Grid Layout ───────────────────────── */
  #app {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr;
    min-height: 100dvh;
  }

  /* ── Sidebar Navigation ────────────────────── */
  .bottom-nav {
    grid-column: 1;
    grid-row: 1 / -1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: var(--space-md) var(--space-sm);
    border-top: none;
    border-right: 1px solid var(--border-subtle);
    gap: 2px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-secondary);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .bottom-nav::before {
    content: 'Bookverse';
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--accent-primary);
    padding: var(--space-lg) var(--space-md) var(--space-xl);
    letter-spacing: -0.02em;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
  }

  .nav-item:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
  }

  .nav-item.is-active {
    background: var(--accent-soft);
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .nav-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
  }

  /* ── Header: Hidden on desktop ─────────────── */
  .app-header {
    display: none;
  }

  /* ── Main Content ──────────────────────────── */
  .app-main {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: var(--space-2xl);
  }

  /* Constrain content width */
  .app-main > * {
    max-width: 900px;
  }

  /* ── Typography ────────────────────────────── */
  .page-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-xl);
  }

  /* ── Book Grid ─────────────────────────────── */
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-lg);
  }

  .book-grid__cover {
    border-radius: var(--radius-md);
    transition: box-shadow var(--duration-fast) var(--ease-out);
  }

  .book-grid__item:hover .book-grid__cover {
    box-shadow: var(--shadow-md);
  }

  /* ── Shelf List: 2 columns ─────────────────── */
  .shelf-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* ── Book Hero: Horizontal ─────────────────── */
  .book-hero {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: var(--space-2xl);
    padding: var(--space-xl) 0;
  }

  .book-hero__cover {
    width: 220px;
    height: 330px;
    flex-shrink: 0;
  }

  .book-hero__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding-top: var(--space-sm);
  }

  .book-hero__title {
    font-size: var(--text-3xl);
  }

  .book-hero__actions {
    justify-content: flex-start;
    margin-top: var(--space-sm);
  }

  /* ── Book Card ─────────────────────────────── */
  .book-card__cover {
    width: 80px;
    min-width: 80px;
    height: 120px;
  }

  /* ── Stats Grid ────────────────────────────── */
  .stats-grid {
    gap: var(--space-md);
    max-width: 600px;
  }

  .stat-card {
    padding: var(--space-lg);
  }

  .stat-card__value {
    font-size: var(--text-3xl);
  }

  /* ── Profile Header ────────────────────────── */
  .profile-header__bio {
    max-width: 500px;
  }

  .profile-header__avatar {
    width: 96px;
    height: 96px;
    font-size: var(--text-3xl);
  }

  /* ── Settings List ─────────────────────────── */
  .settings-list {
    max-width: 600px;
  }

  /* ── Search Bar ────────────────────────────── */
  .search-bar {
    max-width: 480px;
  }

  /* ── Toast ─────────────────────────────────── */
  .toast-container {
    right: var(--space-xl);
    top: var(--space-xl);
  }

  .toast {
    min-width: 320px;
  }

  /* ── Modal ─────────────────────────────────── */
  .modal {
    max-width: 560px;
  }

  /* ── Auth Page ─────────────────────────────── */
  .auth-page {
    min-height: 80vh;
  }

  .auth-form {
    max-width: 440px;
  }

  .auth-title {
    font-size: var(--text-4xl);
  }

  /* ── Review Cards ──────────────────────────── */
  .review-card {
    padding: var(--space-lg);
  }

  /* ── Focus States for Keyboard Navigation ──── */
  .nav-item:focus-visible,
  .btn:focus-visible,
  .tab:focus-visible,
  .shelf-item:focus-visible,
  .book-card:focus-visible,
  .book-grid__item:focus-visible,
  .settings-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
  }
}

/* ─── Large Desktop ≥1440px ─────────────────── */
@media (min-width: 1440px) {

  #app {
    grid-template-columns: 280px 1fr;
  }

  .bottom-nav {
    width: 280px;
  }

  .bottom-nav::before {
    font-size: var(--text-2xl);
  }

  .nav-label {
    font-size: var(--text-base);
  }

  .app-main {
    padding: var(--space-2xl) var(--space-3xl);
  }

  .app-main > * {
    max-width: 1060px;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .shelf-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .book-hero__cover {
    width: 240px;
    height: 360px;
  }
}
