@import url('../../fonts/google-fonts.css');

html { font-size: 20px; }

@font-face {
  font-family: 'averta_bold';
  src: url('../../fonts/AvertaCY-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal;
}
@font-face {
  font-family: 'averta_regular';
  src: url('../../fonts/AvertaCY-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'averta_light';
  src: url('../../fonts/AvertaCY-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal;
}

::selection { color: #fff; background: #000; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Montserrat", sans-serif !important;
  font-size: 1rem;
  background: #fff;
  color: #000;
  line-height: 1.6;
}

/* Nav */
.nav { display: flex; align-items: center; padding: 0.8rem 1.5rem; border-bottom: 1px solid #e0e0e0; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #000; text-decoration: none; font-size: 0.7rem; font-weight: 500; }
.nav a:hover { text-decoration: underline; }
.nav-title { font-weight: 700; font-size: 0.7rem; }

/* Header */
.header { text-align: center; padding: 2rem 1rem 1rem; }
.header h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.header p { color: #616161; font-size: 0.7rem; max-width: 700px; margin: 0 auto; font-family: 'averta_light', sans-serif; }

/* Cards grid (index) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; padding: 0 2rem 2rem; max-width: 1200px; margin: 0 auto; }
.card { display: block; text-decoration: none; color: #000; border: 1px solid #e0e0e0; padding: 1.2rem; transition: all 0.2s; }
.card:hover { border-color: #000; box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card h3 { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.card p { font-size: 0.6rem; color: #616161; font-family: 'averta_light', sans-serif; line-height: 1.5; }
.card .tag { display: inline-block; margin-top: 0.5rem; font-size: 0.5rem; font-weight: 600; color: #616161; border: 1px solid #e0e0e0; padding: 0.15rem 0.5rem; }
.card.hidden { display: none; }

/* Section label on index */
.section-heading { font-size: 0.85rem; font-weight: 700; padding: 1rem 2rem 0.5rem; max-width: 1200px; margin: 0 auto; }

/* Search */
.search-wrap { max-width: 480px; margin: 0 auto 2rem; position: relative; }
.search-wrap input { width: 100%; padding: 0.6rem 1rem 0.6rem 2.4rem; border: 1px solid #e0e0e0; font-size: 0.7rem; font-family: inherit; outline: none; transition: border-color 0.2s; }
.search-wrap input:focus { border-color: #000; }
.search-wrap svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #bdbdbd; pointer-events: none; }
.search-wrap input:focus ~ svg { color: #000; }
.no-results { text-align: center; color: #616161; font-size: 0.7rem; padding: 3rem 1rem; display: none; }

/* ============ CONCEPT PAGE LAYOUT ============ */
.concept-body { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; }

/* Topic sections */
.topic { margin-bottom: 2.5rem; scroll-margin-top: 80px; }
.topic h2 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.8rem; padding-bottom: 0.3rem; border-bottom: 2px solid #000; }
.topic h3 { font-size: 0.75rem; font-weight: 700; margin: 1.2rem 0 0.4rem; }
.topic p, .topic li { font-size: 0.65rem; color: #333; line-height: 1.7; font-family: 'averta_light', sans-serif; }
.topic ul, .topic ol { padding-left: 1.2rem; margin-bottom: 0.8rem; }
.topic li { margin-bottom: 0.3rem; }
.topic strong { font-family: 'Montserrat', sans-serif; font-weight: 600; color: #000; }
.topic code { background: #f5f5f5; padding: 0.1rem 0.3rem; font-size: 0.6rem; border: 1px solid #e0e0e0; }

/* Key insight boxes */
.insight { background: #f5f5f5; border-left: 3px solid #000; padding: 0.8rem 1rem; margin: 0.8rem 0; }
.insight .label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.3rem; color: #616161; }
.insight p { font-size: 0.6rem; margin: 0; }

/* Trade-off boxes */
.tradeoff { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.8rem 0; }
.tradeoff .side { padding: 0.8rem; border: 1px solid #e0e0e0; }
.tradeoff .side h4 { font-size: 0.6rem; font-weight: 700; margin-bottom: 0.3rem; }
.tradeoff .side.pro { border-left: 3px solid #2e7d32; }
.tradeoff .side.con { border-left: 3px solid #c62828; }
.tradeoff .side p, .tradeoff .side li { font-size: 0.55rem; }

/* Diagrams */
.diagram { margin: 1rem 0; text-align: center; overflow-x: auto; }
.diagram svg { max-width: 100%; height: auto; }
.diagram-caption { font-size: 0.5rem; color: #616161; margin-top: 0.3rem; text-align: center; }

/* Comparison tables */
.cmp-table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; font-size: 0.6rem; }
.cmp-table th { background: #000; color: #fff; padding: 0.5rem; text-align: left; font-weight: 600; font-size: 0.55rem; }
.cmp-table td { padding: 0.5rem; border: 1px solid #e0e0e0; font-family: 'averta_light', sans-serif; }
.cmp-table tr:nth-child(even) td { background: #fafafa; }

/* Topic nav (sidebar for long pages) */
.topic-nav { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #e0e0e0; padding: 0.5rem 1.5rem; z-index: 10; display: flex; gap: 1rem; flex-wrap: wrap; max-width: 900px; margin: 0 auto; }
.topic-nav a { font-size: 0.55rem; color: #616161; text-decoration: none; font-weight: 500; white-space: nowrap; }
.topic-nav a:hover { color: #000; }

/* Flow diagrams with CSS boxes */
.flow { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.flow-box { padding: 0.5rem 0.8rem; border: 1px solid #e0e0e0; font-size: 0.55rem; font-weight: 600; text-align: center; min-width: 80px; }
.flow-box.primary { background: #000; color: #fff; border-color: #000; }
.flow-box.success { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.flow-box.warning { background: #ff9800; color: #fff; border-color: #ff9800; }
.flow-box.danger { background: #c62828; color: #fff; border-color: #c62828; }
.flow-arrow { font-size: 0.8rem; color: #bdbdbd; }

/* Footer */
.footer { text-align: center; padding: 3rem 1rem; color: #616161; font-size: 0.65rem; }
.footer a { color: #000; font-weight: 500; }

@media (max-width: 640px) {
  .grid { padding: 0 1rem 1rem; }
  .concept-body { padding: 0 1rem 2rem; }
  .tradeoff { grid-template-columns: 1fr; }
  .topic-nav { gap: 0.5rem; }
}
