/* =====================================================================
   ReadingNova – Home page (Phase 2). Only used by index.html.
   All classes start with rh- so nothing in styles.css can clash.
   Colours come from rn-theme.css (--rn-*).
   ===================================================================== */

.rh { font-family: var(--rn-font-body); color: var(--rn-navy); background: #FFFFFF; }
.rh h1, .rh h2, .rh h3 { font-family: var(--rn-font-head); color: var(--rn-navy); }
.rh-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.rh-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rh a { -webkit-tap-highlight-color: transparent; }
.rh a:focus-visible, .rh button:focus-visible, .rh input:focus-visible, .rh summary:focus-visible { outline: 3px solid var(--rn-indigo); outline-offset: 2px; }

.rh-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.rh-head h2 { margin: 0; font-weight: 700; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; }
.rh-head p { margin: 0; font-size: 16px; color: var(--rn-body); line-height: 1.6; }

/* ---------- Hero ---------- */
.rh-hero { background: #E8F6FF; padding-top: calc(var(--rn-h) + 40px); position: relative; overflow: hidden; }
.rh-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; padding-bottom: 32px; }
.rh-hero__text { display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 2; min-width: 0; }
.rh-pill {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 0;
    background: #FFFFFF; color: var(--rn-indigo-deep); font-weight: 600; font-size: 13px;
    padding: 8px 14px; border-radius: 999px; border: 2px solid var(--rn-indigo-tint);
}
.rh-eyebrow { margin: 4px 0 -8px; font-family: var(--rn-font-head); font-weight: 600; font-size: 18px; color: var(--rn-indigo-deep); }
.rh-title { margin: 0; font-weight: 700; font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.5px; }
.rh-c1 { color: var(--rn-red); } .rh-c2 { color: var(--rn-orange); } .rh-c3 { color: #EAB308; } .rh-c4 { color: var(--rn-green); }
.rh-lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--rn-body); max-width: 540px; }

.rh-search {
    position: relative; display: flex; align-items: center; gap: 8px; max-width: 560px;
    background: #FFFFFF; border: 3px solid var(--rn-navy); border-radius: 999px;
    padding: 5px 5px 5px 18px; box-shadow: 0 6px 0 var(--rn-navy); margin-top: 4px;
}
.rh-search__icon { color: var(--rn-muted); flex-shrink: 0; }
.rh-search input {
    flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent;
    font-family: var(--rn-font-body); font-size: 16px; color: var(--rn-navy);
}
.rh-search input::-webkit-search-cancel-button { cursor: pointer; }
.rh-search button {
    height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--rn-orange); color: #FFFFFF; font-family: var(--rn-font-head); font-weight: 600; font-size: 17px;
}
.rh-search button:hover { background: var(--rn-orange-deep); }

/* Search results panel */
.rh-results {
    max-width: 560px; background: #FFFFFF; border-radius: 20px; border: 2px solid var(--rn-line);
    box-shadow: 0 14px 30px rgba(30, 42, 74, .12); padding: 12px; margin-top: 6px;
    max-height: 420px; overflow-y: auto;
}
.rh-results[hidden] { display: none; }
.rh-results__summary { margin: 2px 6px 8px; font-size: 13px; color: var(--rn-muted); }
.rh-results__group { padding: 6px 0; border-top: 1px solid #F0F1F6; }
.rh-results__group:first-of-type { border-top: 0; }
.rh-results__head { display: flex; align-items: center; gap: 8px; margin: 2px 6px 4px; font-family: var(--rn-font-head); font-weight: 600; font-size: 15px; }
.rh-results__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rh-results a { display: flex; justify-content: space-between; gap: 10px; min-height: 40px; align-items: center; padding: 6px 10px; border-radius: 10px; color: var(--rn-navy); text-decoration: none; font-size: 14px; }
.rh-results a:hover { background: var(--rn-cloud); }
.rh-results a small { color: var(--rn-muted); font-size: 12px; white-space: nowrap; }
.rh-results__all { font-weight: 600; }
.rh-results__empty { margin: 8px 6px; font-size: 14px; color: var(--rn-body); }

.rh-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rh-chips__label { font-size: 13px; color: var(--rn-muted); margin-right: 2px; }
.rh-chip { display: inline-flex; align-items: center; min-height: 36px; font-size: 13px; font-weight: 600; text-decoration: none; padding: 0 14px; border-radius: 999px; border: 2px solid transparent; }
.rh-chip:hover { border-color: currentColor; background: #FFFFFF; }
.rh-chip--orange { background: var(--rn-orange-tint); color: var(--rn-orange-deep); }
.rh-chip--violet { background: var(--rn-violet-tint); color: var(--rn-violet-deep); }
.rh-chip--blue   { background: var(--rn-blue-tint);   color: var(--rn-blue-deep); }
.rh-chip--indigo { background: var(--rn-indigo-tint); color: var(--rn-indigo-deep); }
.rh-chip--green  { background: var(--rn-green-tint);  color: var(--rn-green-deep); }

.rh-hero__art { min-width: 0; position: relative; z-index: 1; }
.rh-hero__art svg { display: block; width: 100%; height: auto; }
.rh-wave { display: block; width: 100%; height: 40px; margin-top: -2px; }

/* Gentle animation (switched off for people who prefer less motion) */
.rh-float { animation: rhFloat 3.2s ease-in-out infinite; }
.rh-drift { animation: rhDrift 9s ease-in-out infinite; }
.rh-twinkle { animation: rhTwinkle 2.4s ease-in-out infinite; }
.rh-twinkle--2 { animation-duration: 2s; animation-delay: .6s; }
.rh-twinkle--3 { animation-duration: 3s; animation-delay: 1.1s; }
@keyframes rhFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes rhDrift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(18px); } }
@keyframes rhTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
    .rh-float, .rh-drift, .rh-twinkle { animation: none; }
    .rh-tile, .rh-age, .rh-cta__btn { transition: none; }
}

