/*
Theme Name: First Credit Path
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: A fast, lightweight theme for credit-building and personal finance sites monetized with Google AdSense and affiliate links. Includes AdSense placements, an automatic table of contents, an advertiser disclosure bar, an author box, pros and cons blocks and a score-ladder home page.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: first-credit-path
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

:root {
  --paper: #f5f8fc;
  --surface: #ffffff;
  --ink: #0e1b2c;
  --ink-2: #3b4a5e;
  --line: #d9e1ec;
  --cobalt: #2547d0;
  --cobalt-dark: #1a34a3;
  --cobalt-tint: #e8edfb;
  --amber: #f2a33a;
  --amber-tint: #fff3df;
  --green: #1f8f5f;
  --green-tint: #e8f6ee;
  --red: #c2413b;
  --red-tint: #fdeceb;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1140px;
  --read: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--cobalt); text-underline-offset: 0.18em; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.15em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* Buttons */
.btn, .wp-block-button__link, .search-submit, .comment-form .submit {
  display: inline-block; background: var(--cobalt); color: #fff; font: 600 1rem/1.2 var(--sans);
  padding: .8rem 1.25rem; border: 2px solid var(--cobalt); border-radius: 6px; text-decoration: none; cursor: pointer;
}
.btn:hover, .wp-block-button__link:hover, .search-submit:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--cobalt); }
.btn--ghost:hover { background: var(--cobalt-tint); color: var(--cobalt-dark); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.brand__name { font: 700 1.3rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand__mark { flex: none; }
.custom-logo { max-height: 48px; width: auto; }
.primary-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: .5rem 0; color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; border-bottom: 2px solid transparent; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { border-bottom-color: var(--cobalt); color: var(--cobalt-dark); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; font: 600 .9rem var(--sans); color: var(--ink); cursor: pointer; }

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
  .nav-toggle { display: block; }
  .primary-nav { display: none; width: 100%; order: 3; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; padding-bottom: .5rem; }
  .primary-nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
}

/* Hero with score ladder */
.hero { padding: 3.5rem 0 3rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.hero__lead { font-size: 1.2rem; color: var(--ink-2); max-width: 34rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.ladder { margin: 0; }
.ladder__steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 290px; margin: 0; padding: 0; list-style: none; }
.ladder__step {
  height: var(--h); background: var(--bg); color: var(--fg); border-radius: 4px 4px 0 0;
  padding: .55rem .5rem; display: flex; flex-direction: column; justify-content: flex-end; line-height: 1.25; font-size: .8rem;
}
.ladder__step strong { font-size: .85rem; }
.ladder__step--start { background: transparent; border: 2px dashed var(--amber); border-bottom: 0; color: var(--ink); }
.ladder__cap { margin-top: .9rem; color: var(--ink-2); font-size: .9rem; border-top: 3px solid var(--ink); padding-top: .6rem; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; gap: 2rem; } }
@media (max-width: 640px) {
  .hero { padding: 2.25rem 0; }
  .ladder__steps { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: auto; }
  .ladder__step { height: auto; width: var(--w); min-width: 11.5rem; flex-direction: row; justify-content: space-between; align-items: center; border-radius: 0 4px 4px 0; padding: .55rem .8rem; }
  .ladder__step--start { border: 2px dashed var(--amber); border-left: 0; }
}

/* Sections */
.section { padding: 3rem 0; }
.section--tint { background: var(--cobalt-tint); }
.section__head { max-width: 40rem; margin-bottom: 1.75rem; }
.section__head p { color: var(--ink-2); margin: 0; }

/* Starting points */
.starts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 2rem; }
.starts a { display: block; padding: .25rem 0 .25rem 1.1rem; border-left: 4px solid var(--cobalt); text-decoration: none; color: var(--ink); }
.starts a:hover { border-left-color: var(--amber); }
.starts strong { display: block; font: 700 1.15rem/1.3 var(--serif); }
.starts span { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 700px) { .starts { grid-template-columns: 1fr; } }

