/* ==========================================================================
   IRONFORGE THEME — Visual DNA from Apex Home Repair Template
   
   Transferred design characteristics:
   - Warm amber accent (#F5A623) on deep navy (#1A2637) base
   - Thick left-border accent pattern on section headings
   - Alternating light/dark full-width sections
   - Dark image overlays (rgba(0,0,0,.65))
   - Geometric sans-serif typography with uppercase labels
   - Card hover fill animations (bottom-up color sweep)
   - Generous vertical rhythm with varied section padding
   - Numbered overlay pattern adapted for topic cards
   - Sticky navigation with uppercase links
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
  --clr-primary: #F5A623;
  --clr-primary-dark: #D48E1A;
  --clr-dark: #1A2637;
  --clr-dark-deep: #111B28;
  --clr-secondary: #7E878F;
  --clr-light: #F6F7F9;
  --clr-white: #FFFFFF;
  --clr-border: #E2E5E9;
  --clr-text: #3A424B;
  --clr-text-light: #99A1A9;

  --ff-heading: "Segoe UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-max: 1180px;
  --gutter: 20px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--clr-text);
  background: var(--clr-white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-primary); text-decoration: none; transition: color .3s; }
a:hover { color: var(--clr-primary-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  color: var(--clr-dark);
  line-height: 1.25;
  font-weight: 700;
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* --- Skip Nav --- */
.skip-link {
  position: absolute; top: -100%; left: 50%;
  transform: translateX(-50%);
  background: var(--clr-primary); color: var(--clr-dark);
  padding: 8px 24px; z-index: 10000;
  font-weight: 600; border-radius: 0 0 4px 4px;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   HEADER / NAVBAR — Sticky, uppercase nav links, left-aligned brand
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  transition: box-shadow .3s;
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--clr-dark);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.brand:hover { color: var(--clr-dark); }
.brand img { height: 36px; width: auto; }
.brand-accent { color: var(--clr-primary); }

.main-nav { display: flex; align-items: center; gap: 0; }
.main-nav a {
  display: block;
  padding: 24px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--clr-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color .3s;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active { color: var(--clr-primary); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 44px; height: 44px;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 24px; height: 2px;
  background: var(--clr-dark);
  position: absolute; left: 10px;
  transition: .3s;
}
.nav-toggle span { top: 50%; transform: translateY(-50%); }
.nav-toggle span::before { content: ''; top: -7px; }
.nav-toggle span::after { content: ''; top: 7px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--clr-white);
    border-top: 1px solid var(--clr-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    padding: 8px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px var(--gutter); }
}

/* ==========================================================================
   HERO — Full-width dark overlay with left-aligned content
   Adapted from carousel hero: dark overlay, breadcrumb-style tags, large display heading
   ========================================================================== */
.hero {
  position: relative;
  background: var(--clr-dark);
  padding: 100px 0 90px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--clr-dark-deep) 0%, rgba(26,38,55,.85) 100%);
  z-index: 1;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
.hero-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-primary);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--clr-white);
  margin-bottom: 20px;
  line-height: 1.15;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.7);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
}
.hero-subtitle p { margin-bottom: 0; }

.btn-primary {
  display: inline-block;
  background: var(--clr-primary);
  color: var(--clr-dark);
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 36px;
  border: none;
  cursor: pointer;
  transition: background .3s, transform .2s;
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
  color: var(--clr-dark);
  transform: translateY(-2px);
}

.hero-decoration {
  position: absolute;
  right: -60px; bottom: -80px;
  width: 320px; height: 320px;
  border: 3px solid rgba(245,166,35,.15);
  z-index: 1;
}

@media (min-width: 992px) {
  .hero { padding: 120px 0 110px; }
  .hero-grid { grid-template-columns: 7fr 5fr; }
}

/* ==========================================================================
   SECTION HEADING PATTERN — Thick left border accent (DNA from source)
   ========================================================================== */
.section-heading {
  border-left: 5px solid var(--clr-primary);
  padding-left: 20px;
  margin-bottom: 40px;
}
.section-heading .label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-secondary);
  margin-bottom: 6px;
}
.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
}

/* ==========================================================================
   TOPICS — Numbered overlay cards adapted from "Facts" section
   Full-bleed grid with dark overlays and large stroke numbers
   ========================================================================== */
