/**
 * Site-level styles (shared layout + mobile overrides).
 * Loaded after the Tailwind build so these rules win without editing generated CSS.
 *
 * Inline styles kept only for page-specific hero background-image URLs.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

/* Prevent iOS zoom-on-focus for form controls */
input,
select,
textarea {
  font-size: 16px;
}

/* ----- Hero overlays (opacity variants) ----- */
.hero-overlay {
  background-color: rgba(27, 27, 36, 0.41);
}

.hero-overlay--light {
  background-color: rgba(27, 27, 36, 0.15);
}

.hero-overlay--dark {
  background-color: rgba(27, 27, 36, 0.55);
}

/* ----- Contact bio ----- */
.contact-photo {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  object-fit: cover;
}

.contact-bio-name {
  margin: 0;
}

/* ----- Footer Resources dropdown ----- */
footer .group {
  display: inline-block;
  position: relative;
}

footer .group > .invisible {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.35rem;
  text-align: left;
}

/* Mobile menu: indent Resources child links under "Resources for…" */
#mobile-menu a[href="/resources/leaders/"],
#mobile-menu a[href="/resources/organizations/"],
#mobile-menu a[href="/resources/individuals/"] {
  padding-left: 1.25rem;
}

/* ----- Resource accordions ----- */
.site-accordion details {
  border-bottom: 1px solid #d5d8dc;
}

.site-accordion details:last-child {
  border-bottom: 0;
}

.site-accordion summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #3a3a3a;
}

.site-accordion summary::-webkit-details-marker {
  display: none;
}

.site-accordion summary::before {
  content: "+";
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.site-accordion details[open] > summary::before {
  content: "\2212";
}

.site-accordion .accordion-panel {
  padding: 0.5rem 1rem 1.5rem 2.75rem;
  font-size: 16px;
  line-height: 2;
  color: #4b4f58;
}

.site-accordion .accordion-panel p {
  margin-bottom: 1.1em;
}

.site-accordion .accordion-panel ul {
  margin: 0 0 1.1em 1.4em;
  list-style: disc;
}

.site-accordion .accordion-panel a {
  color: #0170b9;
}

/* ----- Mobile / tablet ----- */
@media (max-width: 767px) {
  header nav > a:first-of-type {
    min-width: 0;
    flex: 1 1 auto;
  }

  /* Large blur shadows often create horizontal scroll on small screens */
  .shadow-card {
    --tw-shadow: 0 0 24px rgba(15, 15, 43, 0.35);
    --tw-shadow-colored: 0 0 24px var(--tw-shadow-color);
    box-shadow:
      var(--tw-ring-offset-shadow, 0 0 #0000),
      var(--tw-ring-shadow, 0 0 #0000),
      var(--tw-shadow);
  }

  /* Home cards: fluid images, tighter padding */
  #home-cards article {
    padding: 2rem 1.25rem;
  }

  #home-cards img {
    width: 100% !important;
    max-width: 260px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  /* Contact bio row: stack photo above details */
  .page-content .flex.items-start.gap-6 {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .page-content .contact-photo,
  .page-content .flex.items-start.gap-6 > img {
    width: 120px !important;
    height: 120px !important;
  }

  .page-content .flex.items-start.gap-6 > div {
    width: 100%;
  }

  /* Heroes: slightly shorter first paint; let headings wrap naturally */
  main > section.bg-cover {
    min-height: 280px;
  }

  main > section.bg-cover h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.75rem);
    line-height: 1.35;
  }

  main > section.bg-cover h1 br {
    display: none;
  }

  /* Footer nav wraps cleanly; hide hover submenu (absolute menus expand scroll width) */
  footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  footer p.mb-3 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
    line-height: 1.6;
  }

  footer p.mb-3 > span.mx-1 {
    display: none;
  }

  footer .group > .invisible {
    display: none !important;
  }

  /* Accordion: more readable column on narrow screens */
  .site-accordion summary {
    padding: 0.75rem 0.85rem;
    font-size: 14px;
  }

  .site-accordion .accordion-panel {
    padding: 0.5rem 0.85rem 1.25rem 1.15rem;
  }
}
