/*
 * SPDX-FileCopyrightText: 2026 Mad Scientist
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

.dictionary-page {
  --dictionary-accent: #9a4f1d;
  --dictionary-soft: #fff0e5;
  --dictionary-line: #ecd4c4;
}

.dictionary-topbar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem clamp(1rem, 4vw, 4rem) 1.25rem;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}

.page-nav a {
  padding: .55rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 750;
}

.page-nav a:hover,
.page-nav a[aria-current="page"] {
  border-color: var(--dictionary-accent);
  background: var(--dictionary-soft);
  color: #6d3411;
}

.dictionary-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: 0 clamp(1rem, 4vw, 4rem) 3rem;
}

.dictionary-controls {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding-right: .15rem;
}

.dictionary-control-panel { padding: 1.1rem; }
.dictionary-control-panel h2 { margin: 0 0 .8rem; }

.search-field {
  display: grid;
  gap: .4rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.search-field input {
  width: 100%;
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}

.search-field input:focus {
  outline: 3px solid color-mix(in srgb, var(--dictionary-accent) 18%, transparent);
  border-color: var(--dictionary-accent);
}

.dictionary-toggle {
  display: flex;
  margin-top: .55rem;
  box-shadow: none;
}

.dictionary-toggle input { accent-color: var(--dictionary-accent); }

.dictionary-study-area { min-width: 0; }
.dictionary-toolbar { margin: .2rem 0 .8rem; }

.dictionary-intro {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  color: #5f4433;
  line-height: 1.5;
}

.dictionary-intro strong { display: block; margin-bottom: .25rem; }

.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 1rem;
  align-items: start;
}

.dictionary-card {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.dictionary-card-head {
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid var(--dictionary-line);
  background: linear-gradient(145deg, #fffdf8, var(--dictionary-soft));
}

.dictionary-card-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.dictionary-primary {
  margin: .35rem 0 0;
  color: var(--dictionary-accent);
  font-size: 1.35rem;
  font-weight: 850;
}

.dictionary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .65rem;
}

.dictionary-badge {
  padding: .25rem .45rem;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--dictionary-line);
  color: #755037;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dictionary-body {
  display: grid;
  gap: .9rem;
  padding: 1rem;
}

.dictionary-forms {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.dictionary-form {
  padding: .28rem .48rem;
  border-radius: 8px;
  background: #f2f4f7;
  color: #4e5967;
  font-size: .78rem;
  font-weight: 750;
}

.dictionary-section h3 {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.dictionary-alternatives {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dictionary-alternative {
  padding: .62rem .68rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.dictionary-alternative strong {
  display: block;
  color: #603717;
  font-size: .95rem;
}

.dictionary-alternative span {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.dictionary-note {
  margin: 0;
  padding: .72rem .78rem;
  border-left: 4px solid var(--dictionary-accent);
  border-radius: 0 10px 10px 0;
  background: var(--dictionary-soft);
  color: #604631;
  font-size: .83rem;
  line-height: 1.5;
}

.dictionary-examples {
  display: grid;
  gap: .5rem;
}

.dictionary-example {
  padding-top: .55rem;
  border-top: 1px solid var(--line);
}

.dictionary-example:first-child { border-top: 0; padding-top: 0; }
.dictionary-example p { margin: 0; }
.dictionary-example .spanish {
  font-weight: 800;
  line-height: 1.4;
}
.dictionary-example .english {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 900px) {
  .dictionary-topbar { align-items: center; }
  .dictionary-layout { grid-template-columns: 1fr; }
  .dictionary-controls {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  .dictionary-topbar {
    flex-direction: column;
    gap: 1rem;
  }
  .page-nav { justify-content: flex-start; }
  .dictionary-grid { grid-template-columns: 1fr; }
}
