/* ==========================================================================
   Study Resources — page styles on top of base.css.
   Ported 1:1 from 03 Features/01 Resources/Resources.html. Rules are scoped to .resources (on <main>), the page's
   dark-mode overrides became [data-theme="dark"] and keyframes are prefixed.
   !important is kept: in these pages it decides same-specificity conflicts
   (the .mobile-only / .desktop-only helpers), so dropping it breaks layout.
   ========================================================================== */

.resources-page { overflow-x: hidden; background: #FFFBF5; }
/* The page's own background (the source's body rule) is painted here: fixed,
   behind everything, and inside <main> so it can read the page's tokens. */
.resources::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; }
[data-theme="dark"] .resources-page { background: #0E0E0E; }
.resources { padding: 0px; }   /* the Elementor container's padding on live (0 or 10, per page) */
/* Blocksy wrapped every page's content in a container with overflow: clip, so
   anything wider than the page was trimmed rather than scrollable — Connect's
   directory grid is wider than its box, and its tools dropdown bleeds 100vw.
   clip (not hidden) doesn't make <main> a scroll container. */
.resources { overflow-x: clip; }

/* The element baseline every page sat on in WordPress — measured on live by
   _migration/compare-baseline.py, not guessed. Anything the page doesn't
   style itself falls back to these, exactly as it did on live; the page's own
   rules below override them (same specificity, later in the file). */
/* Blocksy's element layer (its bundle/main.min.css), in its own order and at
   its own selector strength plus the scope — so a page's rules win or lose
   against it exactly as they did on live. Variables resolved to live values;
   sizes measured with _migration/compare-baseline.py. */
.resources :is(p, h1, h2, h3, h4, h5, h6, em, ol, ul, li, tr, th, td, dl, ins, sub, sup, big, cite, form, small, label, table, figure, button, legend, strike, address, caption, fieldset, blockquote) { margin: 0; padding: 0; border: none; font: inherit; }
.resources :is(b, strong) { font-weight: bold; }
.resources small { font-size: 80%; }
.resources hr { height: 1px; border: none; background-color: #E1E8ED; }
.resources img { height: auto; max-width: 100%; vertical-align: middle; }
.resources :is(figure, textarea) { display: block; }
.resources hr { margin: 0; }
.resources table { max-width: 100%; }
.resources :is(code, kbd, samp) { padding: 3px 6px; background: #F2F5F7; border-radius: 3px; }
.resources :is(table, th, td) { border: 1px solid #E1E8ED; }
.resources :is(th, td) { padding: 0.7em 1em; }
.resources th { font-weight: 600; }
.resources h1 { color: #FF6B4A; font-family: "Bricolage Grotesque", sans-serif; font-size: 40px; }
.resources h2 { color: #1A1A1A; font-family: "Bricolage Grotesque", sans-serif; font-size: 35px; }
.resources h3 { color: #1A1A1A; font-family: "Plus Jakarta Sans", sans-serif; font-size: 30px; }
.resources h4 { color: #FFFBF5; font-size: 25px; }
.resources h5 { color: #FFFBF5; font-size: 20px; }
.resources h6 { color: #FFFBF5; font-size: 16px; }
.resources :is(h1, h2, h3, h4, h5, h6) { font-weight: 700; line-height: 1.5; }
.resources p { margin-block-end: 1.5em; }
.resources :is(ul, ol) { padding-inline-start: 2.5em; margin-block-end: 1.5em; }
.resources :is(h1, h2, h3, h4, h5, h6) { margin-block-end: calc(.3em + 10px); }
.resources :is(h1, h2, h3, h4, h5, h6):where(:last-child) { margin-block-end: 0; }
.resources ul:last-child, .resources ol:last-child, .resources ul li:last-child, .resources ol li:last-child, .resources label:last-child { margin-bottom: 0; }
.resources a { color: #FF6B4A; }
.resources select, .resources textarea, .resources input:is([type="url"], [type="tel"], [type="text"], [type="time"], [type="date"], [type="datetime"], [type="datetime-local"], [type="email"], [type="number"], [type="search"], [type="password"]) {
  appearance: none; width: 100%; height: 40px; padding: 0 15px; color: #1A1A1A;
  background-color: transparent; border: 1px solid #E1E8ED; border-radius: 3px;
  font-family: inherit; font-size: 16px; font-weight: 400; line-height: inherit;
  transition: color .12s, outline .12s, border-color .12s, background .12s; }
.resources select { padding-inline-end: 25px; }
.resources textarea { line-height: 1.5; resize: vertical; padding: 12px 15px; }
.resources label { font-size: 15px; line-height: inherit; cursor: pointer; margin: 0 0 0.5em; }
.resources blockquote:where(:not(.is-style-plain):not(.has-text-align-center):not(.has-text-align-right)) { padding-inline-start: 1.5em; border-inline-start: 4px solid #FF6B4A; }
.resources [type="submit"] { appearance: none; height: 40px; padding: 5px 20px; border: 0; border-radius: 3px; color: #fff; background-color: #FF6B4A; font-size: 15px; font-weight: 500; }

.resources { line-height: 1.65; color: #1A1A1A; color-scheme: normal; }
/* Inside Elementor's content area on live: <hr> without the theme's grey fill. */
.resources hr { background-color: transparent; }

/* ╔══════════════════════════════════════════╗
   ║  ALL RULES SCOPED UNDER .cl-page         ║
   ║  Zero conflict with theme globals        ║
   ╚══════════════════════════════════════════╝ */
.resources .cl-page *, .resources .cl-page *::before, .resources .cl-page *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.resources .cl-page {
  /* Default light theme variables */
  --bg:          #FFFBF5;
  --s2:          #FFFFFF;
  --s3:          #FDF8F2;
  --txt:         #1A1A1A;
  --txt2:        rgba(26,26,26,0.65);
  --txt3:        rgba(26,26,26,0.38);
  --bdr:         rgba(26,26,26,0.06);
  --bdr2:        rgba(26,26,26,0.12);
  --dot-clr:     rgba(139,74,12,0.04);
  --card-shadow: 0 8px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04) inset;
  --card-shadow-hover: 0 16px 40px rgba(139,74,12,0.08), 0 0 0 1px rgba(255,107,74,0.08) inset;
  --orange:      #FF6B4A;
  --orange-glow: rgba(255,107,74,0.06);
  
  --font-d:      'Bricolage Grotesque', sans-serif;
  --font-b:      'Plus Jakarta Sans', sans-serif;
  --font-s:      'Fraunces', serif;

  background: var(--bg) !important;
  color: var(--txt) !important;
  font-family: var(--font-b) !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  overflow-x: hidden !important;
  -webkit-font-smoothing: antialiased !important;
  transition: background 0.35s, color 0.35s;
}
[data-theme="dark"] .resources .cl-page {
  --bg:          #0E0B08;
  --s2:          #1E1A16;
  --s3:          #252018;
  --txt:         #F0EBE3;
  --txt2:        rgba(240,235,227,0.65);
  --txt3:        rgba(240,235,227,0.38);
  --bdr:         rgba(240,235,227,0.07);
  --bdr2:        rgba(240,235,227,0.13);
  --dot-clr:     rgba(240,235,227,0.045);
  --card-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.03) inset;
  --card-shadow-hover: 0 16px 48px rgba(0,0,0,0.48), 0 0 0 1px rgba(255,255,255,0.04) inset;
  --orange-glow: rgba(255,107,74,0.15);
}
/* ── RESET common elements inside scope ── */
.resources .cl-page a { text-decoration: none; color: inherit; }
.resources .cl-page ul { list-style: none; }
.resources .cl-page button { font-family: var(--font-b); cursor: pointer; border: none; background: transparent; }
.resources .cl-page img { display: block; max-width: 100%; }
.resources .cl-page h1, .resources .cl-page h2, .resources .cl-page h3 { font-weight: inherit; }
/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.resources .cl-hero-wrap {
  position: relative;
  overflow: hidden;
}
.resources .cl-hero {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 96px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
}
.resources .cl-hero-left {}
.resources .cl-hero-right { position: relative; height: 460px; perspective: 1000px; }
.resources .cl-page .bg-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, var(--dot-clr) 1px, transparent 1px);
  background-size: 24px 24px;
}
.resources .cl-page .bg-layer::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 42% at 50% 0%, rgba(255,107,74,0.07) 0%, transparent 65%);
}
.resources .cl-page .cl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 107, 74, 0.08);
  border: 1px solid rgba(255, 107, 74, 0.20);
  color: var(--orange);
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.resources .cl-page .cl-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: re-cl-pulse 2s infinite;
}
@keyframes re-cl-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; box-shadow: 0 0 8px var(--orange); }
}
.resources .cl-page .cl-hero-h1 {
  font-family: var(--font-d) !important;
  font-weight: 800 !important;
  font-size: clamp(52px, 6vw, 84px) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.04em !important;
  color: var(--txt) !important;
  margin-bottom: 24px !important;
}
.resources .cl-page .cl-hl {
  background: #FFD6A8;
  color: #1A1A1A;
  display: inline-block;
  transform: rotate(-1.5deg);
  padding: 0 12px 6px;
  border-radius: 6px;
  line-height: inherit;
  font-style: normal;
}
.resources .cl-page .cl-ac {
  color: var(--orange);
}
.resources .cl-hero-sub {
  font-family: var(--font-b);
  font-size: 16px;
  color: var(--txt2);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 36px;
}
.resources .cl-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.resources .cl-hero-note { font-family: var(--font-b); font-size: 13.5px; color: var(--txt3); font-weight: 600; }
.resources .cl-page .cl-btn-solid {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-b);
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 0 1px rgba(255,107,74,0.28), 0 4px 18px rgba(255,107,74,0.28);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
}
.resources .cl-page .cl-btn-solid:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 3px rgba(255,107,74,0.20), 0 10px 32px rgba(255,107,74,0.50);
}
.resources .cl-page .cl-btn-solid:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}
/* ── Floating cards ── */
@keyframes re-cl-popIn {
  0%   { opacity: 0; transform: translateY(28px) scale(0.94); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes re-cl-floatA {
  0%, 100% { translate: 0 0; opacity: 1; }
  50%       { translate: 0 -10px; opacity: 1; }
}
@keyframes re-cl-floatB {
  0%, 100% { translate: 0 0; opacity: 1; }
  50%       { translate: 0 -7px; opacity: 1; }
}
@keyframes re-cl-floatC {
  0%, 100% { translate: 0 0; opacity: 1; }
  50%       { translate: 0 -12px; opacity: 1; }
}
.resources .cl-page .cl-fcard {
  position: absolute;
  background: var(--s2);
  border-radius: 18px;
  border: 1px solid var(--bdr);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  width: 260px;
  opacity: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: border-color 0.3s, box-shadow 0.3s, scale 0.3s, opacity 0.35s, transform 0.3s;
}
.resources .cl-page .cl-fcard::before {
  content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cl-card-accent, var(--orange)) 28%, transparent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.resources .cl-page .cl-fcard:hover::before {
  opacity: 1;
}
.resources .cl-page .cl-fcard:hover {
  border-color: color-mix(in srgb, var(--cl-card-accent, var(--orange)) 30%, transparent);
  box-shadow: var(--card-shadow-hover), 0 0 0 1px color-mix(in srgb, var(--cl-card-accent, var(--orange)) 14%, transparent) inset;
  scale: 1.03;
}
.resources .cl-page .cl-fcard.is-active {
  animation: re-cl-cardFlip 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  z-index: 100 !important;
  opacity: 1 !important;
  border-color: color-mix(in srgb, var(--cl-card-accent, var(--orange)) 45%, transparent) !important;
  box-shadow: var(--card-shadow-hover), 0 0 0 1.5px color-mix(in srgb, var(--cl-card-accent, var(--orange)) 20%, transparent) inset;
}
@keyframes re-cl-cardFlip {
  0% {
    transform: rotateX(0deg) rotateY(0deg) scale(1) translateY(0);
    opacity: 1;
  }
  40% {
    transform: rotateX(-20deg) rotateY(12deg) scale(1.1) translateY(-35px);
    opacity: 1;
  }
  100% {
    transform: rotateX(0deg) rotateY(0deg) scale(1.05) translateY(-8px);
    opacity: 1;
  }
}
.resources .cl-page .cl-fcard-math {
  top: 10px; left: 0; z-index: 3;
  --cl-card-accent: var(--orange);
  animation: re-cl-popIn 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.1s forwards,
             cl-floatA 5s ease-in-out 0.65s infinite;
}
.resources .cl-page .cl-fcard-phys {
  top: 50px; right: 0; z-index: 2;
  --cl-card-accent: #6399FF;
  animation: re-cl-popIn 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.35s forwards,
             cl-floatB 6s ease-in-out 0.9s infinite;
}
.resources .cl-page .cl-fcard-chem {
  bottom: 50px; left: 50px; z-index: 3;
  --cl-card-accent: #9B59B6;
  animation: re-cl-popIn 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.6s forwards,
             cl-floatC 7s ease-in-out 1.15s infinite;
}
.resources .cl-fcard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.resources .cl-page .cl-fcard-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--cl-card-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cl-card-accent) 22%, transparent);
}
.resources .cl-page .cl-fcard-icon svg { width: 18px; height: 18px; stroke: var(--cl-card-accent); }
.resources .cl-page .cl-fcard-badge {
  font-family: var(--font-b);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-block;
  background: var(--s3);
  border: 1px solid var(--bdr);
  color: var(--txt3);
}
.resources .cl-page .cl-fcard-subject {
  font-family: var(--font-d) !important;
  font-weight: 800 !important;
  font-size: 17px !important;
  color: var(--txt) !important;
  line-height: 1.2 !important;
  margin-bottom: 4px !important;
  display: block !important;
}
.resources .cl-page .cl-fcard-chapter {
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cl-card-accent);
  margin-bottom: 8px;
  display: block;
}
.resources .cl-page .cl-fcard-excerpt {
  font-family: var(--font-b);
  font-size: 12px;
  color: var(--txt2);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.resources .cl-fcard-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.resources .cl-page .cl-fcard-pages { font-family: var(--font-b); font-size: 11px; font-weight: 700; color: var(--txt3); }
.resources .cl-page .cl-fcard-tag {
  font-family: var(--font-b);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cl-card-accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--cl-card-accent) 22%, transparent);
  color: var(--cl-card-accent);
  display: inline-block;
  text-transform: uppercase;
}
/* ══════════════════════════════════════════
   SHARED SECTION WRAPPER
══════════════════════════════════════════ */
.resources .cl-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 48px;
}
.resources .cl-sec-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.resources .cl-page .cl-sec-title {
  font-family: var(--font-d) !important;
  font-weight: 800 !important;
  font-size: clamp(28px, 3vw, 36px) !important;
  letter-spacing: -1px !important;
  color: var(--txt) !important;
  line-height: 1.15 !important;
  display: block !important;
}
.resources .cl-page .cl-sec-sub {
  font-family: var(--font-b);
  font-size: 14.5px;
  color: var(--txt2);
  margin-top: 4px;
  display: block;
}
.resources .cl-page .cl-sec-link {
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1.5px solid var(--txt);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.resources .cl-page .cl-sec-link:hover { color: var(--orange); border-color: var(--orange); }
/* ══════════════════════════════════════════
   SUBJECTS
══════════════════════════════════════════ */
.resources .cl-subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.resources .cl-page .cl-subj-card {
  border-radius: 20px;
  background: var(--s2);
  border: 1px solid var(--bdr);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 32px;
  min-height: 220px;
  box-shadow: var(--card-shadow);
}
.resources .cl-page .cl-subj-card::before {
  content: ''; position: absolute; top: 0; left: 32px; right: 32px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--subj-clr) 28%, transparent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.resources .cl-page .cl-subj-card:hover::before {
  opacity: 1;
}
.resources .cl-page .cl-s-math { --subj-clr: var(--orange); }
.resources .cl-page .cl-s-physics { --subj-clr: #6399FF; }
.resources .cl-page .cl-s-chem { --subj-clr: #9B59B6; }
.resources .cl-page .cl-subj-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--subj-clr) 30%, transparent);
  box-shadow: var(--card-shadow-hover), 0 0 0 1px color-mix(in srgb, var(--subj-clr) 14%, transparent) inset;
}
.resources .cl-page .cl-subj-name {
  font-family: var(--font-d) !important;
  font-weight: 800 !important;
  font-size: 30px !important;
  letter-spacing: -1px !important;
  line-height: 1.1 !important;
  color: var(--txt) !important;
  margin-bottom: 6px !important;
  transition: color 0.2s;
}
.resources .cl-page .cl-subj-count {
  font-family: var(--font-b);
  font-size: 13.5px;
  color: var(--txt3);
  font-weight: 600;
}
.resources .cl-page .cl-subj-card:hover .cl-subj-name {
  color: var(--subj-clr) !important;
}
.resources .cl-page .cl-subj-icon {
  position: absolute;
  bottom: -24px;
  right: -24px;
  width: 140px;
  height: 140px;
  border-radius: 36px;
  background: color-mix(in srgb, var(--subj-clr) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--subj-clr) 18%, transparent);
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, border-color 0.3s;
}
.resources .cl-page .cl-subj-card:hover .cl-subj-icon {
  transform: scale(1.08) rotate(-8deg);
  background: color-mix(in srgb, var(--subj-clr) 12%, transparent);
  border-color: color-mix(in srgb, var(--subj-clr) 35%, transparent);
}
.resources .cl-page .cl-subj-icon svg {
  width: 64px;
  height: 64px;
  stroke: var(--subj-clr);
  transition: transform 0.3s;
}
/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .resources .cl-hero { grid-template-columns: 1fr; padding: 64px 32px; gap: 48px; }
  .resources .cl-hero-right { height: 340px; }
  .resources .cl-fcard { width: 220px; }
  .resources .cl-subjects-grid { grid-template-columns: repeat(3,1fr); }
  .resources .cl-section { padding: 64px 32px; }
}
@media (max-width: 640px) {
  .resources .cl-hero { padding: 48px 20px; }
  .resources .cl-hero-right { height: 320px; }
  .resources .cl-fcard { width: 195px; padding: 12px 14px; }
  .resources .cl-subjects-grid { grid-template-columns: 1fr; }
  .resources .cl-section { padding: 48px 20px; }
  .resources .cl-hero-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .resources .cl-hero-actions { justify-content: center; }
  .resources .cl-hero-sub { margin-left: auto; margin-right: auto; }
  .resources .cl-subj-card { padding: 24px; min-height: 180px; }
  .resources .cl-subj-icon { width: 120px; height: 120px; border-radius: 30px; bottom: -16px; right: -16px; }
  .resources .cl-subj-icon svg { width: 56px; height: 56px; }
}
