/* =========================================================
   SUSSEX TOWNHOMES — HOME V2
   Paste into Appearance > Customize > Additional CSS
   ========================================================= */

.sth-home-v2 {
  --sth-green: #004d3b;
  --sth-green-dark: #003b2f;
  --sth-olive: #4f6f21;
  --sth-gold: #c79a22;
  --sth-cream: #f7f3e8;
  --sth-ink: #14201b;
  --sth-card: #fbf9f2;
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--sth-cream);
  color: var(--sth-ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
  overflow: hidden;
}

.sth-home-v2 *,
.sth-home-v2 *::before,
.sth-home-v2 *::after {
  box-sizing: border-box;
}

.sth-home-v2 a {
  text-decoration: none;
}

.sth-hero {
  position: relative;
  width: 100%;
  background: #d9e4e4;
}

.sth-hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.sth-emergency-hotspot {
  position: absolute;
  top: 5%;
  right: 4%;
  width: 20%;
  height: 18%;
  border-radius: 16px;
}

.sth-emergency-hotspot:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

.sth-primary-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: linear-gradient(180deg, #075943, #004b39);
  border-top: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}

.sth-primary-nav a {
  min-height: 58px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.85rem, 1.2vw, 1.15rem);
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: background .2s ease, transform .2s ease;
}

.sth-primary-nav a:hover,
.sth-primary-nav a:focus-visible,
.sth-primary-nav a.is-current {
  background: #72892f;
}

.sth-primary-nav a:hover {
  transform: translateY(-1px);
}

.sth-nav-icon {
  color: #fff7c9;
  font-size: 1.35em;
  line-height: 1;
}

.sth-welcome {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 34px 20px;
  display: grid;
  grid-template-columns: 1.05fr 1px 1.25fr;
  gap: 34px;
  align-items: center;
}

.sth-welcome h1 {
  margin: 0;
  color: #073f33;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1;
}

.sth-gold-rule {
  width: 165px;
  height: 3px;
  margin: 16px 0 13px;
  background: var(--sth-gold);
}

.sth-welcome p {
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
}

.sth-welcome-note {
  margin-top: 7px !important;
  color: #416622;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}

.sth-welcome-divider {
  width: 1px;
  height: 190px;
  background: #d5c99d;
}

.sth-about {
  display: grid;
  grid-template-columns: minmax(145px, 205px) 1fr;
  gap: 30px;
  align-items: center;
}

.sth-emblem {
  width: 100%;
  max-width: 190px;
  height: auto;
  margin: 0 auto;
}

.sth-resource-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.sth-card {
  --card-accent: var(--sth-green);
  min-height: 282px;
  padding: 14px 13px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, #fffdf8, var(--sth-card));
  border: 1px solid #ded6c3;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(76, 62, 29, .12);
}

.sth-card-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-accent);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
}

.sth-card h2 {
  margin: 0 0 7px;
  color: var(--card-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 1.45vw, 1.5rem);
  line-height: 1.02;
}

.sth-card p {
  margin: 0 0 12px;
  font-size: .92rem;
  line-height: 1.38;
}

.sth-card a {
  width: 100%;
  margin-top: auto;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--card-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}

.sth-card a:hover,
.sth-card a:focus-visible {
  filter: brightness(1.12);
}