/* Post rows */
.rows { display: grid; gap: 0; }
.row { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; padding: 1.4rem 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:not(:has(.row__img)) { grid-template-columns: 1fr; }
.row__img img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.row__cat { font: 600 .85rem var(--sans); }
.row__cat a { text-decoration: none; }
.row__title { font-size: 1.35rem; margin: .15rem 0 .4rem; }
.row__title a { color: var(--ink); text-decoration: none; }
.row__title a:hover { color: var(--cobalt); text-decoration: underline; }
.row__excerpt { color: var(--ink-2); margin: 0 0 .5rem; }
.row__meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; color: var(--ink-2); font-size: .85rem; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

/* Topics */
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 2.5rem; }
.topics li { border-top: 1px solid var(--line); padding: 1rem 0; }
.topics a { font: 700 1.1rem var(--serif); text-decoration: none; }
.topics small { color: var(--ink-2); margin-left: .4rem; }
.topics p { margin: .25rem 0 0; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 700px) { .topics { grid-template-columns: 1fr; } }

/* Trust */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.trust h3 { font-size: 1.1rem; }
.trust p { color: var(--ink-2); margin: 0; font-size: .97rem; }
@media (max-width: 800px) { .trust { grid-template-columns: 1fr; gap: 1.25rem; } }

/* Layout with sidebar */
.layout { display: grid; grid-template-columns: minmax(0, var(--read)) 300px; gap: 3.5rem; justify-content: center; padding: 2rem 0 3.5rem; }
.layout--single { align-items: start; }
.main-col { min-width: 0; }
@media (max-width: 1060px) { .layout { grid-template-columns: minmax(0, var(--read)); } .sidebar { display: none; } .sidebar.sidebar--keep { display: block; } }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: 0 0 1rem; padding: 0; font-size: .85rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: .6rem; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* Single */
.entry__cat { font: 600 .9rem var(--sans); }
.entry__cat a { text-decoration: none; }
.entry__title { margin-top: .2rem; }
.entry__meta { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0 0 1.25rem; color: var(--ink-2); font-size: .9rem; }
.entry__meta a { color: var(--ink-2); }
.disclosure { background: var(--amber-tint); border-left: 4px solid var(--amber); padding: .7rem 1rem; font-size: .88rem; margin: 0 0 1.75rem; border-radius: 0 6px 6px 0; color: var(--ink); }
.disclosure p { margin: 0; }
.entry__thumb { margin: 0 0 1.75rem; }
.entry__thumb img { display: block; width: 100%; border-radius: 8px; }