/* ---------- Stats ---------- */
.rh-stats { padding: 8px 0 28px; }
.rh-stats__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.rh-stat { border-radius: 20px; padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; }
.rh-stat__num { font-family: var(--rn-font-head); font-weight: 700; font-size: 34px; line-height: 1.1; }
.rh-stat__label { font-size: 14px; font-weight: 500; color: var(--rn-navy); }
.rh-stat--orange { background: var(--rn-orange-tint); } .rh-stat--orange .rh-stat__num { color: var(--rn-orange-deep); }
.rh-stat--blue   { background: var(--rn-blue-tint); }   .rh-stat--blue .rh-stat__num   { color: var(--rn-blue-deep); }
.rh-stat--green  { background: var(--rn-green-tint); }  .rh-stat--green .rh-stat__num  { color: var(--rn-green-deep); }
.rh-stat--violet { background: var(--rn-violet-tint); } .rh-stat--violet .rh-stat__num { color: var(--rn-violet-deep); }
.rh-stat--red    { background: var(--rn-red-tint); }    .rh-stat--red .rh-stat__num    { color: var(--rn-red-deep); }

/* ---------- Explore tiles ---------- */
.rh-explore { padding: 48px 0 60px; background: var(--rn-cloud); }
.rh-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rh-tile {
    --c: var(--rn-navy); --cd: var(--rn-navy); --ct: var(--rn-cloud); --on: #FFFFFF;
    background: #FFFFFF; border-radius: 22px; border: 2px solid var(--ct); overflow: hidden;
    display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.rh-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30, 42, 74, .12); }
.rh-tile--red    { --c: var(--rn-red);    --cd: var(--rn-red-deep);    --ct: var(--rn-red-tint); }
.rh-tile--orange { --c: var(--rn-orange); --cd: var(--rn-orange-deep); --ct: var(--rn-orange-tint); }
.rh-tile--yellow { --c: var(--rn-yellow); --cd: var(--rn-yellow-deep); --ct: var(--rn-yellow-tint); --on: var(--rn-navy); }
.rh-tile--green  { --c: var(--rn-green);  --cd: var(--rn-green-deep);  --ct: var(--rn-green-tint);  --on: var(--rn-navy); }
.rh-tile--blue   { --c: var(--rn-blue);   --cd: var(--rn-blue-deep);   --ct: var(--rn-blue-tint);   --on: var(--rn-navy); }
.rh-tile--indigo { --c: var(--rn-indigo); --cd: var(--rn-indigo-deep); --ct: var(--rn-indigo-tint); }
.rh-tile--violet { --c: var(--rn-violet); --cd: var(--rn-violet-deep); --ct: var(--rn-violet-tint); }
.rh-tile--navy   { --c: var(--rn-navy);   --cd: var(--rn-navy);        --ct: var(--rn-navy); }

