/*
Theme Name: Setasider
Theme URI: https://setasider.com
Author: Setasider
Description: Personal-finance publishing theme for everyday readers. FinanceBuzz-blue palette, Bankrate-style article layout (key takeaways, callouts, sticky table of contents).
Version: 0.1.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: setasider
*/

/* ============================================================
   Setasider — design system (v0.1)
   Palette: FinanceBuzz blues (stability). Structure for articles
   inspired by Bankrate (navy header band, overlapping content
   card, key takeaways, callouts, sticky table of contents).
   Everything beyond the blues is a first pass, to be refined.
   ============================================================ */

:root {
  /* blues — taken from FinanceBuzz */
  --blue:       #0049b8;   /* primary: links, buttons, accents */
  --blue-dark:  #002f78;   /* hover / pressed */
  --navy:       #0a0832;   /* headings, header band, footer */
  --tint:       #e4ecf5;   /* light blue panels */
  --tint-soft:  #f3f6fb;   /* very light blue */

  /* neutrals */
  --bg:         #ffffff;
  --bg-soft:    #f0f1f2;
  --ink:        #1b1f2e;   /* body text */
  --muted:      #5d6275;
  --line:       #dcdfe6;
  --white:      #ffffff;

  /* shape */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --pill:       999px;
  --shadow:     0 1px 2px rgba(10,8,50,.06), 0 6px 20px rgba(10,8,50,.06);

  /* type */
  --head: "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--navy); line-height: 1.2; letter-spacing: -.01em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-family: var(--head); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: var(--white); }

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 36px; height: 72px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 26px; width: auto; }
.nav { display: flex; gap: 28px; flex: 1; }
.nav a {
  font-family: var(--head); font-weight: 600; font-size: 15px; color: var(--navy);
  text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav a:hover, .nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--navy); display: inline-grid; place-items: center;
  transition: border-color .2s ease, color .2s ease;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }

.search-panel { display: none; border-top: 1px solid var(--line); background: var(--white); }
.search-panel.open { display: block; }
.search-panel form { display: flex; gap: 10px; padding: 16px 0; }
.search-panel input {
  flex: 1; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; font: inherit; color: var(--ink); outline: none;
}
.search-panel input:focus { border-color: var(--blue); }

/* article pages: logo-only header (FinanceBuzz style) — the reader stays on the article */
.site-header--min {
  position: relative; border-bottom: 0;
  box-shadow: 0 0 20px rgba(206, 206, 214, .6);
}
.site-header--min .header-inner { justify-content: center; height: 72px; }
.site-header--min .brand img { height: 30px; }
html:has(.site-header--min) { scroll-padding-top: 24px; }
.single .article-aside { top: 24px; }

/* reading progress (article pages) */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--blue); z-index: 60; transition: width .1s linear; }

/* ===========================================================
   Home
   =========================================================== */
.home-hero { background: var(--tint); padding: 64px 0 56px; }
.home-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; text-align: center; margin: 0; }
.home-hero .lede { text-align: center; color: var(--muted); font-size: 18px; margin: 12px auto 0; max-width: 56ch; }

.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.topic {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--navy); border: 1.5px solid transparent;
  transition: border-color .2s ease, transform .2s ease;
}
.topic:hover { border-color: var(--blue); transform: translateY(-2px); }
.topic-ico { width: 46px; height: 46px; border-radius: var(--radius-sm); background: var(--tint); color: var(--blue); display: grid; place-items: center; flex: none; }
.topic-ico svg { width: 24px; height: 24px; }
.topic b { display: block; font-family: var(--head); font-size: 17px; }
.topic small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.section { padding: 64px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--blue); padding-bottom: 12px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: 28px; font-weight: 800; }
.section-head a { font-family: var(--head); font-weight: 700; font-size: 15px; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.post-card-media { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-card-media .ph { width: 54px; height: 54px; color: var(--blue); opacity: .55; }
.post-card-cat { font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin: 16px 0 6px; }
.post-card h3 { font-size: 20px; font-weight: 700; margin: 0; }
.post-card:hover h3 { color: var(--blue); }
.post-card-meta { color: var(--muted); font-size: 14px; margin-top: 8px; }

.mission { background: var(--navy); color: var(--white); border-radius: var(--radius-lg); padding: 48px; text-align: center; }
.mission p { font-family: var(--head); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; margin: 0 auto; max-width: 40ch; line-height: 1.35; }

/* ===========================================================
   Article (Bankrate-style)
   =========================================================== */
.article-band { background: var(--navy); color: var(--white); padding: 36px 0 120px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 500; color: #b9bdd6; margin-bottom: 18px; }
.breadcrumb a { color: #d6daf0; text-decoration: none; }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: .6; }
.article-title { color: var(--white); font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; margin: 0; max-width: 28ch; text-wrap: balance; }
.article-dek { color: #c9cde6; font-size: 19px; margin: 14px 0 0; max-width: 60ch; }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 16px; flex: none; border: 2px solid rgba(255,255,255,.25); }
.byline-name { color: var(--white); font-weight: 600; }
.byline-meta { color: #b9bdd6; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; margin-top: -88px; padding-bottom: 72px; }
.article-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 48px 56px; min-width: 0; }

/* sidebar / table of contents */
.article-aside { position: sticky; top: 96px; }
.toc { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; }
.toc summary { list-style: none; cursor: pointer; font-family: var(--head); font-weight: 800; font-size: 17px; color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary svg { width: 18px; height: 18px; transition: transform .2s ease; }
.toc[open] summary svg { transform: rotate(180deg); }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a {
  display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--muted); font-size: 14.5px; text-decoration: none; line-height: 1.35;
  transition: color .2s ease, border-color .2s ease;
}
.toc li a:hover { color: var(--blue); }
.toc li a.active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

/* prose */
.prose { font-size: 18px; line-height: 1.75; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 22px; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--blue-dark); }
.prose h2 { font-size: 30px; font-weight: 800; margin: 52px 0 18px; padding-top: 8px; }
.prose h3 { font-size: 22px; font-weight: 700; margin: 36px 0 12px; display: flex; gap: 12px; align-items: baseline; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 700; color: var(--navy); }
.prose img { border-radius: var(--radius); }

/* numbered steps: add class "sa-step" to an H3 and it gets the next number */
.prose { counter-reset: sa-step; }
.prose h3.sa-step::before {
  counter-increment: sa-step; content: counter(sa-step);
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tint); color: var(--blue); font-size: 15px; font-weight: 800; transform: translateY(-2px);
}

/* key takeaways */
.sa-takeaways { background: var(--tint-soft); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 24px 28px; margin: 0 0 32px; }
.sa-takeaways-title { font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--navy); margin: 0 0 12px; }
.prose .sa-takeaways ul { list-style: none; padding: 0; margin: 0; }
.prose .sa-takeaways li { position: relative; padding-left: 30px; font-size: 16.5px; line-height: 1.55; margin-bottom: 10px; }
.prose .sa-takeaways li:last-child { margin-bottom: 0; }
.prose .sa-takeaways li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* callouts */
.sa-callout { display: grid; grid-template-columns: 40px 1fr; gap: 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 22px; margin: 4px 0 26px; background: var(--white); }
.sa-callout-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--blue); display: grid; place-items: center; }
.sa-callout-ico svg { width: 20px; height: 20px; }
.sa-callout-title { font-family: var(--head); font-weight: 800; font-size: 16px; color: var(--navy); margin: 0 0 4px !important; }
.prose .sa-callout p { font-size: 16px; line-height: 1.6; margin: 0; }
.sa-callout--warn { border-left-color: var(--navy); }
.sa-callout--warn .sa-callout-ico { background: var(--navy); color: var(--white); }