.topics-section {
  padding: 80px 0;
  background: var(--clr-white);
}
.topics-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 48px;
}
.topics-header p {
  max-width: 420px;
  color: var(--clr-secondary);
  margin: 0;
}
.topics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.topic-card {
  position: relative;
  background: var(--clr-dark);
  padding: 44px 32px 40px;
  overflow: hidden;
  transition: background .4s;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topic-card::before {
  content: attr(data-index);
  position: absolute;
  top: -10px; right: 20px;
  font-size: 7rem;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(245,166,35,.18);
  line-height: 1;
  pointer-events: none;
  transition: -webkit-text-stroke .4s;
}
.topic-card:hover::before {
  -webkit-text-stroke-color: rgba(245,166,35,.35);
}
.topic-card h3 {
  font-size: 1.15rem;
  color: var(--clr-white);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.topic-card .topic-desc {
  color: rgba(255,255,255,.6);
  font-size: .92rem;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}
.topic-card .topic-desc p { margin: 0; }
.topic-card:hover { background: var(--clr-dark-deep); }

@media (min-width: 600px) {
  .topics-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .topic-card { border-right: 1px solid rgba(255,255,255,.06); }
}
@media (min-width: 992px) {
  .topics-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   LATEST POSTS — Asymmetric two-column layout inspired by about section
   Featured post large + remaining posts stacked
   ========================================================================== */
.posts-section {
  padding: 80px 0;
  background: var(--clr-light);
}
.posts-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
.post-card {
  background: var(--clr-white);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.post-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--clr-dark);
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 28px 28px 32px; }
.post-card-date {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--clr-primary);
  margin-bottom: 10px;
}
.post-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  line-height: 1.35;
}
.post-card-body h3 a {
  color: var(--clr-dark);
  transition: color .3s;
}
.post-card-body h3 a:hover { color: var(--clr-primary); }
.post-card-excerpt {
  color: var(--clr-secondary);
  font-size: .92rem;
  line-height: 1.65;
}
.post-card-excerpt p { margin: 0; }

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--clr-dark);
  margin-top: 16px;
  transition: color .3s, gap .3s;
}
.read-more-link:hover { color: var(--clr-primary); gap: 12px; }
.read-more-link svg { transition: transform .3s; }

/* Featured (first) post bigger */
.post-featured .post-card-img { aspect-ratio: 16/10; }
.post-featured .post-card-body h3 { font-size: 1.4rem; }

@media (min-width: 768px) {
  .posts-layout {
    grid-template-columns: 1fr 1fr;
  }
  .post-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .post-featured .post-card-img { aspect-ratio: auto; min-height: 320px; }
  .post-featured .post-card-body { display: flex; flex-direction: column; justify-content: center; padding: 36px 40px; }
}

/* ==========================================================================
   FAQ — Left-aligned with border-left accent pattern
   NOT accordion - uses expandable blocks with smooth reveal
   ========================================================================== */
.faq-section {
  padding: 80px 0 90px;
  background: var(--clr-white);
}
.faq-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.faq-intro { max-width: 480px; }
.faq-intro p { color: var(--clr-secondary); margin-top: 16px; }

.faq-list { display: flex; flex-direction: column; gap: 0; }
.faq-item {
  border-bottom: 1px solid var(--clr-border);
  overflow: hidden;
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 22px 0;
  font-family: var(--ff-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-dark);
  text-align: left;
  transition: color .3s;
}
.faq-question:hover { color: var(--clr-primary); }
.faq-question:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}
.faq-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  position: relative;
  transition: transform .3s;
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--clr-dark);
  transition: transform .3s, background .3s;
}
.faq-icon::before { width: 16px; height: 2px; top: 13px; left: 6px; }
.faq-icon::after { width: 2px; height: 16px; top: 6px; left: 13px; }
.faq-item.open .faq-icon::after { transform: rotate(90deg); }
.faq-item.open .faq-question { color: var(--clr-primary); }
.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after { background: var(--clr-primary); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .4s ease;
  padding: 0 0 0 0;
}
.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 0 0 24px 0;
}
.faq-answer-inner {
  color: var(--clr-secondary);
  font-size: .95rem;
  line-height: 1.7;
  border-left: 4px solid var(--clr-primary);
  padding-left: 20px;
}
.faq-answer-inner p { margin: 0 0 8px; }
.faq-answer-inner p:last-child { margin-bottom: 0; }

@media (min-width: 992px) {
  .faq-layout { grid-template-columns: 5fr 7fr; gap: 60px; }
}

/* ==========================================================================
   FOOTER — Dark bg matching source, 4-column with nav links
   ========================================================================== */
