/* ==========================================================================
   Groundwater Dictionary — extends theme.css, loaded after it.
   ========================================================================== */

/* -------------------------------------------------- Hub: category cards */

.dict-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.dict-category-card {
  display: block;
  text-align: center;
  padding: 44px 32px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dict-category-card:hover,
.dict-category-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.dict-category-card .card-icon {
  margin: 0 auto 20px;
}

.dict-category-card h3 {
  margin: 0 0 10px;
}

.dict-category-blurb {
  margin: 0 0 18px;
  color: var(--text-body);
  font-size: 14.5px;
  line-height: 1.6;
}

.dict-category-count {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 700;
}

.dict-category-card:hover .dict-category-count {
  background: var(--teal-400);
  color: var(--navy-950);
}

/* -------------------------------------------------- Subgroup filter pills (Geology) */

.dict-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.dict-pill {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--navy-900);
  font-size: 13.5px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.dict-pill:hover {
  background: rgba(45, 212, 191, 0.2);
}

.dict-pill.is-active {
  background: var(--teal-400);
  color: var(--navy-950);
}

/* -------------------------------------------------- Index: search + A-Z nav */

.dict-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 48, 77, 0.06);
  margin-bottom: 28px;
  position: sticky;
  top: 78px;
  z-index: 20;
}

.dict-search {
  flex: 1 1 260px;
  position: relative;
}

.dict-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid rgba(16, 48, 77, 0.14);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--navy-900);
  background: var(--slate-50);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dict-search input:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
  background: #fff;
}

.dict-search::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  border: 2px solid var(--slate-500);
  border-radius: 50%;
  box-shadow: 4px 4px 0 -3px var(--slate-500);
}

.dict-count {
  font-size: 13.5px;
  color: var(--slate-500);
  white-space: nowrap;
}

.dict-count strong {
  color: var(--navy-900);
}

.dict-az {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dict-az a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--slate-100);
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 700;
}

.dict-az a:hover,
.dict-az a:focus-visible {
  background: var(--teal-400);
  color: var(--navy-950);
}

.dict-az a.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* -------------------------------------------------- Index: term listing */

.dict-letter-group {
  margin-bottom: 40px;
  scroll-margin-top: 150px;
}

.dict-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--teal-400), var(--navy-700));
  color: var(--navy-950);
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 16px;
}

.dict-term-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
}

.dict-term-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(16, 48, 77, 0.06);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dict-term-card:hover,
.dict-term-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dict-term-name {
  display: block;
  color: var(--navy-900);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.dict-term-card:hover .dict-term-name {
  color: var(--teal-400);
}

.dict-term-snippet {
  display: block;
  color: var(--slate-500);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dict-no-results {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--slate-500);
}

.dict-no-results.is-visible {
  display: block;
}

/* -------------------------------------------------- Term page */

.dict-page-head {
  padding: 148px 0 40px;
  background: linear-gradient(150deg, var(--navy-900), var(--navy-700));
  color: #fff;
}

.dict-breadcrumb {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.dict-breadcrumb a {
  color: var(--text-muted);
}

.dict-breadcrumb a:hover {
  color: #fff;
}

.dict-page-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.dict-content {
  padding-top: 56px;
}

.dict-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 48, 77, 0.06);
}

.dict-section + .dict-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(16, 48, 77, 0.08);
}

.dict-section h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-400);
  margin: 0 0 14px;
}

.dict-section p {
  margin: 0 0 14px;
  color: var(--text-body);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.dict-section p:last-child {
  margin-bottom: 0;
}

.dict-section a {
  font-weight: 600;
  border-bottom: 1px solid rgba(45, 212, 191, 0.35);
}

.dict-section a:hover {
  border-color: var(--teal-400);
}

.dict-figure {
  border-radius: 12px;
  margin: 6px 0 18px;
  box-shadow: var(--shadow-sm);
}

.dict-related {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(16, 48, 77, 0.08);
}

.dict-related h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0 0 14px;
}

.dict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dict-chip {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--navy-900);
  font-size: 13.5px;
  font-weight: 600;
}

.dict-chip:hover {
  background: var(--teal-400);
  color: var(--navy-950);
}

.dict-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.dict-pager a {
  display: block;
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  border: 1px solid rgba(16, 48, 77, 0.06);
  box-shadow: var(--shadow-sm);
}

.dict-pager a:hover {
  box-shadow: var(--shadow-lg);
}

.dict-pager-next {
  text-align: right;
}

.dict-pager-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 4px;
}

.dict-pager-title {
  display: block;
  font-weight: 700;
  color: var(--navy-900);
  font-size: 15px;
}

.dict-pager a:hover .dict-pager-title {
  color: var(--teal-400);
}

.dict-back {
  margin-top: 24px;
  text-align: center;
}

/* -------------------------------------------------- Responsive */

/* Grid/flex items default to min-width:auto, so a long unbroken snippet or
   term name can force its track wider than the viewport (same issue as
   .card-grid etc. in theme.css). Applied unconditionally, not just under a
   breakpoint, since 3-across on a mid-width tablet is just as exposed. */
.dict-term-grid > *,
.dict-category-grid > *,
.dict-pager > *,
.dict-az,
.dict-chips,
.dict-pills {
  min-width: 0;
}

@media (max-width: 900px) {
  .dict-term-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dict-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dict-toolbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .dict-term-grid {
    grid-template-columns: 1fr;
  }

  .dict-card {
    padding: 26px 22px;
  }

  .dict-page-head {
    padding: 120px 0 32px;
  }

  .dict-page-head h1 {
    overflow-wrap: anywhere;
  }

  .dict-pager {
    grid-template-columns: 1fr;
  }

  .dict-pager-next {
    text-align: left;
  }

  .dict-pills {
    margin-bottom: 16px;
  }

  .dict-pill {
    padding: 7px 14px;
    font-size: 13px;
  }

  .dict-related h2,
  .dict-section h2 {
    font-size: 12px;
  }
}

/* Very narrow phones (e.g. iPhone SE at 320px). */
@media (max-width: 380px) {
  .dict-toolbar {
    padding: 16px;
  }

  .dict-az a {
    width: 27px;
    height: 27px;
    font-size: 12px;
  }

  .dict-card {
    padding: 22px 18px;
  }

  .dict-category-card {
    padding: 32px 22px;
  }
}
