/* Exam-pattern pages: /patterns/ and /patterns/<topic>/ (tools/build-pattern-pages.py).
   Loaded only by those pages, after style.css, so it can use its variables and the
   light/dark themes without touching the app's stylesheet.

   Partial gate: sections marked .pt-locked are blurred until the browser holds a
   signed-in session (the inline script in each page's head adds .pt-in to <html>).
   The text is in the page source on purpose: it is free content, marked for Google
   with isAccessibleForFree=false, and the gate only asks for a free account. */

.pt-crumbs { margin: 18px 0 0; color: var(--muted); font-size: var(--fs-13); }
.pt-crumbs a { color: var(--muted); }
.pt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.pt-tag { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: var(--fs-12); letter-spacing: .04em; color: var(--muted); background: var(--card); }
.pt-tag.is-key { color: var(--ink); background: rgba(233, 185, 73, .22); border-color: rgba(233, 185, 73, .6); }
.pt-oneline { margin: 22px 0 0; padding: 16px 20px; border-left: 3px solid var(--gold); background: rgba(var(--tint-rgb), .045); border-radius: 0 12px 12px 0; font-family: var(--serif); font-size: var(--fs-18); line-height: 1.5; }
.pt-oneline b { font-weight: 600; }

.pt-short { display: flex; gap: 16px; align-items: center; margin: 22px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-decoration: none; color: inherit; }
.pt-short:hover { border-color: var(--ink); }
.pt-short-thumb { flex: none; width: 54px; height: 96px; border-radius: 10px; background: linear-gradient(160deg, #25314a, #0b1019); display: flex; align-items: center; justify-content: center; }
.pt-short-thumb span { width: 30px; height: 30px; border-radius: 15px; background: var(--gold); display: flex; align-items: center; justify-content: center; color: #1d2637; font-size: 12px; }
.pt-short b { display: block; font-family: var(--serif); font-size: var(--fs-18); font-weight: 600; }
.pt-short small { color: var(--muted); font-size: var(--fs-13); }

.pt-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.pt-item { display: grid; grid-template-columns: 92px 1fr; gap: 6px 16px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.pt-meter { grid-row: span 3; display: flex; flex-direction: column; gap: 6px; }
.pt-meter strong { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.pt-meter strong small { font-size: var(--fs-13); color: var(--muted); font-weight: 400; }
.pt-dots { display: flex; gap: 3px; }
.pt-dots i { width: 11px; height: 11px; border-radius: 3px; background: rgba(var(--tint-rgb), .12); }
.pt-dots i.on { background: var(--gold); }
.pt-item h3 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.35; }
.pt-papers { display: flex; flex-wrap: wrap; gap: 5px; }
.pt-papers span { padding: 1px 7px; border-radius: 6px; font-family: var(--mono); font-size: 11px; background: rgba(var(--tint-rgb), .07); color: var(--ink); }
.pt-watch { margin: 0; color: var(--muted); font-size: var(--fs-14); line-height: 1.5; }
.pt-watch b { color: var(--ink); font-weight: 600; }

.pt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 0; }
.pt-paper { padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.pt-paper header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pt-paper header b { font-family: var(--mono); font-size: var(--fs-13); letter-spacing: .06em; }
.pt-paper header small { color: var(--muted); font-size: var(--fs-12); }
.pt-paper p { margin: 6px 0 8px; font-family: var(--serif); font-size: 15px; line-height: 1.45; }
.pt-paper ul { margin: 0; padding-left: 18px; font-size: var(--fs-14); line-height: 1.5; }
.pt-paper .pt-src { display: block; margin-top: 8px; color: var(--muted); font-size: var(--fs-12); }

.pt-steps { margin: 14px 0 0; padding-left: 0; list-style: none; counter-reset: st; }
.pt-steps li { position: relative; padding: 0 0 14px 44px; counter-increment: st; }
.pt-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 15px; background: var(--banner); color: #fbfaf7; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: var(--fs-13); }
:root[data-theme="dark"] .pt-steps li::before { background: var(--gold); color: #1d2637; }
.pt-steps b { font-weight: 600; }

.pt-cta { margin: 30px 0 0; padding: 20px; border-radius: 14px; background: var(--banner); color: #fbfaf7; }
.pt-cta p { margin: 0 0 14px; font-family: var(--serif); font-size: var(--fs-18); line-height: 1.45; }
.pt-cta .lp-cta { background: var(--gold); color: #1d2637; }
:root[data-theme="dark"] .pt-cta { background: rgba(var(--tint-rgb), .35); border: 1px solid var(--line); }

/* The gate */
.pt-gate { margin: 18px 0 0; padding: 18px 20px; border: 1px solid rgba(233, 185, 73, .7); border-radius: 14px; background: rgba(233, 185, 73, .1); }
.pt-gate p { margin: 0 0 12px; }
.pt-gate b { font-family: var(--serif); font-size: var(--fs-18); font-weight: 600; }
html:not(.pt-in) .pt-locked { filter: blur(5px); user-select: none; pointer-events: none; }
html.pt-in .pt-gate { display: none; }
.pt-unlocked-note { display: none; color: var(--muted); font-size: var(--fs-13); }
html.pt-in .pt-unlocked-note { display: block; }

/* Hub */
.pt-subject { margin: 34px 0 0; }
.pt-subject h2 { margin: 0 0 4px; }
.pt-subject > p { margin: 0; color: var(--muted); font-size: var(--fs-14); }
.pt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.pt-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.pt-card:hover { border-color: var(--ink); }
.pt-card .pt-slot { font-family: var(--mono); font-size: var(--fs-12); letter-spacing: .06em; color: var(--muted); }
.pt-card b { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.pt-card span { font-size: var(--fs-14); color: var(--muted); line-height: 1.45; }
.pt-card em { margin-top: auto; padding-top: 6px; font-style: normal; font-size: var(--fs-13); font-weight: 600; color: var(--accent); }
.pt-card.is-new { border-color: rgba(233, 185, 73, .8); box-shadow: 0 0 0 3px rgba(233, 185, 73, .18); }
.pt-new { align-self: flex-start; padding: 1px 8px; border-radius: 999px; background: var(--gold); color: #1d2637; font-size: 11px; font-weight: 700; letter-spacing: .06em; }

.pt-short:focus-visible, .pt-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 560px) {
  .pt-grid, .pt-cards { grid-template-columns: 1fr; }
  .pt-item { grid-template-columns: 1fr; }
  .pt-meter { grid-row: auto; flex-direction: row; align-items: center; gap: 10px; }
}
