/* Palette + typography lifted from the live safeneedledisposal.org theme.
   Pixel-match is approximate at this stage. Refined in a later pass. */

:root {
  --c-orange: #f16549;       /* primary accent / CTA */
  --c-teal: #3d858c;         /* secondary */
  --c-teal-light: #75cede;
  --c-green: #add36a;
  --c-slate: #3d5866;
  --c-ink: #131420;          /* body text */
  --c-mist: #a8a9ac;
  --c-cream: #fafaf7;
  --c-line: #e6e6e6;

  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Raleway", "Poppins", sans-serif;

  --maxw: 1200px;
}

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700;900&family=Raleway:wght@400;700&display=swap");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-ink);
  background: #fff;
}
a { color: var(--c-teal); }
a:hover { color: var(--c-orange); }

h1, h2, h3 { font-family: var(--font-display); color: var(--c-slate); line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
.redOrange { color: var(--c-orange); }

/* ----- Header / Nav ----- */
.site-header {
  border-bottom: 4px solid var(--c-orange);
  background: #fff;
}
.site-header .group {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-header .logo img { height: 64px; width: auto; display: block; }
.primary-nav { margin-left: auto; display: flex; gap: 1.25rem; align-items: center; }
.primary-nav a {
  color: var(--c-slate);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--c-orange); }

.nav-item { position: relative; flex-shrink: 0; }
.nav-item .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  white-space: nowrap;
}
.nav-item .caret { font-size: 0.7em; transition: transform 0.15s ease; }
.nav-item.has-children:hover .caret,
.nav-item.has-children:focus-within .caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 240px;
  border: 1px solid var(--c-line);
  border-top: 3px solid var(--c-orange);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  padding: 0.5rem 0;
  display: none;
  z-index: 100;
}
.nav-item.has-children:hover .nav-dropdown,
.nav-item.has-children:focus-within .nav-dropdown,
.nav-item.has-children.open .nav-dropdown { display: block; }

