/*
Theme Name: Solidfish
Author: Solidfish
Description: Light editorial theme with a mountain photograph header.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: solidfish
Update URI: false
*/
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f3f7f8;
  --surface-2: #e8f0f3;
  --text: #172a38;
  --muted: #526774;
  --line: #d2dfe4;
  --primary: #176f7a;
  --primary-soft: #e2f3f2;
  --accent: #326c9e;
  --danger: #ac3535;
  --ok: #216e4b;
  --max: 1120px;
  --mono-font: ui-monospace, "SFMono-Regular", Menlo, Monaco, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --body-font: var(--mono-font);
  --display-font: var(--mono-font);
  font-family: var(--body-font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: .005em;
  -webkit-user-select: text;
  user-select: text;
}

a { color: var(--primary); }
button, select, input { font: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono-font); }
::selection { background: #81d8d0; color: #10252f; }

.sf-page { max-width: var(--max); margin: 0 auto; padding: 28px 22px 72px; }
.article-hero { padding: 42px 0 28px; border-top: 6px solid var(--primary); border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; }
h1, h2, h3 { font-family: var(--display-font); }
h1 { max-width: 820px; margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 4rem); font-weight: 700; line-height: 1.02; letter-spacing: -.045em; }
.article-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.source-links a, .button { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--text); text-decoration: none; }
.source-links a:hover, .button:hover { border-color: var(--primary); }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 42px; margin-top: 28px; }
.section-index { position: sticky; top: 18px; align-self: start; }
.section-index strong { display: block; margin-bottom: 8px; }
.section-index a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.section-index a:hover { color: var(--primary); }
main { min-width: 0; }
.entry-content > section { scroll-margin-top: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.entry-content > section:last-child { border-bottom: 0; }
h2 { margin: 0 0 16px; color: var(--primary); font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 700; letter-spacing: -.035em; }
h3 { margin: 24px 0 8px; font-size: 1.18rem; font-weight: 700; letter-spacing: -.02em; }
p { margin: 8px 0 16px; }
ul, ol { padding-left: 1.3rem; }
.lede { font-size: 1.06rem; }
.muted { color: var(--muted); }

.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; padding: 0; list-style: none; }
.outcomes li { position: relative; padding-left: 25px; }
.outcomes li::before { content: "□"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.reasoning-flow, .identity-flow { display: flex; align-items: stretch; gap: 8px; margin: 22px 0; }
.flow-node { flex: 1; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
.flow-node strong { display: block; color: var(--primary); margin-bottom: 5px; }
.arrow { display: grid; place-items: center; color: var(--muted); font-size: 1.5rem; }

.cia-grid, .concept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.concept { padding: 17px; background: var(--surface); border-top: 4px solid var(--primary); border-radius: 2px; }
.concept h3 { margin: 0 0 7px; }
.concept p { margin: 0; color: var(--muted); }
.violation { display: block; margin-top: 10px; color: var(--accent); font-weight: 650; }

.boundary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 20px 0; }
.zone { padding: 20px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); }
.zone.kernel { border-color: var(--primary); background: var(--primary-soft); }
.gate { display: grid; place-items: center; padding: 12px; text-align: center; color: var(--primary); font-weight: 700; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 14px 0 24px; background: var(--surface); }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--primary); font-size: .92rem; }
tr:last-child td { border-bottom: 0; }

