/* ============================================================================
   SchoolNotes — v10 storefront pass
   File: assets/css/site-v10.css   (loaded LAST, after site-v9.css)
   ----------------------------------------------------------------------------
   What this file owns:
     1. "Find Resources" panel — clean single-row search + filter row (fixes
        the broken/blank filter row and the duplicated chip that shipped in
        the previous search_box.php).
     2. Right-to-left marquee for the category rail and the class chips strip
        ("all categories keep moving right to left"), with pause-on-hover,
        focus support and a reduced-motion fallback that becomes a normal
        swipeable/scrolling rail.
     3. Header WhatsApp button sitting next to the AI chat button.
     4. Hero artwork framing for the new generated hero art.
   Nothing here removes existing behaviour: the marquee is an additive wrapper
   around the existing .category-card markup, and the find panel keeps the
   same /search.php GET contract (q, board, class, section, medium).
   ========================================================================== */

/* ==========================================================================
   1. FIND RESOURCES PANEL
   ========================================================================== */
.find-notes { padding: 10px 0 8px; }

.find-card {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--paper-line, #e3e9f2);
  border-radius: 18px;
  padding: 24px 26px 20px;
  box-shadow: 0 18px 44px rgba(20, 51, 92, .12);
}

.find-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.find-card h2 {
  margin: 0;
  color: var(--navy, #14335c);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 9px;
}
.find-card h2 i { color: var(--blue, #1a67c4); }

/* one small inline pill instead of the two absolutely-positioned badges that
   overlapped the card border (and each other) on narrow screens */
.find-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eef6ff;
  color: #0b5fce;
  border: 1px solid #d5e6fb;
  font-size: .76rem;
  font-weight: 800;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.find-pill i { color: #0b7a43; }

.find-form { display: block; }

.find-row { display: flex; gap: 10px; }
.find-row-main { align-items: stretch; }
.find-row-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.find-q { position: relative; flex: 1; min-width: 0; }
.find-q-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #7b8ca3;
  font-size: .9rem;
  pointer-events: none;
}
.find-q input {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px 13px 42px;
  border: 1px solid var(--paper-line, #e3e9f2);
  border-radius: 11px;
  background: #f8fafd;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink, #16263c);
}
.find-q input:focus {
  outline: 2px solid rgba(26, 103, 196, .35);
  outline-offset: 1px;
  border-color: var(--blue, #1a67c4);
  background: #fff;
}

.find-select { position: relative; min-width: 0; }
.find-select select {
  width: 100%;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 38px 12px 14px;
  border: 1px solid var(--paper-line, #e3e9f2);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink, #16263c);
  cursor: pointer;
  text-overflow: ellipsis;
}
.find-select::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: .68rem;
  color: #7b8ca3;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.find-select select:focus {
  outline: 2px solid rgba(26, 103, 196, .35);
  outline-offset: 1px;
  border-color: var(--blue, #1a67c4);
}

.btn-find {
  flex: 0 0 auto;
  min-width: 168px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(120deg, #f0b429, #c9860f);
  color: #14335c;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-find:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(201, 134, 15, .3); }
.btn-find:active { transform: translateY(0); }

.find-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.find-chips-label {
  font-size: .74rem;
  font-weight: 800;
  color: #7b8ca3;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: center;
  margin-right: 2px;
}
.find-chip {
  font-size: .78rem;
  font-weight: 600;
  color: #1a67c4;
  background: #eef6ff;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid #dbeafb;
  font-family: inherit;
  cursor: pointer;
}
.find-chip:hover { background: #1a67c4; color: #fff; border-color: #1a67c4; }

.find-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid #eef2f7;
  font-size: .78rem;
  color: #5b6b80;
  font-weight: 600;
}
.find-foot i { color: #0b7a43; margin-right: 5px; }

@media (max-width: 900px) {
  .find-card { padding: 20px 18px 18px; }
  .find-card h2 { font-size: 1.15rem; }
  .find-row-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .find-row-main { flex-direction: column; }
  .btn-find { width: 100%; min-width: 0; }
  .find-row-filters { grid-template-columns: 1fr; }
}

/* ==========================================================================
   2. RIGHT-TO-LEFT MARQUEE  (category rail + class chips)
   --------------------------------------------------------------------------
   index.php renders the card set TWICE inside .cat-marquee-track (the second
   copy is aria-hidden). Because both halves are identical, animating the
   track to translateX(-50%) loops with no visible seam.
   ========================================================================== */
.cat-marquee {
  position: relative;
  overflow: hidden;
  padding: 4px 0 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
}
.cat-marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: cat-marquee-scroll 44s linear infinite;
  will-change: transform;
}
/* the gap lives on the cards (not on flex `gap`) so -50% lands exactly on the
   start of the second copy and the loop is seamless */
.cat-marquee .category-card {
  flex: 0 0 262px;
  width: 262px;
  max-width: none;
  margin-right: 18px;
  scroll-snap-align: none;
}

.cat-marquee:hover .cat-marquee-track,
.cat-marquee:focus-within .cat-marquee-track,
.cat-marquee.is-paused .cat-marquee-track { animation-play-state: paused; }

@keyframes cat-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Class chips strip: same right-to-left motion, slimmer cardless track */
.chip-marquee {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
}
.chip-marquee-track {
  display: flex;
  width: max-content;
  animation: cat-marquee-scroll 30s linear infinite;
}
.chip-marquee:hover .chip-marquee-track,
.chip-marquee:focus-within .chip-marquee-track { animation-play-state: paused; }
.chip-marquee .class-chip { flex: 0 0 auto; margin-right: 8px; }

/* Reduced motion / no-JS fallback: stop the animation and hand scrolling back
   to the user as a normal horizontal rail. */
@media (prefers-reduced-motion: reduce) {
  .cat-marquee-track,
  .chip-marquee-track { animation: none !important; }
  .cat-marquee, .chip-marquee { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cat-marquee::-webkit-scrollbar, .chip-marquee::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  .cat-marquee .category-card { flex: 0 0 224px; width: 224px; margin-right: 12px; }
  .cat-marquee-track { animation-duration: 34s; }
}

/* ==========================================================================
   3. HEADER WHATSAPP BUTTON (sits immediately after the AI chat button)
   ========================================================================== */
.header-wa-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #25d366, #0f8a5f);
  color: #fff;
  font-size: .98rem;
  box-shadow: 0 4px 12px rgba(15, 138, 95, .32);
  transition: transform .16s cubic-bezier(.2, .8, .2, 1);
}
.header-wa-btn:hover { transform: scale(1.07); }
.header-wa-btn:active { transform: scale(.95); }
.header-wa-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(37, 211, 102, .45);
  animation: hwa-ping 2.4s ease-out infinite;
}
@keyframes hwa-ping {
  0%   { opacity: .75; transform: scale(.85); }
  70%  { opacity: 0;   transform: scale(1.25); }
  100% { opacity: 0;   transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) { .header-wa-btn::after { animation: none; } }
@media (max-width: 900px) {
  .header-wa-btn { width: 30px; height: 30px; font-size: .85rem; }
}
@media (max-width: 420px) {
  .header-wa-btn { display: none; }   /* the floating cluster still carries it */
}

/* ==========================================================================
   4. HERO ART FRAMING
   ========================================================================== */
.hero-slider .hero-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   5. MOBILE: make sure the new marquees never cause a sideways page scroll
   ========================================================================== */
@media (max-width: 900px) {
  .cat-marquee, .chip-marquee { overscroll-behavior-x: contain; }
}


/* ============================================================================
   v12 storefront additions — loaded last, so these win over the v9/v10 rules.
     1. Header account button (third icon next to the AI + WhatsApp buttons).
     2. Keep the WhatsApp button visible on small phones (it used to be
        display:none below 420px, i.e. exactly where it matters most).
     3. Compact "Find Resources" panel + short popular "shorts" chips.
     4. Footer v2 — five columns, responsive down to one.
   Nothing here removes an existing rule; every selector is additive.
   ========================================================================== */

/* ---------------------------------------------------- 1. HEADER ACCOUNT ICON */
.header-acc-btn {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a67c4, #0b3f86);
  color: #fff;
  font-size: .95rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(11, 63, 134, .28);
  transition: transform .16s cubic-bezier(.2, .8, .2, 1);
}
.header-acc-btn:hover { transform: scale(1.07); color: #fff; }
.header-acc-btn:active { transform: scale(.95); }
.header-acc-btn i { position: relative; z-index: 1; }
@media (max-width: 900px) {
  .header-acc-btn { width: 30px; height: 30px; font-size: .85rem; }
}

/* ------------------------------------------- 2. WHATSAPP + ACCOUNT ON PHONES */
@media (max-width: 420px) {
  .header-wa-btn { display: inline-flex !important; width: 30px !important; height: 30px !important; font-size: .85rem !important; }
  .header-chat-btn, .header-wa-btn, .header-acc-btn { margin-left: 0 !important; }
  .site-header .header-row { gap: 7px; }
}

/* ------------------------------------------ 3. FIND RESOURCES (COMPACT) v12 */
.find-card-v12 {
  padding: 20px 22px 17px;
  border-radius: 16px;
  max-width: 940px;
}
.find-card-v12 .find-head { margin-bottom: 12px; }
.find-card-v12 h2 { font-size: 1.25rem; }
.find-card-v12 .find-pill { font-size: .72rem; padding: 6px 11px; }
.find-card-v12 .find-q input { min-height: 48px; }
.find-card-v12 .btn-find { padding: 12px 20px; min-width: 148px; }
.find-card-v12 .find-row-filters { margin-top: 8px; gap: 8px; }
.find-card-v12 .find-select select { min-height: 44px; font-size: 14px; }

/* Popular "shorts": short 1-2 word chips that stay on one or two lines on a
   phone, instead of four long category names wrapping onto three. */
.find-chips-v12 { margin-top: 12px; gap: 6px; }
.find-chip-v12 {
  font-size: .74rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  line-height: 1.35;
}
.find-card-v12 .find-foot {
  margin-top: 12px;
  padding-top: 11px;
  font-size: .74rem;
  gap: 6px 16px;
}
@media (max-width: 560px) {
  .find-card-v12 { padding: 16px 14px 14px; }
  .find-card-v12 h2 { font-size: 1.08rem; }
  .find-chip-v12 { font-size: .7rem; padding: 5px 10px; }
  .find-card-v12 .find-foot { font-size: .7rem; gap: 5px 12px; }
}

/* ------------------------------------------------------------ 4. FOOTER v2 */
.footer-grid-v2 {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 1.25fr;
  gap: 24px 28px;
  align-items: start;
}
.footer-grid-v2 .footer-col h4 { display: flex; align-items: center; gap: 8px; }
.footer-grid-v2 .footer-col-brand p { max-width: 40ch; }
.footer-grid-v2 .footer-col a { display: block; }
.footer-bottom-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-bottom-v2 nav { display: flex; gap: 15px; flex-wrap: wrap; }
.footer-bottom-v2 nav a { font-size: .78rem; }
@media (max-width: 1100px) {
  .footer-grid-v2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .footer-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 460px) {
  .footer-grid-v2 { grid-template-columns: 1fr; }
  .footer-bottom-v2 { justify-content: center; text-align: center; }
}
