/* ==========================================================================
   Cybergen — Resource Centre
   ========================================================================== */

/* ---------- Hero ---------- */
.res-hero .sub { max-width: 560px; }
.res-search { position: relative; margin-top: 30px; max-width: 560px; }
.res-search svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.res-search input { width: 100%; height: 56px; padding: 0 20px 0 50px; border-radius: 12px; border: 1px solid rgba(148,212,244,.35); background: #fff; font: 500 15px/1 var(--font); color: var(--ink); box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.res-search input:focus { outline: 3px solid rgba(148,212,244,.55); outline-offset: 2px; }
.res-quick { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; font-size: 14px; color: rgba(255,255,255,.75); }
.res-quick b { color: #fff; font-weight: 700; }

/* fanned covers */
.res-fan { position: relative; height: 420px; }
.res-fan a { position: absolute; top: 50%; left: 50%; width: 230px; aspect-ratio: 210 / 297; border-radius: 8px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.45); border: 1px solid rgba(148,212,244,.25); transition: transform .5s var(--ease), box-shadow .3s; background: var(--navy-card); }
.res-fan img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-fan a:nth-child(1) { transform: translate(-112%, -46%) rotate(-9deg); }
.res-fan a:nth-child(2) { transform: translate(-50%, -54%); z-index: 2; }
.res-fan a:nth-child(3) { transform: translate(12%, -46%) rotate(9deg); }
.res-fan:hover a:nth-child(1) { transform: translate(-122%, -48%) rotate(-12deg); }
.res-fan:hover a:nth-child(3) { transform: translate(22%, -48%) rotate(12deg); }
.res-fan a:hover { box-shadow: 0 40px 80px rgba(0,0,0,.55); }

/* ---------- Featured ---------- */
.res-featured { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; background: var(--navy-card); border: 1px solid var(--line-dark); border-radius: 22px; padding: 48px 56px; color: #fff; position: relative; overflow: hidden; }
.res-featured::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 50%, rgba(11,106,163,.45), transparent 55%); pointer-events: none; }
.res-featured > * { position: relative; }
.res-featured .cover { aspect-ratio: 210 / 297; border-radius: 8px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.5); transform: rotate(-3deg); transition: transform .4s var(--ease); }
.res-featured:hover .cover { transform: rotate(0) scale(1.02); }
.res-featured .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-featured h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; margin: 14px 0 14px; color: #fff; }
.res-featured p { color: rgba(255,255,255,.75); font-size: 16px; line-height: 1.65; max-width: 620px; }
.res-featured ul { list-style: none; padding: 0; margin: 22px 0 30px; display: grid; gap: 10px; }
.res-featured li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.85); font-size: 15px; }
.res-featured li svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }

