/*
Theme Name: Financial Nest Egg (Blocksy child)
Theme URI: https://financialnestegg.com/
Description: Preview child theme. Grade A header, footer, title hierarchy, and reading column patterned after ConsumersWeek chrome (Medium/Polygon rules: no neon, no sticky-ad bars). Slate palette so existing homepage and author-box HTML stay consistent.
Author: Maven Media, LLC
Template: blocksy
Version: 1.0.5
*/

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --fne-ink: #0f172a;
  --fne-body: #1e2937;
  --fne-muted: #475569;
  --fne-soft: #64748b;
  --fne-line: #e2e8f0;
  --fne-wash: #f8fafc;
  --fne-bg: #ffffff;
  --fne-link: #1e3a5f;
  --fne-footer: #0f172a;
  --fne-footer-text: #cbd5e1;
  --fne-measure: 720px;
  --fne-home: 1100px;
  --fne-base: 1.125rem;
}

html, body { overflow-x: clip !important; }

body {
  color: var(--fne-body);
  background: var(--fne-bg);
}

/* ============================================================
   Header: clean wordmark + nav. No neon, no ad chrome.
   ============================================================ */
#header.ct-header {
  background: #fff !important;
  border-bottom: 1px solid var(--fne-line);
  box-shadow: none !important;
}
#header.ct-header [data-row] {
  background: #fff !important;
}
#header .site-title a,
#header .site-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fne-ink) !important;
  text-decoration: none !important;
}
#header .site-description { display: none; }
#header .header-menu-1 .menu,
#header .menu {
  gap: 8px 22px;
}
#header .menu a,
#header .ct-menu-link {
  color: var(--fne-ink) !important;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
}
#header .menu a:hover,
#header .ct-menu-link:hover,
#header .menu .current-menu-item > a {
  text-decoration: underline !important;
  text-underline-offset: 4px;
}
#header [data-id="search"],
#header .ct-header-search,
#header [data-id="cart"],
#header .ct-header-cart,
#header .ct-header [class*="woo-cart"],
.ct-header-cart { display: none !important; }

/* ============================================================
   Home: content owns the H1 (hide Blocksy page title)
   ============================================================ */
