/* Sinabuy Spreadsheet Call Sheet — design system. Prefix: njj- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/inter-700.ttf") format("truetype");
}

:root {
  --njj-red: #e23011;
  --njj-red-btn: #c22a0e;
  --njj-red-btn-hover: #a4240c;
  --njj-red-accent: #ff2327;
  --njj-black: #141414;
  --njj-pink-50: #fff5f0;
  --njj-pink-25: #f9f7f7;
  --njj-ink: #171717;
  --njj-muted: #6b5553;
  --njj-line: #ece3e1;
  --njj-white: #ffffff;
  --njj-radius-s: 8px;
  --njj-radius-m: 12px;
  --njj-radius-l: 16px;
  --njj-radius-pill: 999px;
  --njj-shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 8px 24px rgba(20, 20, 20, 0.06);
  --njj-max: 1180px;
  --njj-focus: 2px solid #c22a0e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--njj-ink);
  background: var(--njj-white);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--njj-red-btn); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: var(--njj-focus);
  outline-offset: 2px;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--njj-black); }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.njj-container { max-width: var(--njj-max); margin: 0 auto; padding: 0 20px; }

.njj-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.njj-skip {
  position: absolute; left: -999px; top: 0; background: var(--njj-black); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.njj-skip:focus { left: 0; }

/* ---------- Header ---------- */
.njj-header {
  border-bottom: 1px solid var(--njj-line);
  position: sticky; top: 0; background: var(--njj-white); z-index: 100;
}
.njj-headerbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.njj-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.njj-brand img { height: 30px; width: auto; flex: none; }
.njj-brand-name { font-weight: 700; color: var(--njj-black); font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.njj-brand-name em { color: var(--njj-red); font-style: normal; }

.njj-nav { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1 1 auto; }
.njj-brand { flex: none; }
.njj-nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: 0 12px; text-decoration: none; color: var(--njj-black); font-weight: 600; font-size: 0.95rem;
  border-radius: var(--njj-radius-s); white-space: nowrap; flex: none;
}
.njj-nav a:hover { background: var(--njj-pink-50); }
.njj-nav a[aria-current="page"] { color: var(--njj-red-btn); background: var(--njj-pink-50); }
.njj-nav a.njj-nav-spread { color: var(--njj-red-btn); border: 1px solid var(--njj-red-btn); }

.njj-navtoggle { display: none; }