/* ---------- Toolbar ---------- */
.res-toolbar { position: sticky; top: 72px; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.res-toolbar .wrap { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.res-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.res-filters::-webkit-scrollbar { display: none; }
.res-filters .pf { flex-shrink: 0; padding: 10px 16px; font-size: 13px; }
.res-filters .pf span { display: inline-block; min-width: 22px; margin-left: 6px; padding: 3px 7px; border-radius: 99px; background: var(--light); color: var(--muted); font-size: 11px; font-weight: 700; }
.res-filters .pf.on span { background: rgba(255,255,255,.18); color: #fff; }
.res-count { flex-shrink: 0; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Library ---------- */
.res-group { margin-top: 64px; }
.res-group:first-child { margin-top: 0; }
.res-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.res-group-head h2 { font-size: 26px; color: var(--navy); margin: 6px 0 0; }
.res-group-head p { margin: 0; max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.res-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.res-card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px rgba(7,28,66,.12); border-color: rgba(11,106,163,.35); }
.res-cover { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3.4; padding: 22px; background: radial-gradient(circle at 50% 120%, #0a4a7c, #03234b 55%, var(--navy) 100%); overflow: hidden; }
.res-cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(148,212,244,.05) 0 1px, transparent 1px 34px), repeating-linear-gradient(0deg, rgba(148,212,244,.05) 0 1px, transparent 1px 34px); pointer-events: none; }
.res-cover img { position: relative; z-index: 1; max-height: 100%; max-width: 100%; width: auto; height: auto; border-radius: 4px; box-shadow: 0 16px 32px rgba(0,0,0,.45); transition: transform .4s var(--ease); }
.res-card:hover .res-cover img { transform: scale(1.04) rotate(-1.5deg); }
.res-cover.wide img { max-height: 92%; }
.res-badge { position: absolute; z-index: 2; top: 14px; left: 14px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); background: var(--accent); border-radius: 99px; padding: 5px 10px; }
.res-body { display: flex; flex-direction: column; flex: 1; padding: 20px 20px 18px; }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.res-meta span { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--blue); background: rgba(11,106,163,.08); border-radius: 99px; padding: 4px 9px; }
.res-meta span.pub { color: var(--muted); background: var(--light); }
.res-body h3 { font-size: 16px; line-height: 1.35; color: var(--navy); margin: 0 0 8px; }
.res-body p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.res-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.res-file { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.res-file svg { width: 16px; height: 16px; color: var(--red); }
.res-dl { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--blue); }
.res-dl svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.res-card:hover .res-dl svg { transform: translateY(2px); }
.res-stretch::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.res-card { position: relative; }
.res-card:focus-within { outline: 3px solid rgba(11,106,163,.4); outline-offset: 2px; }
.res-card a:focus { outline: none; }

.res-empty { display: none; text-align: center; padding: 60px 20px; color: var(--muted); }
.res-empty b { display: block; font-size: 20px; color: var(--navy); margin-bottom: 8px; }
.res-empty.show { display: block; }
.is-hidden { display: none !important; }

/* ---------- Free tools ---------- */
.res-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 44px; }
.res-tool { position: relative; display: grid; grid-template-columns: 1fr 200px; gap: 24px; align-items: center; padding: 34px; border-radius: 18px; background: rgba(148,212,244,.05); border: 1px solid var(--line-dark); transition: border-color .3s, transform .3s var(--ease); }
.res-tool:hover { border-color: rgba(148,212,244,.5); transform: translateY(-3px); }
.res-tool .free { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--navy); background: var(--accent); padding: 5px 10px; border-radius: 99px; }
.res-tool h3 { color: #fff; font-size: 21px; margin: 14px 0 10px; }
.res-tool p { color: rgba(255,255,255,.72); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.res-tool .go { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 14px; }
.res-tool .go svg { width: 16px; height: 16px; }
.res-tool img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 16px 32px rgba(0,0,0,.35); }

/* ---------- Brochure ---------- */
.res-brochure { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px 48px; border-radius: 20px; background: linear-gradient(120deg, var(--blue), var(--navy-3)); color: #fff; }
.res-brochure h2 { color: #fff; font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 8px; }
.res-brochure p { margin: 0; color: rgba(255,255,255,.8); max-width: 600px; line-height: 1.6; }
.res-brochure .btn { flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .res-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1080px) {
  .res-fan { height: 340px; }
  .res-fan a { width: 190px; }
  .res-tools { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .res-featured { grid-template-columns: 1fr; padding: 34px 26px; gap: 34px; }
  .res-featured .cover { max-width: 220px; margin: 0 auto; }
  .res-group-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .res-brochure { flex-direction: column; align-items: flex-start; padding: 32px 26px; }
}
@media (max-width: 760px) {
  .res-fan { display: none; }
  .res-count { display: none; }
  .res-tool { grid-template-columns: 1fr; padding: 26px; }
  .res-tool img { max-width: 260px; }
}
@media (max-width: 520px) {
  .res-grid { grid-template-columns: 1fr; }
  .res-cover { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .res-fan a, .res-card, .res-cover img, .res-featured .cover { transition: none; }
}
