/* ============================================================
   Baldwin Mutual Insurance — Main Stylesheet
   Zero third-party dependencies. Self-hosted fonts only.
   ============================================================ */

/* --- Font Faces ------------------------------------------- */
@font-face {
  font-family: 'Noto Serif';
  src: url('/fonts/NotoSerif-Regular.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif';
  src: url('/fonts/NotoSerif-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/PublicSans-Regular.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/PublicSans-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* --- CSS Custom Properties: Heritage Gold palette --------- */
:root,
[data-palette="gold"] {
  --color-primary:           #7A6520;
  --color-primary-light:     #C4A95B;
  --color-primary-container: #F5EDD4;
  --color-bg:                #FAF8F3;
  --color-surface:           #F3EFE8;
  --color-dark:              #2A2A28;
  --color-text:              #2F2E2B;
  --color-text-secondary:    #5C5850;
  --color-accent:            #6B5A1E;
  --color-error:             #9E422C;
  --color-border:            #D6CDBA;
  --color-border-light:      #E8E2D4;
}

/* --- CSS Custom Properties: Sage Green palette ------------ */
[data-palette="sage"] {
  --color-primary:           #51634C;
  --color-primary-light:     #C6DABE;
  --color-primary-container: #D4E8CB;
  --color-bg:                #FAF9F8;
  --color-surface:           #F3F4F3;
  --color-dark:              #2F3333;
  --color-text:              #2F3333;
  --color-text-secondary:    #5B605F;
  --color-accent:            #51634C;
  --color-error:             #9E422C;
  --color-border:            #C6CECA;
  --color-border-light:      #DFE3E2;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

::selection {
  background-color: var(--color-primary-container);
  color: var(--color-text);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* --- Typography ------------------------------------------- */
h1, h2, h3, h4 {
  font-family: 'Noto Serif', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.375rem);
  font-weight: 600;
}

p {
  max-width: 65ch;
}

/* --- Layout ----------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section--surface {
  background-color: var(--color-surface);
}

/* --- Header / Navigation ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 5.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-header__monogram {
  height: 3.5rem;
  width: auto;
  flex-shrink: 0;
}

.site-header__logo-text {
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-family: 'Public Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
}

.site-nav a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.5;
}

.site-header__phone {
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header__phone:hover {
  color: var(--color-primary-light);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 0;
  font-family: 'Public Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.mobile-nav a:hover {
  color: #fff;
}

/* --- Hero ------------------------------------------------- */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 0.375rem 1rem;
  margin-bottom: 1.5rem;
}

.hero__title {
  margin-bottom: 1.5rem;
}

.hero__title em {
  color: var(--color-primary);
  font-style: normal;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__image {
  position: relative;
}

.hero__image img {
  border-radius: 4px;
}

.hero__image::before {
  content: "";
  position: absolute;
  top: -2rem;
  right: -2rem;
  width: 16rem;
  height: 16rem;
  background: var(--color-primary-container);
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(60px);
  z-index: 0;
}

.hero__image img {
  position: relative;
  z-index: 1;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.875rem 2rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn--primary {
  background: linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn--primary:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-primary-light);
}

.btn--phone {
  background: var(--color-primary);
  color: #fff;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-size: 1.25rem;
  padding: 1.125rem 2.5rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.btn--phone:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
  color: #fff;
}

/* --- Product Grid ----------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.product-card {
  background: #fff;
  padding: 2rem;
  border-radius: 6px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--color-border-light);
}

.product-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.product-card__image {
  height: 10rem;
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__image {
  transform: scale(1.04);
}

.product-card h3 {
  margin-bottom: 0.5rem;
}

.product-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.product-card__link {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.product-card__link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.product-card:hover .product-card__link::after {
  transform: translateX(4px);
}

/* --- Pencil Sketch Filter --------------------------------- */
.pencil-sketch {
  filter: grayscale(1) contrast(1.1) opacity(0.8);
  mix-blend-mode: multiply;
}

/* --- CTA Section ------------------------------------------ */
.cta-section {
  text-align: center;
  padding: 6rem 0;
}

.cta-section__inner {
  background: var(--color-primary-container);
  border-radius: 1.5rem;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.cta-section__inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, var(--color-primary-light) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--color-primary-container) 0%, transparent 50%);
  opacity: 0.3;
}

.cta-section__inner > * {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: var(--color-text-secondary);
  font-size: 1.125rem;
  margin: 0 auto 2rem;
}

.cta-section__note {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-top: 1.5rem;
}

/* --- Demotech Badge --------------------------------------- */
.demotech-badge {
  display: inline-block;
  margin-top: 2rem;
}

.demotech-badge img {
  height: 4rem;
  width: auto;
}

.demotech-badge--small img {
  height: 2.5rem;
}

/* --- Page Header ------------------------------------------ */
.page-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-border-light);
}