.sth-card-red { --card-accent: #8c171d; }
.sth-card-olive { --card-accent: #506f20; }
.sth-card-orange { --card-accent: #bd5700; }
.sth-card-purple { --card-accent: #56204f; }
.sth-card-green { --card-accent: #00523f; }

.sth-contact-strip {
  padding: 10px max(24px, calc((100vw - 1100px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f5f0e5;
  border-top: 1px solid #ddd2b8;
  border-bottom: 1px solid #ddd2b8;
}

.sth-contact-item {
  min-height: 78px;
  padding: 6px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: Georgia, "Times New Roman", serif;
  border-right: 1px solid #d7c9a5;
}

.sth-contact-item:last-child {
  border-right: 0;
}

.sth-contact-icon {
  flex: 0 0 auto;
  color: #567522;
  font-size: 3rem;
  line-height: 1;
}

.sth-contact-item a {
  color: inherit;
}

.sth-footer {
  padding: 13px 4.5%;
  display: grid;
  grid-template-columns: 1fr 1.55fr 1.15fr;
  gap: 30px;
  align-items: center;
  background: linear-gradient(180deg, #00513f, #003d31);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  border-top: 2px solid #c89b24;
}

.sth-footer > div + div {
  padding-left: 30px;
  border-left: 1px solid rgba(245,225,154,.55);
}

.sth-footer-brand,
.sth-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sth-footer-message {
  color: #efc755;
  line-height: 1.35;
}

.sth-footer-meta {
  font-size: .9rem;
}

/* Remove typical theme spacing around the custom page.
   This targets only the Home v2 body when WordPress adds our class. */
body .entry-content > .sth-home-v2 {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

body .entry-content:has(> .sth-home-v2) {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* TABLET */
@media (max-width: 1050px) {
  .sth-primary-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .sth-primary-nav a:nth-child(n+5) {
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .sth-welcome {
    grid-template-columns: 1fr;
  }

  .sth-welcome-divider {
    display: none;
  }

  .sth-about {
    border-top: 1px solid #d5c99d;
    padding-top: 22px;
  }

  .sth-resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* PHONE */
@media (max-width: 700px) {
  .sth-emergency-hotspot {
    top: 2%;
    right: 2%;
    width: 28%;
    height: 22%;
  }

  .sth-primary-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .sth-primary-nav a {
    white-space: normal;
    text-align: center;
  }

  .sth-welcome {
    padding: 24px 20px 16px;
  }

  .sth-about {
    grid-template-columns: 120px 1fr;
    gap: 16px;
  }

  .sth-resource-grid {
    padding: 0 18px 16px;
    grid-template-columns: 1fr;
  }

  .sth-card {
    min-height: 0;
  }

  .sth-contact-strip,
  .sth-footer {
    grid-template-columns: 1fr;
  }

  .sth-contact-item {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid #d7c9a5;
  }

  .sth-contact-item:last-child {
    border-bottom: 0;
  }

  .sth-footer > div + div {
    padding-left: 0;
    padding-top: 13px;
    border-left: 0;
    border-top: 1px solid rgba(245,225,154,.55);
  }
}

@media (max-width: 470px) {
  .sth-about {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .sth-emblem {
    max-width: 145px;
  }
}

/* WordPress shortcode placement compatibility */
.sth-home-v2-shortcode-wrap,
.wp-block-shortcode:has(.sth-home-v2) {
  margin: 0 !important;
  padding: 0 !important;
}

.entry-content > .wp-block-shortcode:has(.sth-home-v2) {
  max-width: none !important;
  width: 100vw;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}


/* Dedicated Home v2 template reset */
html, body.sthv2-dedicated-template {
  margin: 0;
  padding: 0;
  background: #f7f3e8;
}

body.sthv2-dedicated-template .sth-home-v2 {
  width: 100%;
  max-width: none;
  margin: 0;
}

body.sthv2-dedicated-template #wpadminbar {
  position: fixed;
}

@media screen and (min-width: 783px) {
  body.admin-bar.sthv2-dedicated-template {
    padding-top: 32px;
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar.sthv2-dedicated-template {
    padding-top: 46px;
  }
}

/* Sussex Townhomes brand strip below hero photo */
.sth-brand-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 16px 20px;
    background: #f7f3e8;
}

.sth-brand-logo {
    width: 105px;
    height: 105px;
    object-fit: contain;
    flex-shrink: 0;
}

.sth-brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 42px;
    font-weight: 600;
    line-height: 1.1;
    color: #14201b;
}

@media screen and (max-width: 782px) {
    .sth-brand-strip {
        gap: 12px;
        padding: 12px 14px;
    }

    .sth-brand-logo {
        width: 78px;
        height: 78px;
    }

    .sth-brand-name {
        font-size: 28px;
    }
}