.entry__content { font-size: 1.0625rem; }
.entry__content h2 { margin-top: 2.4rem; scroll-margin-top: 1.5rem; }
.entry__content h3 { margin-top: 1.9rem; scroll-margin-top: 1.5rem; }
.entry__content ul, .entry__content ol { padding-left: 1.3rem; margin: 0 0 1.25em; }
.entry__content li { margin-bottom: .4rem; }
.entry__content blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--cobalt); color: var(--ink-2); font-family: var(--serif); font-size: 1.15rem; }
.entry__content img { border-radius: 6px; }
.entry__content figcaption { font-size: .85rem; color: var(--ink-2); margin-top: .4rem; }
.table-wrap, .wp-block-table { overflow-x: auto; margin: 0 0 1.5rem; }
.entry__content table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.entry__content th, .entry__content td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry__content thead th { background: var(--ink); color: #fff; font-weight: 600; border-bottom: 0; }
.entry__content tbody tr:nth-child(even) { background: #eef3fa; }
.is-style-fcp-comparison td:first-child, .is-style-fcp-comparison th:first-child { font-weight: 700; }
.entry__content .is-style-fcp-pros, .entry__content .is-style-fcp-cons, .entry__content .is-style-fcp-callout { padding: 1rem 1.25rem; border-radius: 8px; margin: 1.25rem 0; }
.entry__content .is-style-fcp-pros { background: var(--green-tint); border-left: 4px solid var(--green); }
.entry__content .is-style-fcp-cons { background: var(--red-tint); border-left: 4px solid var(--red); }
.entry__content .is-style-fcp-callout { background: var(--amber-tint); border-left: 4px solid var(--amber); }
.is-style-fcp-pros > :last-child, .is-style-fcp-cons > :last-child, .is-style-fcp-callout > :last-child { margin-bottom: 0; }
.entry__content .wp-block-button__link { text-decoration: none; }

/* TOC */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; font-size: .93rem; }
.toc summary, .toc__title { font: 700 1rem var(--serif); cursor: pointer; margin: 0; }
.toc__list { list-style: none; margin: .8rem 0 0; padding: 0; }
.toc__item { margin: 0; }
.toc__item a { display: block; padding: .3rem 0 .3rem .75rem; border-left: 3px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc__item a:hover { color: var(--cobalt); }
.toc__item a.is-active { border-left-color: var(--cobalt); color: var(--ink); font-weight: 600; }
.toc__item--h3 a { padding-left: 1.6rem; font-size: .88rem; }
.toc--inline { margin: 0 0 2rem; }
.toc--side { position: sticky; top: 1.25rem; }
@media (min-width: 1061px) { .toc--inline { display: none; } }

/* Sidebar */
.sidebar > * + * { margin-top: 1.75rem; }
.widget { font-size: .95rem; }
.widget__title { font-size: 1.05rem; padding-bottom: .4rem; border-bottom: 3px solid var(--ink); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.widget a { text-decoration: none; }

/* Ads */
.ad { margin: 1.75rem 0; min-height: 280px; text-align: center; }
.ad__label { display: block; font-size: .72rem; color: var(--ink-2); margin-bottom: .25rem; }
.ad--list { margin: 0; border-top: 1px solid var(--line); padding-top: 1rem; }

/* Author, related */
.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 1.1rem; margin: 2.5rem 0 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.author-box img { border-radius: 50%; display: block; }
.author-box h2 { font-size: 1.1rem; margin: 0 0 .25rem; }
.author-box p { margin: 0; font-size: .95rem; color: var(--ink-2); }
.related { margin-top: 2.75rem; }
.related h2 { font-size: 1.35rem; }

/* Newsletter */
.newsletter { background: var(--ink); color: #fff; padding: 2rem; border-radius: 8px; margin: 2.5rem 0 0; }
.newsletter h2 { color: #fff; font-size: 1.5rem; }
.newsletter p { color: #cfd9e8; margin-bottom: 1rem; }
.newsletter form { display: flex; flex-wrap: wrap; gap: .6rem; }
.newsletter input[type="email"] { flex: 1 1 220px; padding: .8rem 1rem; border: 2px solid transparent; border-radius: 6px; font: 1rem var(--sans); }
.newsletter .btn { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.newsletter .btn:hover { background: #ffb754; border-color: #ffb754; color: var(--ink); }

/* Archive header */
.archive-head { margin-bottom: 1.5rem; }
.archive-head .term-desc { color: var(--ink-2); }
.archive-head .term-desc > :last-child { margin-bottom: 0; }

/* Pagination, forms, comments */
.pagination { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.page-numbers { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: var(--ink); }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.search-form { display: flex; gap: .5rem; }
.search-field, input[type="text"], input[type="email"], input[type="url"], textarea { width: 100%; padding: .7rem .9rem; border: 1px solid #b9c5d6; border-radius: 6px; font: 1rem var(--sans); background: #fff; color: var(--ink); }
.comments-area { margin-top: 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 1rem 0; border-top: 1px solid var(--line); }
.comment-list .children { list-style: none; padding-left: 1.5rem; }

/* Footer */
.site-footer { background: var(--ink); color: #cfd9e8; padding: 3rem 0 2rem; margin-top: 2rem; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer .widget__title { color: #fff; border-bottom-color: #4a5b73; }
.site-footer .widget li { border-bottom-color: #2b3b52; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-menu ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; padding: 0; margin: 0 0 1rem; }
.footer-note { border-top: 1px solid #2b3b52; padding-top: 1.25rem; font-size: .85rem; }
.footer-note p { margin: 0 0 .5rem; }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

.alignwide { max-width: 100%; }
.alignleft { float: left; margin: 0 1.25rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.25rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor { display: block; }
