/* Vocabulary components matching the N4 destination pages. */
.vocab-word {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted rgba(40, 92, 84, 0.52);
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: help;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.vocab-word:hover {
  color: var(--accent-deep, #285c54);
  background: rgba(217, 235, 229, 0.52);
}


.vocabulary-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0.34rem solid #c59a42;
  border-radius: var(--radius-large);
  background: var(--card);
  box-shadow: var(--shadow);
}

.vocabulary-header {
  display: grid;
  gap: 0.45rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(197, 154, 66, 0.11), transparent 62%),
    var(--card);
}

.vocabulary-kicker {
  margin: 0;
  color: #896823;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.vocabulary-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.vocabulary-intro {
  max-width: 41rem;
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.vocabulary-table-wrap {
  overflow-x: auto;
}

.vocabulary-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  text-align: left;
}

.vocabulary-table th,
.vocabulary-table td {
  padding: 0.9rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.vocabulary-table thead th {
  color: var(--ink-soft);
  background: var(--paper-light);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.vocabulary-table tbody tr:last-child > * {
  border-bottom: 0;
}

.vocabulary-table tbody tr:hover {
  background: rgba(217, 235, 229, 0.28);
}

.vocabulary-table__word {
  width: 26%;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
}

.vocabulary-table__reading {
  width: 26%;
  color: var(--accent-deep, #285c54);
  font-size: 0.92rem;
  font-weight: 700;
}

.vocabulary-table__meaning {
  color: var(--ink-soft);
  font-size: 0.92rem;
}


.vocabulary-dialog {
  width: min(100% - 2rem, 30rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 28px 90px rgba(24, 47, 42, 0.28);
}

.vocabulary-dialog::backdrop {
  background: rgba(23, 39, 35, 0.48);
  backdrop-filter: blur(0.25rem);
}

.vocabulary-dialog__content {
  position: relative;
  padding: 2rem;
}

.vocabulary-dialog__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper-light);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.vocabulary-dialog__kicker {
  margin: 0 0 0.45rem;
  color: var(--accent-deep, #285c54);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.vocabulary-dialog h2 {
  margin: 0;
  padding-right: 2.5rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}

.vocabulary-dialog__reading {
  margin: 0.3rem 0 0;
  color: var(--accent-deep, #285c54);
  font-weight: 700;
}

.vocabulary-dialog__meaning {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}


.vocabulary-section {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.vocab-word:focus-visible,
.vocabulary-dialog__close:focus-visible,
.vocabulary-table-wrap:focus-visible {
  outline: 3px solid rgba(97, 126, 112, 0.48);
  outline-offset: 0.25rem;
}

.vocabulary-dialog {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

@media (max-width: 34rem) {
  .vocabulary-card {
    border-radius: 1.35rem;
  }

  .vocabulary-table th,
  .vocabulary-table td {
    padding: 0.8rem 0.9rem;
  }
}

@media print {
  .vocabulary-dialog {
    display: none !important;
  }

  .vocabulary-card {
    box-shadow: none;
  }

  .vocabulary-table tr {
    break-inside: avoid;
  }
}

.vocabulary-table__word,
.vocabulary-table__reading {
  white-space: nowrap;
}

.vocabulary-scroll-hint {
  display: none;
}

@media (max-width: 40rem) {
  .vocabulary-scroll-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }
}
