/* Jane Brooks Law. Header office picker + News article office list.
   Additive styles only. Existing site.css remains untouched. */

/* Header dropdown. Uses native <details> so no JavaScript is required. */
.header-actions .office-phone-picker {
  position: relative;
  flex: 0 0 auto;
  z-index: 60;
}
.header-actions .office-phone-picker > summary.office-picker-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  text-decoration: none;
  user-select: none;
  color: #15272a;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  min-height: 43px;
}
.office-phone-picker > summary::-webkit-details-marker { display: none; }
.office-phone-picker > summary::marker { content: ''; }
.office-phone-picker .phone-icon {
  flex: 0 0 41px;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #008d83;
  background: #e8f6f3;
  font-size: 19px;
}
.office-phone-picker .office-picker-trigger-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}
.office-phone-picker .office-picker-trigger-text small {
  color: #657478;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.office-phone-picker .office-picker-trigger-text strong {
  color: #15272a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}
.office-phone-picker .office-picker-caret {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  margin-top: -3px;
  border-right: 2px solid #008f84;
  border-bottom: 2px solid #008f84;
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.office-phone-picker[open] .office-picker-caret { transform: translateY(4px) rotate(225deg); }
.office-phone-picker summary:focus-visible,
.office-picker-dropdown a:focus-visible {
  outline: 2px solid #008f84;
  outline-offset: 4px;
}
.office-picker-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  width: min(324px, calc(100vw - 28px));
  max-width: none;
  z-index: 1000;
  padding: 10px;
  border: 1px solid #e3e8e7;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 42, 43, .17);
  border-radius: 12px;
}
.office-picker-heading {
  margin: 4px 8px 8px;
  color: #677679;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.office-picker-dropdown a,
.office-picker-dropdown a:visited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 7px;
  color: #15272a;
  text-decoration: none;
  text-transform: none;
  font-size: 13px;
  line-height: 1.3;
}
.office-picker-dropdown a + a { border-top: 1px solid #f0f2f1; }
.office-picker-dropdown a strong {
  color: #008f84;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.office-picker-dropdown a:hover,
.office-picker-dropdown a:focus-visible { background: #eaf6f3; }
@media (max-width: 650px) {
  .office-phone-picker .office-picker-trigger-text strong { font-size: 13px; }
  .header-actions .office-phone-picker > summary.office-picker-trigger { gap: 7px; }
  .office-picker-dropdown { right: 0; }
}

/* Inside the existing teal contact panel on a News entry. */
.news-office-card .news-office-card-label {
  margin: 19px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .045em;
}
.news-office-card .news-office-list {
  padding: 0;
  margin: 0 0 17px;
  list-style: none;
}
.news-office-card .news-office-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.28);
}
.news-office-card .news-office-list li span {
  font-size: 13px;
  color: rgba(255,255,255,.83);
}
.news-office-card .news-office-list li a,
.news-office-card .news-office-list li a:visited,
.news-office-card .news-office-email,
.news-office-card .news-office-email:visited {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.news-office-card .news-office-list a:hover,
.news-office-card .news-office-email:hover { text-decoration: underline; }
.news-office-card .news-office-email {
  display: inline-block;
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}
.news-office-card .btn { display: inline-flex; }

/* Mobile refinement: consistent phone icon and extra menu gutter. */
/* The old &phone; text remains in the CMS, but is visually replaced with
   a single-colour vector. This prevents iOS turning it into a red emoji. */
.office-phone-picker .phone-icon {
  font-size: 0 !important;
  line-height: 0;
}
.office-phone-picker .phone-icon::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiIgYXJpYS1oaWRkZW49InRydWUiPjxwYXRoIGZpbGw9IiMwMDhmODQiIGQ9Ik0zIDEyLjhDMyA3LjEgOC42IDMuNCAxNiAzLjRzMTMgMy43IDEzIDkuNGMwIDEuNC0xLjEgMi41LTIuNSAyLjVoLTMuOWMtMS40IDAtMi40LTEtMi40LTIuNHYtMS41YzAtLjcuMy0xLjMuOS0xLjctMS4zLTEuNS0zLjItMi4xLTUuMS0yLjFzLTMuOC42LTUuMSAyLjFjLjYuNC45IDEgLjkgMS43djEuNWMwIDEuNC0xIDIuNC0yLjQgMi40SDUuNUM0LjEgMTUuMyAzIDE0LjIgMyAxMi44WiIvPjxwYXRoIGZpbGw9IiMwMDhmODQiIGQ9Ik0xMS4xIDEzLjRoOS44bDQuMSA5LjFjLjkgMi0uNiA0LjItMi44IDQuMkg5LjhjLTIuMiAwLTMuNy0yLjItMi44LTQuMmw0LjEtOS4xWiIvPjxjaXJjbGUgY3g9IjE2IiBjeT0iMjAuNCIgcj0iMy4zNSIgZmlsbD0iI2U4ZjZmMyIvPjxjaXJjbGUgY3g9IjE2IiBjeT0iMjAuNCIgcj0iMS4zIiBmaWxsPSIjMDA4Zjg0Ii8+PC9zdmc+") center / contain no-repeat;
}

/* Keep the mobile navigation button away from the screen edge. */
@media (max-width: 900px) {
  .site-header .header-actions .menu-toggle {
    margin-right: 14px;
    flex-shrink: 0;
  }
}

@media (max-width: 390px) {
  .site-header .header-actions .menu-toggle { margin-right: 10px; }
  .office-phone-picker .office-picker-trigger-text strong { font-size: 12px; }
}

/* Responsive header width correction, 11 Nov 2026. */
/* Adjust the three header items together. Do not mask layout overflow
   with overflow-x:hidden, which can conceal off-screen controls. */
@media (max-width: 680px) {
  .site-header {
    max-width: 100%;
    box-sizing: border-box;
  }

  .site-header .container.header-inner {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    padding-left: 14px !important;
    padding-right: 14px !important;
    column-gap: 7px !important;
  }

  .site-header .header-inner > .brand {
    flex: 0 1 clamp(105px, 29vw, 145px) !important;
    width: clamp(105px, 29vw, 145px) !important;
    max-width: clamp(105px, 29vw, 145px) !important;
    min-width: 0 !important;
    margin-right: auto !important;
  }
  .site-header .header-inner > .brand img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .site-header .header-actions {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 7px !important;
    min-width: 0 !important;
    max-width: calc(100% - 112px);
    margin-left: 0 !important;
  }

  .site-header .header-actions .office-phone-picker {
    min-width: 0;
    flex: 0 1 auto;
  }
  .site-header .header-actions .office-phone-picker > summary.office-picker-trigger {
    gap: 6px !important;
    min-width: 0;
  }
  .site-header .office-phone-picker .phone-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .site-header .office-phone-picker .phone-icon::before {
    width: 19px;
    height: 19px;
  }
  .site-header .office-phone-picker .office-picker-trigger-text {
    min-width: 0;
  }
  .site-header .office-phone-picker .office-picker-trigger-text small {
    font-size: 10px;
    letter-spacing: .06em;
  }
  .site-header .office-phone-picker .office-picker-trigger-text strong {
    font-size: 12px;
    white-space: nowrap;
  }
  .site-header .office-phone-picker .office-picker-caret {
    flex: 0 0 7px;
    margin-left: 0;
  }

  /* Override the previous extra right margin, which pushed the button
     beyond the viewport instead of creating usable space. */
  .site-header .header-actions .menu-toggle {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  /* The list aligns with the header inset, and never exceeds viewport. */
  .site-header .office-picker-dropdown {
    width: min(324px, calc(100vw - 28px));
    box-sizing: border-box;
  }
}

/* Narrow phones. Keep office selector and hamburger accessible. */
@media (max-width: 375px) {
  .site-header .container.header-inner {
    padding-left: 10px !important;
    padding-right: 14px !important;
    column-gap: 4px !important;
  }
  .site-header .header-inner > .brand {
    flex-basis: 105px !important;
    width: 105px !important;
    max-width: 105px !important;
  }
  .site-header .header-actions { gap: 5px !important; }
  .site-header .header-actions .office-phone-picker > summary.office-picker-trigger {
    gap: 5px !important;
  }
  .site-header .office-phone-picker .phone-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .site-header .office-phone-picker .office-picker-trigger-text strong {
    font-size: 11.5px;
  }
  .site-header .office-picker-dropdown {
    right: -45px; /* align to the far edge of the hamburger */
  }
  .site-header .header-actions .menu-toggle {
    flex-basis: 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 42px !important;
  }
}

/* For very small displays there is not room for three full-size items.
   Keep the office label and dropdown accessible instead of clipping menu. */
@media (max-width: 345px) {
  .site-header .office-phone-picker .phone-icon {
    display: none !important;
  }
  .site-header .office-phone-picker .office-picker-trigger-text small {
    font-size: 9px;
  }
  .site-header .office-phone-picker .office-picker-trigger-text strong {
    font-size: 11px;
  }
}

/* Mobile logo visual-size refinement, 11 November 2026 (v4).
   Keep the brand flex width exactly as set by the responsive overflow fix,
   so the telephone selector and hamburger retain their working positions. */
@media (max-width: 680px) {
  .site-header .header-inner > .brand {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    box-sizing: border-box;
  }
  .site-header .header-inner > .brand img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: clamp(55px, 15vw, 70px) !important;
    object-fit: contain;
  }
}

/* v5. Narrow mobile dropdown alignment, 11 November 2026.
   Give the panel a little breathing room on the left without pushing
   its right edge off-screen. Header, logo and buttons are unchanged. */
@media (max-width: 420px) {
  .site-header .office-picker-dropdown {
    width: min(306px, calc(100vw - 34px));
  }
}
@media (max-width: 375px) {
  .site-header .office-picker-dropdown {
    right: -52px;
  }
}
@media (min-width: 376px) and (max-width: 420px) {
  .site-header .office-picker-dropdown {
    right: -8px;
  }
}
