*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f7f6f3;
  --card: #fff;
  --text: #111;
  --muted: #4a4a4a;
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.32);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 0;
  --radius-sm: 0;
  --focus: 0 0 0 4px rgba(17, 17, 17, 0.12);
  --container: 1100px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 16px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
  outline: none;
  box-shadow: var(--shadow), var(--focus);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  padding: 44px 0 18px;
  text-align: center;
}

.main-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.2vw, 46px);
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0 auto;
  max-width: 900px;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line-strong);
  margin: 26px auto 0;
  width: min(900px, 100%);
}

.site-footer {
  margin-top: auto;
  padding: 18px 0 34px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin: 22px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.02em;
}

.section-lede {
  margin: 0 auto;
  max-width: 980px;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 20px);
}

.search-form {
  margin-top: 18px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
}

.search-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 18px;
}

.search-input:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(17, 17, 17, 0.55);
}

.search-button {
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
  min-width: 140px;
}

.search-button:hover {
  opacity: 0.92;
}

.search-button:active {
  transform: translateY(1px);
}

.search-button:focus {
  outline: none;
  box-shadow: var(--focus);
}

.hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.results {
  margin-top: 6px;
}

.empty-state,
.status {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(17, 17, 17, 0.04);
  color: var(--muted);
  text-align: center;
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
}

.result-top {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.result-irish {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.result-english {
  color: var(--muted);
  font-style: italic;
  font-size: 16px;
}

.result-ipa {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 720px) {
  .card {
    padding: 18px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
  }
}

.lang-switch {
  text-align: center;
  margin-bottom: 10px;
}

.lang-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}

.lang-btn:hover {
  background: rgba(17, 17, 17, 0.05);
}

.result-item .result-ipa:first-of-type {
  font-size: 16px;
  color: var(--text);
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  padding: 8px;
}

.audio-btn:hover {
  background: rgba(17,17,17,0.05);
}

.audio-btn:focus {
  outline: none;
  box-shadow: var(--focus);
}

.audio-btn .speaker-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.audio-missing {
  color: var(--muted);
  font-size: 18px;
}
