:root {
  --fb-bg: transparent;
  --fb-accent: #7a1424;
  --fb-text: #1d1d1f;
  --fb-muted: #6b6b70;
  --fb-card: #ffffff;
  --fb-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--fb-bg); color: var(--fb-text); font-family: var(--fb-font); line-height: 1.4; }
html.fb-embedded, html.fb-embedded body { overflow: hidden; }

.fb { position: relative; width: 100%; }
.fb-stage { position: relative; width: 100%; min-height: 200px; display: flex; justify-content: center; }
.fb-sizer { width: 100%; margin: 0 auto; transition: transform .5s ease; }
.fb-sizer.fb-shift-left { transform: translateX(-25%); }
.fb-sizer.fb-shift-right { transform: translateX(25%); }
.fb-book { margin: 0 auto; }
.fb-page { background: #fff; overflow: hidden; }
.fb-page-inner { position: relative; width: 100%; height: 100%; background: #fff; }
.fb-page-inner > img, .fb-page-inner > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.fb-loading { position: absolute; inset: 0; display: flex; gap: .6rem; align-items: center; justify-content: center; color: var(--fb-muted); font-size: .95rem; }
.fb-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: fb-spin .8s linear infinite; }
@keyframes fb-spin { to { transform: rotate(360deg); } }

.fb-bar { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 0 0; }
.fb-spacer { width: 1rem; }
.fb-counter { min-width: 6.5em; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--fb-muted); }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); background: #fff; color: var(--fb-accent); cursor: pointer; padding: 0; text-decoration: none; transition: background .15s, color .15s; }
.fb-btn:hover:not(:disabled) { background: var(--fb-accent); color: #fff; }
.fb-btn:disabled { opacity: .35; cursor: default; }
.fb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fb-btn[hidden] { display: none; }

.fb:fullscreen { background: #2b2b2e; padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.fb:fullscreen .fb-counter { color: #ddd; }

.fb-error { padding: 2rem 1rem; text-align: center; color: var(--fb-muted); }

/* Page layouts */
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.issue-head { text-align: center; margin: 0 0 12px; }
.issue-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--fb-accent); font-weight: 600; margin: 0; }
.issue-title { margin: .2rem 0 0; font-size: clamp(1.2rem, 2.5vw, 1.7rem); }
/* Compact homepage embed: title opens the full reader without an extra row. */
.fb-compact-full-link { color: inherit; text-decoration: none; }
.fb-compact-full-link:hover, .fb-compact-full-link:focus-visible { color: var(--fb-accent); text-decoration: underline; } 
/* For the homepage's narrow fourth column, put the page-turning reader
   first, then its small linked title. Keep the full preview unchanged. */
.fb-compact .wrap {
  display: flex;
  flex-direction: column;
  padding: 0 8px 6px;
}
.fb-compact #book { order: 0; }
.fb-compact .issue-head { order: 1; margin: 4px 0 0; }
.fb-compact .issue-kicker { display: none; }
.fb-compact .issue-title { margin: 0; font-size: .86rem; line-height: 1.25; font-weight: 600; }
.fb-compact .issue-date { margin: 0; font-size: .75rem; }
.fb-compact .cta { order: 2; margin-top: 5px; }
.fb-compact .cta a { padding: .35rem .7rem; font-size: .78rem; }

/* Phones: a full PDF page can exceed a fixed-height Duda row even in compact
   mode. Give touchscreen mobiles a small cover-link instead. The desktop
   compact page-turner and full-size reader keep their existing behaviour. */
.fb-mobile-cover-only .wrap { padding: 0 8px 6px; }
.fb-mobile-cover-only #book { display: flex; justify-content: center; }
.fb-mobile-cover-link {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; width: min(100%, 190px); margin: 0 auto;
  text-align: center; color: var(--fb-accent); text-decoration: none;
}
.fb-mobile-cover-link img {
  display: block; width: auto; max-width: 100%; max-height: 230px;
  height: auto; object-fit: contain; box-shadow: 0 2px 9px rgba(0,0,0,.18);
}
.fb-mobile-cover-action { font-size: .78rem; font-weight: 700; line-height: 1.25; }
.fb-mobile-cover-link:hover .fb-mobile-cover-action,
.fb-mobile-cover-link:focus-visible .fb-mobile-cover-action { text-decoration: underline; }
.fb-mobile-cover-placeholder {
  display: grid; place-items: center; width: 160px; height: 200px;
  padding: 12px; background: #fff; font-size: 1rem; font-weight: 600;
}
.fb-mobile-cover-only .issue-head { margin-top: 3px; }
.fb-mobile-cover-only .issue-title { font-size: .83rem; }

/* The archive should use actual cover thumbnails on phones, rather than
   turning every portrait issue into a nearly full-screen card. */
