/* ==========================================================================
   AWOOGA — Glossary page styles
   Builds on the shared design system in style.css (tokens, .container, etc.)
   ========================================================================== */

/* ---------- Hero ---------- */
.gl-hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(29, 77, 120, 0.16), transparent 60%),
    var(--paper);
  text-align: center;
  overflow: hidden;
}
.gl-hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.gl-hero h1 em { color: var(--red); font-style: normal; }
.gl-hero .lead { margin-inline: auto; }

/* Rope-knot divider flourish */
.gl-knot {
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  color: var(--brass);
  margin: 0.4rem 0 0;
  opacity: 0.85;
}

/* ---------- Toolbar: search + count ---------- */
.gl-toolbar {
  position: sticky;
  top: 60px;                 /* clears the sticky site header */
  z-index: 20;
  background: rgba(251, 247, 238, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}
.gl-toolbar__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.gl-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.gl-search__icon {
  position: absolute;
  left: 0.95rem; top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
  pointer-events: none;
}
.gl-search input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.72rem 1rem 0.72rem 2.5rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.gl-search input::placeholder { color: var(--text-soft); opacity: 0.7; }
.gl-search input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.18);
}
.gl-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ---------- Category filter chips ---------- */
.gl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.gl-chip {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--navy-800);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.gl-chip:hover { transform: translateY(-1px); border-color: var(--wood); }
.gl-chip.is-active {
  background: var(--navy-900);
  color: var(--cream);
  border-color: var(--navy-900);
}
.gl-chip__n {
  display: inline-block;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-left: 0.15rem;
}
.gl-chip.is-active .gl-chip__n { opacity: 0.85; }

/* ---------- The grid ---------- */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
}

.gl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.4rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.gl-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brass);
}
.gl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* Per-category accent stripe */
.gl-card[data-cat="parts"]::before  { background: var(--wood); }
.gl-card[data-cat="water"]::before  { background: var(--navy-600); }
.gl-card[data-cat="tug"]::before     { background: var(--red); }
.gl-card[data-cat="awooga"]::before  { background: var(--brass); }

.gl-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.gl-card__term {
  font-size: 1.32rem;
  margin: 0;
  color: var(--navy-900);
}
.gl-card__tag {
  flex: none;
  font-family: var(--font-sans);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--wood-dk);
  white-space: nowrap;
}
.gl-card__tag[data-cat="water"]  { background: rgba(29, 77, 120, 0.12);  color: var(--navy-700); }
.gl-card__tag[data-cat="tug"]     { background: rgba(184, 71, 63, 0.14);  color: var(--red-dk); }
.gl-card__tag[data-cat="awooga"]  { background: rgba(201, 162, 39, 0.18); color: var(--wood-dk); }

.gl-card__meta {
  margin: 0.3rem 0 0.7rem;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.gl-card__pos {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.gl-card__pron {
  font-size: 0.8rem;
  color: var(--wood-dk);
  font-weight: 600;
}
.gl-card__def {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--text);
}
.gl-card__aside {
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-soft);
  font-style: italic;
}
.gl-card__mark {
  font-style: normal;
  color: var(--brass);
  margin-right: 0.35rem;
}
.gl-card__see {
  display: inline-block;
  margin-top: 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.gl-card__see:hover { border-color: var(--red); }

/* ---------- Nearby-page cards ("See the words in the wild") ---------- */
.next-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.next-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 100%;
  padding: 1.3rem 1.35rem 1.2rem;
  border: 1px solid rgba(12, 32, 52, 0.12);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(251,247,238,0.92));
  box-shadow: 0 14px 30px rgba(12, 32, 52, 0.08);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.next-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(201, 162, 39, 0.12), transparent 56%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.next-link:hover,
.next-link:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 18px 34px rgba(12, 32, 52, 0.14);
}
.next-link:hover::before,
.next-link:focus-visible::before {
  opacity: 1;
}
.next-link h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--navy-900);
}
.next-link p {
  margin: 0;
  flex: 1;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}
.next-link .xcard__arrow {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--red);
}
.next-link:hover .xcard__arrow,
.next-link:focus-visible .xcard__arrow {
  gap: 0.7rem;
  transform: translateX(2px);
}

/* ---------- Empty state ---------- */
.gl-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}
.gl-empty__horn { font-size: 2.6rem; margin-bottom: 0.4rem; }

@media (max-width: 640px) {
  .next-links { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .gl-toolbar { top: 54px; }
  .gl-count { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-card, .gl-chip { transition: none; }
}
