/* ─── ClearExamPapers public-site stylesheet ──────────────────────────────
 *
 * Mobile-first, no framework, ~200 lines. Phase 1 baseline — the design is
 * intentionally plain so phase 4 can polish without fighting existing styles.
 *
 * Design goals:
 *   - Readable on any device down to 320px wide
 *   - Fast (single CSS file, no external fonts, no JS-dependent styles)
 *   - Trustworthy-looking rather than flashy (per §1.5 positioning)
 *   - Ad placeholder zones are visually obvious slots, not hidden — so when
 *     AdSense launches, it inherits a container that's already sized.
 * ─────────────────────────────────────────────────────────────────────── */

/* ── Reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #1c1c1c;
  background: #fafafa;
}

h1, h2, h3 { line-height: 1.25; margin-top: 1.5em; margin-bottom: 0.5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em 0; }

a { color: #1a4fa0; text-decoration: underline; }
a:hover { color: #0d2d66; }

ul { padding-left: 1.5em; }
li { margin: 0.25em 0; }

em { color: #555; font-style: italic; }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e4e4e4;
  padding: 0.8rem 1rem;
}

.site-header__inner {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo {
  color: #1c1c1c;
  text-decoration: none;
  font-size: 1.2rem;
}
.site-header__logo:hover { color: #1a4fa0; }

.site-header__search {
  display: flex;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 220px;
}
.site-header__search input[type="search"] {
  flex: 1;
  padding: 0.45rem 0.7rem;
  font-size: 1rem;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
}
.site-header__search button {
  padding: 0.45rem 0.9rem;
  font-size: 0.95rem;
  border: 1px solid #1a4fa0;
  background: #1a4fa0;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.site-header__search button:hover { background: #0d2d66; }

/* ── Main content area ────────────────────────────────────────────────── */
.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ── Homepage hero ────────────────────────────────────────────────────── */
.hero {
  padding: 2rem 0;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 1.9rem;
  margin-top: 0;
}
.hero__subhead {
  max-width: 560px;
  margin: 1rem auto;
  color: #444;
}
.hero__cta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.hero__trust {
  color: #666;
  font-size: 0.92rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary {
  background: #1a4fa0;
  color: #fff;
  border-color: #1a4fa0;
}
.btn--primary:hover { background: #0d2d66; border-color: #0d2d66; color: #fff; }
.btn--secondary {
  background: #fff;
  color: #1a4fa0;
  border-color: #1a4fa0;
}
.btn--secondary:hover { background: #eef3fb; color: #0d2d66; }

/* ── Stub / notice block (phase 1 only — removed in phase 4) ──────────── */
.phase1-notice {
  background: #fff7e1;
  border: 1px solid #f0d377;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  color: #4a3c0a;
  margin: 1.5rem 0;
}
.phase1-notice h2 { margin-top: 0; color: #4a3c0a; }

/* ── Legal / contact pages ────────────────────────────────────────────── */
.legal-page { max-width: 680px; }
.legal-page h1 { font-size: 1.6rem; }
.legal-page h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal-meta { color: #777; font-size: 0.9rem; }

/* ── Ad placeholder zones ─────────────────────────────────────────────── *
 * Kept visible but minimal so phase 7+ AdSense inherits a predictable
 * container. We label them clearly per AdSense policy (§11.4) so there's
 * no risk of a download-button-lookalike.                                */
.ad-slot {
  background: #f0f0f0;
  border: 1px dashed #bbb;
  text-align: center;
  padding: 0.75rem;
  margin: 1rem auto;
  max-width: 900px;
  min-height: 90px;
  color: #777;
  font-size: 0.85rem;
  position: relative;
}
.ad-slot__label {
  position: absolute;
  top: 4px;
  left: 8px;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: #888;
}
.ad-slot--top { margin-top: 0; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: #2a2a2a;
  color: #cfcfcf;
  padding: 1.5rem 1rem 2rem;
  margin-top: 3rem;
  font-size: 0.92rem;
}
.site-footer__inner {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  text-align: center;
}
.site-footer a { color: #9bc1ff; }
.site-footer a:hover { color: #cfe0ff; }

.site-footer__tagline { margin: 0; color: #eee; font-weight: 500; }

.site-footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
}

.site-footer__feedback { margin: 0; color: #bbb; font-size: 0.88rem; }

/* ── Responsive tweaks ────────────────────────────────────────────────── */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.4rem; }
  .site-header__inner { flex-wrap: nowrap; }
  .site-footer__inner { gap: 0.9rem; }
}

/* ── Phase 2: level cards, latest, browse, paper detail ───────────────── */

.muted { color: #777; }

.phase-notice {
  margin-top: 3rem;
  padding: 0.8rem 1rem;
  background: #f3f3f3;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}

/* Level cards on homepage */
.level-cards { margin-top: 2rem; }
.level-cards h2 { margin-bottom: 0.3rem; }
.level-cards__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
.level-card {
  display: block;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  color: #1c1c1c;
  font-weight: 500;
}
.level-card:hover {
  background: #eef3fb;
  border-color: #1a4fa0;
  color: #1a4fa0;
}

@media (min-width: 480px) {
  .level-cards__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) {
  .level-cards__grid { grid-template-columns: repeat(6, 1fr); }
}

/* Paper list — used on homepage latest, browse results, related */
.paper-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.paper-list__item {
  margin: 0;
  border-bottom: 1px solid #eaeaea;
}
.paper-list__item:last-child { border-bottom: none; }
.paper-list__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding: 0.7rem 0.5rem;
  text-decoration: none;
  color: #1c1c1c;
}
.paper-list__link:hover {
  background: #f3f7fc;
  color: #1a4fa0;
}
.paper-list__title { font-weight: 500; flex: 1 1 auto; }
.paper-list__meta { color: #777; font-size: 0.88rem; flex: 0 0 auto; }

/* Browse filters */
.browse__filters {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
}
.browse__filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
}
.browse__filter-row + .browse__filter-row { margin-top: 0.8rem; }
.browse__filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 130px;
  min-width: 130px;
}
.browse__filter > span {
  font-size: 0.83rem;
  color: #555;
  font-weight: 500;
}
.browse__filter select,
.browse__filter input[type="search"] {
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fff;
}
.browse__filter--search { flex: 1 1 240px; }

.browse__active {
  margin: 0.8rem 0;
  font-size: 0.9rem;
  color: #555;
}
.browse__active-label { margin-right: 0.4rem; font-weight: 500; }
.browse__chip {
  display: inline-block;
  background: #eef3fb;
  border: 1px solid #c4d3ec;
  color: #1a4fa0;
  padding: 0.15rem 0.55rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  border-radius: 12px;
  font-size: 0.85rem;
}

.browse__count { color: #555; margin: 1rem 0; }

.browse__pagination {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.browse__pagination-info { color: #555; font-size: 0.92rem; }

/* Paper detail */
.paper-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 1.2rem;
}
.chip {
  display: inline-block;
  background: #f1f1f1;
  border: 1px solid #d4d4d4;
  color: #333;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
}
.paper-detail__cta {
  background: #fff;
  border: 1px solid #c4d3ec;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1rem 0 2rem;
  text-align: center;
}
.btn--download { font-size: 1.05rem; padding: 0.75rem 1.5rem; }
.paper-detail__trust {
  margin: 0.8rem 0 0 0;
  color: #555;
  font-size: 0.92rem;
}
.paper-detail__about p { color: #444; }
.paper-detail__related { margin-top: 2rem; }
.paper-detail__back { margin-top: 2rem; color: #555; font-size: 0.92rem; }

/* ── Phase 3: paper preview thumbnail ──────────────────────────────────── */

.paper-detail__preview {
  margin: 2rem 0;
  text-align: center;
}
.paper-detail__preview h2 {
  margin-bottom: 0.5rem;
}
.paper-detail__preview-img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  background: #fff;
  padding: 8px;
  /* Subtle shadow so the page "lifts" off the background */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-top: 0.6rem;
}

/* ── Phase 4: homepage redesign ───────────────────────────────────────── */

/* Hero with side-by-side copy + image (stacks on mobile) */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
  align-items: center;
}
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    margin: 2rem 0 3rem;
  }
}
.hero__copy h1 {
  margin: 0 0 0.6rem 0;
  line-height: 1.15;
}
.hero__subhead {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 1rem;
}
.hero__cta-row { margin-top: 1.2rem; }
.hero__cta-row .btn { margin-right: 0.5rem; }
.hero__trust {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  color: #666;
}
.hero__visual {
  text-align: center;
}
.hero__image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Value-prop grid */
.value-props {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid #eaeaea;
  border-bottom: 1px solid #eaeaea;
}
.value-props h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}
.value-props__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 700px) {
  .value-props__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}
.value-prop h3 {
  margin: 0 0 0.4rem 0;
  color: #1a4fa0;
  font-size: 1.05rem;
}
.value-prop p {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
}

/* Latest section CTA */
.latest__cta {
  margin-top: 1.2rem;
  text-align: center;
}

/* FAQ */
.faq {
  margin: 3rem 0;
}
.faq h2 {
  margin-bottom: 1rem;
}
.faq__item {
  padding: 1rem 0;
  border-bottom: 1px solid #eaeaea;
}
.faq__item:last-child {
  border-bottom: none;
}
.faq__item h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.02rem;
  color: #1c1c1c;
}
.faq__item p {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
}

/* ── Phase 4: error pages ────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 3rem 1rem;
  max-width: 540px;
  margin: 0 auto;
}
.error-page h1 {
  margin: 0 0 0.5rem 0;
}
.error-page__lead {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
}
.error-page__actions {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}
.error-page__actions li {
  margin: 0.4rem 0;
}
