/* TechFix Q&A styles.
   Tailwind (CDN) handles layout. This file holds the pieces that are cleaner as plain CSS. */

:root {
  --ink: #0E1B2C;
  --paper: #F4F6F9;
  --line: #D9DFE7;
  --muted: #4A5A6E;
  --brand: #1B6B45;
  --code: #0D1520;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 3px solid #2E8B5E; outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 50;
  background: var(--ink); color: #fff; padding: .6rem 1rem;
}
.skip-link:focus { left: 0; }

/* Header and footer */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-footer { background: #fff; border-top: 1px solid var(--line); }
.logo-fx {
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 4px;
  background: var(--brand); color: #fff;
  font: italic 500 .85rem "IBM Plex Mono", ui-monospace, monospace;
}
.nav a { text-decoration: none; color: var(--muted); padding: .25rem 0; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Hero: faint spreadsheet cells behind a formula-bar search */
.hero { position: relative; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(#E4E9EF 1px, transparent 1px),
    linear-gradient(90deg, #E4E9EF 1px, transparent 1px);
  background-size: 112px 30px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}
.formula-bar {
  display: flex; align-items: stretch;
  background: #fff; border: 1px solid #A9B5C4; border-radius: 6px; overflow: hidden;
}
.formula-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27, 107, 69, .2); }
.formula-bar .fx {
  display: flex; align-items: center; padding: 0 .95rem;
  background: #EEF3F0; border-right: 1px solid #A9B5C4; color: var(--brand);
  font: italic 500 1rem "IBM Plex Mono", ui-monospace, monospace;
}
.formula-bar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: .95rem 1rem; font: inherit; font-size: 1rem; color: var(--ink);
}
.formula-bar input::placeholder { color: #6A7A8D; }
.formula-bar kbd {
  display: none; align-items: center; margin: .6rem .7rem .6rem 0; padding: 0 .55rem;
  border: 1px solid var(--line); border-radius: 4px; background: #F4F6F9; color: var(--muted);
  font: 500 .8rem "IBM Plex Mono", ui-monospace, monospace;
}
@media (min-width: 768px) { .formula-bar kbd { display: inline-flex; } }

.chip {
  border: 1px solid #A9B5C4; background: #fff; color: var(--ink); border-radius: 4px;
  padding: .2rem .6rem; cursor: pointer;
  font: 400 .8rem "IBM Plex Mono", ui-monospace, monospace;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* Filters */
.filter-btn {
  border: 1px solid #A9B5C4; background: #fff; color: var(--ink); border-radius: 999px;
  padding: .35rem .85rem; font-size: .875rem; font-weight: 500; cursor: pointer;
}
.filter-btn:hover { border-color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-btn span { opacity: .7; margin-left: .25rem; font-weight: 400; }

/* Question cards: the left rule carries the language */
.card {
  display: block; text-decoration: none; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--rule, #8A97A8);
  border-radius: 6px; padding: 1rem 1.1rem;
}
.card:hover { border-color: #AEBBCB; border-left-color: var(--rule, #8A97A8); }
.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.rule-excel { --rule: #1B6B45; }
.rule-javascript { --rule: #C9A100; }
.rule-python { --rule: #2F6FA8; }
.rule-database { --rule: #6B3FA0; }
.rule-react { --rule: #0E7C86; }
.rule-devops { --rule: #B4530A; }
.rule-other { --rule: #8A97A8; }

.badge {
  display: inline-block; border-radius: 4px; padding: .12rem .5rem;
  font-size: .78rem; font-weight: 600; line-height: 1.4;
}
.cat-excel { background: #E1F1E8; color: #14532F; }
.cat-javascript { background: #FBEFB3; color: #5B4600; }
.cat-python { background: #DCEAF6; color: #1B4A75; }
.cat-database { background: #EBE1F5; color: #46257A; }
.cat-react { background: #D8F1F3; color: #0B5A62; }
.cat-devops { background: #FCE3CC; color: #7A3503; }
.cat-other { background: #E8ECF1; color: #2B3A4D; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; }

/* Article typography */
.article h1 {
  font-size: clamp(1.65rem, 4.2vw, 2.3rem); line-height: 1.2;
  font-weight: 600; letter-spacing: -.012em; margin: .75rem 0 0;
}
.article h2 { font-size: 1.2rem; font-weight: 600; line-height: 1.3; margin: 2.2rem 0 .6rem; }
.article p { max-width: 68ch; line-height: 1.7; margin: 0; }
.callout {
  max-width: 68ch; border-left: 4px solid var(--brand); background: #EAF3EE;
  border-radius: 0 6px 6px 0; padding: .9rem 1.1rem; font-size: 1.05rem; line-height: 1.6;
}
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; max-width: 68ch; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1rem; line-height: 1.65; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem;
  width: 1.7rem; height: 1.7rem; display: grid; place-items: center;
  border-radius: 4px; background: var(--brand); color: #fff;
  font: 500 .85rem "IBM Plex Mono", ui-monospace, monospace;
}
.code-wrap { background: var(--code); border-radius: 6px; overflow: hidden; max-width: 100%; }
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem .5rem .4rem .9rem; border-bottom: 1px solid #1F2D3F;
  color: #9FB2C8; font-size: .8rem;
}
.copy-btn {
  border: 1px solid #34465D; background: transparent; color: #D6E2F0; border-radius: 4px;
  padding: .2rem .7rem; font-size: .8rem; cursor: pointer;
}
.copy-btn:hover { background: #172433; }
.code-wrap pre {
  margin: 0; padding: 1rem; overflow-x: auto; color: #D6E2F0;
  font: 400 .875rem/1.65 "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre; tab-size: 2;
}
.note { font-size: .85rem; color: var(--muted); }

/* Simple content pages (About, Privacy, Contact) */
.page-copy h1 { font-size: clamp(1.7rem, 4.2vw, 2.3rem); line-height: 1.2; font-weight: 600; letter-spacing: -.012em; margin: 0 0 1rem; }
.page-copy h2 { font-size: 1.2rem; font-weight: 600; margin: 2rem 0 .5rem; }
.page-copy p, .page-copy li { max-width: 68ch; line-height: 1.7; }
.page-copy p { margin: 0 0 1rem; }
.page-copy ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.page-copy a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.btn {
  display: inline-block; background: var(--brand); color: #fff !important; text-decoration: none !important;
  border-radius: 6px; padding: .6rem 1.1rem; font-weight: 500;
}
.btn:hover { background: #155539; }

/* Ad containers: dashed placeholders until AdSense IDs are set in assets/site.js */
.ad-wrap { width: 100%; }
.ad-caption { margin: 0 0 .25rem; font-size: .7rem; color: var(--muted); text-align: center; }
.ad-box {
  display: flex; flex-direction: column; gap: .2rem; align-items: center; justify-content: center;
  text-align: center; border: 2px dashed #8EA0B5; border-radius: 6px; padding: .75rem;
  background: repeating-linear-gradient(135deg, #F7F9FB, #F7F9FB 10px, #EEF2F6 10px, #EEF2F6 20px);
  color: var(--muted); font-size: .85rem;
}
.ad-box strong { color: var(--ink); font-size: .95rem; }
.ad-leaderboard .ad-box { min-height: 90px; }
.ad-sidebar .ad-box { min-height: 250px; }
.ad-inline .ad-box { min-height: 120px; }
