/* =========================================================
   FinOpsZilla — WordPress-only additions.
   styles.css is identical to the static site; everything WordPress needs on top lives here.
   ========================================================= */

/* ---------- Admin toolbar (logged-in users) ---------- */
.admin-bar .site-header { top: 32px; }
.admin-bar { scroll-padding-top: calc(var(--header-h) + 48px); }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
/* Below 600px the toolbar scrolls away with the page */
@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
}

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

/* ---------- Loading screen: progress bar + percentage ---------- */
/* The bar fills to match the percentage (set by assets/js/intro.js as --progress, 0–1). */
.intro .loader__bar::after {
  width: 100%;
  animation: none;
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
}
.loader__pct {
  margin: -8px 0 0;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  letter-spacing: .12em; color: var(--muted-on-dark);
  font-variant-numeric: tabular-nums;
  min-width: 4ch; text-align: center;
  animation: rise-in .7s var(--ease-out) .6s both;
}

/* ---------- Footer social links ---------- */
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.social__link {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink-2); color: #D6DED9;
  box-shadow: inset 0 0 0 1px var(--line-dark);
  transition: transform .3s var(--ease-spring), background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.social__link svg { width: 18px; height: 18px; fill: currentColor; }
.social__link:hover { transform: translateY(-3px); background: var(--volt); color: var(--ink); box-shadow: inset 0 0 0 1px var(--volt); }
.social__link:focus-visible { outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .social__link:hover { transform: none; }
}

/* ---------- Posts, pages and archives ---------- */
.entry-hero {
  background: var(--ink); color: var(--paper);
  padding-block: clamp(56px, 8vw, 104px) clamp(48px, 6vw, 80px);
}
.entry-hero__inner { display: flex; flex-direction: column; gap: 18px; }
.entry-hero__inner > * { max-width: 860px; }
/* On a post or page, line the title up with the reading column below it */
.entry .entry-hero__inner { max-width: calc(720px + var(--gutter) * 2); }
.entry-hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -.035em;
  animation: rise-in .8s var(--ease-out) both;
}
.entry-hero__meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted-on-dark); font-size: 14px; }

.entry__media { margin: clamp(-40px, -3vw, -24px) auto 0; max-width: calc(1000px + var(--gutter) * 2); }
.entry__media img { width: 100%; height: auto; border-radius: var(--radius); display: block; }

.entry__content {
  max-width: calc(720px + var(--gutter) * 2);
  margin-inline: auto; padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(64px, 8vw, 104px);
  font-size: 17px; line-height: 1.75; color: #1E2925;
}
.entry__content > * + * { margin-top: 1.2em; }
.entry__content h2, .entry__content h3, .entry__content h4 {
  font-family: var(--font-display); color: var(--ink); letter-spacing: -.025em; line-height: 1.2;
  margin-top: 1.8em;
}
.entry__content h2 { font-size: clamp(24px, 3vw, 32px); }
.entry__content h3 { font-size: clamp(20px, 2.4vw, 24px); }
.entry__content a { color: var(--emerald-deep); text-underline-offset: 3px; }
.entry__content a:hover { color: var(--ink); }
.entry__content ul, .entry__content ol { padding-left: 1.4em; }
.entry__content ul { list-style: disc; }
.entry__content ol { list-style: decimal; }
.entry__content li + li { margin-top: .4em; }
.entry__content blockquote {
  margin-inline: 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--volt); font-size: 1.08em; color: var(--ink);
}
.entry__content img, .entry__content video { max-width: 100%; height: auto; border-radius: 12px; }
.entry__content figure { margin-inline: 0; }
.entry__content figcaption, .entry__content .wp-caption-text { font-size: 13px; color: var(--muted-on-light); margin-top: 8px; }
.entry__content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry__content th, .entry__content td { border-bottom: 1px solid var(--line-light); padding: 10px 8px; text-align: left; }
.entry__content code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry__content pre { background: var(--ink); color: var(--paper); padding: 18px; border-radius: 12px; overflow-x: auto; }
.entry__content pre code { background: none; padding: 0; }
.entry__content hr { border: 0; border-top: 1px solid var(--line-light); }
.entry__content .alignwide { max-width: 1000px; margin-inline: auto; }
.entry__content .alignleft { float: left; margin: 6px 24px 12px 0; }
.entry__content .alignright { float: right; margin: 6px 0 12px 24px; }
.entry__content .aligncenter { margin-inline: auto; }
.page-links { font-weight: 500; }

/* Archive grid (reuses the landing page's .card styles) */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-grid .card__thumb { aspect-ratio: 16 / 9; }
.post-grid .card__thumb .card__image { width: 100%; height: 100%; object-fit: cover; max-height: none; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }

.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; background: var(--white); color: var(--ink); text-decoration: none; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line-light);
}
.pagination .page-numbers.current { background: var(--ink); color: var(--volt); box-shadow: none; }
.pagination a.page-numbers:hover { box-shadow: inset 0 0 0 1px var(--emerald); }

@media (prefers-reduced-motion: reduce) {
  .entry-hero__title { animation: none !important; }
}