.njj-indie-banner {
  background: var(--njj-black); color: #fff; font-size: 0.82rem; text-align: center;
  padding: 7px 16px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px; min-height: 44px;
}
.njj-indie-banner a { color: #ffd9cf; display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Hero ---------- */
.njj-hero { padding: 44px 0 36px; background: linear-gradient(180deg, var(--njj-pink-25), #fff 70%); }
.njj-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; align-items: center; }
.njj-hero-copy .njj-eyebrow { display: inline-block; margin-bottom: 10px; }
.njj-hero h1 { margin-bottom: 10px; }
.njj-lede { font-size: 1.1rem; color: var(--njj-muted); max-width: 54ch; margin-bottom: 20px; }

.njj-search { display: flex; gap: 0; width: 100%; max-width: 720px; border: 2px solid var(--njj-black); border-radius: var(--njj-radius-pill); overflow: hidden; background: #fff; }
.njj-search input[type="search"] {
  flex: 1; border: 0; padding: 14px 18px; font: inherit; font-size: 1rem; color: var(--njj-ink); background: transparent; min-width: 0;
}
.njj-search input[type="search"]:focus { outline: none; }
.njj-search button {
  border: 0; background: var(--njj-red-btn); color: #fff; font-weight: 700; padding: 0 24px;
  cursor: pointer; font-size: 0.98rem; min-height: 48px;
}
.njj-search button:hover { background: var(--njj-red-btn-hover); }

.njj-subnav { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.njj-subnav a { color: var(--njj-red-btn); font-weight: 600; text-decoration: underline; font-size: 0.95rem; min-height: 44px; display: inline-flex; align-items: center; }

.njj-hero-mascot { text-align: center; }
.njj-hero-mascot img { width: 100%; max-width: 220px; margin: 0 auto; }

/* ---------- Eyebrow / section heading ---------- */
.njj-eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700;
  color: var(--njj-red-btn); background: var(--njj-pink-50); padding: 4px 10px; border-radius: var(--njj-radius-pill);
}
.njj-section { padding: 44px 0; }
.njj-section--tint { background: var(--njj-pink-25); }
.njj-section-head { max-width: 72ch; margin-bottom: 26px; }
.njj-section-head p { color: var(--njj-muted); }

/* ---------- Category wall ---------- */
.njj-catwall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.njj-catcard {
  display: block; text-decoration: none; color: inherit; border-radius: var(--njj-radius-m);
  overflow: hidden; background: #fff; border: 1px solid var(--njj-line); box-shadow: var(--njj-shadow);
  min-height: 44px;
}
.njj-catcard figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--njj-pink-50); display: flex; align-items: center; justify-content: center; }
.njj-catcard img { width: 100%; height: 100%; object-fit: contain; }
.njj-catcard figcaption {
  padding: 10px 12px; font-weight: 600; font-size: 0.92rem; display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
}
.njj-catcard .njj-dest { font-size: 0.72rem; font-weight: 600; color: var(--njj-muted); background: var(--njj-pink-50); padding: 2px 8px; border-radius: var(--njj-radius-pill); white-space: nowrap; }

/* ---------- Decision cards (signature module) ---------- */
.njj-decisions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.njj-dcard {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
  background: var(--njj-black); color: #fff; border-radius: var(--njj-radius-m); padding: 18px 16px;
  min-height: 150px; position: relative;
}
.njj-dcard:hover { background: #262626; }
.njj-dcard .njj-dnum {
  font-size: 0.78rem; font-weight: 700; color: #ffb199; letter-spacing: 0.06em;
}
.njj-dcard h3 { color: #fff; font-size: 1rem; margin: 0; }
.njj-dcard::after { content: ""; display: block; height: 3px; width: 28px; background: var(--njj-red); border-radius: 2px; margin-top: auto; }

/* ---------- Split (text/image) ---------- */
.njj-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: stretch; margin-bottom: 40px; }
.njj-split.njj-flip .njj-split-media { order: 2; }
.njj-split-media { margin: 0; }
.njj-split-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--njj-radius-m); }
.njj-split-media figcaption { font-size: 0.82rem; color: var(--njj-muted); margin-top: 8px; }
.njj-split-body { display: flex; flex-direction: column; justify-content: center; }
.njj-split-body h2, .njj-split-body h3 { margin-bottom: 0.4em; }

/* decision detail block (used on /guide/) */
.njj-decision-block { padding: 34px 0; border-top: 1px solid var(--njj-line); }
.njj-decision-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.njj-decision-head .njj-dnum-badge {
  background: var(--njj-black); color: #fff; font-weight: 700; font-size: 0.85rem;
  border-radius: var(--njj-radius-s); padding: 4px 10px; flex: none;
}

/* ---------- Feature block (stacked text + near-native figure, gate-safe) ---------- */
.njj-feature { max-width: 900px; margin: 0 auto; }
.njj-feature-figure { max-width: 900px; margin: 18px auto 0; }
.njj-feature-figure img { width: 100%; height: auto; border-radius: var(--njj-radius-m); display: block; }
.njj-feature-figure figcaption { font-size: 0.82rem; color: var(--njj-muted); margin-top: 8px; }
.njj-feature--wide, .njj-feature--wide + .njj-feature-figure { max-width: 1140px; }