.page-header h1 {
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
}

/* --- Content Pages ---------------------------------------- */
.page-content {
  padding: 3rem 0 5rem;
}

.page-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  margin-bottom: 1.25rem;
}

.page-content ol,
.page-content ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.page-content ol li {
  padding-left: 0.25rem;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0 2rem;
  filter: grayscale(1) contrast(1.1) opacity(0.8);
  mix-blend-mode: multiply;
}

/* --- Products Detail (alternating layout) ----------------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--color-border-light);
  align-items: center;
}

.product-detail:last-child {
  border-bottom: none;
}

.product-detail__image {
  max-width: 20rem;
}

.product-detail__text h3 {
  margin-bottom: 0.75rem;
}

.product-detail__text p {
  color: var(--color-text-secondary);
}

/* --- About Page ------------------------------------------- */
.about-section {
  padding: 3rem 0;
}

.about-section + .about-section {
  border-top: 1px solid var(--color-border-light);
}

.about-section h2 {
  margin-bottom: 1rem;
}

.about-section p {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

/* --- Contact Page ----------------------------------------- */
.contact-info {
  padding: 3rem 0 5rem;
}

.contact-info dt {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.contact-info dd {
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.contact-info dd a {
  color: var(--color-text);
}

.contact-info dd a:hover {
  color: var(--color-primary);
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  padding: 3rem 0 2rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.site-footer__logo img {
  height: 4rem;
  width: auto;
  margin: 0 auto;
}

.site-footer__info {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.site-footer__links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--color-primary);
  text-decoration-color: var(--color-primary);
}

.site-footer__copyright {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 1rem;
}

/* --- 404 Page --------------------------------------------- */
.not-found {
  text-align: center;
  padding: 8rem 0;
}

.not-found h1 {
  font-size: 6rem;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 1rem;
}

.not-found p {
  margin: 0 auto 2rem;
}

/* --- Responsive ------------------------------------------- */
@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: 7fr 5fr;
  }

  .hero {
    padding: 8rem 0 6rem;
  }

  .product-detail {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem 0;
  }

  .product-detail:nth-child(even) .product-detail__image {
    order: 2;
  }

  .cta-section__inner {
    padding: 5rem 3rem;
  }

  .container {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .products-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Card width accounts for 2 gaps (1.5rem each = 3rem total) across 3 columns */
  .products-grid .product-card {
    width: calc((100% - 3rem) / 3);
  }

  .container {
    padding: 0 3rem;
  }
}

/* --- Skip Link (Accessibility) ---------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  z-index: 200;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
}

/* --- Bill of Rights Numbered List ------------------------- */
.bill-of-rights ol {
  counter-reset: bill-counter;
  list-style: none;
  padding-left: 0;
}

.bill-of-rights ol li {
  counter-increment: bill-counter;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}

.bill-of-rights ol li::before {
  content: counter(bill-counter);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary);
  width: 2rem;
  text-align: center;
}
