/* cy-resources.css — CyberLegends Digest / Cybersecurity Resources.
   Brand: #002E5B (primary), #1A76D1 (secondary), #F9A61A (accent),
   font Poppins (loaded by the page templates). No new font downloads.
   Light + dark: follows the site theme switcher ([data-theme="dark"]
   from the i18n package) and falls back to the visitor's system
   preference when no theme is set. RTL: flex/grid + logical
   properties only, so Arabic/Urdu flip automatically. */

:root {
  --cy-primary: #002e5b;
  --cy-secondary: #1a76d1;
  --cy-accent: #f9a61a;
  --cy-bg: #f5f7fa;
  --cy-surface: #ffffff;
  --cy-surface-muted: #eef2f7;
  --cy-text: #1c2b3a;
  --cy-muted: #5a6b7d;
  --cy-border: #d7e0ea;
  --cy-focus: #1a76d1;
  --cy-on-primary: #ffffff;
  --cy-shadow: 0 6px 24px rgba(0, 46, 91, 0.08);
}

[data-theme="dark"] {
  --cy-bg: #0e1a2b;
  --cy-surface: #16283f;
  --cy-surface-muted: #1e3450;
  --cy-text: #e8eef5;
  --cy-muted: #a9bacd;
  --cy-border: #2c4767;
  --cy-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cy-bg: #0e1a2b;
    --cy-surface: #16283f;
    --cy-surface-muted: #1e3450;
    --cy-text: #e8eef5;
    --cy-muted: #a9bacd;
    --cy-border: #2c4767;
    --cy-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

.cy-resources {
  background: var(--cy-bg);
  color: var(--cy-text);
  font-family: "Poppins", sans-serif;
  padding-block: 2.5rem 3.5rem;
}

.cy-resources a { color: var(--cy-secondary); }
.cy-resources a:focus-visible,
.cy-resources button:focus-visible,
.cy-resources input:focus-visible {
  outline: 3px solid var(--cy-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Breadcrumbs */
.cy-crumbs { margin-block-end: 1.5rem; }
.cy-crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--cy-muted);
}
.cy-crumbs li + li::before {
  content: "/";
  margin-inline-end: 0.35rem;
  color: var(--cy-muted);
}
.cy-crumbs a { color: var(--cy-secondary); text-decoration: none; }
.cy-crumbs a:hover { text-decoration: underline; }

/* Page header */
.cy-resources-head { max-width: 820px; margin-block-end: 2rem; }
.cy-resources-head h1 {
  color: var(--cy-primary);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-block-end: 0.5rem;
}
[data-theme="dark"] .cy-resources-head h1 { color: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cy-resources-head h1 { color: #ffffff; }
}
.cy-tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cy-secondary);
  margin-block-end: 0.4rem;
}
.cy-intro { color: var(--cy-muted); font-size: 1rem; line-height: 1.7; }

