/* =============================================
   LAYOUT.CSS — Header, footer, page containers
   ============================================= */

/* --- Site Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.brand-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, #15803D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--color-primary);
}

/* Mobile hamburger menu */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav dropdown */
@media (max-width: 768px) {
  .site-header__inner {
    padding: 0 12px;
    height: 48px;
  }

  .site-brand img {
    height: 30px;
  }

  .site-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav a {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .site-nav a:hover {
    background: #F8FAFC;
  }

  .hamburger {
    display: flex;
  }
}

/* --- Site Footer --- */
.site-footer {
  background: #F1F5F9;
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 24px 16px;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* --- Page Containers --- */

/* Hero: centered, max 700px, generous top padding */
.page-hero {
  padding: 40px 16px 24px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.page-hero h1 {
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA button in hero */
.btn-hero {
  display: inline-block;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}

/* General page content block */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 16px;
}

.section-title {
  margin-bottom: 8px;
}

.section-sub {
  font-size: 16px;
  margin-bottom: 32px;
  text-align: center;
}

/* Calculator tool pages — remove top padding (hero already provides spacing) */
.page-content--tool {
  padding-top: 0;
  padding-bottom: 40px;
}

/* --- SEO Intro (Homepage) --- */
.seo-intro {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 28px 16px;
  text-align: center;
}

.seo-intro__heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.seo-intro__body {
  font-size: 15px;
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
}

/* =============================================
   HOMEPAGE LAYOUT SECTIONS
   ============================================= */

/* --- Hero Section --- */
.hero-section {
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
  padding: 32px 16px 48px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(22, 163, 74, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(31, 58, 95, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  width: fit-content;
}

.hero-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.4px;
  margin: 0;
}

.hero-section .hero-sub {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 420px;
  text-align: center;
}

.hero-right {
  display: flex;
  justify-content: center;
}

/* Hero calculator widget - larger and elevated */
.calc-widget--hero {
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .hero-left {
    align-items: center;
  }

  .hero-badge {
    margin: 0 auto;
  }

  .hero-sub {
    max-width: 100%;
  }

  .hero-right {
    width: 100%;
  }

  .hero-section {
    padding: 20px 12px 40px;
  }
}

/* --- Tools Section --- */
.tools-section {
  padding: 80px 24px;
  background: var(--color-bg);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.tools-section .section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}

.section-sub {
  font-size: 17px;
  color: var(--color-text-muted);
  text-align: center;
}

/* 3-col grid for tools section on desktop */
.tools-section .tools-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .tools-section {
    padding: 64px 20px;
  }

  .tools-section .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tools-section .tools-grid {
    grid-template-columns: 1fr;
  }
}
