/* ================================================================
   custom.css — all custom styles for Kids Learn With Concept
   (extracted from index.php inline <style> blocks)
   ================================================================ */

/* ---- Play with AI marquee ---- */
@keyframes pwaSlide { from { transform: translate3d(-50%,0,0); } to { transform: translate3d(0,0,0); } }
.pwa-mq-link { display:block; text-decoration:none; }
.pwa-mq { overflow:hidden; white-space:nowrap; width:100vw; margin-left:calc(50% - 50vw); padding:14px 0; background:linear-gradient(90deg,#8e2de2,#4a00e0,#ff6b6b,#ffd93d,#4d96ff); }
.pwa-mq-track { display:inline-block; white-space:nowrap; animation:pwaSlide 18s linear infinite; }
.pwa-mq-track span { display:inline-block; color:#fff; font-family:'Baloo 2',sans-serif; font-weight:700; font-size:26px; letter-spacing:1px; text-shadow:0 0 8px rgba(255,255,255,.85), 0 2px 4px rgba(0,0,0,.35); }
.pwa-mq:hover .pwa-mq-track { animation-play-state:paused; }
@media (max-width:768px){ .pwa-mq-track span { font-size:18px; } }

/* ---- Book hover tooltip ---- */
.book-tip {
  position: fixed; z-index: 100001; box-sizing: border-box;
  max-width: 300px;                 /* fallback: no min() before Safari 13.1 */
  max-width: min(300px, 88vw);
  background: linear-gradient(145deg, #1f2a4d, #2b3a6b); color: #fff;
  padding: 12px 14px; border-radius: 12px;
  font-size: 13px;                  /* fallback: no clamp() before Safari 13.1 */
  font-size: clamp(12px, 3.4vw, 13.5px); line-height: 1.55; text-align: left;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 26px rgba(0,0,0,.30);
  opacity: 0; visibility: hidden; transition: opacity .18s ease;
  pointer-events: none;
}
.book-tip.show { opacity: 1; visibility: visible; }
.pdf-card { cursor: pointer; }

/* ---- PDF books grid ---- */
#pdf .carousel-wrapper { max-width: 1120px; width: 92%; margin: 20px auto; display: block; }
#pdf .nav-btn { display: none; }
#pdf .carousel-container { overflow: visible; }

#pdf-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100% !important;
  padding: 10px 0;
}
@media (max-width: 900px) { #pdf-gallery { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 600px) { #pdf-gallery { grid-template-columns: 1fr; } }

#pdf-gallery .pdf-card {
  background: #fff; border: 1px solid #eee; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06); overflow: hidden;
  display: flex; flex-direction: column; text-align: left;
  transition: transform .2s ease, box-shadow .2s ease;
}
#pdf-gallery .pdf-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }

#pdf-gallery .pdf-card img {
  /* contain (not cover) so the whole book cover is visible - it shrinks to
     fit instead of being cropped top/bottom. Same treatment as the
     worksheet thumbnails below. */
  width: 100% !important; height: 340px; object-fit: contain; object-position: center;
  display: block; margin: 0;
  background: #faf7f2; padding: 8px; box-sizing: border-box;
  border-radius: 0; box-shadow: none; border-bottom: 3px solid #7a1f2b;
}
@media (max-width: 600px) { #pdf-gallery .pdf-card img { height: 300px; } }
#pdf-gallery .pdf-card p { margin: 12px 16px 2px; font-weight: 700; font-size: 1rem; color: #222; }
#pdf-gallery .pdf-card .pdf-price { margin: 4px 16px 14px !important; font-size: 1.15rem; color: #111; }

#pdf-gallery .pdf-action-btn {
  margin: auto 16px 16px !important; padding: 12px 14px !important;
  background: #fff !important; color: #111 !important;
  border: 1.6px solid #111 !important; border-radius: 30px !important;
  font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  font-size: .82rem; cursor: pointer; transition: background .18s ease, color .18s ease;
}
#pdf-gallery .pdf-action-btn:hover { background: #111 !important; color: #fff !important; }
#pdf-gallery .pdf-action-btn.owned { background: #2e9e5b !important; color: #fff !important; border-color: #2e9e5b !important; }
#pdf-gallery .pdf-action-btn.owned:hover { background: #23814a !important; }

#pdf-gallery .pdf-card.pdf-extra { display: none; }
#pdf-gallery.pdf-expanded .pdf-card.pdf-extra { display: flex; }

/* ---- Worksheets grid ---- */
#worksheets .carousel-wrapper { max-width: 1120px; width: 92%; margin: 20px auto; display: block; }
#worksheets .nav-btn { display: none; }
#worksheets .carousel-container { overflow: visible; }

#worksheet-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px !important; width: 100% !important; padding: 10px 0;
  transform: none !important;
}
@media (max-width: 900px) { #worksheet-gallery { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 600px) { #worksheet-gallery { grid-template-columns: 1fr; } }

#worksheet-gallery .pdf-card {
  background: #fff; border: 1px solid #eee; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06); overflow: hidden;
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
#worksheet-gallery .pdf-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
#worksheet-gallery .pdf-card img {
  width: 100% !important; height: 340px; object-fit: contain; display: block; margin: 0;
  background: #faf7f2; padding: 8px; box-sizing: border-box;
  border-radius: 0; box-shadow: none; border-bottom: 3px solid #7a1f2b;
}
#worksheet-gallery .pdf-card p { margin: 12px 16px 14px; font-weight: 700; font-size: 1rem; color: #222; }

#worksheet-gallery .pdf-card.ws-extra { display: none; }
#worksheet-gallery.ws-expanded .pdf-card.ws-extra { display: flex; }

/* ---- Worksheet categories ---- */
#worksheet-gallery.ws-cat-view { grid-template-columns: repeat(4, 1fr) !important; }
@media (max-width: 900px) { #worksheet-gallery.ws-cat-view { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 600px) { #worksheet-gallery.ws-cat-view { grid-template-columns: 1fr !important; } }

.ws-cat-card {
  background: linear-gradient(135deg, #7a1f2b, #b0303f); color: #fff;
  border-radius: 16px; padding: 30px 18px; text-align: center; cursor: pointer;
  box-shadow: 0 6px 18px rgba(122,31,43,.22); transition: transform .2s ease, box-shadow .2s ease;
}
.ws-cat-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(122,31,43,.34); }
#worksheet-gallery .ws-cat-card.cat-extra { display: none; }
#worksheet-gallery.cat-expanded .ws-cat-card.cat-extra { display: block; }
.ws-cat-icon { font-size: 2.6rem; line-height: 1; }
.ws-cat-name { font-weight: 800; font-size: 1.15rem; margin-top: 10px; }
.ws-cat-count { opacity: .9; font-size: .85rem; margin-top: 4px; }

/* ---- Best Advice for Kids ---- */
#advice { max-width: 1160px; margin: 0 auto; padding: 0 4%; }
.advice-intro { text-align: center; color: #555; max-width: 760px; margin: 0 auto 24px; line-height: 1.6; }
.advice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .advice-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .advice-grid { grid-template-columns: 1fr; } }
.advice-card {
  background: #fff; border: 1px solid #eee; border-radius: 16px; padding: 20px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06); text-align: left; border-top: 4px solid #7a1f2b;
  transition: transform .2s ease, box-shadow .2s ease;
}
.advice-card:hover { transform: translateY(-5px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.advice-card:nth-child(4n+1) { border-top-color: #7a1f2b; }
.advice-card:nth-child(4n+2) { border-top-color: #2e9e5b; }
.advice-card:nth-child(4n+3) { border-top-color: #3399cc; }
.advice-card:nth-child(4n+4) { border-top-color: #e08a1e; }
.advice-stage {
  display: inline-block; background: #f3f4f6; color: #7a1f2b; font-weight: 700;
  font-size: .72rem; padding: 4px 11px; border-radius: 20px; letter-spacing: .2px;
}
.advice-emoji { font-size: 2rem; margin: 12px 0 6px; line-height: 1; }
.advice-card p { margin: 0; color: #333; line-height: 1.55; font-size: .95rem; }
.advice-more { display: inline-block; margin-top: 12px; color: #7a1f2b; font-weight: 700; font-size: .88rem; text-decoration: none; }
.advice-more:hover { text-decoration: underline; }
#adviceGrid .advice-extra { display: none; }
#adviceGrid.advice-expanded .advice-extra { display: block; }
.advice-viewer { max-width: 1120px; width: 92%; margin: 8px auto 30px; }
.advice-viewer-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.advice-viewer-bar #advice-viewer-title { font-weight: 700; color: #7a1f2b; }
.advice-viewer iframe {
  width: 100%; height: 80vh; min-height: 520px; border: 2px solid #7a1f2b;
  border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

/* ---- In-page presentation / file viewer ---- */
.ppt-viewer-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;   /* long-hand first: `inset` needs Safari 14.1+ */
  inset: 0; background: rgba(0,0,0,.85); z-index: 100000;
  display: none; flex-direction: column; padding: 14px; box-sizing: border-box;
}
.ppt-viewer-overlay.show { display: flex; }
.ppt-viewer-bar { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 10px; flex-wrap: wrap; }
.ppt-viewer-bar .ppt-title { font-weight: 700; flex: 1; min-width: 120px; font-size: 1rem; }
.ppt-viewer-bar .ppt-dl, .ppt-viewer-bar .ppt-close {
  border: none; border-radius: 30px; padding: 9px 20px; font-weight: 700; font-size: .9rem;
  cursor: pointer; text-decoration: none; color: #fff;
}
.ppt-viewer-bar .ppt-dl { background: #2e9e5b; }
.ppt-viewer-bar .ppt-dl:hover { background: #23814a; }
.ppt-viewer-bar .ppt-close { background: #555; }
.ppt-viewer-bar .ppt-close:hover { background: #333; }
.ppt-viewer-body {
  flex: 1; background: #fff; border-radius: 10px; overflow: auto; position: relative;
  -webkit-overflow-scrolling: touch;
}
.ppt-viewer-body iframe, .ppt-viewer-body embed {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;   /* long-hand first for older Safari */
  inset: 0; width: 100%; height: 100%; border: 0;
}
.ppt-viewer-body img { display: block; margin: auto; max-width: 100%; max-height: 100%; }

/* ---- Read more button ---- */
.ws-readmore-box { text-align: center; margin: 6px 0 34px; }
.ws-readmore {
  display: inline-block; margin: 6px; font-weight: 700; font-size: 1rem; color: #7a1f2b;
  text-decoration: none; border: 2px solid #7a1f2b; padding: 9px 24px; border-radius: 30px;
  cursor: pointer; transition: background .18s ease, color .18s ease;
}
.ws-readmore:hover { background: #7a1f2b; color: #fff; }

/* ---- Video Gallery / YouTube extra toggles ---- */
#video-gallery img.vg-extra { display: none !important; }
#video-gallery.vg-expanded img.vg-extra { display: block !important; }
#youtube-container img.yt-extra { display: none !important; }
#youtube-container.yt-expanded img.yt-extra { display: block !important; }

/* Make the Read-more tap target reliable on touch devices */
.ws-readmore { -webkit-tap-highlight-color: rgba(122,31,43,.15); touch-action: manipulation; }

/* ---- Blog article reader ----
   The gold 2px border here clashed with the restyled article pages, so the
   frame now uses the same quiet card treatment as the rest of the site. */
#blog .iframe-box { max-width: 1120px; width: 92%; margin: 0 auto 40px; }
#blog .iframe-container { height: auto !important; border: none !important; background: none !important; }
#blog .iframe-container iframe {
  display: block;
  width: 100%; height: 760px !important;
  border-radius: 14px; border: 1px solid #e3ded6 !important;
  background: #fffdfa;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
@media (max-width: 600px) {
  #blog .iframe-container iframe { height: 460px !important; border-radius: 10px; }
}

/* ---- Video Gallery + YouTube 3-per-row grid ---- */
#youtube .carousel-wrapper { max-width: 1120px; width: 92%; margin: 20px auto; display: block; }
#youtube .nav-btn { display: none; }
#youtube .carousel-container { overflow: visible !important; width: 100% !important; }

#youtube-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px !important; width: 100% !important; transform: none !important; padding: 10px 0;
}
#video-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; max-width: 1120px; width: 92%; margin: 16px auto;
}
@media (max-width: 900px) { #youtube-container, #video-gallery { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 600px) { #youtube-container, #video-gallery { grid-template-columns: 1fr; } }

#video-gallery img, #youtube-container img {
  width: 100% !important; height: 200px !important; object-fit: cover;
  border-radius: 14px; margin: 0 !important; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.08); transition: transform .2s ease;
}
#video-gallery img:hover, #youtube-container img:hover { transform: translateY(-4px); }

/* ---- Connect With Us — modern card form ---- */
#social .contact-box {
  max-width: 620px; width: 92%; margin: 10px auto 30px; background: #fff;
  border: 1px solid #eee; border-radius: 18px; padding: 30px 26px;
  box-shadow: 0 8px 26px rgba(0,0,0,.07);
}
#social .contact-box h2 { margin-bottom: 4px; }
#social .contact-subtitle { text-align: center; color: #777; margin: 0 0 22px; font-size: .95rem; }
#social .contact-table { width: 100%; border-collapse: collapse; }
#social .contact-table td { display: block; width: 100%; padding: 0; }
#social .contact-table tr { display: block; margin-bottom: 16px; }
#social .contact-table td:first-child { font-weight: 700; color: #333; margin-bottom: 6px; font-size: .9rem; text-align: left; }
#social .contact-table input,
#social .contact-table textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid #ddd;
  border-radius: 10px; font-size: 1rem; font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
#social .contact-table input:focus,
#social .contact-table textarea:focus { outline: none; border-color: #7a1f2b; box-shadow: 0 0 0 3px rgba(122,31,43,.12); }
#social .contact-table .btn-primary {
  background: linear-gradient(135deg, #7a1f2b, #b0303f); color: #fff; border: none;
  padding: 13px 44px; border-radius: 30px; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
#social .contact-table .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(122,31,43,.3); }

/* ---- Visitor counter ---- */
.counter-box { max-width: 760px; margin: 20px auto; text-align: center; }
.counter-box .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0 8px; }
@media (max-width: 600px) { .counter-box .stats-grid { grid-template-columns: 1fr; } }
.counter-box .stat-card {
  background: linear-gradient(135deg, #7a1f2b, #b0303f); color: #fff;
  border-radius: 16px; padding: 22px 14px; box-shadow: 0 8px 22px rgba(122,31,43,.25);
}
.counter-box .stat-num { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.counter-box .stat-label { margin-top: 8px; font-size: .9rem; opacity: .92; }
.counter-box .device-line { color: #777; font-size: .9rem; margin-top: 6px; }

/* ---- Footer ---- */
.site-footer {
  background: linear-gradient(135deg, #7a1f2b, #3a0d14);
  color: #fff; padding: 40px 20px 24px; margin-top: 40px; text-align: center;
}
.site-footer h3 { margin: 0 0 6px; font-size: 1.4rem; letter-spacing: .5px; }
.site-footer .footer-tag { margin: 0 auto 20px; max-width: 520px; opacity: .85; font-size: .95rem; }
.site-footer .footer-social {
  display: flex; justify-content: center; align-items: center; gap: 16px; margin: 18px 0 22px; flex-wrap: wrap;
}
.site-footer .footer-social a {
  display: inline-flex; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .18s ease;
}
.site-footer .footer-social a:hover { transform: translateY(-4px) scale(1.06); }
.site-footer .footer-social img { width: 100%; height: 100%; object-fit: cover; }
.site-footer .footer-contact { margin: 6px 0; font-size: .95rem; }
.site-footer .footer-contact a { color: #ffd9dd; text-decoration: none; }
.site-footer .footer-divider { border: none; border-top: 1px solid rgba(255,255,255,.2); max-width: 620px; margin: 20px auto; }
.site-footer .footer-copy { font-size: .85rem; opacity: .8; margin: 0; }

/* ================================================================
   MOBILE RHYTHM + OLDER-BROWSER SUPPORT
   Added to remove the dead vertical bands between sections on phones
   and to keep the layout working on older iOS Safari / Android Chrome.
   Loaded last, so these win over the rules above at equal specificity.
   ================================================================ */

/* ---- 1. Safety nets ---- */
img, video, iframe { max-width: 100%; }
.carousel-container { -webkit-overflow-scrolling: touch; }

/* Reliable, fast taps on touch devices (also kills the old 300ms delay) */
.pdf-card, .ws-cat-card, .advice-more, .ws-readmore,
#blog .nav a, button, .pdf-action-btn, .site-footer .footer-social a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(122,31,43,.15);
}

/* ---- 2. Containers that only get filled when there is content.
        While empty they used to leave a heading floating over nothing. ---- */
#blog-grid:empty, #concept-grid:empty, #image-gallery:empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ---- 3. Header: compact on phones, and compact-on-scroll via a class
        (main.js used to write inline styles here, which beat the media
        queries below and left phones with a 30px gutter after a scroll) ---- */
#mainHeader { transition: padding .25s ease; }
#mainHeader.is-compact { padding: 5px 30px; }
#mainHeader.is-compact #siteLogo { width: 60px; }

@media (max-width: 768px) {
  #mainHeader { padding: 8px 14px; }
  #mainHeader.is-compact { padding: 6px 14px; }
  #mainHeader .logo-container { gap: 8px; }
  #mainHeader .logo-container img,
  #mainHeader.is-compact #siteLogo { width: 54px; }
  #mainHeader h1 { font-size: 1.05rem; line-height: 1.25; margin: 0; }
  #mainHeader nav { gap: 8px 14px; font-size: .84rem; justify-content: center; }
}
@media (max-width: 380px) {
  #mainHeader .logo-container img,
  #mainHeader.is-compact #siteLogo { width: 44px; }
  #mainHeader h1 { font-size: .95rem; }
  #mainHeader nav { gap: 6px 10px; font-size: .78rem; }
}

/* ---- 4. Tighter vertical rhythm on phones ---- */
@media (max-width: 600px) {
  section h2 { margin-top: 20px; margin-bottom: 10px; }
  section h3 { margin-top: 14px; margin-bottom: 10px; }

  .ws-readmore-box { margin: 4px 0 18px; }

  #worksheets .carousel-wrapper,
  #pdf .carousel-wrapper,
  #youtube .carousel-wrapper { margin: 12px auto; }

  #pdf-gallery, #worksheet-gallery, #youtube-container { padding: 4px 0; }
  #video-gallery { margin: 10px auto; }
  #image-gallery, #video-gallery { padding: 6px 0; }

  #advice { padding: 0 5%; }
  .advice-intro { margin-bottom: 16px; }

  #blog .nav { margin: 8px 0; }
  #blog .iframe-box { margin: 12px auto 22px; }
  #blog .iframe-container iframe { height: 460px !important; }

  #social .contact-box { margin: 10px auto 20px; padding: 22px 18px; }
  .counter-box { margin: 10px auto; }
  .counter-box .stats-grid { gap: 12px; margin: 12px 0 6px; }
  .site-footer { margin-top: 22px; padding: 26px 18px 20px; }
  .site-footer .footer-social { margin: 14px 0 16px; }
}

/* ---- 5. Flexbox `gap` fallback.
        iOS Safari only learned flex-gap in 14.1 and Android Chrome in 84.
        A tiny test in the page <head> adds .no-flexgap to <html> when it is
        missing, so these margins apply only on the browsers that need them. ---- */
.no-flexgap header nav { margin: -4px -7px; }
.no-flexgap header nav > a { margin: 4px 7px; }
.no-flexgap #blog .nav { margin-left: -6px; margin-right: -6px; }
.no-flexgap #blog .nav > a { margin: 6px; }
.no-flexgap .site-footer .footer-social { margin-left: -8px; margin-right: -8px; }
.no-flexgap .site-footer .footer-social > a { margin: 0 8px; }
.no-flexgap .advice-viewer-bar > * + *,
.no-flexgap .ppt-viewer-bar > * + * { margin-left: 10px; }
.no-flexgap .grid > * { margin: .5rem; }
.no-flexgap .carousel-wrapper > * + * { margin-left: 10px; }

/* ---- 6. aspect-ratio fallback (Safari < 15) ---- */
@supports not (aspect-ratio: 1 / 1) {
  #image-gallery img { height: 150px; }
}

/* ==================================================================
   SEO / conversion pass — added with the pre-launch review.
   Covers: site title (was an <h1>), hero sub-line, e-book trust strip,
   server-rendered card meta + "What's inside", FAQ block, footer legal.
   All values are plain CSS that iOS 12-era Safari understands.
   ================================================================== */

/* Header brand name: styled to match the old <h1> it replaced. */
.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #fff;
  white-space: nowrap;
}
@media (max-width: 600px) { .site-title { font-size: 1.25rem; white-space: normal; } }

/* Hero supporting line under the single H1. */
.hero-sub {
  max-width: 680px;
  margin: 10px auto 4px;
  padding: 0 14px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #444;
}
@media (max-width: 600px) { .hero-sub { font-size: .95rem; } }

/* ---- E-Books: intro, trust strip, terms ---- */
.pdf-intro {
  max-width: 680px;
  margin: 0 auto 12px;
  padding: 0 14px;
  color: #444;
  font-size: 1rem;
  line-height: 1.55;
}

.trust-strip {
  list-style: none;
  margin: 0 auto 10px;
  padding: 0 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
}
.trust-strip li {
  margin: 4px 6px;
  padding: 6px 12px;
  border: 1px solid #e3ded6;
  border-radius: 30px;
  background: #faf7f2;
  color: #4a3f36;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
/* On phones the four badges stacked into four full-width rows and pushed the
   first book below the fold. Two compact columns keeps them to two rows. */
@media (max-width: 600px) {
  .trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 420px;
    padding: 0 10px;
  }
  .trust-strip li {
    margin: 3px;
    padding: 6px 8px;
    font-size: .72rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
}
@media (max-width: 360px) { .trust-strip li { font-size: .68rem; } }

.pdf-terms {
  max-width: 700px;
  margin: 0 auto 14px;
  padding: 0 14px;
  color: #777;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- Card contents (now rendered server-side) ---- */
#pdf-gallery .pdf-card .pdf-title {
  margin: 12px 16px 4px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #222;
}
#pdf-gallery .pdf-card .pdf-meta {
  margin: 0 12px 4px !important;
  font-weight: 400;
  display: flex;
  flex-wrap: wrap;
}
#pdf-gallery .pdf-card .pdf-badge {
  display: inline-block;
  margin: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #f1ece4;
  color: #6b5b4c;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2px;
}
#pdf-gallery .pdf-card .pdf-price {
  margin: 6px 16px 12px !important;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111;
}
#pdf-gallery .pdf-card .pdf-price-note {
  font-weight: 400;
  color: #777;
  font-size: 12px;
}

/* "What's inside" — keeps the full write-up in the HTML for search engines
   while staying folded away so the card grid stays tidy. */
#pdf-gallery .pdf-details {
  margin: 0 16px 14px;
  border-top: 1px solid #f0ece6;
  padding-top: 8px;
}
#pdf-gallery .pdf-details > summary {
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #7a1f2b;
  list-style: none;
  padding: 4px 0;
}
#pdf-gallery .pdf-details > summary::-webkit-details-marker { display: none; }
#pdf-gallery .pdf-details > summary::after { content: " ↓"; }
#pdf-gallery .pdf-details[open] > summary::after { content: " ↑"; }
#pdf-gallery .pdf-card .pdf-desc {
  margin: 6px 0 2px !important;
  font-weight: 400;
  font-size: .84rem;
  line-height: 1.55;
  color: #555;
}

/* ---- FAQ ---- */
#faq .faq-list {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 14px;
  text-align: left;
}
#faq .faq-item {
  border: 1px solid #ece7e0;
  border-radius: 12px;
  background: #fff;
  margin: 0 0 10px;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
#faq .faq-item > summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 700;
  font-size: .98rem;
  color: #222;
  list-style: none;
  position: relative;
  padding-right: 26px;
}
#faq .faq-item > summary::-webkit-details-marker { display: none; }
#faq .faq-item > summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 12px;
  font-size: 1.3rem;
  font-weight: 400;
  color: #7a1f2b;
}
#faq .faq-item[open] > summary::after { content: "\2013"; }
#faq .faq-item > p {
  margin: 0 0 14px;
  font-size: .92rem;
  line-height: 1.6;
  color: #555;
}

/* ---- Footer policy links ---- */
.footer-legal {
  margin: 14px auto 4px;
  padding: 0 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-legal a {
  margin: 4px 10px;
  color: inherit;
  opacity: .85;
  font-size: .85rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.footer-legal a:hover,
.footer-legal a:focus { opacity: 1; }

/* ==================================================================
   Blog article cards. Replaces the empty #blog-grid placeholder that
   main.js used to hide, leaving the section with two bare links.
   ================================================================== */
.blog-intro {
  max-width: 700px;
  margin: 0 auto 18px;
  padding: 0 14px;
  color: #444;
  font-size: 1rem;
  line-height: 1.55;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 20px;
  gap: 20px;
  max-width: 1120px;
  width: 92%;
  margin: 0 auto 26px;
  text-align: left;
}
@media (max-width: 900px) { .article-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 600px) { .article-grid { grid-template-columns: 1fr; width: 94%; } }

.article-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid #ece7e0;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0,0,0,.12);
}
.article-card.is-open {
  border-color: #7a1f2b;
  box-shadow: 0 6px 20px rgba(122,31,43,.16);
}

/* Cards past the first row hide behind "Read more", the same way the
   E-Books and Worksheets grids do. */
.article-grid .article-card.blog-extra { display: none; }
.article-grid.blog-expanded .article-card.blog-extra { display: flex; }

.article-icon { font-size: 1.7rem; line-height: 1; margin-bottom: 8px; }

.article-tag {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f1ece4;
  color: #6b5b4c;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.article-card .article-title {
  margin: 0 0 8px;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.3;
  color: #222;
}
.article-card .article-desc {
  margin: 0 0 16px;
  font-size: .88rem;
  line-height: 1.6;
  color: #5c554e;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
}
.article-btn {
  padding: 10px 18px;
  margin: 0 10px 0 0;
  background: #7a1f2b;
  color: #fff;
  border: 1.6px solid #7a1f2b;
  border-radius: 30px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.article-btn:hover, .article-btn:focus { background: #5e1721; border-color: #5e1721; }
.article-card.is-open .article-btn { background: #2e9e5b; border-color: #2e9e5b; }

.article-link {
  font-size: .82rem;
  font-weight: 600;
  color: #7a1f2b;
  text-decoration: none;
  border-bottom: 1px solid rgba(122,31,43,.35);
}
.article-link:hover, .article-link:focus { border-bottom-color: #7a1f2b; }

@media (max-width: 600px) { .article-btn { padding: 11px 16px; } }

/* ---- Blog quick links (restored) ----
   Same pill look as before; the active one is filled so it is obvious which
   article the reader below is showing. */
.blog-quicklinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto 18px;
  padding: 0 14px;
}
.blog-quicklinks a {
  margin: 6px;
  padding: 9px 20px;
  background: #fff;
  border: 2px solid #7a1f2b;
  border-radius: 30px;
  color: #7a1f2b;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: rgba(122,31,43,.15);
  touch-action: manipulation;
}
.blog-quicklinks a:hover,
.blog-quicklinks a:focus { background: #7a1f2b; color: #fff; }
.blog-quicklinks a.is-active { background: #7a1f2b; color: #fff; }
@media (max-width: 400px) { .blog-quicklinks a { font-size: .84rem; padding: 9px 15px; } }

/* Brief highlight when a #book-... deep link lands on a card. */
@keyframes bookPulse {
  0%   { box-shadow: 0 0 0 0 rgba(122,31,43,.45); }
  70%  { box-shadow: 0 0 0 14px rgba(122,31,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(122,31,43,0); }
}
#pdf-gallery .pdf-card.book-highlight {
  border-color: #7a1f2b;
  -webkit-animation: bookPulse 1.1s ease-out 2;
  animation: bookPulse 1.1s ease-out 2;
}

/* ==================================================================
   AdSense Auto Ads — collapse slots Google could not fill.

   This is the difference between local and live. Auto Ads injects
   <div class="google-auto-placed"><ins class="adsbygoogle"> between the
   page's blocks, and reserves height for each one BEFORE it knows whether
   an ad exists to put there. When nothing fills, Google marks the slot
   data-ad-status="unfilled" but leaves the reserved height behind — which
   reads as a big empty band between every section. Locally the AdSense
   script never loads, so no slots, no gaps.

   Hiding UNFILLED slots is Google's own documented remedy and costs no
   revenue: there was no ad in them. Filled slots are left completely alone.
   ================================================================== */
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}
/* The wrapper Google puts around an auto-placed slot: never let it reserve
   height of its own, and drop the collapsed ones out of the flow. */
.google-auto-placed {
  min-height: 0 !important;
}
.google-auto-placed.kl-ad-empty {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Anchor / vignette overlays sometimes pad the body; keep that at zero. */
body { padding-bottom: 0 !important; }
