/* Advisories site. Colours, fonts and building blocks taken from the main
   Perceptive Security site (public/css/style.css), plus filter chips and a
   Critical level. Self-hosted fonts: no requests to Google. */
/* Poppins and Open Sans (SIL Open Font License), self-hosted from Google Fonts:
   latin plus latin-ext (accented letters). Open Sans is one variable font for all weights. */
@font-face { font-family: 'Open Sans'; font-weight: 400 700; font-display: swap; src: url('/static/fonts/open-sans-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Open Sans'; font-weight: 400 700; font-display: swap; src: url('/static/fonts/open-sans.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/static/fonts/poppins-400-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/static/fonts/poppins-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/static/fonts/poppins-600-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('/static/fonts/poppins-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/static/fonts/poppins-700-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/static/fonts/poppins-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #141416;
  --card: rgba(20, 20, 22, .55);
  --border: rgba(138, 138, 138, .25);
  --text: #ffffff;
  --text-dim: #8a8a8a;
  --accent: #30729a;
  --accent-light: #4894bd;
  --accent-pale: #7fb7d4;
  --critical: #8b0000;
  --danger: #d64550;
  --severity-high: #e8792a;
  --severity-medium: #e8c72a;
  --search-hit-bg: #ffe58a;
  --radius: 10px;
  --max-width: 1120px;
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); position: relative;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background: url('/static/images/hero-bg-v2.jpg') center top / cover no-repeat; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 50%, rgba(33, 71, 95, .93) 0%, rgba(27, 28, 30, .95) 100%); }
a { color: var(--accent-pale); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: 'Poppins', sans-serif; line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(20, 20, 22, .88);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: block; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-lockup { display: flex; align-items: center; gap: .6rem; }
.brand-icon { display: block; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.125rem; }
.brand-tagline { font-size: .75rem; font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { color: var(--text-dim); font-size: .9rem; }

/* Buttons */
.btn { display: inline-block; padding: .6rem 1.2rem; border-radius: var(--radius); font-weight: 600; font-size: .95rem; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: transparent; cursor: pointer; font-family: inherit; }
.btn-ghost:hover { border-color: var(--accent-light); }

/* Page header and sections */
.page-header { padding: 2.5rem 0 1.5rem; text-align: center; }
.page-header h1 { margin-bottom: .3rem; }
.hero-sub { font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
/* Banner as on the main site's Early warnings page */
.hero-banner { display: block; margin: 0 auto 1.5rem; max-width: 100%; height: auto; border-radius: 6px; }
.section { padding: 1.5rem 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .6rem;
  text-align: center; backdrop-filter: blur(4px); display: flex; flex-direction: column; justify-content: flex-start; }
.stat-value { display: block; font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent-pale); line-height: 1.2; }
.stat-label { display: block; color: var(--text-dim); font-size: .78rem; margin-top: .15rem; }
.stat-week { text-align: left; padding-left: 1rem; gap: .1rem; justify-content: center; }
.stat-week .stat-label { margin: 0 0 .15rem; }
.week-line { font-size: .85rem; display: flex; align-items: center; gap: .45rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; flex-shrink: 0; }
.dot-C { background: var(--critical); box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.dot-H { background: var(--severity-high); }
.dot-M { background: var(--severity-medium); }

/* Trending */
.block-title { font-size: 1.1rem; margin-bottom: .6rem; }
.trending { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(4px); }
.trending li { display: grid; grid-template-columns: 1.5rem auto 1fr auto; align-items: center; gap: .4rem .75rem;
  padding: .6rem 1rem; border-top: 1px solid var(--border); }
.trending li:first-child { border-top: 0; }
.trending .rank { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--text-dim); text-align: center; }
.trend-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.trend-sources { color: var(--text-dim); font-size: .82rem; white-space: nowrap; }

/* Get alerts page */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); gap: 1.25rem; justify-content: center; }
.channel-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; backdrop-filter: blur(4px); }
.channel-card h2 { font-size: 1.25rem; }
.alerts-link { margin: 1.25rem 0 0; font-weight: 600; }

/* Filters */
.filter-bar { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.5rem; }
.search-row { display: flex; gap: .6rem; }
.search-row input[type=search] { flex: 1; min-width: 0; background: rgba(20,20,22,.7); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; padding: .6rem .8rem; border-radius: var(--radius); font-size: .95rem; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; border: 0; margin: 0; padding: 0; }
.filter-group legend, .filter-label { float: left; margin-right: .3rem; color: var(--text-dim); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border); border-radius: 999px;
  padding: .25rem .75rem; font-size: .82rem; color: var(--text); background: var(--card); cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--accent-light); text-decoration: none; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked), .chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent-pale); outline-offset: 2px; }