.site-footer {
  background: var(--clr-dark);
  color: rgba(255,255,255,.55);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand {
  font-family: var(--ff-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-white);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.footer-brand .brand-accent { color: var(--clr-primary); }
.footer-about p { font-size: .9rem; line-height: 1.7; max-width: 300px; }

.footer-heading {
  font-size: .95rem;
  color: var(--clr-white);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  font-weight: 600;
}
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: 10px; }
.footer-nav a {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  transition: color .3s, padding-left .3s;
}
.footer-nav a::before {
  content: '›';
  margin-right: 8px;
  color: rgba(255,255,255,.3);
  transition: color .3s;
}
.footer-nav a:hover { color: var(--clr-white); padding-left: 4px; }
.footer-nav a:hover::before { color: var(--clr-primary); }

.footer-contact a {
  display: block;
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  margin-bottom: 8px;
  transition: color .3s;
}
.footer-contact a:hover { color: var(--clr-primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 992px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ==========================================================================
   PAGE TEMPLATE — Content pages (about, etc.)
   ========================================================================== */
.page-hero {
  background: var(--clr-dark);
  padding: 80px 0 60px;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--clr-dark-deep), rgba(26,38,55,.9));
}
.page-hero-inner {
  position: relative; z-index: 2;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--clr-white);
}
.page-hero .label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-primary);
  margin-bottom: 12px;
}

.page-content {
  padding: 60px 0 80px;
}
.page-content .content-wrap {
  max-width: 780px;
}
.page-content h2 {
  font-size: 1.5rem;
  margin: 36px 0 16px;
  border-left: 4px solid var(--clr-primary);
  padding-left: 16px;
}
.page-content h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
}
.page-content p {
  margin-bottom: 16px;
  color: var(--clr-text);
}
.page-content ul, .page-content ol {
  margin: 0 0 16px 24px;
}
.page-content li { margin-bottom: 6px; }
.page-content a { text-decoration: underline; }

/* ==========================================================================
   BLOG INDEX — Two-column grid with pagination
   ========================================================================== */
.blog-section {
  padding: 60px 0 80px;
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
@media (min-width: 600px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 992px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; height: 44px;
  padding: 0 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-dark);
  border: 1px solid var(--clr-border);
  transition: all .3s;
}
.pagination a:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}
.pagination a.active,
.pagination span.active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: var(--clr-dark);
}

/* ==========================================================================
   SINGLE POST — Article layout
   ========================================================================== */
.post-header {
  background: var(--clr-dark);
  padding: 80px 0 50px;
  position: relative;
}
.post-header::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--clr-dark-deep), rgba(26,38,55,.9));
}
.post-header-inner {
  position: relative; z-index: 2;
  max-width: 780px;
}
.post-meta {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-primary);
  margin-bottom: 16px;
}
.post-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--clr-white);
  margin-bottom: 16px;
}
.post-header-excerpt {
  color: rgba(255,255,255,.6);
  font-size: 1.05rem;
  line-height: 1.7;
}
.post-header-excerpt p { margin: 0; }

.post-cover {
  margin: -40px auto 0;
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 0 var(--gutter);
}
.post-cover img {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 21/9;
}

.post-body {
  padding: 48px 0 80px;
}
.post-body .content-wrap {
  max-width: 780px;
}
.post-body h2 {
  font-size: 1.5rem;
  margin: 36px 0 16px;
  border-left: 4px solid var(--clr-primary);
  padding-left: 16px;
}
.post-body h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
}
.post-body p {
  margin-bottom: 16px;
}
.post-body ul, .post-body ol { margin: 0 0 16px 24px; }
.post-body li { margin-bottom: 6px; }
.post-body a { text-decoration: underline; }
.post-body img {
  margin: 24px 0;
  border-left: 5px solid var(--clr-primary);
}
.post-body blockquote {
  border-left: 5px solid var(--clr-primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--clr-light);
  font-style: italic;
  color: var(--clr-secondary);
}

/* ==========================================================================
   BACK TO TOP — Matching source pattern
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  background: var(--clr-primary);
  color: var(--clr-dark);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 800;
  border: none;
  cursor: pointer;
  transition: background .3s, transform .2s;
}
.back-to-top:hover { background: var(--clr-primary-dark); transform: translateY(-3px); }
.back-to-top.visible { display: flex; }

/* ==========================================================================
   ANIMATIONS — Fade-in on scroll (replaces WOW.js)
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE FINE-TUNING
   ========================================================================== */
@media (max-width: 480px) {
  .hero { padding: 60px 0 50px; }
  .topics-section, .posts-section, .faq-section { padding: 56px 0; }
  .topic-card { padding: 32px 20px 28px; }
  .post-card-body { padding: 20px 20px 24px; }
  .btn-primary { padding: 14px 28px; }
}