.lab { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.lab h3 { margin-top: 0; }
.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.control-group { min-width: 0; }
.control-group > label, .control-group > strong { display: block; margin-bottom: 7px; }
select { width: 100%; min-height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.checks label { display: inline-flex; align-items: center; gap: 5px; }
.result { min-height: 48px; margin-top: 14px; padding: 12px; border-left: 4px solid var(--line); background: var(--surface-2); }
.result.ok { border-color: var(--ok); }
.result.no { border-color: var(--danger); }

.uid-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.uid-steps button { min-height: 48px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.uid-steps button[aria-pressed="true"] { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.uid-display { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.uid-box { padding: 14px; text-align: center; background: var(--surface-2); border-radius: 8px; }
.uid-box span { display: block; color: var(--muted); font-size: .85rem; }
.uid-box strong { font-size: 1.35rem; }

.principle-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.principle { padding: 14px 16px; background: var(--surface); border-left: 4px solid var(--primary); }
.principle strong { display: block; }
.principle span { color: var(--muted); }

.ladder { display: grid; gap: 7px; margin: 18px 0; padding-left: 0; list-style-position: inside; }
.ladder li { width: var(--w); max-width: 100%; padding: 10px 14px; background: var(--primary-soft); border-left: 4px solid var(--primary); }
.ladder li::marker { color: var(--primary); font-weight: 700; }

details { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
summary { cursor: pointer; font-weight: 650; }
details p:last-child { margin-bottom: 0; }

fieldset { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
legend { padding: 0 6px; font-weight: 700; }
fieldset label { display: block; margin: 8px 0; }
fieldset label.is-correct { padding: 6px 9px; border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
fieldset label.is-incorrect { padding: 6px 9px; border-left: 4px solid var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.quiz-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#quiz-result { font-weight: 700; }

.trap-list li { margin: 7px 0; }
.trap-list li::marker { color: var(--accent); }
.site-footer { max-width: var(--max); margin: 0 auto; padding: 20px 22px 45px; color: var(--muted); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .section-index { position: static; columns: 2; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .section-index strong { column-span: all; }
  .cia-grid, .concept-grid, .controls { grid-template-columns: 1fr; }
  .reasoning-flow, .identity-flow { flex-direction: column; }
  .arrow { transform: rotate(90deg); }
  .boundary { grid-template-columns: 1fr; }
  .gate { min-height: 58px; }
  .outcomes, .principle-list { grid-template-columns: 1fr; }
  .uid-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .sf-page { padding-inline: 15px; }
  .section-index { columns: 1; }
  .uid-display { grid-template-columns: 1fr; }
}

@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef4f7;
    --text: #172a38;
    --muted: #4f6672;
    --line: #b8c6cc;
    --primary: #176f7a;
    --primary-soft: #dceff1;
    --accent: #366f9f;
    --danger: #9e2e2e;
    --ok: #176b3a;
  }
  body { background: white; }
  .sf-page { max-width: none; padding: 0; }
  .section-index, .source-links, .interactive-only, .site-footer { display: none !important; }
  .layout { display: block; }
  .entry-content > section { break-inside: avoid; }
  details > * { display: block !important; }
}

/* WordPress layout and content integration. */
body { min-height: 100vh; font-family: var(--mono-font); font-size: 16px; }
[hidden] { display: none !important; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 26px; padding-bottom: 26px; }
.site-brand { color: var(--text); font-size: 1.65rem; font-weight: 700; letter-spacing: -.07em; text-decoration: none; }
.brand-dot { color: var(--primary); }
.site-navigation .menu { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none; }
.site-navigation a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.site-navigation a:hover, .site-navigation .current-menu-item > a { color: var(--primary); }
.site-navigation .sub-menu { padding-left: 18px; list-style: none; }
.article-hero { padding: 38px 0 30px; border-top-width: 4px; }
h1 { overflow-wrap: anywhere; }
.article-hero h1 { max-width: 1040px; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.13; margin: 16px 0 20px; }
.eyebrow a { text-decoration: none; }
.article-hero .post-meta, .post-meta { color: var(--muted); font-size: .8rem; }
.article-layout { margin-top: 32px; }
.article-layout.has-index { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.article-index { min-width: 0; }
.section-index { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: .78rem; padding-right: 16px; }
.section-index strong { text-transform: uppercase; letter-spacing: .1em; color: var(--primary); font-size: .72rem; margin-bottom: 14px; }
.section-index ol { list-style: none; padding: 0; margin: 0; }
.section-index a { padding: 6px 0; overflow-wrap: anywhere; }
.section-index .subheading { padding-left: 12px; font-size: .72rem; }
.admin-bar .section-index { top: 56px; max-height: calc(100vh - 80px); }
.article-body { min-width: 0; }
.entry-content { overflow-wrap: anywhere; }
.entry-content h2 { margin-top: 42px; }
.entry-content h3 { margin-top: 30px; }
.entry-content :is(h2,h3,h4) { scroll-margin-top: 60px; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img, .featured-image img { max-width: 100%; height: auto; }
.entry-content iframe, .entry-content video { max-width: 100%; }
.entry-content figure, .wp-caption { max-width: 100%; margin: 24px 0; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .8rem; }
.entry-content pre { overflow-x: auto; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; font-size: .85rem; }
.entry-content :not(pre) > code { background: var(--surface); padding: .1em .3em; }
.entry-content blockquote { margin: 24px 0; border-left: 3px solid var(--primary); padding: 8px 24px; background: var(--surface); }
.entry-content table { display: block; overflow-x: auto; }
.entry-content th, .entry-content td { min-width: 100px; }
.alignleft { float: left; margin: 0 24px 20px 0; }
.alignright { float: right; margin: 0 0 20px 24px; }
.aligncenter { display: block; margin-inline: auto; }
.entry-content::after { content: ''; display: table; clear: both; }
.post-tags { margin: 32px 0; font-size: .8rem; color: var(--muted); }
.post-navigation, .pagination { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 36px; }
.nav-links { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.post-navigation .nav-links > div { flex: 1; min-width: 0; }
.nav-next { text-align: right; }
.post-navigation a { font-size: .85rem; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; font-size: .75rem; border-top: 1px solid var(--line); }
.site-footer { flex-wrap: wrap; align-items: center; }
.footer-navigation { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.listing-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 30px 0 10px; color: var(--muted); font-size: .85rem; }
.search-form { display: flex; gap: 8px; margin: 16px 0; }
.search-form label { min-width: 0; }
input:not([type=checkbox]):not([type=radio]), textarea, button { max-width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; color: var(--text); font: inherit; }
button, input[type=submit] { cursor: pointer; color: var(--primary); }
button:hover, input[type=submit]:hover { border-color: var(--primary); }
.post-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 30px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.post-row h2 { font-size: 1.5rem; margin-bottom: 12px; }
.post-row h2 a { text-decoration: none; color: var(--text); }
.post-row h2 a:hover { color: var(--primary); }
.post-excerpt { color: var(--muted); font-size: .9rem; }
.read-link { font-size: .8rem; }
.comments-area { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.comment-list { padding-left: 22px; }
.comment-body { padding: 16px 0; }
.comment-metadata { font-size: .75rem; }
.comment-form label { display: block; margin-bottom: 6px; }
.comment-form textarea { width: 100%; }
.comment-form-cookies-consent label { display: inline; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 100000; background: var(--surface); padding: 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.outcomes { list-style: square; padding-left: 1.3rem; }
.outcomes li { padding-left: 0; }
.outcomes li::before { content: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (max-width: 820px) {
  .article-layout.has-index { grid-template-columns: 1fr; gap: 28px; }
  .section-index, .admin-bar .section-index { position: static; columns: auto; max-height: none; }
  .section-index ol { columns: 2; }
  .post-row { grid-template-columns: 1fr; gap: 10px; }
  .site-header { align-items: flex-start; }
  .listing-toolbar { align-items: flex-start; flex-direction: column; gap: 0; }
}
@media (max-width: 480px) {
  .site-header { flex-direction: column; gap: 12px; }
  .section-index ol { columns: 1; }
  .search-form input { width: 100%; }
  .alignleft, .alignright { float: none; margin-inline: 0; }
}
@media print {
  .site-header, .article-index, .post-navigation, .comments-area, .search-form { display: none !important; }
  .article-layout.has-index { display: block; }
  body { font-size: 11pt; }
  .article-hero h1 { font-size: 26pt; }
  .entry-content pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .entry-content table { display: table; }
  .entry-content > section { break-inside: auto; }
  h2, h3 { break-after: avoid; }
}

.home-intro { max-width: 850px; padding: 32px 0; }
.pagination .page-numbers { display: inline-block; padding: 8px 12px; }
.pagination .current { background: var(--surface); color: var(--text); }

/* Full-width photo masthead; article backgrounds stay pure white. */
.site-header {
  background: linear-gradient(90deg, rgba(6, 23, 34, .48), rgba(6, 23, 34, .12)), url("assets/solidfish-main-bg.png") center 22% / cover;
  padding: 0;
  border-bottom: 4px solid #81d8d0;
}
.site-header-inner {
  width: 100%;
  min-height: 300px;
  padding-block: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-brand { color: #fff; font-size: clamp(2rem, 4vw, 3rem); text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.brand-dot { color: #81d8d0; }
.site-navigation { padding: 8px 16px; background: rgba(10, 29, 40, .78); border-radius: 3px; }
.site-navigation a { color: #fff; }
.site-navigation a:hover, .site-navigation .current-menu-item > a { color: #81d8d0; }
.site-header :focus-visible { outline-color: #81d8d0; }
.article-hero { border-top: 0; }
@media (max-width: 600px) {
  .site-header-inner { min-height: 220px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 16px; }
  .site-header { background-position: 60% top; }
}
@media print { .site-header { display: none !important; } }

/* Reader-controlled article width and independent section index. */
.article-page.is-wide { max-width: none; }
.reading-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.reading-controls button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; }
.reading-controls svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reading-controls button[aria-pressed="true"], .reading-controls button[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--primary); }
.width-toggle .contract-icon, .width-toggle[aria-pressed="true"] .expand-icon { display: none; }
.width-toggle[aria-pressed="true"] .contract-icon { display: initial; }
.article-table-scroll { max-width: 100%; overflow-x: auto; margin: 14px 0 24px; overscroll-behavior-x: contain; }
.entry-content .article-table-scroll > table { display: table; overflow: visible; margin: 0; }
.entry-content .wp-block-table { max-width: 100%; }
@media (max-width: 820px) {
  .reading-controls { gap: 8px; }
  .reading-controls button { min-height: 44px; }
}
@media print {
  .reading-controls { display: none !important; }
  .article-table-scroll { overflow: visible; }
}
