/*
Theme Name: CyberCrew CVE
Theme URI: https://cyber.spool.co.jp/
Author: ChatGPT
Description: CyberCrew-style CVE database theme (hero + search + severity filters + CVE card grid).
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cybercrew-cve
*/

:root{
  --bg:#f6faf9;
  --surface:#ffffff;
  --text:#0f172a;           /* slate-900 */
  --muted:#64748b;          /* slate-500 */
  --border:rgba(15,23,42,.10);
  --shadow:0 10px 30px rgba(15,23,42,.06);
  --brand:#10b0a0;          /* from logo dominant */
  --brand-2:#0abab5;
  --pill:#e7fbf8;
  --pillText:#0b7f75;
  --link:#0b7f75;
  --critical:#ef4444;
  --high:#f59e0b;
  --medium:#3b82f6;
  --low:#22c55e;
  --radius:14px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:linear-gradient(180deg, #eef6f5 0%, #ffffff 40%, var(--bg) 100%);
  color:var(--text);
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.65;
}
img{max-width:100%; height:auto; display:block}
a{color:var(--link); text-decoration:none}
a:hover{text-decoration:underline}

.container{
  width:min(1100px, 92vw);
  margin-inline:auto;
}

/* Header */
.site-header{
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand img{
  height:34px;
  width:auto;
}
.primary-nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:18px;
  align-items:center;
}
.primary-nav a{
  color:var(--muted);
  font-size:14px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:8px;
}
.primary-nav a:hover{color:var(--text); text-decoration:none}
.nav-icon{
  width:16px; height:16px;
  color:var(--muted);
}
.primary-nav a:hover .nav-icon{color:var(--text)}

/* Hero */
.hero{
  padding:56px 0 22px;
  text-align:center;
}
.hero-badge{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(16,176,160,.10);
  color:var(--pillText);
  font-weight:700;
  font-size:13px;
}
.hero h1{
  margin:18px 0 10px;
  font-size:44px;
  letter-spacing:-.02em;
}
.hero p{
  margin:0 auto;
  max-width:720px;
  color:var(--muted);
  font-size:16px;
}
.hero-stats{
  margin-top:18px;
  display:flex;
  justify-content:center;
  gap:26px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
}
.stat{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.icon{
  width:16px; height:16px;
  color:var(--brand);
}

/* Controls row */
.controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  padding:18px 0 10px;
  border-top:1px solid var(--border);
}
.searchbox{
  flex:1 1 520px;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
}
.searchbox input[type="search"]{
  width:100%;
  border:0;
  outline:0;
  font-size:14px;
  background:transparent;
  color:var(--text);
}
.filters{
  display:flex;
  gap:10px;
  flex:0 0 auto;
  flex-wrap:wrap;
}
.filter-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 14px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--muted);
  font-weight:700;
  font-size:13px;
}
.filter-btn:hover{
  color:var(--text);
  text-decoration:none;
}
.filter-btn.is-active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

/* Listing */
.result-count{
  color:var(--muted);
  font-size:13px;
  margin:14px 0 14px;
}
.grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:18px;
  padding-bottom:56px;
}
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:0 2px 12px rgba(15,23,42,.04);
  padding:18px 18px 14px;
  position:relative;
  min-height:220px;
}
.card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.cve-id{
  color:var(--brand);
  font-weight:800;
  font-size:12px;
  letter-spacing:.02em;
}
.card-title{
  margin:6px 0 10px;
  font-size:16px;
  letter-spacing:-.01em;
  line-height:1.35;
}
.card-title a{color:var(--text)}
.card-title a:hover{text-decoration:none; color:#0b2b2f}
.card-excerpt{
  color:var(--muted);
  font-size:13px;
  margin:0 0 14px;
}
.card-link{
  position:absolute;
  top:16px;
  right:16px;
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.9);
}
.card-link:hover{background:#fff; text-decoration:none}
.card-link svg{width:16px; height:16px; color:var(--muted)}
.card-link:hover svg{color:var(--text)}

/* Card footer */
.card-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-top:1px solid var(--border);
  padding-top:12px;
  margin-top:auto;
}
.badges{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:8px;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
}
.badge.sev-critical{background:rgba(239,68,68,.10); color:var(--critical); border-color:rgba(239,68,68,.22)}
.badge.sev-high{background:rgba(245,158,11,.12); color:var(--high); border-color:rgba(245,158,11,.25)}
.badge.sev-medium{background:rgba(59,130,246,.10); color:var(--medium); border-color:rgba(59,130,246,.22)}
.badge.sev-low{background:rgba(34,197,94,.10); color:var(--low); border-color:rgba(34,197,94,.22)}

