.dictionary-hero {
  padding: clamp(3rem, 8vw, 7rem) 0 3rem;
  background: linear-gradient(135deg, #07172b 0%, #17365e 62%, #2f557d 100%);
  color: #fff;
}

.dictionary-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}

/* Grid children otherwise keep their min-content width and push the long
   dictionary title/search form outside the viewport. */
.dictionary-hero-grid > * {
  min-width: 0;
}

.dictionary-hero h1 {
  max-width: 100%;
  margin: 0.25rem 0 1rem;
  font: 700 clamp(2.4rem, 5vw, 5rem) / 0.98 Georgia, serif;
  overflow-wrap: anywhere;
}

.dictionary-hero p {
  max-width: 100%;
  color: #eef4fb;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.dictionary-back {
  display: inline-flex;
  margin-top: 1rem;
  color: #f2cf76;
  font-weight: 800;
}

.dictionary-search {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.dictionary-search label {
  display: block;
  margin-bottom: 0.65rem;
  color: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dictionary-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  min-width: 0;
}

.dictionary-search input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  font: inherit;
}

.dictionary-search button {
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 12px;
  background: #c89d38;
  color: #07172b;
  font-weight: 900;
  cursor: pointer;
}

.dictionary-main {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.dictionary-result-header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.dictionary-result-header > * {
  min-width: 0;
}

.dictionary-result-header h2 {
  font: 700 clamp(1.8rem, 4vw, 2.8rem) / 1 Georgia, serif;
}

.dictionary-result-header p {
  overflow-wrap: anywhere;
}

.dictionary-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.dictionary-card {
  min-width: 0;
  padding: 1.35rem;
  border: 1px solid #dfe5ed;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 12px 34px rgba(7, 23, 43, 0.07);
}

.dictionary-card > span,
.dictionary-part {
  display: inline-flex;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: #f3e7c9;
  color: #6a4a05;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dictionary-card h3 {
  margin: 0.65rem 0 0.6rem;
  font: 700 1.55rem / 1.1 Georgia, serif;
  overflow-wrap: anywhere;
}

.dictionary-card h3 a {
  color: #0d2c52;
}

.dictionary-card p {
  margin: 0 0 0.9rem;
  overflow-wrap: anywhere;
}

.dictionary-card small {
  color: #667085;
  overflow-wrap: anywhere;
}

.dictionary-empty {
  max-width: 760px;
  margin: 2rem auto;
  padding: 2.2rem;
  border: 1px solid #dfe5ed;
  border-radius: 20px;
  background: #fffdf8;
  text-align: center;
}

.dictionary-entry-detail {
  display: grid;
  gap: 1.6rem;
}

.dictionary-entry-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.dictionary-entry-heading > * {
  min-width: 0;
}

.dictionary-entry-heading h2 {
  margin: 0.55rem 0 0;
  font: 700 clamp(2.2rem, 5vw, 4.5rem) / 1 Georgia, serif;
  color: #07172b;
  overflow-wrap: anywhere;
}

.dictionary-pronunciation {
  color: #6b7280;
}

.dictionary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.dictionary-tags span {
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #edf3f8;
  color: #274969;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.dictionary-definition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dictionary-definition-grid > *,
.dictionary-thesaurus-grid > * {
  min-width: 0;
}

.dictionary-definition-grid section,
.dictionary-thesaurus-grid section {
  padding: 1.35rem;
  border: 1px solid #dfe5ed;
  border-radius: 18px;
  background: #fff;
}

.dictionary-definition-grid h3,
.dictionary-thesaurus-grid h3,
.dictionary-languages h3,
.dictionary-related h3 {
  margin: 0 0 0.75rem;
  font: 700 1.1rem Georgia, serif;
  color: #17365e;
}

.dictionary-definition-grid p {
  margin: 0;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.dictionary-languages {
  min-width: 0;
  padding: 1.5rem;
  border-radius: 22px;
  background: #07172b;
  color: #fff;
}

.dictionary-languages > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.dictionary-languages article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.dictionary-languages article span {
  color: #f2cf76;
  font-size: 0.78rem;
  font-weight: 800;
}

.dictionary-languages h4 {
  margin: 0.35rem 0;
  font: 700 1.35rem Georgia, serif;
  overflow-wrap: anywhere;
}

.dictionary-languages p {
  margin: 0;
  color: #e8eef5;
  overflow-wrap: anywhere;
}

.dictionary-thesaurus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.dictionary-thesaurus-grid ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dictionary-thesaurus-grid li {
  max-width: 100%;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: #f6f1e4;
  overflow-wrap: anywhere;
}

.dictionary-related > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.dictionary-related a {
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(36, 63, 52, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #244034;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.dictionary-related a:hover,
.dictionary-related a:focus-visible {
  border-color: #c4943c;
  background: #fff9ed;
}

.dictionary-source {
  margin: 0;
  overflow-wrap: anywhere;
}

.dictionary-source a {
  color: #325f8f;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .dictionary-hero-grid,
  .dictionary-definition-grid {
    grid-template-columns: 1fr;
  }

  .dictionary-card-grid,
  .dictionary-languages > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dictionary-entry-heading {
    display: grid;
  }

  .dictionary-tags {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .dictionary-card-grid,
  .dictionary-languages > div,
  .dictionary-thesaurus-grid {
    grid-template-columns: 1fr;
  }

  .dictionary-search > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .dictionary-search button {
    width: 100%;
  }

  .dictionary-result-header {
    display: grid;
  }

  .dictionary-hero {
    padding-top: 2.5rem;
  }

  .dictionary-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }
}

.dictionary-hero h1 {
  color: #fff;
}
