/*
Theme Name: US Home Calcs Theme
Theme URI: https://ushomecalcs.com
Author: US Home Calcs Engineering
Author URI: https://ushomecalcs.com
Description: Fast, accessible, mobile-first calculator child theme for US Home Calcs, built on GeneratePress semantics and 21st.dev UI standards.
Version: 1.0.1
Template: generatepress
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: ushomecalcs-theme
License: Proprietary
*/

/* ==========================================================================
   GeneratePress Child Theme Overrides & Layout Architecture (21st.dev Standards)
   ========================================================================== */

/* 1. Global Box-Sizing & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  background-color: #ffffff;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* 2. Container & Layout Constraints (TRD §4.1: max-width 720px, no sidebar) */
.site.grid-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.ushc-calculator-page .site-content,
.ushc-calculator-page .entry-content,
.page-template-template-calculator .site-content,
.ushc-calculator-layout,
.ushc-calculator-container {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

/* Enforce No Sidebar on Calculator Pages */
.ushc-calculator-page .sidebar,
.ushc-calculator-page #right-sidebar,
.ushc-calculator-page #left-sidebar,
.page-template-template-calculator .sidebar,
.page-template-template-calculator #right-sidebar,
.page-template-template-calculator #left-sidebar {
  display: none !important;
}

.ushc-calculator-page .content-area,
.page-template-template-calculator .content-area {
  width: 100% !important;
  float: none !important;
}

/* Hub, Front-page & Utility Pages Container (TRD §4.4: max-width 1080px) */
.ushc-hub-page .site-content,
.home .site-content,
.page .site-content {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

/* 3. Header Styling */
.site-header {
  border-bottom: 1px solid #e5e7eb;
  background-color: #ffffff;
  padding: 16px 20px;
  width: 100%;
}

.site-header .header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  font-size: 20px;
  font-weight: 700;
  color: #166534; /* Accent deep tool green */
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-brand:hover {
  color: #14532d;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.main-navigation a {
  color: #374151;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.15s ease;
}

.main-navigation a:hover {
  color: #166534;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

@media (max-width: 767px) {
  .menu-toggle {
    display: block;
  }
  .main-navigation {
    display: none;
    width: 100%;
    margin-top: 12px;
  }
  .main-navigation.is-active {
    display: block;
  }
  .main-navigation ul {
    flex-direction: column;
    gap: 12px;
  }
  .site-header .header-inner {
    flex-wrap: wrap;
  }
}

/* 4. Footer Styling */
.site-footer {
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  padding: 36px 20px 48px;
  margin-top: 48px;
  font-size: 14px;
  color: #6b7280;
  width: 100%;
}

.site-footer .footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 16px 24px;
}

.footer-nav a {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: #166534;
}

.footer-disclaimer {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.footer-copy {
  font-size: 13px;
  color: #9ca3af;
}

/* 5. Typography Scale (TRD §3) */
h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px;
}

@media (min-width: 1024px) {
  h1 {
    font-size: 36px;
  }
}

h2 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  color: #1f2937;
  margin: 32px 0 16px;
}

@media (min-width: 1024px) {
  h2 {
    font-size: 26px;
  }
}

p {
  margin: 0 0 16px;
  line-height: 1.5;
}

/* 6. Utility & Breadcrumb Navigation */
.ushc-breadcrumbs {
  font-size: 13px;
  color: #6b7280;
  margin-top: 20px;
  margin-bottom: 20px;
}

.ushc-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.ushc-breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.ushc-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #9ca3af;
}

.ushc-breadcrumbs a {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ushc-breadcrumbs a:hover {
  text-decoration: underline;
  color: #166534;
}

.ushc-breadcrumbs [aria-current="page"] {
  color: #1f2937;
  font-weight: 500;
}

/* 7. Tool Header & Promise */
.ushc-tool-header {
  margin-bottom: 24px;
}

.ushc-tool-header h1.entry-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #1f2937;
  margin: 0 0 8px 0;
}

@media (min-width: 768px) {
  .ushc-tool-header h1.entry-title {
    font-size: 34px;
  }
}

.ushc-tool-promise {
  font-size: 16px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
}

