/*
Theme Name: Chellsy Guide
Theme URI: https://chellsy.com/
Description: Lightweight theme for the Chellsy research software guide. Built for Pagelayer page content.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: chellsy-guide
*/

:root {
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --sunk: #F4F2EC;
  --ink: #161B26;
  --ink-2: #3B4252;
  --ink-3: #636B7A;
  --line: #E4E0D6;
  --line-2: #D3CEC1;
  --brand: #2D3FA0;
  --brand-2: #1F2E7A;
  --brand-soft: #E9ECFA;
  --gold: #F4C542;
  --gold-soft: #FFF4D1;
  --gold-ink: #5A4300;
  --good: #1E7A4E;
  --good-soft: #E2F2E9;
  --part: #9A5B00;
  --part-soft: #FFF0D9;
  --add: #2D5DA0;
  --add-soft: #E5EEFA;
  --none: #8A8F99;
  --none-soft: #EFEFEF;
  --r: 14px;
  --shadow: 0 1px 2px rgba(22, 27, 38, .05), 0 10px 28px -14px rgba(22, 27, 38, .22);
  --f-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16.5px/1.65 var(--f-sans); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { font-family: var(--f-serif); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(32px, 4.6vw, 50px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; }
h3 { font-size: clamp(19px, 2vw, 22px); font-weight: 700; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; background: #fff; padding: 8px 14px; border-radius: 8px; }
.ch-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* header */
.ch-head { position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 247, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.admin-bar .ch-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .ch-head { top: 0; position: relative; } }
.ch-head .ch-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; }
.ch-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.ch-brand svg { width: 34px; height: 34px; flex: none; }
.ch-brand b { display: block; font: 700 22px/1 var(--f-serif); letter-spacing: -.01em; }
.ch-brand small { display: block; font: 600 10.5px/1.2 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.ch-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.ch-nav a { display: block; padding: 8px 11px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.ch-nav a:hover, .ch-nav .current-menu-item > a, .ch-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-2); }
.ch-menu-toggle { display: none; }
@media (max-width: 980px) {
  .ch-menu-toggle { display: block; position: relative; }
  .ch-menu-toggle > summary { list-style: none; cursor: pointer; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--ink); background: #fff; }
  .ch-menu-toggle > summary::-webkit-details-marker { display: none; }
  .ch-menu-toggle[open] > summary { background: var(--brand-soft); }
  .ch-menu-toggle .ch-nav { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; min-width: 240px; }
  .ch-menu-toggle .ch-nav ul { flex-direction: column; }
  .ch-nav-desktop { display: none; }
}

/* breadcrumbs */
.ch-crumbs { font-size: 13.5px; color: var(--ink-3); padding: 14px 0 0; }
.ch-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ch-crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line-2); }
.ch-crumbs a { color: var(--ink-3); }

/* page content (Pagelayer rows) */
.ch-main { min-height: 50vh; }
.ch-main .pagelayer-row-holder.pagelayer-width-auto { max-width: var(--wrap); }
.pagelayer-row.ch-sec { padding: 56px 0; }
.pagelayer-row.ch-sec-alt { background: var(--sunk); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pagelayer-row.ch-hero { padding: 40px 0 28px; }
.ch-kicker .pagelayer-text-holder p, p.ch-kicker { font: 700 12px/1.3 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin: 0; }
.ch-lead .pagelayer-text-holder p, p.ch-lead { font-size: 19px; color: var(--ink-2); max-width: 70ch; }
.ch-main .pagelayer-text-holder > *:last-child { margin-bottom: 0; }
.ch-main .pagelayer-heading-holder h1, .ch-main .pagelayer-heading-holder h2 { margin-bottom: 0; }
.ch-prose { max-width: 76ch; }
.ch-prose h2 { margin-top: 1.4em; }
.ch-prose h3 { margin-top: 1.2em; }
.ch-prose ul, .ch-prose ol { padding-left: 1.3em; }
.ch-prose li { margin-bottom: .35em; }

/* disclosure */
.ch-disclosure { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 10px 14px; margin: 0; max-width: 76ch; }
.ch-disclosure svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--gold-ink); }
.ch-meta { font-size: 13.5px; color: var(--ink-3); }