.rh-tile__top { background: var(--c); color: var(--on); padding: 18px 20px; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.rh-tile__icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; transform: rotate(-5deg); }
.rh-tile:nth-child(even) .rh-tile__icon { transform: rotate(5deg); }
.rh-tile__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--cd); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rh-tile--navy .rh-tile__icon { background: var(--rn-gold); }
.rh-tile__name { display: flex; flex-direction: column; min-width: 0; }
.rh-tile__title { font-family: var(--rn-font-head); font-weight: 600; font-size: 22px; line-height: 1.15; }
.rh-tile__sub { font-size: 13px; }
.rh-tile__rows { list-style: none; margin: 0; padding: 10px 12px 0; display: flex; flex-direction: column; gap: 2px; }
.rh-tile__rows a { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 40px; padding: 0 8px; border-radius: 10px; text-decoration: none; font-size: 14px; color: var(--rn-navy); }
.rh-tile__rows a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-tile__rows a b { color: var(--cd); font-weight: 600; white-space: nowrap; }
.rh-tile__rows a:hover { background: var(--ct); }
.rh-tile__all { margin: 6px 20px 18px; font-size: 14px; font-weight: 600; color: var(--cd); text-decoration: none; }
.rh-tile__all:hover { text-decoration: underline; text-underline-offset: 3px; }
.rh-tile__body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.rh-tile__body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--rn-body); }
.rh-tile__btn { margin-top: auto; align-self: flex-start; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--ct); color: var(--cd); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; }
.rh-tile__btn:hover { background: var(--c); color: var(--on); }
.rh-tile--navy { background: var(--rn-navy); }
.rh-tile--navy .rh-tile__body p { color: #D6DAE6; }
.rh-tile--navy .rh-tile__btn { background: var(--rn-gold); color: var(--rn-navy); }
.rh-tile__soon { margin-top: auto; align-self: flex-start; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ct); color: var(--cd); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; }