.chip .count { color: var(--text-dim); font-size: .75rem; }
.chip:has(input:checked) .count, .chip.is-active .count { color: #dfeef7; }
.chip-level-C:has(input:checked) { background: var(--critical); border-color: var(--critical); }
.chip-level-H:has(input:checked) { background: var(--severity-high); border-color: var(--severity-high); color: #2a1200; }
.chip-level-M:has(input:checked) { background: var(--severity-medium); border-color: var(--severity-medium); color: #2a2400; }
.js .apply-btn { display: none; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem; position: relative; z-index: 20; }
.filter-group.levels { margin-right: .4rem; }
.filter-panel { position: static; }
.filter-panel summary { list-style: none; padding: .3rem .9rem; font-size: .85rem; user-select: none; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel summary::after { content: " ▾"; color: var(--text-dim); }
.filter-panel[open] summary { border-color: var(--accent-light); }
.filter-panel[open] summary::after { content: " ▴"; }
/* The panel folds out below the whole button row, over the list, so the
   buttons never move. Closes on a click elsewhere or Escape (filters.js). */
.panel-body .chip { background: #222327; }
.panel-body { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); z-index: 20;
  display: flex; flex-wrap: wrap; gap: .45rem; padding: .75rem; max-height: 60vh; overflow-y: auto;
  background: #18191b; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.match-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border: 0; padding: 0; margin: 0; }
.match-row legend { float: left; padding: 0; }
.match-option { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; cursor: pointer; }
.match-option input { accent-color: var(--accent); margin: 0; }
.match-hint { color: var(--text-dim); font-size: .8rem; }
.feed-box { font-size: .85rem; scroll-margin-top: 90px; }
.feed-box summary { cursor: pointer; color: var(--accent-pale); display: inline-block; }
.feed-body { margin-top: .6rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; max-width: 720px; }
.feed-body p { margin: 0 0 .6rem; }
.feed-link { display: flex; gap: .5rem; margin-bottom: .7rem; }
.feed-link input { flex: 1; min-width: 0; background: #0f1012; color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: .45rem .6rem; font-size: .8rem; font-family: ui-monospace, Menlo, monospace; }
.feed-howto { margin: 0 0 .6rem; padding-left: 1.1rem; }
.feed-howto li { margin-bottom: .3rem; }
.feed-box .note { color: var(--text-dim); font-size: .78rem; margin: 0; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.active-filters:empty { display: none; }
.clear-all { font-size: .82rem; color: var(--text-dim); text-decoration: underline; margin-left: .2rem; }

/* Results */
.results-count { font-size: .85rem; color: var(--text-dim); margin: 0 0 1rem; }
mark.search-hit { background: var(--search-hit-bg); color: #2a2400; padding: 0 .1em; border-radius: 3px; }
.advisory-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.advisory-item { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; backdrop-filter: blur(4px); overflow-wrap: anywhere; }
.advisory-item.level-C { border-left-color: var(--critical); }
.advisory-item.level-H { border-left-color: var(--severity-high); }
.advisory-item.level-M { border-left-color: var(--severity-medium); }
.advisory-item.level-L { border-left-color: var(--accent-pale); }
.advisory-meta { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; font-size: .8rem; color: var(--text-dim); margin-bottom: .4rem; }
.advisory-item h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.advisory-item h3 a { color: var(--text); }
.summary-short { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .5rem; }
.item-line { font-size: .85rem; color: var(--text-dim); margin: .2rem 0 0; }
.item-line a { color: var(--accent-pale); }
.badge { text-transform: uppercase; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 5px; background: var(--accent); color: #fff; }
.badge-C { background: var(--critical); }
.badge-H { background: var(--severity-high); color: #2a1200; }
.badge-M { background: var(--severity-medium); color: #2a2400; }
.badge-L { background: var(--accent-pale); color: #04263a; }
.pagination { display: flex; gap: .4rem; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Story page */
.detail-back { display: inline-block; margin: 1.5rem 0 1rem; color: var(--text-dim); font-size: .85rem; }
.detail-header .advisory-meta { border: 1px dashed var(--border); border-radius: var(--radius); padding: .5rem .85rem; margin-bottom: .75rem; }
.detail-section { margin-top: 1.75rem; overflow-wrap: anywhere; }
.detail-section h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin-bottom: .6rem; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.pill { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.plain-list .when { color: var(--text-dim); font-size: .8rem; margin-right: .5rem; }
.detail-section .note { display: block; color: var(--text-dim); font-size: .8rem; margin-top: .25rem; }
#references a { overflow-wrap: anywhere; }
.exploited { color: var(--danger); font-weight: 700; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; text-align: center; padding: 1.75rem 1rem 2.5rem;
  color: var(--text-dim); font-size: .8rem; }
.site-footer p { margin: 0 0 .3rem; }
.site-footer a { color: var(--text-dim); text-decoration: underline; }

@media (max-width: 800px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-week { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; text-align: center; padding-left: .6rem; }
  .stat-week .stat-label { width: 100%; }
}
@media (max-width: 600px) {
  .nav-link { display: none; }
  .brand-name { font-size: 1rem; }
  .trending li { grid-template-columns: 1.5rem auto 1fr; gap: .25rem .6rem; }
  .trending .rank { grid-row: 1 / 3; align-self: start; }
  .trend-sources { grid-column: 3; grid-row: 1; }
  .trend-title { grid-column: 2 / -1; grid-row: 2; }
}

/* Details from the full article text (what to do, versions, IOCs) */
.actions { margin: .25rem 0 0 1.2rem; padding: 0; }
.actions li { margin: .3rem 0; }
.ioc-kind { display: inline-block; color: var(--text-dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-right: .4rem; }
.ioc-list { list-style: none; margin: .2rem 0 .6rem; padding: 0; }
.ioc-list li { margin: .15rem 0; }
.ioc-list code, .ioc-kind + code { font-size: .85rem; overflow-wrap: anywhere; }
.ai-note { color: var(--text-dim); font-size: .85rem; margin-top: .5rem; }
