/* ——— Class 9 & 10 resource pages ——— */

/* Tiles nav */
.resource-tiles {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: clamp(10px,2vw,16px);
  margin-bottom: clamp(24px,4vw,36px);
}

.resource-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 5rem;
  padding: clamp(16px,2.5vw,22px) 10px;
  border-radius: var(--q-r-lg);
  background: linear-gradient(145deg, var(--q-navy-l) 0%, var(--q-navy) 55%, var(--q-navy-d) 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(.85rem,1.8vw,.95rem);
  text-align: center;
  box-shadow: var(--q-sh-md);
  transition: transform .24s var(--q-ease), box-shadow .24s var(--q-ease);
  position: relative;
  overflow: hidden;
}

.resource-tile::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--q-accent), var(--q-royal));
  opacity: 0;
  transition: opacity .24s ease;
}

.resource-tile:hover { transform: translateY(-4px); box-shadow: var(--q-sh-lg); }
.resource-tile:hover::after { opacity: 1; }
.resource-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(53,40,217,.4); }

.resource-tile-icon { font-size: 1.5rem; line-height: 1; }
.resource-tile-label { font-size: clamp(.82rem,1.6vw,.9rem); }

.resource-hub-actions { margin-top: clamp(18px,3vw,26px); }
.resource-hub-actions .btn-outline { margin-top: 0; }

/* Intro box */
.resource-intro {
  margin: 0 0 clamp(22px,3.5vw,36px);
  padding: clamp(18px,3vw,26px) clamp(18px,3.5vw,24px);
  background: rgba(255,255,255,.78);
  border-radius: var(--q-r-lg);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: var(--q-sh-sm);
  backdrop-filter: blur(10px);
}

.resource-intro h2 {
  font-size: clamp(.92rem,2vw,1.05rem);
  font-weight: 700;
  color: var(--q-navy);
  margin-bottom: 10px;
}

.resource-intro p {
  font-size: clamp(.88rem,1.7vw,.96rem);
  line-height: 1.7;
  color: var(--q-muted);
}

.resource-intro p + p { margin-top: 10px; }

.resource-intro ul {
  margin: 12px 0 0;
  padding-left: 1.15rem;
  color: var(--q-muted);
  font-size: clamp(.88rem,1.7vw,.96rem);
  line-height: 1.6;
}

.resource-intro li + li { margin-top: 7px; }

.resource-intro-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(20,27,79,.14);
  font-size: .84rem !important;
  color: var(--q-soft) !important;
}

/* Inline code */
.inline-code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: .84em;
  font-weight: 600;
  padding: .1em .4em;
  border-radius: 5px;
  background: rgba(20,27,79,.07);
  color: var(--q-navy);
  word-break: break-all;
}

/* Chapter list */
.pdf-chapter-list {
  list-style: none;
  margin: 0 0 clamp(22px,4vw,36px);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-chapter-list__item {
  display: grid;
  grid-template-columns: 2.8rem minmax(0,1fr) auto;
  gap: 0 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--q-r-md);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--q-sh-sm);
  transition: transform .2s var(--q-ease), box-shadow .2s var(--q-ease);
}

.pdf-chapter-list__item:has(.pdf-chapter-list__link):hover {
  transform: translateX(3px);
  box-shadow: var(--q-sh-md);
}

.pdf-chapter-list__item--missing { opacity: .72; background: rgba(255,255,255,.5); }

.pdf-chapter-list__num {
  font-weight: 800;
  font-size: .95rem;
  color: var(--q-accent);
  text-align: center;
}

.pdf-chapter-list__body { min-width: 0; }

.pdf-chapter-list__link {
  font-weight: 700;
  color: var(--q-navy);
  text-decoration: none;
  font-size: clamp(.9rem,1.8vw,.98rem);
  line-height: 1.35;
  display: block;
}

.pdf-chapter-list__link:hover { color: var(--q-royal); }

.pdf-chapter-list__meta {
  display: block;
  margin-top: 3px;
  font-size: .72rem;
  color: var(--q-muted);
  font-weight: 500;
}

.pdf-chapter-list__title-muted {
  font-weight: 600;
  color: var(--q-muted);
  font-size: clamp(.88rem,1.8vw,.96rem);
  display: block;
}

.pdf-chapter-list__badge {
  display: inline-block;
  margin-top: 4px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--q-soft);
  background: rgba(228,91,124,.1);
  padding: 3px 9px;
  border-radius: 999px;
}

.pdf-chapter-list__open-icon {
  color: var(--q-accent);
  font-size: .9rem;
  opacity: 0;
  transition: opacity .2s ease;
}

.pdf-chapter-list__item:has(.pdf-chapter-list__link):hover .pdf-chapter-list__open-icon {
  opacity: 1;
}

/* Auto PDF list */
.pdf-auto-list {
  list-style: none;
  margin: 0 0 clamp(22px,4vw,36px);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-auto-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--q-r-md);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--q-sh-sm);
  transition: transform .2s var(--q-ease), box-shadow .2s var(--q-ease);
}

.pdf-auto-list li:hover { transform: translateX(3px); box-shadow: var(--q-sh-md); }

.pdf-auto-list__icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--q-accent), var(--q-royal));
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}

.pdf-auto-list__info { flex: 1; min-width: 0; }

.pdf-auto-list__link {
  font-weight: 700;
  color: var(--q-navy);
  text-decoration: none;
  font-size: .95rem;
  display: block;
}

.pdf-auto-list__link:hover { color: var(--q-royal); }

.pdf-auto-list__file {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  color: var(--q-muted);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

/* PDF viewer */
.pdf-viewer-body .page-main--viewer { max-width: min(1200px,100%); padding-bottom: 28px; }

.pdf-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: var(--q-r-lg);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--q-sh-sm);
  backdrop-filter: blur(10px);
}

.pdf-viewer-kicker {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--q-accent);
  margin-bottom: 3px;
}

.pdf-viewer-title {
  font-size: clamp(1rem,2.2vw,1.28rem);
  font-weight: 700;
  color: var(--q-navy);
  line-height: 1.25;
  max-width: 34rem;
}

.pdf-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.pdf-viewer-actions .btn-outline,
.pdf-viewer-actions .btn-primary { margin-top: 0; }

.pdf-viewer-frame-wrap {
  border-radius: var(--q-r-md);
  overflow: hidden;
  border: 1px solid rgba(20,27,79,.1);
  box-shadow: var(--q-sh-md);
  background: #525659;
  min-height: 400px;
}

.pdf-viewer-frame {
  display: block;
  width: 100%;
  height: min(78vh,900px);
  min-height: 460px;
  border: 0;
  background: #525659;
}

.pdf-viewer-fallback {
  margin: 12px 0 0;
  font-size: .86rem;
  color: var(--q-muted);
  text-align: center;
}

.pdf-viewer-fallback a { font-weight: 600; color: var(--q-royal); }

/* Responsive */
@media (max-width: 600px) {
  .resource-tiles { grid-template-columns: repeat(2,1fr); }
  .resource-tile { min-height: 4.2rem; padding: 14px 10px; }

  .pdf-chapter-list__item {
    grid-template-columns: 2.2rem minmax(0,1fr);
    padding: 12px 12px;
  }

  .pdf-chapter-list__open-icon { display: none; }
}

/* ── Coming Soon tile ───────────────────────────────── */
.resource-tile--soon {
  cursor: default;
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.resource-tile-soon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(228, 91, 124, 0.85);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
}

.coming-soon-pill {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}