/* ---------- Stacked figure ---------- */
.njj-figure { margin: 0 0 20px; }
.njj-figure img { width: 100%; height: auto; border-radius: var(--njj-radius-m); }
.njj-figure figcaption { font-size: 0.82rem; color: var(--njj-muted); margin-top: 8px; }
.njj-figure--wide img { aspect-ratio: auto; }

/* ---------- Cards / grids ---------- */
.njj-cardgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.njj-card { background: #fff; border: 1px solid var(--njj-line); border-radius: var(--njj-radius-m); padding: 20px; }
.njj-card h3 { margin-bottom: 8px; }

/* ---------- Buttons ---------- */
.njj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 22px; border-radius: var(--njj-radius-pill); font-weight: 700; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; font-size: 0.98rem;
}
.njj-btn--primary { background: var(--njj-red-btn); color: #fff; }
.njj-btn--primary:hover { background: var(--njj-red-btn-hover); }
.njj-btn--ghost { background: var(--njj-pink-50); color: var(--njj-black); border-color: var(--njj-line); }
.njj-btn--ghost:hover { background: #fde8e0; }
.njj-btn--line { background: transparent; color: var(--njj-red-btn); border-color: var(--njj-red-btn); }

/* ---------- Tables ---------- */
.njj-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.2em 0; }
.njj-table-wrap .njj-table { margin: 0; min-width: 560px; }
.njj-table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.95rem; }
.njj-table caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.njj-table th, .njj-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--njj-line); vertical-align: top; }
.njj-table th { background: var(--njj-pink-25); font-weight: 700; }

/* ---------- FAQ ---------- */
.njj-faq-item { border-bottom: 1px solid var(--njj-line); }
.njj-faq-item summary {
  cursor: pointer; font-weight: 600; padding: 16px 4px; list-style: none; display: flex;
  justify-content: space-between; gap: 12px; min-height: 44px; align-items: center;
}
.njj-faq-item summary::-webkit-details-marker { display: none; }
.njj-faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--njj-red-btn); flex: none; }
.njj-faq-item[open] summary::after { content: "\2212"; }
.njj-faq-item p { padding: 0 4px 16px; color: var(--njj-muted); }

