/* AplusGen — Resources page sections */

/* ============================================================
   1. Hero
   ============================================================ */
.rhero { position: relative; overflow: hidden; }
.rhero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.22fr) minmax(0, 1fr);
  align-items: center;
}
.rhero__copy {
  grid-area: 1 / 1 / 2 / 3;
  position: relative;
  z-index: 2;
  padding: var(--sp-12) 0 var(--sp-12)
           max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
}
.rhero__title { font-size: var(--fs-hero); font-weight: 700; letter-spacing: -0.015em; }
.rhero__lead { margin-top: var(--sp-4); max-width: 44ch; color: var(--muted); font-size: var(--fs-lead); }

.rhero__media {
  grid-area: 1 / 2 / 2 / 4;
  position: relative;
  align-self: stretch;
  min-height: 340px;
  /* Pull the image toward the copy by roughly one category-card width, while
     keeping its right edge aligned with the shared 1200px content boundary. */
  margin-left: clamp(-190px, -13vw, -150px);
  margin-right: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  z-index: 1;
  overflow: hidden;
  background-image: url("../../assets/img/Resources/resources-hero.webp");
  background-repeat: no-repeat;
  /* Crop the source's large empty left side so the laptop sits closer to the
     headline and the books no longer stretch the composition outward. */
  background-position: right center;
  background-size: 118% auto;
}
.rhero__media::before {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(97deg,
    #fff 0%, rgba(255,255,255,0.98) 18%, rgba(255,255,255,0.7) 32%, rgba(255,255,255,0) 52%);
}

/* ============================================================
   2. Category filter
   ============================================================ */
/* Six across, as the mock has it. Measured there at 156px per card at 1024
   wide, which is 183px here — so they only fit if the padding and the icon
   come down with them. */
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); }
.filter {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: 10px 12px;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--muted);
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
/* Smaller than the shared --sm badge; 42px would eat a third of the card. */
.filter .ibadge { width: 32px; height: 32px; }
.filter .ibadge svg { width: 16px; height: 16px; }
.filter b { display: block; font-size: var(--fs-xs); color: var(--navy); font-weight: 700; }
.filter:hover { border-color: #c8d3e4; }
.filter.is-active { border-color: var(--blue-ink); background: var(--tint-blue); }
.filter.is-active b { color: var(--blue-ink); }

.filters__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   3. Expandable resource previews
   ============================================================ */
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.group {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  scroll-margin-top: calc(var(--header-h) + var(--sp-4));
}
.group[hidden] { display: none; }
.group[data-group="practice"] { grid-column: 1 / -1; }
.group__head { margin-bottom: var(--sp-4); }
.group__title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
  color: var(--navy);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.group__title span {
  color: var(--orange-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.group__sub { margin-top: 4px; color: var(--muted); font-size: var(--fs-sm); }
.group__empty {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 84px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--bg-tint);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.group__empty svg {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--blue-ink);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}
.resource-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fff 0%, var(--bg-tint) 100%);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.resource-card:hover {
  border-color: #c8d3e4;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.resource-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.resource-card__grade {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--blue-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.resource-card__title {
  color: var(--navy);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.35;
}
.resource-card__meta {
  margin-top: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.resource-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.resource-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding-inline: var(--sp-3);
  border-radius: var(--r-pill);
  color: var(--blue-ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.resource-card__link:hover {
  background: var(--tint-blue);
  text-decoration: none;
}
.resource-card__link svg { width: 17px; height: 17px; }

.parent-guide { min-width: 0; }
.parent-guide__title {
  color: var(--navy);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
}
.parent-guide__description {
  margin: var(--sp-2) 0 var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.video-cover {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--navy);
}
.video-cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.video-cover__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-pill);
  background: rgba(11, 42, 91, 0.88);
  color: #fff;
  transform: translate(-50%, -50%);
}
.video-cover__play svg { width: 24px; height: 24px; }
.video-cover:hover .video-cover__play,
.video-card:hover .video-cover__play { background: var(--blue-ink); }
.parent-guide__link { margin-top: var(--sp-3); }

.group--videos { grid-column: 1 / -1; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}
.video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--navy);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.video-card:hover {
  border-color: var(--blue-ink);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.video-card__media { border-radius: 0; }
.video-card__body { padding: var(--sp-4); }
.video-card__title { font-size: var(--fs-body); font-weight: 600; line-height: 1.4; }
.video-card__action {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  color: var(--blue-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.video-card__action svg { width: 16px; height: 16px; }
@media (max-width: 768px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   4. Topics
   ============================================================ */
.topics { padding: var(--sp-6); background: var(--bg-tint); border-radius: var(--r-lg); }
.topics__title { font-size: var(--fs-h3); font-weight: 600; }
.topics__sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.topics__list { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-4); }
.topic {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  color: var(--navy);
}
/* Inert on purpose: these are labels, not controls, until D-08 lands. Rendering
   them as buttons would promise filtering that does not exist. */
.topic i {
  font-style: normal;
  font-weight: 700;
  color: var(--blue-ink);
  font-family: var(--font-head);
}
/* ============================================================
   5. Quality strip
   ============================================================ */
.quality { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.quality__item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.quality__item + .quality__item { border-left: 1px solid var(--line); padding-left: var(--sp-6); }
.quality h3 { font-size: var(--fs-sm); font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.quality p { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }

/* ============================================================
   6. CTA + newsletter
   ============================================================ */
.rcta {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-8);
  align-items: center;
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, #10419e, #1554d1 60%, #1668e3);
  color: #fff;
}
.rcta__title { color: #fff; font-size: var(--fs-h2-sm); font-weight: 600; }
.rcta__text { margin-top: var(--sp-3); color: #e3ecff; font-size: var(--fs-sm); max-width: 44ch; }
.rcta__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }
.rcta .btn--white { background: #fff; color: var(--navy); }
.rcta .btn--white:hover { background: #e9f0ff; }
.rcta :focus-visible { outline-color: #fff; }

.rcta__news { padding: var(--sp-6); color: var(--ink); }
.rcta__news-title { font-size: var(--fs-h3); font-weight: 600; color: var(--navy); }
.rcta__news-title span { color: var(--orange-ink); font-size: var(--fs-sm); }
.rcta__news-text { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-2); }
.rcta__news .form { margin-top: var(--sp-4); }
.rcta__news .btn { width: 100%; }
.rcta__news-foot { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-3); }
.news .field { margin-bottom: var(--sp-3); }
.news .field label {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.news input[type="email"] {
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit;
}
.news input[type="email"]:focus {
  outline: none;
  border-color: var(--blue-ink);
  box-shadow: 0 0 0 3px rgba(19, 84, 189, 0.16);
}
.news .field__err { margin-top: 5px; color: #a51b1b; font-size: var(--fs-xs); font-weight: 600; }
.news .form__status { margin-bottom: var(--sp-3); font-size: var(--fs-sm); }
.news .form__status:empty { margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .groups { grid-template-columns: 1fr; }
  .quality { grid-template-columns: 1fr; gap: var(--sp-4); }
  .quality__item + .quality__item { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
  .rhero__grid { grid-template-columns: 1fr; }
  .rhero__copy { grid-area: auto; padding: var(--sp-8) var(--gutter) var(--sp-6); }
  .rhero__lead { max-width: none; }
  .rhero__media {
    grid-area: auto;
    min-height: 240px;
    margin-inline: 0;
  }
  .rhero__media { background-position: 62% center; background-size: cover; }
  .rhero__media::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 22%);
  }
  .rcta { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filter { gap: 6px; padding-inline: 8px; }
  .filter .ibadge { width: 28px; height: 28px; }
  .filter .ibadge svg { width: 14px; height: 14px; }
  .topics, .rcta { padding: var(--sp-6); }
  .rcta__actions .btn { width: 100%; }
}