/* Signup box */
.cy-signup {
  background: linear-gradient(135deg, var(--cy-primary), var(--cy-secondary));
  color: #fff;
  border-radius: 16px;
  padding: 1.75rem;
  margin-block-end: 2rem;
  box-shadow: var(--cy-shadow);
}
.cy-signup h2 { font-size: 1.3rem; font-weight: 700; margin-block-end: 0.5rem; }
.cy-signup p { margin-block-end: 1rem; opacity: 0.95; }
.cy-signup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.cy-signup-field { flex: 1 1 200px; display: grid; gap: 0.3rem; }
.cy-signup-field label { font-size: 0.9rem; font-weight: 600; }
.cy-signup-field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 2px solid transparent;
  font: inherit;
  color: #1c2b3a;
  background: #fff;
}
.cy-signup-btn {
  background: var(--cy-accent);
  color: #002e5b;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cy-signup-btn:hover { filter: brightness(1.05); }
.cy-privacy { font-size: 0.85rem; opacity: 0.9; margin-block: 0.75rem 0; }
.cy-signup-ok, .cy-signup-err {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-block-start: 0.75rem;
  font-weight: 600;
}
.cy-signup-ok { background: rgba(255, 255, 255, 0.16); }
.cy-signup-err { background: #b3261e; color: #fff; }

/* Filter toolbar */
.cy-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 1rem;
}
.cy-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cy-filter-btn {
  border: 2px solid var(--cy-border);
  background: var(--cy-surface);
  color: var(--cy-text);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.cy-filter-btn:hover { border-color: var(--cy-secondary); }
.cy-filter-btn[aria-pressed="true"] {
  background: var(--cy-primary);
  border-color: var(--cy-primary);
  color: #fff;
}
.cy-search { flex: 1 1 240px; max-width: 340px; }
.cy-search input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--cy-border);
  background: var(--cy-surface);
  color: var(--cy-text);
  font: inherit;
  font-size: 0.95rem;
}
.cy-count { color: var(--cy-muted); font-size: 0.9rem; margin-block-end: 1rem; }
.cy-empty {
  background: var(--cy-surface);
  border: 1px solid var(--cy-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--cy-muted);
}