/* stat strip */
.sa-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 28px; }
.sa-stat { background: var(--tint-soft); border-radius: var(--radius); padding: 18px 18px 16px; }
.sa-stat b { display: block; font-family: var(--head); font-weight: 800; font-size: 28px; color: var(--blue); line-height: 1.1; }
.sa-stat span { display: block; font-size: 13.5px; line-height: 1.4; color: var(--muted); margin-top: 6px; }

/* bottom line */
.sa-bottomline { background: var(--navy); color: #e3e6f5; border-radius: var(--radius-lg); padding: 30px 34px; margin: 48px 0 28px; }
.prose .sa-bottomline h2 { color: var(--white); margin: 0 0 10px; padding: 0; font-size: 26px; }
.prose .sa-bottomline p { margin: 0; font-size: 17px; }

.sa-disclaimer { border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 14px !important; font-style: italic; }

/* ===========================================================
   Archive / generic page
   =========================================================== */
.page-band { background: var(--tint); padding: 48px 0; }
.page-band h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
.page-band p { margin: 8px 0 0; color: var(--muted); }
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--navy); font-weight: 600; }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ===========================================================
   WordPress content
   =========================================================== */
.post-card-media .ph { display: block; }
.post-card-media .ph svg { width: 100%; height: 100%; }
.article-hero-img { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.page-prose { max-width: 760px; }
.page-band p { max-width: 70ch; }
.prose figure { margin: 28px 0; }
.prose figcaption, .prose .wp-element-caption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }
.prose blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--blue); font-size: 20px; color: var(--navy); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--tint-soft); font-family: var(--head); color: var(--navy); }
.alignleft { float: left; margin: 6px 24px 16px 0; }
.alignright { float: right; margin: 6px 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { background: var(--navy); color: #c9cde6; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding: 56px 0 40px; }
.footer-brand img { height: 26px; width: auto; }
.footer-brand p { font-size: 15px; margin: 16px 0 0; max-width: 34ch; }
.fcol h4 { color: var(--white); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 14px; }
.fcol a { display: block; color: #c9cde6; text-decoration: none; font-size: 15px; padding: 5px 0; }
.fcol a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 22px 0 32px; font-size: 13px; color: #9ea3c2; }
.footer-bottom p { margin: 0 0 8px; max-width: 90ch; }
/* article pages: no navigation in the footer either */
.footer-min { padding: 40px 0 24px; }
.footer-min img { height: 24px; width: auto; }
.footer-min p { font-size: 15px; margin: 12px 0 0; max-width: 60ch; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; order: -1; }
  .article-card { padding: 36px 32px; }
  .topic-grid, .card-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; gap: 0; position: absolute; top: 72px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 24px 16px; }
  .nav.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: inline-grid; }
  .wrap { padding: 0 18px; }
  .site-header--min .header-inner { height: 56px; }
  .site-header--min .brand img { height: 26px; }
  .article-band { padding: 28px 0 100px; }
  .article-card { padding: 28px 20px; border-radius: var(--radius); }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 25px; }
  .prose h3 { font-size: 20px; }
  .sa-stats { grid-template-columns: 1fr; }
  .sa-callout { grid-template-columns: 1fr; }
  .topic-grid, .card-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .mission { padding: 32px 22px; }
}
