/* ============================================
   PetirPedia — Main Stylesheet
   Mobile-first · No CLS · Zero framework
   ============================================ */

/* --- Reset & tokens --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --storm: #0E1726;
  --storm-2: #16213A;
  --card: #1B273F;
  --line: rgba(255, 255, 255, 0.1);
  --ink: #0E1726;
  --bg: #FFFFFF;
  --bg-soft: #F3F6FB;
  --text: #1C2433;
  --text-soft: #56617A;
  --muted: #8A93A8;
  --border: #E3E8F0;
  --bolt: #F5B731;
  --bolt-deep: #E09A0C;
  --electric: #3D6FE0;
  --electric-light: #5B8DEF;
  --danger: #E0483D;
  --safe: #2E9E5B;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Base --- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--electric); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* Reserve space to avoid CLS on images: use aspect-ratio everywhere */

/* --- Skip link (a11y) --- */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--bolt); color: var(--ink); padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600; z-index: 1000; }
.skip-link:focus { left: 0; }

/* --- Container --- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* --- Header --- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--storm); color: #fff; border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; background: var(--bolt); border-radius: 9px; display: grid; place-items: center; color: var(--ink); font-size: 18px; }
.brand span b { color: var(--bolt); }

/* Nav */
.nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.main-nav { display: none; }
.main-nav.open { display: block; }
.main-nav ul { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 16px; }
.main-nav a { display: block; color: #C7D0E0; font-weight: 500; font-size: 15px; padding: 12px 8px; border-radius: 8px; }
.main-nav a:hover { background: var(--storm-2); color: #fff; text-decoration: none; }

@media (min-width: 880px) {
  .nav-toggle { display: none; }
  .main-nav { display: block !important; }
  .main-nav ul { flex-direction: row; gap: 6px; padding: 0; }
  .main-nav a { padding: 9px 16px; font-size: 14.5px; }
}

/* --- Hero --- */
.hero { background: linear-gradient(160deg, var(--storm) 0%, var(--storm-2) 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 85% 15%, rgba(245,183,49,0.14), transparent 45%); pointer-events: none; }
.hero-inner { position: relative; padding-block: 56px 64px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: 13px; color: #C7D0E0; margin-bottom: 22px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(32px, 7vw, 60px); font-weight: 800; line-height: 1.06; letter-spacing: -0.02em; margin-bottom: 18px; max-width: 16ch; }
.hero h1 .hl { color: var(--bolt); }
.hero p { font-size: clamp(16px, 2.4vw, 19px); color: #C7D0E0; max-width: 56ch; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 15px; padding: 13px 26px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--bolt); color: var(--ink); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(245,183,49,0.35); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-outline:hover { border-color: #fff; }

/* --- Section --- */
.section { padding-block: 56px; }
.section-soft { background: var(--bg-soft); }
.section-head { margin-bottom: 32px; }
.section-head.center { text-align: center; max-width: 60ch; margin-inline: auto; }
.eyebrow { display: inline-block; font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--electric); margin-bottom: 10px; }
.section-title { font-family: var(--font-display); font-size: clamp(26px, 4.5vw, 38px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
.section-head p { margin-top: 12px; color: var(--text-soft); font-size: 17px; }

/* --- Silo category cards --- */
.silo-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 700px) { .silo-grid { grid-template-columns: repeat(3, 1fr); } }
.silo-card { display: block; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 26px; color: var(--text); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.silo-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 14px 34px rgba(14,23,38,0.1); border-color: transparent; }
.silo-icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; font-size: 26px; margin-bottom: 18px; }
.silo-icon.sci { background: rgba(61,111,224,0.12); }
.silo-icon.safe { background: rgba(46,158,91,0.12); }
.silo-icon.myth { background: rgba(224,72,61,0.12); }
.silo-card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.silo-card p { font-size: 14.5px; color: var(--text-soft); line-height: 1.6; }
.silo-card .silo-link { display: inline-block; margin-top: 16px; font-weight: 600; font-size: 14px; color: var(--electric); }

/* --- Layout with sidebar --- */
.layout { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 980px) { .layout { grid-template-columns: minmax(0,1fr) 320px; } }

/* --- Article grid --- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 560px) { .article-grid { grid-template-columns: 1fr 1fr; } }
.card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(14,23,38,0.1); }
.card-media { aspect-ratio: 16 / 9; background: var(--storm-2); position: relative; overflow: hidden; }
.card-media svg { width: 100%; height: 100%; }
.card-cat { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 5px 11px; border-radius: 6px; color: #fff; }
.cat-sci { background: var(--electric); }
.cat-safe { background: var(--safe); }
.cat-myth { background: var(--danger); }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--electric); text-decoration: none; }
.card-snippet { font-size: 14px; color: var(--text-soft); line-height: 1.6; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.card-meta time { font-variant-numeric: tabular-nums; }

/* --- Sidebar --- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.widget h4 { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.popular-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.popular-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.popular-list a { display: flex; gap: 12px; align-items: baseline; color: var(--text); font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.popular-list a:hover { color: var(--electric); text-decoration: none; }
.popular-rank { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--bolt); flex-shrink: 0; width: 22px; }
.widget-alert { background: var(--storm); color: #fff; border-color: transparent; }
.widget-alert h4 { color: #fff; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-icon { font-size: 22px; }
.alert-text { font-size: 13.5px; color: #C7D0E0; }
.alert-text b { color: #fff; display: block; font-size: 14.5px; }
.widget-note { font-size: 12px; color: var(--muted); margin-top: 14px; }

/* --- Article page --- */
.article-wrap { max-width: 760px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--electric); }
.article-header h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 44px); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 16px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13.5px; color: var(--muted); padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.article-cat { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 6px; color: #fff; font-size: 11px; }
.article-figure { aspect-ratio: 16 / 9; background: var(--storm-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.article-body { font-size: 17px; line-height: 1.8; color: var(--text); }
.article-body > * + * { margin-top: 20px; }
.article-body h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 40px; line-height: 1.2; }
.article-body h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 28px; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body ul li { list-style: disc; margin-top: 8px; }
.article-body ol li { list-style: decimal; margin-top: 8px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.callout { border-left: 4px solid var(--bolt); background: var(--bg-soft); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout.danger { border-color: var(--danger); }
.callout.safe { border-color: var(--safe); }
.callout strong { display: block; margin-bottom: 4px; }
.lead { font-size: 19px; color: var(--text-soft); line-height: 1.7; }

/* FAQ (details) */
.faq { margin-top: 16px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--bg); }
.faq summary { cursor: pointer; padding: 18px 20px; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--electric); font-size: 22px; font-weight: 400; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 20px 18px; color: var(--text-soft); font-size: 15px; line-height: 1.7; }

/* --- Footer --- */
.site-footer { background: var(--storm); color: #C7D0E0; padding-block: 48px 28px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 38ch; }
.footer-col h4 { font-family: var(--font-display); color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #C7D0E0; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-32 { margin-top: 32px; }
.disclaimer { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; font-size: 13.5px; color: var(--text-soft); line-height: 1.7; }
.disclaimer strong { color: var(--ink); }