/* buttons and badges */
.ch-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; background: var(--brand); color: #fff !important; border: 1.5px solid var(--brand); line-height: 1.2; }
.ch-btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.ch-btn-ghost { background: transparent; color: var(--brand) !important; }
.ch-btn-ghost:hover { background: var(--brand-soft); color: var(--brand-2) !important; }
.ch-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ch-badge { display: inline-block; font: 700 11.5px/1 var(--f-sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); vertical-align: middle; }
.ch-badge-gold { background: var(--gold); color: var(--gold-ink); }
.ch-badge-good { background: var(--good-soft); color: var(--good); }
.ch-pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); margin: 0 4px 4px 0; }

/* score */
.ch-score { display: inline-flex; align-items: baseline; gap: 3px; font: 700 26px/1 var(--f-serif); color: var(--ink); }
.ch-score small { font: 600 13px/1 var(--f-sans); color: var(--ink-3); }
.ch-bar { height: 7px; border-radius: 99px; background: var(--sunk); overflow: hidden; margin-top: 6px; }
.ch-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #5468D4); }

/* ranking list */
.ch-rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; gap: 14px; }
.ch-rank > li { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr) 150px; gap: 18px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.ch-rank > li.is-top { border: 2px solid var(--gold); background: linear-gradient(180deg, #FFFCF2, #FFFFFF 46%); }
.ch-rank .n { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font: 700 20px/1 var(--f-serif); }
.ch-rank li.is-top .n { background: var(--gold); color: var(--gold-ink); }
.ch-rank h3 { margin: 0 0 4px; font-size: 21px; }
.ch-rank h3 a { color: var(--ink); text-decoration: none; }
.ch-rank h3 a:hover { color: var(--brand); text-decoration: underline; }
.ch-rank .bf { font-size: 14.5px; color: var(--ink-2); margin: 0 0 8px; }
.ch-rank .uf { font-size: 15px; margin: 0; }
.ch-rank .uf b { color: var(--ink); }
.ch-rank .sc { text-align: right; }
.ch-rank .sc .ch-bar { margin-left: auto; width: 120px; }
.ch-rank .links { margin-top: 10px; font-size: 14.5px; font-weight: 600; display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .ch-rank > li { grid-template-columns: 46px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .ch-rank .n { width: 38px; height: 38px; font-size: 17px; }
  .ch-rank .sc { grid-column: 2; text-align: left; }
  .ch-rank .sc .ch-bar { margin-left: 0; }
}

/* card grids */
.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ch-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .ch-grid, .ch-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ch-grid, .ch-grid.two, .ch-grid.four { grid-template-columns: minmax(0, 1fr); } }
.ch-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.ch-card h3 { margin: 0; font-size: 19px; }
.ch-card p { margin: 0; font-size: 15px; color: var(--ink-2); }
.ch-card .pick { font-weight: 700; color: var(--ink); }
.ch-card .alt { font-size: 14px; color: var(--ink-3); }
.ch-card a.more { margin-top: auto; font-weight: 700; font-size: 14.5px; text-decoration: none; }
.ch-card.is-top { border: 2px solid var(--gold); }

/* comparison table */
.ch-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.ch-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 760px; }
.ch-table th, .ch-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ch-table thead th { position: sticky; top: 0; background: var(--sunk); font: 700 12px/1.3 var(--f-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); z-index: 2; }
.ch-table tbody th { position: sticky; left: 0; background: var(--surface); font-weight: 700; z-index: 1; min-width: 160px; }
.ch-table tbody tr:hover td, .ch-table tbody tr:hover th { background: #FAFAF6; }
.ch-table tr.is-top th, .ch-table tr.is-top td { background: #FFFBEE; }
.ch-table td.c { text-align: center; }
.ch-table caption { caption-side: bottom; text-align: left; padding: 10px 12px; font-size: 13px; color: var(--ink-3); }

/* feature marks */
.fm { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 700 13px/1 var(--f-sans); }
.fm.y { background: var(--good-soft); color: var(--good); }
.fm.p { background: var(--part-soft); color: var(--part); }
.fm.a { background: var(--add-soft); color: var(--add); }
.fm.n { background: var(--none-soft); color: var(--none); }
.fm.u { background: transparent; color: var(--none); border: 1px dashed var(--line-2); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--ink-2); margin: 0 0 12px; }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* feature list on review pages */
.ch-feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.ch-feats li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ch-feats li small { display: block; color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .ch-feats { grid-template-columns: minmax(0, 1fr); } }

/* facts box, pros and cons */
.ch-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.ch-facts > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.ch-facts > div:last-child { border-right: 0; }
.ch-facts dt { font: 700 11.5px/1.3 var(--f-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.ch-facts dd { margin: 0; font-size: 15px; font-weight: 600; }
@media (max-width: 820px) { .ch-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ch-facts > div:nth-child(2n) { border-right: 0; } .ch-facts > div { border-bottom: 1px solid var(--line); } }
.ch-unique { background: var(--brand-2); color: #EEF0FB; border-radius: var(--r); padding: 22px 24px; position: relative; overflow: hidden; }
.ch-unique::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.ch-unique .ch-kicker, .ch-unique p.ch-kicker { color: var(--gold); }
.ch-unique h3 { color: #fff; margin: 6px 0 8px; }
.ch-unique p { margin: 0; color: #DCE1F7; }
.ch-pc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ch-pc > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.ch-pc h3 { font-size: 17px; margin: 0 0 8px; font-family: var(--f-sans); }
.ch-pc ul { margin: 0; padding-left: 1.2em; }
.ch-pc li { margin-bottom: 6px; font-size: 15px; }
.ch-pc .pro h3 { color: var(--good); }
.ch-pc .con h3 { color: var(--part); }
@media (max-width: 640px) { .ch-pc { grid-template-columns: minmax(0, 1fr); } }

/* FAQ, sources, table of contents */
.ch-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 18px; }
.ch-faq summary { cursor: pointer; list-style: none; padding: 15px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 14px; }
.ch-faq summary::-webkit-details-marker { display: none; }
.ch-faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--brand); }
.ch-faq details[open] summary::after { content: "\2212"; }
.ch-faq details p { color: var(--ink-2); padding-bottom: 4px; }
.ch-sources { font-size: 13.5px; color: var(--ink-3); }
.ch-sources ol, .ch-sources ul { padding-left: 1.3em; margin: 6px 0 0; }
.ch-sources a { color: var(--ink-3); word-break: break-word; }
.ch-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ch-toc a { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ch-toc a:hover { border-color: var(--brand); color: var(--brand); }
.ch-note { font-size: 14px; color: var(--ink-3); }

/* footer */
.ch-foot { margin-top: 48px; background: #12172A; color: #C4C9DA; font-size: 14.5px; }
.ch-foot .ch-wrap { padding-top: 40px; padding-bottom: 28px; }
.ch-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .ch-foot-grid { grid-template-columns: minmax(0, 1fr); } }
.ch-foot h2 { font: 700 13px/1.3 var(--f-sans); letter-spacing: .1em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.ch-foot ul { list-style: none; margin: 0; padding: 0; }
.ch-foot li { margin-bottom: 6px; }
.ch-foot a { color: #DDE1F0; text-decoration: none; }
.ch-foot a:hover { color: #fff; text-decoration: underline; }
.ch-foot .ch-brand { color: #fff; }
.ch-foot .ch-brand small { color: #9AA1B8; }
.ch-foot-disc { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 13.5px; color: #AEB4C8; }
.ch-foot-disc strong { color: #fff; font-weight: 600; }

/* fallback content (non-Pagelayer pages) */
.ch-entry { padding: 40px 0; }
.ch-entry .ch-wrap > * { max-width: 76ch; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .ch-head, .ch-foot, .ch-crumbs { display: none; } body { background: #fff; } }

/* 1.0.1 fixes */
.ch-card .ch-badge { align-self: flex-start; }
.ch-card h3 a { text-decoration: none; }
.ch-card h3 a:hover { text-decoration: underline; }

/* 1.0.2 alignment */
.ch-main .pagelayer-row-holder.pagelayer-width-auto { max-width: var(--wrap); padding-left: 8px; padding-right: 8px; box-sizing: border-box; }

/* 1.0.3 breadcrumbs */
.ch-crumbs.ch-wrap { padding: 14px 20px 0; }