/* ---------- Video embed ---------- */
.njj-video { position: relative; border-radius: var(--njj-radius-m); overflow: hidden; background: var(--njj-black); aspect-ratio: 16 / 9; margin-bottom: 10px; }
.njj-video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.njj-video video { width: 100%; height: 100%; object-fit: cover; }
.njj-video-play {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(20,20,20,0.28);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.njj-video-play .njj-video-ico {
  width: 64px; height: 64px; border-radius: 50%; background: var(--njj-red-btn); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.njj-video-cap { font-size: 0.82rem; color: var(--njj-muted); }

/* ---------- Media slot (hidden placeholder) ---------- */
.njj-gslot, .njj-vslot {
  border: 1px dashed var(--njj-line); border-radius: var(--njj-radius-m); aspect-ratio: 16/9; margin: 0 0 20px;
}

/* ---------- Tool / estimator ---------- */
.njj-tool { background: #fff; border: 1px solid var(--njj-line); border-radius: var(--njj-radius-l); padding: 26px; box-shadow: var(--njj-shadow); }
.njj-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.njj-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; }
.njj-field label { font-weight: 600; font-size: 0.9rem; }
.njj-field input, .njj-field select {
  min-height: 44px; width: 100%; max-width: 100%; border: 1px solid var(--njj-line);
  border-radius: var(--njj-radius-s); padding: 0 12px; font: inherit; box-sizing: border-box;
}
.njj-field select {
  text-overflow: ellipsis; -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9'><path d='M1 1l6 6 6-6' stroke='%23141414' stroke-width='2' fill='none'/></svg>") no-repeat right 12px center;
  padding-right: 32px;
}
.njj-tool-result { margin-top: 18px; background: var(--njj-pink-50); border-radius: var(--njj-radius-m); padding: 18px; }
.njj-tool-result dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; }
.njj-tool-result dt { color: var(--njj-muted); }
.njj-tool-result dd { margin: 0; font-weight: 700; text-align: right; }
.njj-tool-result .njj-total dt, .njj-tool-result .njj-total dd { font-size: 1.1rem; color: var(--njj-black); border-top: 1px solid var(--njj-line); padding-top: 8px; }

/* ---------- Footer ---------- */
.njj-footer { background: var(--njj-black); color: #e9e3e1; padding: 46px 0 24px; margin-top: 50px; }
.njj-footer a { color: #ffd9cf; text-decoration: none; }
.njj-footer a:hover { text-decoration: underline; }
.njj-footer-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 24px; }
.njj-footer h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.njj-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 0.92rem; }
.njj-footer ul li a { display: flex; align-items: center; min-height: 44px; }
.njj-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.njj-footer-brand img { height: 26px; }
.njj-footer-indie { font-size: 0.85rem; color: #bdb3b1; max-width: 46ch; margin-top: 10px; }
.njj-footer-bottom { border-top: 1px solid #333; margin-top: 30px; padding-top: 16px; font-size: 0.82rem; color: #a99f9d; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Misc ---------- */
.njj-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; background: var(--njj-pink-50); color: var(--njj-red-btn); padding: 3px 10px; border-radius: var(--njj-radius-pill); margin-bottom: 10px; }
.njj-conflict { border-left: 4px solid var(--njj-red); background: var(--njj-pink-50); padding: 12px 16px; border-radius: 0 var(--njj-radius-s) var(--njj-radius-s) 0; margin: 1em 0; }
.njj-conflict strong { color: var(--njj-red-btn); }
.njj-lastreview { font-size: 0.82rem; color: var(--njj-muted); margin-top: 6px; }
.njj-breadcrumb { font-size: 0.85rem; color: var(--njj-muted); margin-bottom: 10px; display: flex; align-items: center; min-height: 44px; }
.njj-breadcrumb a { color: var(--njj-muted); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.njj-toc { background: var(--njj-pink-25); border-radius: var(--njj-radius-m); padding: 18px 22px; margin: 0 0 30px; }
.njj-toc h2 { font-size: 1rem; margin-bottom: 10px; }
.njj-toc ol { margin: 0; padding-left: 1.2em; columns: 2; gap: 20px; }
.njj-toc li { margin-bottom: 2px; break-inside: avoid; }
.njj-toc a { text-decoration: none; font-weight: 600; display: flex; align-items: center; min-height: 44px; }

/* ---------- 404 ---------- */
.njj-404 { text-align: center; padding: 90px 0; }

/* ======================= Responsive ======================= */
@media (max-width: 1024px) {
  .njj-decisions { grid-template-columns: repeat(3, 1fr); }
  .njj-catwall { grid-template-columns: repeat(3, 1fr); }
  .njj-cardgrid { grid-template-columns: repeat(2, 1fr); }
  .njj-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .njj-hero-grid { grid-template-columns: 1fr; }
  .njj-hero-mascot { order: -1; max-width: 140px; margin: 0 auto; }
  .njj-split, .njj-split.njj-flip { grid-template-columns: 1fr; }
  .njj-split.njj-flip .njj-split-media { order: 0; }
  .njj-nav { gap: 2px; }
}
@media (max-width: 680px) {
  .njj-brand-name { display: none; }
  .njj-headerbar { gap: 8px; }
  .njj-decisions { grid-template-columns: repeat(2, 1fr); }
  .njj-catwall { grid-template-columns: repeat(2, 1fr); }
  .njj-cardgrid { grid-template-columns: 1fr; }
  .njj-tool-grid { grid-template-columns: 1fr; }
  .njj-toc ol { columns: 1; }
  .njj-footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
  .njj-search { flex-direction: row; }
  .njj-search button { padding: 0 16px; }
}
