/* =========================
   GLOBAL BASE
   ========================= */

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
}

/* Overall page chrome: header, main, footer */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
  margin-bottom: 16px;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-logo {
  font-weight: bold;
  text-decoration: none;
  color: #1a4b8f;
  font-size: 18px;
}

/* FIXED: nav container + hover selector */
.site-nav {
  display: flex;
  gap: 12px;
}

.site-nav a {
  text-decoration: none;
  color: #333333;
  font-size: 14px;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-main {
  min-height: 70vh;
}

.site-footer {
  background: #ffffff;
  border-top: 1px solid #dddddd;
  margin-top: 24px;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555555;
}

.site-footer-inner a {
  text-decoration: none;
  color: #1a4b8f;
}

.site-footer-inner a:hover {
  text-decoration: underline;
}

/* =========================
   CALCULATOR PAGES
   ========================= */

.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Main heading (used on most pages) */
h1 {
  text-align: center;
  margin-bottom: 32px;
}

/* 3x2 grid: 3 columns, 2 rows (calculator pages) */
.page-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 380px) 1fr;
  grid-auto-rows: auto;
  gap: 24px;
  align-items: start;
}

/* Generic slot wrapper (calculator pages) */
.grid-slot {
  display: flex;
  justify-content: center;
}

/* Ensure calculator stays centered within its slot */
.calculator-container {
  max-width: 340px;
  width: 100%;
}

/* Ad / affiliate blocks (calculator pages) */
.ad-block {
  width: 100%;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
}

.ad-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.ad-placeholder-img {
  width: 100%;
  height: 120px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* SEO / description / FAQ section (calculator pages) */
.seo-section {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
}

.seo-section h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
}

.seo-section h3 {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 16px;
}

.seo-section p {
  margin: 4px 0 8px;
}

/* Mobile: stack everything in one column (calculator pages) */
@media (max-width: 899px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .grid-slot {
    justify-content: center;
  }

  .ad-block,
  .seo-section {
    max-width: 380px;
  }
}

/* =========================
   HOMEPAGE
   ========================= */

.home-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.home-header {
  text-align: center;
  margin-bottom: 32px;
}

.home-header p {
  margin: 6px 0;
  font-size: 14px;
  color: #444444;
}

/* 3 x 5 grid for homepage blocks */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* Individual category / contact blocks */
/* UPDATED: center content horizontally and vertically */
.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: #222222;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
  min-height: 120px;
  text-align: center;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  border-color: #bbbbbb;
}

.home-card-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.home-card-desc {
  font-size: 13px;
  color: #555555;
}

/* Placeholder card (contact/feedback coming later) */
.home-card-empty {
  background: #f0f0f0;
  border-style: dashed;
  text-align: center;
}

/* Mobile: homepage grid becomes single column */
@media (max-width: 799px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   CATEGORY PAGES
   ========================= */

.category-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.category-header {
  text-align: center;
  margin-bottom: 16px;
}

.category-header p {
  margin: 4px 0;
  font-size: 14px;
  color: #444444;
}

.category-back {
  text-align: center;
  margin-bottom: 16px;
}

.category-back a {
  text-decoration: none;
  color: #1a4b8f;
  font-size: 14px;
}

.category-back a:hover {
  text-decoration: underline;
}

.category-grid {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* UPDATED: center text inside category tiles */
.category-item {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-item a {
  text-decoration: none;
  color: #1a4b8f;
  font-weight: bold;
}

.category-item a:hover {
  text-decoration: underline;
}

.category-item p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #555555;
}