.nav-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-dropdown a:hover { background: var(--c-cream); color: var(--c-orange); }
.nav-dropdown .ext { color: #999; font-size: 0.8em; }

.donate-cta {
  background: var(--c-orange);
  color: #fff !important;
  padding: 0.45rem 0.9rem;
  border-radius: 3px;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.04em;
}
.donate-cta:hover { background: #d65538; color: #fff !important; }

.primary-nav .lang-toggle {
  border: 1px solid var(--c-slate);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
}

/* ----- Auto-generated hub pages ----- */
.hub-intro { color: var(--c-slate); font-size: 1.05rem; }
.hub-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.5rem; }
.hub-list a {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--c-cream);
  border-left: 3px solid var(--c-orange);
  color: var(--c-slate);
  text-decoration: none;
  font-weight: 500;
}
.hub-list a:hover { background: var(--c-orange); color: #fff; }

/* ----- Main ----- */
main { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.5rem; }

/* ----- Hero / finder ----- */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p.tagline { font-size: 1.15rem; color: var(--c-slate); max-width: 640px; margin: 0 auto 1.5rem; }
.finder {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.finder input, .finder select {
  padding: 0.6rem 0.8rem;
  font: inherit;
  border: 1px solid var(--c-line);
  border-radius: 3px;
  background: #fff;
}
.finder button {
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  background: var(--c-orange);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.finder button:hover { background: #d65538; }

/* ----- State pages ----- */
.state-hero { text-align: center; padding: 2rem 0 0.5rem; }
.state-hero h1 { font-size: 2.25rem; }
.state-overview {
  background: var(--c-cream);
  border-left: 4px solid var(--c-orange);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.state-agency {
  border: 1px solid var(--c-line);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}
.state-agency h2 { margin-top: 0; }
.state-agency .meta { color: var(--c-slate); font-size: 0.95rem; }
.state-agency .meta strong { color: var(--c-ink); }

table.locations {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.results-intro {
  margin: 1rem 0 0.5rem;
  color: var(--c-ink);
  line-height: 1.5;
}
.locations-disclaimer {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: #fff3cd;
  border-left: 4px solid var(--c-orange, #f16549);
  color: #856404;
  line-height: 1.5;
  font-size: 0.95rem;
}
.locations-disclaimer a { color: inherit; text-decoration: underline; }

/* State-page educational section (sharps container → trash/drop-off → don't
   throw loose). Mirrors the live WP layout: no boxed sections, full-width
   imagery, plain section spacing. */
.state-educational {
  margin: 0.5rem 0 2rem;
}
.state-edu-intro {
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.state-edu-block {
  margin: 0 auto 2.25rem;
  max-width: 720px;
  text-align: center;
}
.state-edu-block h3 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  line-height: 1.35;
}
.state-edu-block img {
  display: block;
  max-width: 720px;
  width: 100%;
  height: auto;
  margin: 0.5rem auto 0.8rem;
}
/* Drop-off illustration: trimmed to 75% of full width on desktop;
   full-width on mobile where space is already constrained. */
.state-edu-block img.state-edu-img--smaller { max-width: 540px; }
@media (max-width: 720px) {
  .state-edu-block img.state-edu-img--smaller { max-width: 720px; }
}
.state-edu-block p { margin: 0.5rem 0; line-height: 1.6; }
.state-edu-intro { text-align: center; max-width: 720px; margin-left: auto; margin-right: auto; }
table.locations th, table.locations td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}
table.locations th { background: var(--c-slate); color: #fff; font-weight: 600; }
table.locations th.sortable { cursor: pointer; user-select: none; }
table.locations th.sortable:hover { background: #4a5568; }
table.locations th.sortable::after { content: " ↕"; opacity: 0.45; font-size: 0.85em; }
table.locations th.sortable[data-sort-dir="asc"]::after  { content: " ▲"; opacity: 1; }
table.locations th.sortable[data-sort-dir="desc"]::after { content: " ▼"; opacity: 1; }
table.locations tr:nth-child(even) td { background: #fafafa; }
table.locations a { overflow-wrap: anywhere; }

/* Long URLs / agency-block links should never push layout wider than container */
.state-agency a,
.state-overview a,
.location-meta a,
.wp-page a { overflow-wrap: anywhere; }

/* Mobile: collapse locations table to stacked cards so it fits on narrow screens.
   Each <td> gets its column label via a data-label attribute set in the template. */
@media (max-width: 720px) {
  table.locations thead { display: none; }
  table.locations,
  table.locations tbody,
  table.locations tr,
  table.locations td { display: block; width: 100%; box-sizing: border-box; }
  table.locations tr {
    border: 1px solid var(--c-line);
    border-radius: 4px;
    padding: 0.6rem 0.85rem;
    margin: 0 0 0.6rem;
    background: #fff !important;
  }
  table.locations tr:nth-child(even) td { background: transparent; }
  table.locations td {
    padding: 0.25rem 0;
    border: none;
  }
  table.locations td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--c-slate);
    margin-right: 0.4em;
  }
  /* "Location" cell is the title — show without label and bigger */
  table.locations td[data-label="Location"]::before,
  table.locations td[data-label="Location Name"]::before,
  table.locations td[data-label="Centro"]::before { content: ""; }
  table.locations td[data-label="Location"],
  table.locations td[data-label="Location Name"],
  table.locations td[data-label="Centro"] {
    font-size: 1.05em;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--c-line);
    margin-bottom: 0.3rem;
  }
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin: 2rem 0;
}
.state-grid a {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--c-line);
  border-radius: 3px;
  text-decoration: none;
  color: var(--c-slate);
}
.state-grid a:hover { border-color: var(--c-orange); color: var(--c-orange); }

/* ----- Footer ----- */
.site-footer {
  background: var(--c-slate);
  color: #fff;
  margin-top: 4rem;
  font-size: 0.95rem;
}
.site-footer a { color: var(--c-teal-light); }
.site-footer a:hover { color: var(--c-orange); }
.site-footer h4 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.site-footer .redOrange { color: var(--c-orange); }

.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-ddc img {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.footer-col p { margin: 0.5em 0; line-height: 1.55; }
.footer-cta { display: flex; align-items: flex-start; }
.footer-button {
  display: inline-block;
  background: var(--c-orange);
  color: #fff !important;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.footer-button:hover { background: #d65538; }

.social-icons { display: flex; gap: 0.75rem; justify-content: center; }
.social-icons a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  transition: background 0.15s ease;
}
.social-icons a:hover { background: var(--c-orange); border-color: var(--c-orange); }
.social-icons img { width: 18px; height: 18px; }

.footer-about a { color: var(--c-teal-light); }
.footer-modified {
  margin-top: 1rem !important;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.footer-copyright {
  background: rgba(0,0,0,0.2);
  padding: 0.9rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}
.footer-copyright p { margin: 0; }

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  .footer-cta { justify-content: flex-start; }
}

/* ----- PDF download grid (resource-center brochures, etc.) ----- */
.wp-page ul.pdfs {
  list-style: none;
  padding: 0;
  margin: 1.5em 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  text-align: center;
}
.wp-page ul.pdfs li {
  background: var(--c-orange);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.wp-page ul.pdfs li a { text-decoration: none; color: #fff; display: block; width: 100%; }
.wp-page ul.pdfs li img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  background: #fff;
  padding: 0.25rem;
}
.wp-page ul.pdfs li h4 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
  line-height: 1.3;
  text-align: center;
}
.wp-page ul.pdfs li h4 strong { display: block; margin-bottom: 0.25rem; }
.wp-page ul.pdfs li h4 span { font-weight: 400; font-size: 0.85em; }
@media (max-width: 900px)  { .wp-page ul.pdfs { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .wp-page ul.pdfs { grid-template-columns: repeat(2, 1fr); } }

/* ----- Imported WordPress page content ----- */
.wp-page { max-width: 920px; margin: 0 auto; }
.wp-page h1 { margin-bottom: 1rem; }
.wp-page h2, .wp-page h3 { margin-top: 2rem; }
.wp-page p { margin: 1em 0; }
.wp-page img { max-width: 100%; height: auto; }
.wp-page ul, .wp-page ol { padding-left: 1.5em; }
.wp-page li { margin: 0.25em 0; }
.wp-page a { word-break: break-word; }
.wp-page figure { margin: 1.5em 0; }
.wp-page figcaption { font-size: 0.9em; color: var(--c-slate); margin-top: 0.5em; }
.wp-page hr { border: none; border-top: 1px solid var(--c-line); margin: 2em 0; }
.wp-page table { border-collapse: collapse; width: 100%; margin: 1.5em 0; }
.wp-page td, .wp-page th { padding: 0.5em 0.75em; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.wp-page details {
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: var(--c-cream);
}
.wp-page details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--c-slate);
}
.wp-page details[open] summary { color: var(--c-orange); margin-bottom: 0.5rem; }
.wp-page .placeholder-form {
  padding: 0.75rem 1rem;
  background: #fff3cd;
  border-left: 4px solid var(--c-orange);
  color: #856404;
}
.wp-page .jotform-embed {
  display: block;
  width: 100%;
  min-height: 800px;
  border: 0;
  margin: 1rem 0;
}

/* Two-column layout used on several content pages */
.wp-page .columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5em 0;
}
.wp-page .columns > .half,
.wp-page .columns > div { min-width: 0; }
@media (max-width: 768px) { .wp-page .columns { grid-template-columns: 1fr; } }

/* WP image alignment */
.wp-page .aligncenter, .wp-page .alignnone { display: block; margin: 1em auto; }
.wp-page .alignleft { float: left; margin: 0.5em 1em 0.5em 0; }
.wp-page .alignright { float: right; margin: 0.5em 0 0.5em 1em; }
.wp-page .alignfull { width: 100%; }

/* ----- Mobile / hamburger nav ----- */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--c-slate);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle .bars::before { content: ""; position: absolute; top: -8px; left: 0; }
.nav-toggle .bars::after  { content: ""; position: absolute; top:  8px; left: 0; }
.primary-nav.open ~ .nav-toggle .bars,
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after  { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1199px) {
  .site-header .group { padding: 0.75rem 1rem; }
  .site-header .logo img { height: 50px; }
  .nav-toggle { display: block; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--c-line);
    border-bottom: 4px solid var(--c-orange);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: 0 10px 16px rgba(0,0,0,0.08);
    z-index: 99;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }
  .primary-nav.open { display: flex; }
  .nav-item { width: 100%; }
  .nav-item .nav-link { padding: 0.75rem 1.25rem; justify-content: space-between; width: 100%; }
  .nav-item:not(:last-child) { border-bottom: 1px solid var(--c-line); }
  .nav-dropdown {
    position: static;
    border: none;
    border-top: 1px solid var(--c-line);
    box-shadow: none;
    padding: 0;
    background: var(--c-cream);
  }
  .nav-dropdown a { padding: 0.6rem 2rem; }
  .donate-cta {
    margin: 0.75rem 1.25rem;
    text-align: center;
  }
  .primary-nav .lang-toggle { margin: 0.5rem 1.25rem; align-self: flex-start; }
  /* Make sure the header doesn't grow vertically and the nav slides under it */
  .site-header { position: relative; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
}