/* Insight cards grid */
.cy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-block-end: 1.5rem;
}
.cy-card {
  background: var(--cy-surface);
  border: 1px solid var(--cy-border);
  border-radius: 14px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--cy-shadow);
}
.cy-card:hover { border-color: var(--cy-secondary); }
.cy-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--cy-muted);
}
.cy-tag {
  background: var(--cy-surface-muted);
  color: var(--cy-primary);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
}
[data-theme="dark"] .cy-tag { color: #ffd166; }
.cy-card h2, .cy-card h3 { font-size: 1.15rem; line-height: 1.35; margin: 0; }
.cy-card h2 a, .cy-card h3 a {
  color: var(--cy-text);
  text-decoration: none;
}
.cy-card h2 a:hover, .cy-card h3 a:hover {
  color: var(--cy-secondary);
  text-decoration: underline;
}
.cy-card p { color: var(--cy-muted); line-height: 1.65; margin: 0; flex: 1; }
.cy-readmore {
  align-self: flex-start;
  background: var(--cy-secondary);
  color: #fff !important;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.cy-readmore:hover { background: var(--cy-primary); }

/* Pagination + Load more */
.cy-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-block: 0.5rem 1rem;
}
.cy-pages a, .cy-pages span {
  min-width: 2.4rem;
  text-align: center;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--cy-border);
  background: var(--cy-surface);
  color: var(--cy-text);
  text-decoration: none;
  font-weight: 600;
}
.cy-pages span[aria-current="page"] {
  background: var(--cy-primary);
  border-color: var(--cy-primary);
  color: #fff;
}
.cy-loadmore-wrap { text-align: center; margin-block-end: 1rem; }
.cy-loadmore {
  background: var(--cy-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cy-loadmore:hover { background: var(--cy-secondary); }
.cy-loadmore[disabled] { opacity: 0.6; cursor: wait; }

/* CTA box */
.cy-cta {
  background: var(--cy-surface);
  border: 2px solid var(--cy-accent);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  margin-block-start: 2rem;
  box-shadow: var(--cy-shadow);
}
.cy-cta h2 { color: var(--cy-primary); font-size: 1.35rem; margin-block-end: 0.5rem; }
[data-theme="dark"] .cy-cta h2 { color: #ffd166; }
.cy-cta p { color: var(--cy-muted); margin-block-end: 1rem; }
.cy-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.cy-btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--cy-secondary);
}
.cy-btn-primary { background: var(--cy-secondary); color: #fff !important; }
.cy-btn-primary:hover { background: var(--cy-primary); border-color: var(--cy-primary); }
.cy-btn-outline { background: transparent; color: var(--cy-secondary) !important; }
.cy-btn-outline:hover { background: var(--cy-surface-muted); }

/* Detail page */
.cy-article { max-width: 820px; margin-inline: auto; }
.cy-article h1 {
  color: var(--cy-primary);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.25;
  margin-block: 0.5rem 0.75rem;
}
[data-theme="dark"] .cy-article h1 { color: #ffffff; }
.cy-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  color: var(--cy-muted);
  font-size: 0.92rem;
  margin-block-end: 1rem;
}
.cy-share { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-end: 1.5rem; }
.cy-share a {
  border: 1px solid var(--cy-border);
  background: var(--cy-surface);
  color: var(--cy-text) !important;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.cy-share a:hover { border-color: var(--cy-secondary); color: var(--cy-secondary) !important; }
.cy-article section { margin-block-end: 1.75rem; }
.cy-article h2 {
  color: var(--cy-primary);
  font-size: 1.3rem;
  margin-block-end: 0.5rem;
  padding-block-start: 0.5rem;
  border-block-start: 3px solid var(--cy-accent);
}
[data-theme="dark"] .cy-article h2 { color: #ffd166; }
.cy-article section p { line-height: 1.8; color: var(--cy-text); }
.cy-source-box {
  background: var(--cy-surface-muted);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.cy-source-box p { margin-block-end: 0.6rem; }
.cy-related { margin-block-start: 2.5rem; }
.cy-related > h2 { border-block-start: none; }

@media (max-width: 576px) {
  .cy-resources { padding-block: 1.5rem 2.5rem; }
  .cy-signup, .cy-cta { padding: 1.25rem; }
  .cy-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .cy-resources * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ v2 GUI refresh (2026-11-22)
   Root cause of the "CSS not working" report: cy-resources.css and
   cy-resources.js existed only in main_cyber/static/ and never
   reached public_html/static/, the served root, so both 404'd and
   the page rendered with Bootstrap only. This refresh also brings
   the page in line with the blog/homepage: gradient hero with
   floating shapes, animated stats counters, icon cards with a scroll
   reveal and hover lift, and the site's own animations.css/js reveal
   system. Cards use an IntersectionObserver reveal (v2.1 note below),
   not .reveal: the filter/search/load-more JS swaps the grid via
   innerHTML, and elements added after animations.js ran would never
   be observed, so .reveal on a card would leave it invisible
   (opacity 0). The hero h1 carries no inner span: the i18n script
   sets textContent, which would wipe it; the accent is an ::after
   bar instead. */
.cy-resources { padding-block: 0 3.5rem; }

/* Hero (list + detail share .cy-hero; detail adds .cy-hero-compact) */
.cy-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #002e5b 0%, #0a4a86 55%, #1a76d1 100%);
  color: #fff;
  padding: 3rem 0 3.5rem;
  margin-block-end: 2.5rem;
}
.cy-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
}
.cy-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -120px;
  inset-block-start: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 166, 26, 0.35), transparent 70%);
  pointer-events: none;
}
.cy-hero .container { position: relative; z-index: 1; }
.cy-hero .cy-crumbs { color: rgba(255, 255, 255, 0.75); margin-block-end: 1.25rem; }
.cy-hero .cy-crumbs a { color: #ffd166; }
.cy-hero .cy-crumbs li + li::before { color: rgba(255, 255, 255, 0.6); }
.cy-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-block-end: 1rem;
}
.cy-hero-badge i { color: var(--cy-accent); }
.cy-hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-block-end: 0.75rem;
}
.cy-hero h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  background: var(--cy-accent);
  border-radius: 2px;
  margin-block-start: 0.7rem;
}
.cy-hero .cy-tagline {
  color: #dbeafe;
  font-size: 1.15rem;
  font-weight: 600;
  margin-block-end: 0.4rem;
}
.cy-hero .cy-intro {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 720px;
  margin-block-end: 1.5rem;
}
.cy-hero-stats { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.cy-hero-stat { display: flex; flex-direction: column; }
.cy-hero-stat strong { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.1; }
.cy-hero-stat span { font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); }
.cy-hero-shape {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.cy-hero-shape.s1 { width: 90px; height: 90px; inset-inline-end: 12%; inset-block-start: 20%; }
.cy-hero-shape.s2 { width: 46px; height: 46px; inset-inline-end: 24%; inset-block-end: 16%; background: rgba(249, 166, 26, 0.25); border: none; }
.cy-hero-shape.s3 { width: 140px; height: 140px; inset-inline-end: 4%; inset-block-end: -40px; }
.cy-hero-compact { padding: 2.25rem 0 2.5rem; margin-block-end: 2rem; }
.cy-hero-compact h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.cy-hero .cy-article-meta { color: rgba(255, 255, 255, 0.85); }
.cy-hero .cy-tag { background: rgba(255, 255, 255, 0.16); color: #ffd166; }
.cy-hero .cy-share { margin-block-end: 0; }
.cy-hero .cy-share a {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff !important;
}
.cy-hero .cy-share a:hover { background: #fff; color: var(--cy-primary) !important; border-color: #fff; }

/* Signup: icon header + dotted pattern overlay */
.cy-signup { position: relative; overflow: hidden; }
.cy-signup::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.cy-signup > * { position: relative; z-index: 1; }
.cy-signup-head { display: flex; gap: 1rem; align-items: flex-start; margin-block-end: 0.25rem; }
.cy-signup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffd166;
  font-size: 1.4rem;
}

/* Search input with icon */
.cy-search-box { position: relative; }
.cy-search-box > i {
  position: absolute;
  inset-inline-start: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cy-muted);
  pointer-events: none;
}
.cy-search-box input { padding-inline-start: 2.5rem; }

/* Cards: scroll reveal via IntersectionObserver (see cy-resources.js).
   The v2 keyframe entrance is REMOVED on purpose: its fill-mode kept
   the final keyframe applied forever, which overrode the :hover lift,
   and it played at page load instead of on scroll. The hidden state
   below applies only when the JS adds .cy-cards-js to <html>, so the
   cards stay fully visible if the script fails to load. */
.cy-cards-js .cy-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.cy-cards-js .cy-card.in-view { opacity: 1; transform: translateY(0); }
.cy-cards-js .cy-card.in-view:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 46, 91, 0.16);
  border-color: var(--cy-secondary);
}
.cy-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.cy-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cy-primary), var(--cy-secondary), var(--cy-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cy-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 46, 91, 0.16);
  border-color: var(--cy-secondary);
}
.cy-card:hover::before { opacity: 1; }
.cy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.cy-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cy-primary), var(--cy-secondary));
  color: #fff;
  font-size: 1.15rem;
}
.cy-readtime { display: inline-flex; align-items: center; gap: 0.3rem; }
.cy-readmore i { transition: transform 0.25s ease; margin-inline-start: 0.2rem; }
.cy-readmore:hover i { transform: translateX(4px); }

@media (max-width: 576px) {
  .cy-hero { padding: 2rem 0 2.5rem; margin-block-end: 1.75rem; }
  .cy-hero-shape { display: none; }
  .cy-hero-stats { gap: 0.75rem 1.5rem; }
  .cy-signup-head { flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ v2.1 fixes (2026-11-22)
   Found by the live browser re-test. (1) High-contrast text on the
   gradient hero and signup box: the subtitle, privacy line and hero
   breadcrumb were hard to read, so they are now solid white (with a
   soft shadow on the hero lines). (2) The v2 keyframe entrance is
   replaced by the IntersectionObserver reveal above. */
.cy-signup h2, .cy-signup p, .cy-signup label { color: #fff !important; }
.cy-signup p { opacity: 1; }
.cy-privacy { color: rgba(255, 255, 255, 0.92) !important; opacity: 1; }
.cy-hero .cy-crumbs, .cy-hero .cy-crumbs li { color: #fff !important; }
.cy-hero .cy-crumbs li + li::before { color: rgba(255, 255, 255, 0.8); }
.cy-hero .cy-tagline, .cy-hero .cy-intro { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