.meta{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.meta svg{width:14px; height:14px; color:var(--muted)}

/* Single / Page */
.content-wrap{
  padding:30px 0 56px;
}
.paper{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:26px;
}
.single-title{
  margin:0 0 6px;
  font-size:30px;
  letter-spacing:-.02em;
}
.single-meta{
  color:var(--muted);
  font-size:13px;
  margin-bottom:18px;
}
.entry-content h2{
  margin-top:28px;
  font-size:18px;
  display:flex;
  align-items:center;
  gap:10px;
}
.entry-content h2:before{
  content:"";
  width:18px; height:18px;
  background:currentColor;
  -webkit-mask: var(--shield) no-repeat center / contain;
          mask: var(--shield) no-repeat center / contain;
  color:var(--brand);
}
.entry-content hr{
  border:0;
  border-top:1px solid var(--border);
  margin:18px 0;
}
.entry-content p, .entry-content li{
  color:#26324a;
}
.entry-content a{font-weight:700}

/* Pagination */
.pagination{
  display:flex;
  justify-content:center;
  gap:8px;
  padding:10px 0 56px;
}
.pagination a, .pagination span{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  font-size:13px;
  font-weight:800;
  color:var(--muted);
}
.pagination .current{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

/* Footer */
.site-footer{
  border-top:1px solid var(--border);
  padding:18px 0;
  color:var(--muted);
  font-size:13px;
  background:rgba(255,255,255,.65);
}

/* Responsive */
@media (max-width: 980px){
  .grid{grid-template-columns:repeat(2, 1fr);}
  .hero h1{font-size:38px;}
}
@media (max-width: 640px){
  .grid{grid-template-columns:1fr;}
  .hero{padding-top:40px;}
  .hero h1{font-size:32px;}
  .header-inner{flex-direction:column; align-items:flex-start;}
}


/* --- Single page sidebar + TOC --- */
.single-layout{
  display:flex;
  gap:18px;
  align-items:flex-start;
}
.single-main{flex:1 1 auto; min-width:0;}
.single-aside{
  flex:0 0 320px;
}
@media (max-width: 980px){
  .single-aside{flex-basis:280px;}
}
@media (max-width: 820px){
  .single-layout{flex-direction:column;}
  .single-aside{flex-basis:auto; width:100%;}
}

.toc-widget{
  background:#e9fbf7;
  border:1px solid rgba(16,176,160,.20);
  border-radius:14px;
  padding:16px 16px 14px;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
  position:sticky;
  top:18px;
}
.toc-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:10px;
  margin-bottom:10px;
  border-bottom:1px solid rgba(15,23,42,.10);
}
.toc-title{
  font-size:13px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#0b7f75;
  margin:0;
}
.toc-toggle{
  font-size:12px;
  font-weight:900;
  color:#0b7f75;
  text-decoration:none;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid rgba(16,176,160,.22);
  background:rgba(255,255,255,.6);
}
.toc-toggle:hover{text-decoration:none; background:#fff}

#cc-toc.is-collapsed .toc-list{display:none;}
.toc-list{
  margin:0;
  padding-left:18px;
}
.toc-list li{margin:6px 0; color:#0f172a;}
.toc-list a{
  color:#0f172a;
  font-weight:700;
  font-size:13px;
  text-decoration:none;
}
.toc-list a:hover{color:#0b7f75; text-decoration:underline;}
.toc-sublist{
  margin-top:6px;
  padding-left:18px;
}

/* Better anchor positioning for sticky header */
.entry-content h2, .entry-content h3{
  scroll-margin-top:90px;
}


/* --- Card featured image on listing --- */
.card{
  padding:0;              /* allow full-bleed image */
  overflow:hidden;
}
.card-media{
  position:relative;
  width:100%;
  height:120px;
  background:rgba(15,23,42,.04);
}
.card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.card-body{
  padding:18px 18px 14px;
}
.card-link{
  top:14px;
  right:14px;
}
.card-top{margin-top:2px;}


/* --- Single featured image --- */
.single-hero{
  margin: 0 0 16px;
}
.single-hero img{
  width:100%;
  height:auto;
  border-radius:14px;
}
