/* Practice questions hub and board index pages.

   These are section landing pages, so they follow the same idiom as
   revision-notes/index.html, past-papers/index.html and the notes board
   index pages: a centred hero, header.major section headings, a grid of
   board buttons, and the green-bordered topic accordion.

   Deliberately WITHOUT the white .notes-container card the notes board
   indexes wrap their list in - the content sits directly on the page
   background here.

   Colours are the root pages' own: #4caf50 green accents, #d52349 brand,
   #f9f9f9 / #f5f5f5 greys, #5d5d5d body text.

   Every rule is nested under .practice-questions-page, the wrapper class on
   <section id="main">, so nothing here can collide with the unscoped rules
   in revision-notes.css or revision-notes-topics.css. */

.practice-questions-page {
  --pq-green: #4caf50; /* borders and rules only - never behind text */
  --pq-green-text: #357a38; /* 4.9:1 on the page, 5.3:1 under white text */
  --pq-green-pale: #a5d6a7;
  --pq-brand: #d52349;
  --pq-body: #5d5d5d;
  --pq-muted: #6b6b6b;
}

/* ------------------------------------------------------------------ hero

   Matches .notes-hero / .papers-hero. */

.practice-questions-page .pq-hero {
  padding: 2em 0 0;
  margin-bottom: 2.5em;
  text-align: center;
}

.practice-questions-page .pq-h1 {
  margin-bottom: 0.4em;
  font-size: 2.4em;
  line-height: 1.2;
}

.practice-questions-page .pq-intro {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1em;
  line-height: 1.7;
  color: var(--pq-body);
}

.practice-questions-page .pq-hero-meta {
  margin: 1.25em 0 0;
  font-size: 0.9em;
  color: var(--pq-muted);
}

/* Board index header, matching .notes-header on the notes board indexes. */

.practice-questions-page .pq-header {
  padding: 2em;
  margin-bottom: 2em;
  text-align: center;
  background: #f9f9f9;
  border-radius: 4px;
}

.practice-questions-page .pq-header header.major {
  margin-bottom: 0;
  padding: 0;
  border: none;
}

/* main.css renders header.major's h1 at body size and italicises its <p>,
   which on the notes board indexes leaves the h1 smaller than the h2s below
   it. Restored here so the heading hierarchy reads correctly. */
.practice-questions-page .pq-header h1 {
  margin-bottom: 0.4em;
  font-size: 2em;
  line-height: 1.2;
}

.practice-questions-page .pq-header p {
  max-width: 760px;
  margin: 0 auto;
  font-style: normal;
  line-height: 1.7;
  color: var(--pq-body);
}

/* ------------------------------------------------------------ breadcrumb */

/* main.css leaves breadcrumb text at #7f888f, which is 3.36:1 on this page's
   #f7f7f7 background - under the 4.5:1 AA floor. Restated at 4.97:1. Link
   colour stays the brand red the notes breadcrumbs use. */
.practice-questions-page .breadcrumb {
  margin-bottom: 2em;
  font-size: 0.9em;
  color: var(--pq-muted);
}

.practice-questions-page .breadcrumb a {
  color: var(--pq-brand);
}

.practice-questions-page .breadcrumb .separator {
  margin: 0 0.4em;
  color: var(--pq-muted);
}

/* -------------------------------------------------------- board sections

   Matches .exam-board-section / .year-section / .subject-buttons on
   revision-notes/index.html. */

.practice-questions-page .pq-board-section {
  margin-bottom: 3em;
}

.practice-questions-page .pq-board-group {
  margin: 2em 0;
}

.practice-questions-page .pq-board-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.practice-questions-page .pq-board-button {
  transition: transform 0.3s ease;
}

.practice-questions-page .pq-board-button:hover {
  transform: translateY(-3px);
}

.practice-questions-page .pq-board-count {
  display: block;
  margin-top: 0.35em;
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
}

.practice-questions-page .pq-note {
  margin: 0 0 1.5em;
  color: var(--pq-body);
}

/* ------------------------------------------------------- topic accordion

   Matches .topic-list / .topic-item / .subtopic-item on the notes board
   indexes, minus the white .notes-container the notes wrap them in. */

.practice-questions-page .topic-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.practice-questions-page .topic-item {
  padding: 1.5em;
  margin-bottom: 1em;
  background: #fff;
  border: 1px solid #ececec;
  border-left: 4px solid var(--pq-green);
  cursor: pointer;
  transition: all 0.3s ease;
}

.practice-questions-page .topic-item:hover {
  background: #f0faf0;
  transform: translateX(5px);
}

.practice-questions-page .topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.practice-questions-page .topic-header h2 {
  margin: 0;
  font-size: 1.35em;
}

.practice-questions-page .topic-item > p {
  margin: 0.5em 0 0;
  font-size: 0.95em;
  color: var(--pq-body);
}

.practice-questions-page .toggle-icon {
  font-size: 1.2em;
  font-weight: bold;
}

/* The heading is a <button> so the panel opens from the keyboard. main.css
   styles every bare <button> as a pink CTA with "color: #fff !important",
   so the inherited heading colour has to be forced back the same way. */
.practice-questions-page .topic-toggle,
.practice-questions-page .topic-toggle:hover,
.practice-questions-page .topic-toggle:active {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit !important;
  text-align: left;
  text-transform: none;
  letter-spacing: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: none;
}

.practice-questions-page .topic-toggle:focus-visible {
  outline: 2px solid var(--pq-green);
  outline-offset: 2px;
}

.practice-questions-page .subtopic-list {
  display: none;
  padding: 0;
  margin-top: 1em;
  list-style: none;
}

.practice-questions-page .subtopic-item {
  padding: 0.8em 1em;
  margin: 0.5em 0;
  background: #f7f7f7;
  border-left: 2px solid var(--pq-green-pale);
  border-radius: 4px;
}

.practice-questions-page .subtopic-item:hover {
  background: #e8f5e9;
}

.practice-questions-page .subtopic-item a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 0.9em;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
}

.practice-questions-page .subtopic-name {
  flex: 1 1 auto;
}

.practice-questions-page .subtopic-meta {
  flex: 0 0 auto;
  font-size: 0.82em;
  color: var(--pq-muted);
}

.practice-questions-page .subtopic-last:empty {
  display: none;
}

.practice-questions-page .subtopic-last {
  flex: 0 0 auto;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--pq-green-text);
}

/* -------------------------------------------------- conversion strip

   Matches .notes-cta-strip on revision-notes/index.html. */

.practice-questions-page .pq-cta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
  justify-content: space-between;
  padding: 1.5em 2em;
  margin: 1em 0 3em;
  background: #f9f9f9;
  border-radius: 4px;
}

.practice-questions-page .pq-cta-strip p {
  flex: 1 1 300px;
  margin: 0;
}

.practice-questions-page .pq-cta-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.8em;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 768px) {
  .practice-questions-page .pq-h1 {
    font-size: 1.9em;
  }

  .practice-questions-page .pq-board-buttons {
    grid-template-columns: 1fr;
  }

  .practice-questions-page .pq-cta-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media screen and (max-width: 736px) {
  .practice-questions-page .topic-header h2 {
    font-size: 1.25em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .practice-questions-page .topic-item,
  .practice-questions-page .pq-board-button {
    transition: none;
  }

  .practice-questions-page .topic-item:hover,
  .practice-questions-page .pq-board-button:hover {
    transform: none;
  }
}
