/* cool-blue: fenixara.com theme modelled on the Fynro app's web layout.
   Loads AFTER fenixara.css (the shared base: article text, code blocks, Prism,
   Ghost cards) and changes the look: cool-blue palette, Onest + Playfair Display,
   floating icon rail on the left (opens on hover), round white buttons, big
   rounded gradient hero card, soft-shadow cards, dark tab bar on mobile.
   This file is cool-blue's own; theme/sync.py only refreshes fenixara.css/js. */

/* ------------------------------------------------------------ fonts (SIL OFL, see ../fonts/OFL.txt) */
@font-face { font-family: "Onest"; src: url("../fonts/Onest-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/Onest-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/PlayfairDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ------------------------------------------------------------ tokens */
:root {
  --font-sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --bg: #f3f6fa;
  --bg-soft: #eaf0f7;
  --surface: #ffffff;
  --text: #141821;
  --text-soft: #4a5263;
  --muted: #8a93a3;
  --border: #e3e8ef;
  --accent: #1778d4;          /* cool blue */
  --accent-strong: #0f5fb0;
  --accent-soft: #e4effc;
  --hero-1: #0a3566;
  --hero-2: #1568c4;
  --hero-3: #3ba0e6;
  --rail-icon: #b3b3b2;
  --rail-label: #888888;
  --tabbar: #0e1a2b;
  --inline-code-bg: #e9eef5;
  --radius: 24px;
  --shadow: 0 1px 2px rgba(16, 42, 84, .04), 0 12px 32px -10px rgba(16, 42, 84, .12);
  --shadow-lg: 0 24px 48px -16px rgba(16, 42, 84, .22);
  --round-shadow: 0 4px 14px rgba(16, 42, 84, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111e; --bg-soft: #0e1727; --surface: #111b2d; --text: #e5ecf6; --text-soft: #b4c0d3;
    --muted: #7f8ca2; --border: #1c2940; --accent: #5aa9f5; --accent-strong: #8cc4fa; --accent-soft: #10284a;
    --rail-icon: #5d6a80; --rail-label: #8391a8; --tabbar: #050a13; --inline-code-bg: #18243a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .6); --round-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #0a111e; --bg-soft: #0e1727; --surface: #111b2d; --text: #e5ecf6; --text-soft: #b4c0d3;
  --muted: #7f8ca2; --border: #1c2940; --accent: #5aa9f5; --accent-strong: #8cc4fa; --accent-soft: #10284a;
  --rail-icon: #5d6a80; --rail-label: #8391a8; --tabbar: #050a13; --inline-code-bg: #18243a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -10px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .6); --round-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

body.cb { font-family: var(--gh-font-body, var(--font-sans)); font-size: 18px; line-height: 1.75; }
.cb h1, .cb h2, .cb .fx-article-title, .cb .fx-section-title { font-family: var(--gh-font-heading, var(--font-display)); font-weight: 700; letter-spacing: -.01em; }
.cb .fx-card-title, .cb h3, .cb h4 { font-family: var(--font-sans); }
.cb .fx-container { max-width: 1120px; padding: 0 24px; }

/* ------------------------------------------------------------ top bar: logo left, round buttons right */
.cb-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 40px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
}
.cb-logo img { height: 34px; width: auto; display: block; }
.cb-actions { display: flex; align-items: center; gap: 12px; }
.cb-round {
  display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface); color: var(--text);
  box-shadow: var(--round-shadow); cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.cb-round:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cb-round svg { width: 20px; height: 20px; }
.cb-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.cb-pill:hover { background: var(--accent-strong); text-decoration: none; color: #fff; }
.cb-pill-light { background: #fff; color: var(--hero-2); box-shadow: none; }
.cb-pill-light:hover { background: #eaf3fd; color: var(--hero-1); }

/* ------------------------------------------------------------ icon rail (desktop) */
.cb-rail {
  position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 30;
  width: 76px; padding: 22px 0; border-radius: 22px; overflow: hidden;
  transition: width .22s cubic-bezier(.215, .61, .355, 1), background .22s, box-shadow .22s;
}
.cb-rail:hover, .cb-rail:focus-within { width: 252px; background: var(--surface); box-shadow: var(--shadow-lg); }
.cb-rail ul { list-style: none; margin: 0; padding: 0; width: 252px; display: flex; flex-direction: column; gap: 32px; }
.cb-rail a {
  display: flex; align-items: center; gap: 14px; height: 28px; padding-left: 26px;
  color: var(--rail-label); font: 500 18px/1 var(--font-sans); white-space: nowrap;
}
.cb-rail a:hover { text-decoration: none; color: var(--text); }
.cb-rail .cb-icon { width: 24px; height: 24px; flex: none; color: var(--rail-icon); transition: color .15s; }
.cb-rail a:hover .cb-icon { color: var(--text); }
.cb-rail .cb-label { opacity: 0; transition: opacity .15s; }
.cb-rail:hover .cb-label, .cb-rail:focus-within .cb-label { opacity: 1; }
.cb-rail .nav-current a { color: var(--text); font: 700 18px/1 var(--font-display); }
.cb-rail .nav-current .cb-icon { color: var(--accent); }

/* ------------------------------------------------------------ tab bar (mobile) */
.cb-tabbar { display: none; }

/* ------------------------------------------------------------ main column */
.cb-main { min-height: 60vh; }
@media (min-width: 1024px) {
  .cb-main, .cb-footer { padding-left: 100px; }
}

/* hero: big rounded gradient card */
.cb-hero-wrap { padding-top: 24px; }
.cb-hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: 28px; padding: 56px 64px 44px;
  background: linear-gradient(160deg, var(--hero-1) 0%, var(--hero-2) 58%, var(--hero-3) 100%);
  box-shadow: 0 28px 56px -24px rgba(21, 104, 196, .55);
}
.cb-hero::after {
  content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 70%); pointer-events: none;
}
.cb-kicker { display: block; color: #bfe0ff; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.cb-hero h1 { margin: 14px 0 0; max-width: 760px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.12; color: #fff; }
.cb-hero-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  margin-top: 44px; padding-top: 22px; border-top: 3px solid rgba(255, 255, 255, .85);
}
.cb-stat { display: flex; align-items: baseline; gap: 10px; }
.cb-stat strong { font: 700 34px/1 var(--font-display); }
.cb-stat span { color: #d6e9fc; font-size: 15px; }

/* topic chips */
.cb .fx-topics { background: none; border: 0; margin-top: 28px; }
.cb .fx-topics-inner { height: auto; max-width: 1120px; padding: 0 24px; gap: 12px; }
.cb .fx-topics-label { display: none; }
.cb .fx-topics ul { gap: 10px; padding: 4px 2px 10px; }
.cb .fx-topics a {
  padding: 9px 18px; font-size: 14.5px; font-weight: 500; color: var(--text-soft);
  background: var(--surface); box-shadow: var(--round-shadow);
}
.cb .fx-topics a:hover { color: var(--accent); background: var(--surface); }
.cb .fx-topics .nav-current a, .cb .fx-topics a[aria-current="page"] { background: var(--accent); color: #fff; }

/* section titles and cards */
.cb .fx-section { padding: 36px 0 64px; }
.cb .fx-section-title { font-size: 30px; text-transform: none; letter-spacing: -.01em; color: var(--text); margin: 0 0 24px; }
.cb .fx-grid { gap: 28px; }
.cb .fx-card { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.cb .fx-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cb .fx-card-title { font-weight: 600; letter-spacing: -.01em; }
.cb .fx-card-featured .fx-card-title { font: 700 30px/1.2 var(--font-display); }
.cb .fx-tag-pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-weight: 600; }

/* archive (tag / author) headers */
.cb-archive { padding: 28px 0 0; }
.cb-archive .fx-container { display: block; }
.cb-archive .cb-back { margin-bottom: 18px; }
.cb .fx-archive h1 { font-size: clamp(36px, 5vw, 56px); margin: 6px 0 8px; }

/* article: round back button + centred serif title */
.cb-article-header { position: relative; text-align: center; padding-top: 28px; }
.cb-article-header .fx-card-tag { display: flex; justify-content: center; }
.cb-article-header .fx-byline { justify-content: center; }
.cb .fx-article-title { font-size: clamp(34px, 5vw, 54px); line-height: 1.12; }
.cb-article-header .cb-back { position: absolute; left: -76px; top: 34px; }
@media (max-width: 1240px) { .cb-article-header .cb-back { position: static; margin: 0 auto 18px; display: grid; } }
.cb .fx-feature img { border-radius: 28px; box-shadow: var(--shadow); }
.cb .fx-content { font-size: 18.5px; }
.cb .fx-content h2, .cb .fx-content h3 { font-family: var(--font-display); }
.cb .fx-content pre { border-radius: 18px; }
.cb .fx-author-box, .cb .fx-subscribe { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.cb .fx-subscribe { background: linear-gradient(160deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3)); color: #fff; }
.cb .fx-subscribe h3, .cb .fx-subscribe p { color: #fff; }
.cb .fx-subscribe .fx-btn { background: #fff; color: var(--hero-2); border-radius: 999px; }
.cb .fx-prev-next a { border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.cb .fx-btn { border-radius: 999px; background: var(--accent); }

/* footer */
.cb-footer {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px;
  padding: 32px 24px 40px; color: var(--muted); font-size: 14px;
}
.cb-footer a { color: var(--text-soft); }

/* ------------------------------------------------------------ tablet / mobile */
@media (max-width: 1023px) {
  .cb-rail { display: none; }
  .cb-top { padding: 14px 20px; }
  .cb-logo img { height: 30px; }
  .cb-round { width: 42px; height: 42px; }
  .cb-pill { height: 42px; padding: 0 18px; }
  body.cb { padding-bottom: 100px; }
  .cb-tabbar {
    display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    background: var(--tabbar); border-radius: 26px; padding: 8px 6px;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45);
  }
  .cb-tabbar ul { display: flex; justify-content: space-around; gap: 2px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .cb-tabbar ul::-webkit-scrollbar { display: none; }
  .cb-tabbar li { flex: 1 1 0; min-width: 0; }
  .cb-tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px;
    color: #cccccc; font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap;
  }
  .cb-tabbar .cb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .cb-tabbar a:hover { text-decoration: none; color: #fff; }
  .cb-tabbar .cb-icon { width: 22px; height: 22px; padding: 6px 12px; box-sizing: content-box; border-radius: 999px; }
  .cb-tabbar .nav-current a { color: #fff; }
  .cb-tabbar .nav-current .cb-icon { background: var(--accent); box-shadow: 0 6px 15px -4px color-mix(in srgb, var(--accent) 80%, transparent); }
}
@media (max-width: 640px) {
  .cb .fx-container, .cb .fx-topics-inner { padding: 0 16px; }
  .cb-hero { padding: 34px 26px 28px; border-radius: 24px; }
  .cb-hero-foot { margin-top: 30px; }
  .cb-pill-light { width: 100%; justify-content: center; }
  .cb-top .cb-pill { display: none; }
  .cb .fx-section-title { font-size: 26px; }
}

/* the home-page ad slot under the hero (partials/home-ad.hbs) */
.cb-ad { margin-top: 28px; min-height: 100px; }
