/* SAT Resources (server/resourcePages.js): the article list and each article. Mobile first;
   the page tokens (--violet, --line, --radius…) come from site.css. */
.resource-skip { position: absolute; top: -100px; left: 16px; z-index: 100; padding: 12px; background: var(--surface); }
.resource-skip:focus { top: 8px; }
.resource-breadcrumb { margin: 20px 0 16px; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.resource-breadcrumb a { color: inherit; }

.sr-hero { padding: 40px 0 16px; }
.sr-hero h1, .sr-article-head h1 { font-family: var(--display); font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.1; letter-spacing: -0.02em; margin: 8px 0 12px; overflow-wrap: break-word; }
.sr-hero .lede, .sr-article-head .lede { font-size: clamp(1.05rem, 2.6vw, 1.2rem); color: var(--muted); max-width: 46rem; margin: 0; }
.sr-list { padding: 8px 0 56px; }
.sr-list-title { font-size: 1.3rem; margin: 0 0 16px; }
.sr-empty { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.sr-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .sr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 980px) { .sr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sr-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.sr-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.sr-card-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-2); }
.sr-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sr-card-body p { margin: 0; color: var(--muted); }
.sr-card-title { font-size: 1.2rem; line-height: 1.3; margin: 0; }
.sr-card-title a { color: var(--ink); text-decoration: none; }
/* The whole card is one tap target, with a single link for screen readers. */
.sr-card-title a::after { content: ""; position: absolute; inset: 0; }
.sr-card-title a:focus-visible { outline: none; }
.sr-card:focus-within { outline: 3px solid var(--violet); outline-offset: 2px; }
.sr-meta { font-size: .88rem; color: var(--muted); margin-top: auto !important; }

.sr-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 0; }
.sr-pager-count { color: var(--muted); font-size: .92rem; }

.sr-cta { display: flex; flex-direction: column; gap: 16px; margin: 40px 0 0; padding: 22px; background: var(--violet-soft); border-radius: var(--radius); }
.sr-cta h2 { font-size: 1.25rem; margin: 0 0 6px; }
.sr-cta p { margin: 0; color: var(--ink); }
.sr-cta .btn { align-self: flex-start; }
@media (min-width: 720px) { .sr-cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 28px 32px; } .sr-cta .btn { align-self: center; flex-shrink: 0; } }

/* ---- one article ---- */
.sr-article { max-width: 760px; padding-bottom: 56px; }
.sr-article-head { margin-bottom: 20px; }
.sr-article-head .sr-meta { margin-top: 14px !important; }
.sr-hero-image { margin: 0 0 24px; }
.sr-hero-image img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--bg-2); }
.sr-toc { margin: 0 0 28px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.sr-toc h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.sr-toc ol { margin: 0; padding-left: 1.2em; }
.sr-toc li { margin: 4px 0; }

.sr-body { font-size: 1.075rem; line-height: 1.7; overflow-wrap: break-word; }
.sr-body > * { margin: 0 0 1.1em; }
.sr-body h2 { font-size: clamp(1.4rem, 4vw, 1.75rem); line-height: 1.25; margin: 1.8em 0 .6em; scroll-margin-top: 16px; }
.sr-body h3 { font-size: 1.25rem; margin: 1.5em 0 .5em; scroll-margin-top: 16px; }
.sr-body h4 { font-size: 1.08rem; margin: 1.3em 0 .4em; scroll-margin-top: 16px; }
.sr-body a { color: var(--violet); text-underline-offset: 2px; }
.sr-body ul, .sr-body ol { padding-left: 1.4em; }
.sr-body li { margin: .3em 0; }
/* Justified article text on tablets and desktops (owner, 2026-11-09), with hyphenation to keep the gaps
   between words even (hyphens: auto needs the page's lang="en"). Phones are left-aligned, in slightly
   smaller type (owner, 2026-11-09, after trying justified phones). */
@media (min-width: 600px) {
  .sr-body p, .sr-body li { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
}
@media (max-width: 599px) {
  .sr-body { font-size: 1rem; line-height: 1.65; }
}
.sr-body blockquote { margin-left: 0; padding: 12px 18px; border-left: 4px solid var(--violet); background: var(--surface); border-radius: 0 12px 12px 0; }
.sr-body blockquote > :last-child { margin-bottom: 0; }
.sr-body code { font-size: .92em; padding: .1em .35em; background: var(--bg-2); border-radius: 6px; }
.sr-body pre { overflow-x: auto; padding: 14px 16px; background: var(--ink); color: #f6f3ee; border-radius: 12px; font-size: .9rem; line-height: 1.5; }
.sr-body pre code { padding: 0; background: none; color: inherit; }
.sr-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.sr-body img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.sr-body figure { margin: 1.5em 0; }
.sr-body figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; text-align: center; }
.sr-body .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sr-body table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sr-body th, .sr-body td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sr-body th { background: var(--bg-2); font-weight: 700; }
.sr-body tr:last-child td { border-bottom: 0; }
/* Phones: three columns in about 360 px, so a little less padding and type, and long words may break. */
@media (max-width: 560px) {
  .sr-body table { font-size: .875rem; }
  .sr-body th, .sr-body td { padding: 8px 9px; -webkit-hyphens: auto; hyphens: auto; }
}

.sr-related { margin-top: 48px; }
.sr-related h2 { font-size: 1.4rem; margin: 0 0 16px; }
.sr-related .sr-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .sr-related .sr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sr-back { margin-top: 32px; }

.sr-preview-bar { position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: var(--sun); color: var(--ink); font-weight: 600; text-align: center; }

.sr-study-planner { margin: 24px 0 32px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sr-study-planner > p:first-child { margin-top: 0; color: var(--muted); }
.sr-planner-fields { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 18px 0; }
.sr-planner-fields label { display: grid; gap: 6px; font-size: .94rem; font-weight: 650; }
.sr-planner-fields input, .sr-planner-fields select { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.sr-planner-fields input:focus-visible, .sr-planner-fields select:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.sr-study-planner form > .btn { min-height: 44px; }
.sr-planner-results { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.sr-planner-results h4 { margin: 0 0 10px; font-size: 1.15rem; }
.sr-planner-score-note { padding: 12px 14px; background: var(--violet-soft); border-radius: 10px; }
.sr-planner-weeks { padding-left: 1.4em; }
.sr-planner-weeks li { padding-left: 4px; margin: 12px 0; }
.sr-planner-weeks li p { margin: 5px 0 0; }
.sr-planner-note { margin: 14px 0 0; color: var(--muted); font-size: .92rem; }
@media (min-width: 640px) { .sr-study-planner { padding: 26px; } .sr-planner-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) { .sr-card, .sr-card:hover { transition: none; transform: none; } }
@media print { .sr-cta, .sr-related, .sr-toc, .site-header, .site-footer, .sr-preview-bar { display: none; } }

/* Bilingual articles: English / Tiếng Việt toggle (site/assets/sr-lang.js) */
.sr-lang-toggle { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.sr-lang-toggle[hidden], .sr-lang[hidden], .sr-toc[hidden] { display: none; }
.sr-lang-toggle button { font: inherit; font-weight: 600; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.sr-lang-toggle button[aria-pressed="true"] { background: var(--teal, #0d9488); color: #fff; }
.sr-lang-toggle button:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