body.home.page .hero-section,
body.home.page .entry-header,
body.home.page .page-title {
  display: none !important;
}
body.home .site-main .ct-container-full[data-vertical-spacing] {
  padding-top: 28px !important;
}
body.home .entry-content {
  max-width: var(--fne-home);
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   Pages: content already has an H1. Same reading column.
   ============================================================ */
body.page:not(.home) .hero-section,
body.page:not(.home) .entry-header {
  display: none !important;
}
body.page:not(.home) .entry-content {
  max-width: var(--fne-measure);
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   Single posts: title, byline, figure, and body share ONE
   720px reading column with the same 24px gutters.
   Blocksy puts the hero and .entry-content in a full-width
   parent and only constrains paragraphs, so we must size the
   wrappers ourselves (otherwise the H1 goes full-bleed).
   ============================================================ */
body.single .site-main .ct-container-full[data-vertical-spacing] {
  padding-top: 8px !important;
}
body.single .hero-section,
body.single .hero-section.is-width-constrained,
body.single figure.ct-featured-image,
body.single .ct-featured-image,
body.single .entry-content {
  max-width: var(--fne-measure) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
}
body.single .hero-section {
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  background: transparent !important;
}
body.single .hero-section .entry-header,
body.single .hero-section .page-title,
body.single .entry-title,
body.single .hero-section .entry-meta,
body.single .entry-meta,
body.single .entry-content.is-layout-constrained > * {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
body.single .hero-section .page-title,
body.single .entry-title {
  margin: 0 0 0.55rem !important;
  color: var(--fne-ink);
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.4rem) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
body.single .hero-section .page-description { display: none !important; }

body.single .entry-meta,
body.single .hero-section ul.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--fne-muted);
}
body.single .entry-meta a {
  color: var(--fne-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.single .entry-meta .meta-comments,
body.single .entry-meta .meta-categories { display: none; }
body.single .entry-meta > li:last-child::after,
body.single .entry-meta > span:last-child::after,
body.single .entry-meta .meta-date::after,
body.single .entry-meta .meta-author::after {
  content: none !important;
  display: none !important;
}
body.single .entry-meta .meta-date time::before {
  content: "Published ";
  font-weight: 600;
}
body.single .entry-meta .meta-updated-date time::before {
  content: "Updated ";
  font-weight: 600;
}
body.single .entry-meta .meta-author .ct-meta-label,
body.single .entry-meta .ct-meta-element-author .ct-meta-label {
  font-weight: 600;
}
body.single .ct-featured-image,
body.single figure.ct-featured-image {
  margin-top: 0.75rem !important;
  margin-bottom: 0.85rem !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important; /* Blocksy default is 50px under the image */
}
body.single .ct-featured-image .ct-media-container,
body.single figure.ct-featured-image .ct-media-container {
  aspect-ratio: 16 / 9 !important;
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
}
body.single .ct-featured-image img,
body.single figure.ct-featured-image img,
body.single .ct-featured-image img.wp-post-image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 400px;
  aspect-ratio: 16 / 9 !important; /* beat Blocksy inline 853/1280 portraits */
  object-fit: cover !important;
  object-position: center center;
  border-radius: 8px;
}
@media (max-width: 781px) {
  body.single .ct-featured-image .ct-media-container,
  body.single figure.ct-featured-image .ct-media-container {
    max-height: 220px;
  }
  body.single .ct-featured-image img,
  body.single figure.ct-featured-image img,
  body.single .ct-featured-image img.wp-post-image {
    max-height: 220px;
  }
}

/* Homepage lead + cards: do not let media dominate */
body.home .entry-content > figure,
body.home .entry-content > p > img:not(.fne-author-avatar),
body.home .hero-section .ct-featured-image,
body.home figure.ct-featured-image {
  max-height: 420px;
}
body.home .entry-content img:not(.fne-author-avatar):not(.emoji),
body.home .hero-section img,
body.home .ct-featured-image img {
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  object-position: center center;
  width: 100%;
  max-height: 420px;
}
body.home .fne-card img,
body.home .fne-feat img {
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  object-position: center center;
  width: 100%;
  max-height: 240px;
}

/* Archive / blog / search cards: consistent 16/9 thumbs */
body.archive .ct-media-container,
body.blog .ct-media-container,
body.search .ct-media-container,
body.home .ct-media-container {
  aspect-ratio: 16 / 9 !important;
  overflow: hidden;
}
body.archive .ct-media-container img,
body.blog .ct-media-container img,
body.search .ct-media-container img,
body.home .ct-media-container img,
body.archive img.wp-post-image,
body.blog img.wp-post-image,
body.search img.wp-post-image {
  aspect-ratio: 16 / 9 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
}

/* ============================================================
   Reading type
   ============================================================ */
.entry-content {
  font-size: var(--fne-base) !important;
  line-height: 1.7 !important;
  color: var(--fne-body);
}
.entry-content p,
.entry-content li {
  font-size: var(--fne-base) !important;
  line-height: 1.7 !important;
}
.entry-content h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.75rem) !important;
  line-height: 1.25 !important;
  color: var(--fne-ink);
  margin-top: 1.8em;
}
.entry-content h3 {
  font-size: clamp(1.15rem, 1rem + 1vw, 1.35rem) !important;
  line-height: 1.3 !important;
  color: var(--fne-ink);
  margin-top: 1.5em;
}
.entry-content a:not(.fne-card):not(.wp-block-button__link) {
  color: var(--fne-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.entry-content a:not(.fne-card):focus-visible,
#header a:focus-visible,
.fne-footer a:focus-visible {
  outline: 2px solid var(--fne-ink);
  outline-offset: 3px;
}

/* ============================================================
   Author box already in post content
   ============================================================ */
.fne-author-box {
  margin: 2.5em 0 1.5em;
  padding: 20px !important;
  border: 1px solid var(--fne-line) !important;
  border-radius: 10px !important;
  background: var(--fne-wash) !important;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-sizing: border-box;
}
.fne-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 64px;
}
@media (max-width: 479px) {
  .fne-author-box { flex-direction: column; }
}

/* Hide Blocksy's own author box if a content box is present */
body.single:has(.fne-author-box) .ct-author-box { display: none !important; }

/* ============================================================
   Footer
   ============================================================ */
#footer.ct-footer.fne-footer,
footer#footer.fne-footer,
.fne-footer {
  background: #0f172a !important;
  background-color: #0f172a !important;
  background-image: none !important;
  color: #cbd5e1 !important;
  margin-top: 4em;
  padding: 48px 24px 36px;
}
.fne-foot {
  max-width: 960px;
  margin: 0 auto;
}
.fne-foot-wordmark {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.fne-foot-line {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fne-footer-text);
}
.fne-foot-line a,
.fne-foot-legal a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fne-foot-legal {
  margin: 22px 0 26px;
}
.fne-foot-legal ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.fne-foot-legal li { margin: 0; }
.fne-foot-legal a {
  font-size: 0.92rem;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.fne-foot-disclaimer {
  margin: 0 0 16px;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 720px;
}
.fne-foot-copy {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Homepage cards keep their own look */
.fne-home a.fne-card { text-decoration: none; }

/* No leftover shop/demo chrome */
.woocommerce-store-notice,
.demo_store { display: none !important; }
