/* 1125p150 — Compact site-wide footer.
   Logo stays top-left. "On this page" is a 2-row grid (12-col, 4+3 or 4+4).
   Contact (3 phones + email) is its own full-width labeled row.
   Do not place the logo near the affiliate band. */

footer[data-hrh-static-footer],
footer.bg-tide-deep {
  /* keep social-icons.css mobile safe-area; just don't add more */
}

/* Main block: brand | on-this-page, then a full-width contact row.
   Was Tailwind: grid md:grid-cols-4 gap-10 py-14 (2.5rem / 3.5rem). */
footer[data-hrh-static-footer] > div:first-child,
footer.bg-tide-deep > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
  column-gap: 2rem;
  row-gap: 1.15rem;
  padding-top: 2rem;      /* 32px; was 3.5rem / 56px */
  padding-bottom: 1.15rem; /* 18px; was 3.5rem / 56px */
  align-items: start;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(1),
footer.bg-tide-deep > div:first-child > div:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(2),
footer.bg-tide-deep > div:first-child > div:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(3),
footer.bg-tide-deep > div:first-child > div:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

/* Brand column: tighten twilight + social/reviews stack. Logo stays here. */
footer[data-hrh-static-footer] .hrh-footer-twilight,
footer.bg-tide-deep .hrh-footer-twilight {
  margin-top: 0.7rem;     /* was mt-5 / 1.25rem */
  margin-bottom: 0;
  line-height: 1.45;      /* was leading-relaxed / 1.625 */
  max-width: 22rem;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(1) > div,
footer.bg-tide-deep > div:first-child > div:nth-child(1) > div {
  margin-top: 0.8rem;     /* was mt-6 / 1.5rem */
}

/* Compress social gaps only in the footer; icon sizes stay ≥40px (YouTube 50px). */
footer[data-hrh-static-footer] ul[aria-label="Social media"],
footer.bg-tide-deep ul[aria-label="Social media"] {
  gap: 1.75rem;           /* 28px; was 50px */
}

footer[data-hrh-static-footer] .hrh-g-reviews,
footer.bg-tide-deep .hrh-g-reviews {
  margin-top: 0.6rem;     /* was 1rem */
  gap: 0.35rem 1rem;
}

/* "On this page": two even rows. Checklists is injected as a raw <a>
   (not an <li>) inside the ul — treat both as grid items.
   ≥768: 4 columns (4+4 or 4+3). <768: 2 even columns. */
footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul,
footer.bg-tide-deep > div:first-child > div:nth-child(2) ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 0.75rem 1rem;
  column-gap: 1rem;
  row-gap: 0.15rem;
  margin-top: 0.55rem;
  padding: 0;
  list-style: none;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul > li,
footer.bg-tide-deep > div:first-child > div:nth-child(2) ul > li,
footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul > a,
footer.bg-tide-deep > div:first-child > div:nth-child(2) ul > a {
  margin: 0 !important;
  min-width: 0;
  grid-column: auto;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul a,
footer.bg-tide-deep > div:first-child > div:nth-child(2) ul a {
  display: flex;
  align-items: center;
  min-height: 2rem;
  line-height: 1.3;
  text-decoration: none;
}

/* Contact: own row, four labeled cells. Label above the number/address. */
footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 1.25rem;
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul > li,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul > li {
  margin: 0 !important;
  min-width: 0;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul a,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul a {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: center;
  min-height: 2.5rem;
  line-height: 1.3;
  text-decoration: none;
}

footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul a span,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul a span {
  margin-top: 0;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

/* Email has no existing label. Use normal flow (not column-reverse) so
   the ::before label sits above the address. */
footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul li:last-child a,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul li:last-child a {
  flex-direction: column;
}
footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul li:last-child a:not(:has(span))::before,
footer.bg-tide-deep > div:first-child > div:nth-child(3) ul li:last-child a:not(:has(span))::before {
  content: "Email";
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: rgba(251, 249, 244, 0.45);
}

/* Affiliate + legal bands: was py-5 (1.25rem). Logo must not move here. */
footer[data-hrh-static-footer] > div:nth-child(2) > div,
footer.bg-tide-deep > div:nth-child(2) > div,
footer[data-hrh-static-footer] > div:nth-child(3) > div,
footer.bg-tide-deep > div:nth-child(3) > div {
  padding-top: 0.75rem;    /* 12px; was 1.25rem */
  padding-bottom: 0.75rem;
}

footer[data-hrh-static-footer] > div:nth-child(2) ul,
footer.bg-tide-deep > div:nth-child(2) ul {
  margin-top: 0.5rem;      /* was mt-3 / 0.75rem */
  gap: 0.5rem;
}

/* Slightly tighter affiliate marks (still fully visible); overrides footer-tune late load. */
footer[data-hrh-static-footer] li:has(img[src*="/media/associations/"]) ,
footer.bg-tide-deep li:has(img[src*="/media/associations/"]) {
  padding: 0.25rem 0.4rem !important;
}

footer[data-hrh-static-footer] li:has(img[src*="/media/associations/"]) img,
footer.bg-tide-deep li:has(img[src*="/media/associations/"]) img,
footer[data-hrh-static-footer] img[src*="/media/associations/"],
footer.bg-tide-deep img[src*="/media/associations/"] {
  height: 40px !important;
}

@media (min-width: 640px) {
  footer[data-hrh-static-footer] li:has(img[src*="/media/associations/"]) img,
  footer.bg-tide-deep li:has(img[src*="/media/associations/"]) img,
  footer[data-hrh-static-footer] img[src*="/media/associations/"],
  footer.bg-tide-deep img[src*="/media/associations/"] {
    height: 48px !important;
  }
}

footer[data-hrh-static-footer] > div:nth-child(3),
footer.bg-tide-deep > div:nth-child(3) {
  /* legal row */
}

footer[data-hrh-static-footer] > div:nth-child(3) p,
footer.bg-tide-deep > div:nth-child(3) p {
  line-height: 1.4;
}

@media (max-width: 1023px) {
  footer[data-hrh-static-footer] > div:first-child,
  footer.bg-tide-deep > div:first-child {
    column-gap: 1.5rem;
    padding-top: 1.75rem;
    padding-bottom: 1rem;
  }
}

/* Mobile: stack brand, then On this page as 2 even columns, then contact as 2x2. */
@media (max-width: 767px) {
  footer[data-hrh-static-footer] > div:first-child,
  footer.bg-tide-deep > div:first-child {
    grid-template-columns: 1fr;
    row-gap: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 0.9rem;
  }

  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1),
  footer.bg-tide-deep > div:first-child > div:nth-child(1),
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2),
  footer.bg-tide-deep > div:first-child > div:nth-child(2),
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(3),
  footer.bg-tide-deep > div:first-child > div:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }

  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul {
    grid-template-columns: 1fr 1fr; /* 2 even columns */
    column-gap: 0.75rem;
    row-gap: 0;
  }

  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul > li,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul > li,
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul:has(> li:nth-child(7):last-child) > li,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul:has(> li:nth-child(7):last-child) > li,
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul:has(> li:nth-child(8):last-child) > li,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul:has(> li:nth-child(8):last-child) > li,
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul:has(> li:nth-child(6):last-child) > li,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul:has(> li:nth-child(6):last-child) > li {
    grid-column: auto;
  }

  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul a,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul a,
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul a,
  footer.bg-tide-deep > div:first-child > div:nth-child(3) ul a,
  footer[data-hrh-static-footer] .hrh-g-review,
  footer.bg-tide-deep .hrh-g-review,
  footer[data-hrh-static-footer] > div:nth-child(3) a,
  footer.bg-tide-deep > div:nth-child(3) a {
    min-height: 40px;
  }

  footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul,
  footer.bg-tide-deep > div:first-child > div:nth-child(3) ul {
    grid-template-columns: 1fr 1fr; /* 2x2 phones + email */
    gap: 0.15rem 1rem;
  }

  footer[data-hrh-static-footer] ul[aria-label="Social media"],
  footer.bg-tide-deep ul[aria-label="Social media"] {
    gap: 1.15rem; /* 18px; was 20px — keep icons tappable */
  }

  footer[data-hrh-static-footer] > div:nth-child(2) > div,
  footer.bg-tide-deep > div:nth-child(2) > div,
  footer[data-hrh-static-footer] > div:nth-child(3) > div,
  footer.bg-tide-deep > div:nth-child(3) > div {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}


/* Desktop/tablet: sit the twilight line beside the logo so the brand column
   is not a tall stack. Logo remains top-left — never in the affiliate band. */
@media (min-width: 768px) {
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1),
  footer.bg-tide-deep > div:first-child > div:nth-child(1) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.65rem;
    align-items: center;
  }
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1) > img,
  footer.bg-tide-deep > div:first-child > div:nth-child(1) > img {
    grid-column: 1;
    grid-row: 1;
  }
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1) > .hrh-footer-twilight,
  footer.bg-tide-deep > div:first-child > div:nth-child(1) > .hrh-footer-twilight {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    max-width: 18rem;
  }
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1) > div,
  footer.bg-tide-deep > div:first-child > div:nth-child(1) > div {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
  }
  footer[data-hrh-static-footer] > div:first-child,
  footer.bg-tide-deep > div:first-child {
    padding-top: 1.15rem;
    padding-bottom: 0.7rem;
    row-gap: 0.65rem;
  }
  footer[data-hrh-static-footer] > div:nth-child(2) > div,
  footer.bg-tide-deep > div:nth-child(2) > div,
  footer[data-hrh-static-footer] > div:nth-child(3) > div,
  footer.bg-tide-deep > div:nth-child(3) > div {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 767px) {
  /* Email is too long for a half-column next to the chat widget. */
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(3) ul li:last-child,
  footer.bg-tide-deep > div:first-child > div:nth-child(3) ul li:last-child {
    grid-column: 1 / -1;
  }
  footer[data-hrh-static-footer] > div:nth-child(3) > div,
  footer.bg-tide-deep > div:nth-child(3) > div {
    padding-bottom: 3.25rem; /* clear the chat widget */
  }
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2) ul a,
  footer.bg-tide-deep > div:first-child > div:nth-child(2) ul a {
    min-height: 40px;
  }
}

/* 768–1279: brand on its own row; On this page and Contact go full width
   so the 4-column / 2-row link grid stays even and does not collide. */
@media (max-width: 1023px) and (min-width: 768px) {
  footer[data-hrh-static-footer] > div:first-child,
  footer.bg-tide-deep > div:first-child {
    grid-template-columns: 1fr;
  }
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(1),
  footer.bg-tide-deep > div:first-child > div:nth-child(1),
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(2),
  footer.bg-tide-deep > div:first-child > div:nth-child(2),
  footer[data-hrh-static-footer] > div:first-child > div:nth-child(3),
  footer.bg-tide-deep > div:first-child > div:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }
}