/* 8. 21st.dev Button System */
.diy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border: 1px solid transparent;
}

.diy-btn-accent,
.diy-btn-primary {
  background-color: #166534;
  color: #ffffff !important;
  border-color: #166534;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.diy-btn-accent:hover,
.diy-btn-primary:hover {
  background-color: #14532d;
  border-color: #14532d;
  color: #ffffff !important;
}

.diy-btn-secondary,
.diy-btn-outline {
  background-color: #ffffff;
  color: #1f2937 !important;
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.diy-btn-secondary:hover,
.diy-btn-outline:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  color: #1f2937 !important;
}

.diy-btn-sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
}

.diy-btn-lg {
  min-height: 50px;
  padding: 14px 24px;
  font-size: 16px;
}

/* 9. Hub & Directory Card Grids (21st.dev Card Standard) */
.diy-hub-grid,
.diy-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.diy-hub-card,
.diy-related-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.diy-hub-card:hover,
.diy-related-card:hover {
  transform: translateY(-2px);
  border-color: #9ca3af;
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08);
}

.diy-hub-card-header {
  margin-bottom: 12px;
}

.diy-hub-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  margin-bottom: 8px;
}

.diy-hub-card-title,
.diy-related-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px 0;
  color: #1f2937;
}

.diy-hub-card-title a,
.diy-related-card h3 a {
  color: #1f2937;
  text-decoration: none;
}

.diy-hub-card-title a:hover,
.diy-related-card h3 a:hover {
  color: #166534;
}

.diy-hub-card-desc,
.diy-related-card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.diy-hub-card-action {
  margin-top: 8px;
}

.diy-card-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  text-decoration: none;
  gap: 4px;
}

.diy-card-arrow:hover {
  text-decoration: underline;
}

/* 10. Homepage Hero & Trust Banner */
.ushc-home-hero {
  padding: 48px 0 36px;
  text-align: center;
}

.ushc-hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.ushc-hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #166534;
  margin-bottom: 12px;
  background-color: #f0fdf4;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
}

.ushc-home-hero h1.entry-title {
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .ushc-home-hero h1.entry-title {
    font-size: 44px;
  }
}

.ushc-hero-desc {
  font-size: 18px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 auto 24px;
}

.ushc-home-directory {
  padding: 24px 0 40px;
}

.ushc-directory-header {
  margin-bottom: 16px;
}

.ushc-directory-header h2 {
  font-size: 24px;
  margin: 0 0 8px 0;
}

.ushc-directory-header p {
  color: #6b7280;
  margin: 0;
}

.ushc-home-trust-banner {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 36px 28px;
  margin: 32px 0 48px;
}

.ushc-trust-content h2 {
  font-size: 22px;
  text-align: center;
  margin: 0 0 28px 0;
}

.ushc-trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.ushc-trust-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #166534;
}

.ushc-trust-item p {
  font-size: 14px;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
}

/* 11. Explanation, Key Facts & Footnote Sections */
.ushc-explanation-section,
.ushc-related-section,
.ushc-faqs-section {
  margin-top: 40px;
}

.ushc-key-facts-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 20px;
}

.ushc-key-facts-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.ushc-key-facts-box ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

.ushc-noscript-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.ushc-noscript-box h2 {
  font-size: 16px;
  font-weight: 600;
  color: #854d0e;
  margin: 0 0 8px 0;
}

.ushc-noscript-box p {
  font-size: 14px;
  color: #854d0e;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.ushc-noscript-box p:last-child {
  margin-bottom: 0;
}

.ushc-methodology-footnote {
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
  margin-top: 40px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.ushc-methodology-footnote a {
  color: #166534;
  text-decoration: underline;
}

/* 12. Utility / Legal Pages Typography */
.ushc-utility-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 0 40px;
}

.ushc-prose-content {
  font-size: 16px;
  line-height: 1.65;
  color: #374151;
}

.ushc-prose-content h1 {
  font-size: 32px;
  margin-bottom: 20px;
}

.ushc-prose-content h2 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.ushc-prose-content ul,
.ushc-prose-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.ushc-prose-content li {
  margin-bottom: 6px;
}