/* ---------- Ages ---------- */
.rh-ages { padding: 56px 0; }
.rh-ages__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rh-age { border-radius: 28px; padding: 24px; display: flex; gap: 18px; align-items: center; border: 2px solid; }
.rh-age--orange { background: #FFF4E6; border-color: var(--rn-orange-tint); --a: var(--rn-orange); --ad: var(--rn-orange-deep); }
.rh-age--green  { background: #EEF9F1; border-color: var(--rn-green-tint);  --a: #16A34A;         --ad: var(--rn-green-deep); }
.rh-age--indigo { background: #F0F1FF; border-color: var(--rn-indigo-tint); --a: var(--rn-indigo); --ad: var(--rn-indigo-deep); }
.rh-age__badge { width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; background: var(--a); color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--rn-font-head); font-size: 13px; font-weight: 500; line-height: 1.05; }
.rh-age__badge b { font-size: 28px; font-weight: 700; }
.rh-age__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rh-age__title { font-family: var(--rn-font-head); font-weight: 600; font-size: 22px; }
.rh-age__desc { font-size: 14px; color: var(--rn-body); line-height: 1.5; }
.rh-age__count { font-size: 14px; font-weight: 600; color: var(--ad); }
/* Phase 3: age cards link to the colouring pages filtered by age */
a.rh-age { color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
a.rh-age:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30, 42, 74, .12); }
a.rh-age:focus-visible { outline: 3px solid var(--rn-indigo); outline-offset: 3px; }
.rh-age__go { font-size: 13px; font-weight: 600; color: var(--ad); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { a.rh-age { transition: none; } a.rh-age:hover { transform: none; } }

/* ---------- Why ---------- */
.rh-why { padding: 56px 0; background: var(--rn-cloud); }
.rh-why__title { margin: 0 0 28px; text-align: center; font-weight: 700; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; }
.rh-why__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rh-why__item { background: #FFFFFF; border-radius: 22px; padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.rh-why__item h3 { margin: 0; font-weight: 600; font-size: 20px; }
.rh-why__item p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--rn-body); }
.rh-why__icon { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.rh-why__icon svg { width: 30px; height: 30px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rh-why__icon--red    { background: var(--rn-red-tint); }    .rh-why__icon--red svg    { stroke: var(--rn-red-deep); }
.rh-why__icon--orange { background: var(--rn-orange-tint); } .rh-why__icon--orange svg { stroke: var(--rn-orange-deep); }
.rh-why__icon--green  { background: var(--rn-green-tint); }  .rh-why__icon--green svg  { stroke: var(--rn-green-deep); }
.rh-why__icon--indigo { background: var(--rn-indigo-tint); } .rh-why__icon--indigo svg { stroke: var(--rn-indigo-deep); }

/* ---------- Nova CTA ---------- */
.rh-cta-wrap { padding: 56px 0 24px; }
.rh-cta { background: var(--rn-indigo); border-radius: 32px; padding: 36px 44px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.rh-cta__nova { width: 132px; height: 132px; flex-shrink: 0; }
.rh-cta__text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.rh-cta__text h2 { margin: 0; color: #FFFFFF; font-weight: 700; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; }
.rh-cta__text p { margin: 0; color: #E0E7FF; font-size: 16px; line-height: 1.6; }
.rh-cta__btn { min-height: 56px; padding: 0 28px; border-radius: 999px; background: var(--rn-gold); color: var(--rn-navy); font-family: var(--rn-font-head); font-weight: 600; font-size: 19px; display: inline-flex; align-items: center; text-decoration: none; box-shadow: 0 5px 0 #B45309; transition: transform .15s ease, box-shadow .15s ease; }
.rh-cta__btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #B45309; }
.rh-cta__btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #B45309; }

/* ---------- About ---------- */
.rh-about { padding: 40px 0 24px; }
.rh-about__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.rh-about__text h2 { margin: 0 0 14px; font-weight: 700; font-size: clamp(26px, 3vw, 34px); }
.rh-about__text p { margin: 0 0 12px; font-size: 15px; line-height: 1.75; color: var(--rn-body); }
.rh-about__logo { display: flex; justify-content: center; }
.rh-about__logo img { width: 100%; max-width: 320px; height: auto; }

/* ---------- FAQ ---------- */
.rh-faq { padding: 32px 0 64px; }
.rh-faq h2 { margin: 0 0 22px; font-weight: 700; font-size: clamp(24px, 3vw, 34px); }
.rh-faq__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.rh-faq details { background: var(--rn-cloud); border-radius: 18px; padding: 0 20px; border: 2px solid transparent; }
.rh-faq details[open] { border-color: var(--rn-indigo-tint); background: #FFFFFF; }
.rh-faq summary { list-style: none; cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 16px; }
.rh-faq summary::-webkit-details-marker { display: none; }
.rh-faq summary::after { content: "+"; font-family: var(--rn-font-head); font-size: 24px; color: var(--rn-indigo); flex-shrink: 0; }
.rh-faq details[open] summary::after { content: "–"; }
.rh-faq details p { margin: 0 0 18px; font-size: 14px; line-height: 1.65; color: var(--rn-body); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .rh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rh-why__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rh-ages__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .rh-stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rh-stat--users { grid-column: 1 / -1; }
    .rh-hero { padding-top: calc(var(--rn-h) + 16px); }
    .rh-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .rh-hero__art { order: -1; max-width: 420px; margin: 0 auto; width: 100%; }
    .rh-hero__text { align-items: center; text-align: center; }
    .rh-eyebrow { margin-bottom: -6px; }
    .rh-search, .rh-results { width: 100%; max-width: 560px; align-self: stretch; margin-left: auto; margin-right: auto; text-align: left; }
    .rh-chips { justify-content: center; }
    .rh-about__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .rh-about__logo { order: -1; }
    .rh-about__logo img { max-width: 220px; }
    .rh-faq__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .rh-wrap { padding: 0 16px; }
    .rh-pill { align-self: center; font-size: 12px; }
    .rh-lead { font-size: 16px; }
    .rh-search { padding-left: 14px; }
    .rh-search__icon { display: none; }
    .rh-search button { padding: 0 18px; font-size: 16px; }
    .rh-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
    .rh-chips::-webkit-scrollbar { display: none; }
    .rh-chip, .rh-chips__label { flex-shrink: 0; }
    .rh-stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rh-stat--users { grid-column: 1 / -1; } /* 5 tiles: the users tile runs full width on top */
    .rh-stat { padding: 14px 16px; border-radius: 18px; }
    .rh-stat__num { font-size: 26px; }
    .rh-stat__label { font-size: 12px; }

    /* Tiles become app-like colour buttons (two per row) */
    .rh-explore { padding: 32px 0 40px; }
    .rh-tiles { gap: 10px; }
    .rh-tile { border: 0; border-radius: 20px; background: var(--c); }
    .rh-tile:hover { transform: none; box-shadow: none; }
    .rh-tile__top { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 120px; box-sizing: border-box; height: 100%; }
    .rh-tile__icon { width: 40px; height: 40px; border-radius: 12px; transform: none !important; }
    .rh-tile__icon svg { width: 22px; height: 22px; }
    .rh-tile__title { font-size: 18px; }
    .rh-tile__sub { font-size: 12px; }
    .rh-tile__rows, .rh-tile__all, .rh-tile__body { display: none; }

    .rh-ages, .rh-why, .rh-cta-wrap { padding: 32px 0; }
    .rh-age { padding: 14px; gap: 14px; border-radius: 22px; }
    .rh-age__badge { width: 64px; height: 64px; font-size: 11px; }
    .rh-age__badge b { font-size: 22px; }
    .rh-age__title { font-size: 18px; }
    .rh-age__desc { display: none; }
    .rh-why__grid { gap: 10px; }
    .rh-why__item { padding: 16px 12px; border-radius: 18px; }
    .rh-why__icon { width: 46px; height: 46px; border-radius: 14px; }
    .rh-why__icon svg { width: 24px; height: 24px; }
    .rh-why__item h3 { font-size: 16px; }
    .rh-why__item p { font-size: 12px; }
    .rh-cta { padding: 24px 20px; border-radius: 28px; flex-direction: column; text-align: center; gap: 12px; }
    .rh-cta__nova { width: 96px; height: 96px; }
    .rh-cta__text { flex-basis: auto; }
    .rh-faq { padding-bottom: 40px; }
}