@media (max-width: 600px) {
  .archive .grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px; row-gap: 16px;
  }
  .archive .card { min-width: 0; }
  .archive .card-cover { width: 100%; max-width: 180px; margin: 0 auto; }
  .archive .card-title {
    margin-top: 5px; font-size: .82rem; line-height: 1.3;
    overflow-wrap: anywhere; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .archive .card-date { font-size: .75rem; }
}


.issue-date { margin: .15rem 0 0; color: var(--fb-muted); font-size: .9rem; }
.back-latest { display: inline-flex; align-items: center; gap: .35rem; margin-top: .6rem; padding: .45rem 1rem .45rem .75rem; border: 1.5px solid var(--fb-accent); border-radius: 999px; background: #fff; color: var(--fb-accent); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.back-latest:hover, .back-latest:focus-visible { background: var(--fb-accent); color: #fff; }
.card-badge { position: absolute; top: 6px; left: 6px; padding: .1rem .45rem; border-radius: 999px; background: var(--fb-accent); color: #fff; font-size: .68rem; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

.cta { display: flex; justify-content: center; margin-top: 14px; }
.cta a { display: inline-block; padding: .7rem 1.4rem; border-radius: 999px; background: var(--fb-accent); color: #fff; text-decoration: none; font-weight: 600; }
.cta a:hover { filter: brightness(1.12); }

.archive { margin-top: 40px; }
.archive h2 { font-size: 1.25rem; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--fb-accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.card { display: flex; flex-direction: column; text-align: left; width: 100%; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.card-cover { position: relative; width: 100%; aspect-ratio: 1 / 1.414; background: #eee; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .2s, box-shadow .2s; }
.card-cover img, .card-cover canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .card-cover, .card:focus-visible .card-cover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.card[aria-current="true"] .card-cover { outline: 3px solid var(--fb-accent); outline-offset: 3px; }
.card-title { font-weight: 600; margin-top: 8px; font-size: .95rem; }
.card-date { color: var(--fb-muted); font-size: .85rem; }
.empty { color: var(--fb-muted); }
.card-date:empty, .issue-date:empty { display: none; }
[hidden] { display: none !important; }
.fb-page { box-shadow: 0 1px 8px rgba(0,0,0,.18); }

/* Toolbar groups */
.fb { container-type: inline-size; }
.fb-bar { flex-wrap: wrap; gap: .5rem 1.25rem; }
.fb-group { display: flex; align-items: center; gap: .35rem; }
.fb-btn[aria-pressed="true"] { background: var(--fb-accent); color: #fff; }
@container (max-width: 520px) {
  .fb-bar { gap: .45rem; }
  .fb-group { gap: .25rem; }
  .fb-btn { width: 34px; height: 34px; }
  .fb-btn svg { width: 16px; height: 16px; }
  .fb-counter { min-width: 5em; font-size: .85rem; }
}

/* Zoom */
.fb-zoom { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; background: rgba(40,40,44,.96); border-radius: 4px; overflow: hidden; }
.fb-zoom-scroll { flex: 1; overflow: auto; cursor: grab; touch-action: pan-x pan-y; }
.fb-zoom-scroll.fb-dragging { cursor: grabbing; user-select: none; }
.fb-zoom-pages { display: flex; width: max-content; min-width: 100%; justify-content: center; padding: 12px; }
.fb-zoom-pages canvas { display: block; background: #fff; height: auto; }
.fb-zoom-bar { display: flex; justify-content: center; align-items: center; gap: .35rem; padding: 8px; background: rgba(0,0,0,.35); }
.fb-zoom-bar .fb-counter { color: #eee; min-width: 4em; }

/* Search */
.fb-search { margin: .7rem auto 0; max-width: 560px; background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; padding: .7rem; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.fb-search-form { display: flex; gap: .4rem; }
.fb-search-form input { flex: 1; min-width: 0; padding: .5rem .7rem; border: 1px solid #ccc; border-radius: 999px; font: inherit; }
.fb-search-go { border: 0; border-radius: 999px; padding: .5rem 1rem; background: var(--fb-accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.fb-search-status { margin: .5rem .2rem 0; font-size: .85rem; color: var(--fb-muted); }
.fb-search-status:empty { display: none; }
.fb-search-results { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 260px; overflow: auto; }
.fb-search-hit { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .4rem; font: inherit; font-size: .88rem; color: var(--fb-text); cursor: pointer; border-radius: 6px; }
.fb-search-hit:hover, .fb-search-hit:focus-visible { background: rgba(0,0,0,.05); }
.fb-search-page { font-weight: 700; color: var(--fb-accent); margin-right: .3rem; }
.fb-search-hit mark { background: #ffe58a; color: inherit; padding: 0 1px; }

/* Toast + print frame */
.fb-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 10px); background: rgba(20,20,22,.88); color: #fff; padding: .45rem .9rem; border-radius: 999px; font-size: .85rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
.fb-toast-show { opacity: 1; transform: translate(-50%, 0); }
.fb-print-frame { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }

.archive-year { font-size: 1.05rem; margin: 22px 0 12px; color: var(--fb-accent); }
.archive-year:first-child { margin-top: 6px; }
