/* =========================
   Base + Theme
   ========================= */

*,
*::before,
*::after{
  box-sizing: border-box;
}

:root{
  --bg: #000;
  --panel: #1e2b2b;
  --card: #fff;
  --text: #111;
  --muted: #4b5563;
  --accent: #002F6C;

  --border: rgba(0,0,0,.15);
  --shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  --radius: 15px;

  --page-bg: #333F48;
  --control-bg: #f5f5f5;
  --control-border: rgba(0,0,0,.35);
  --focus: rgba(0, 47, 108, .35);
  
  --cardInsetLeft: 7px;
  --cardInsetPad: 3px;
}

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;

  background: var(--page-bg);
  color: var(--text);
  font-family: Georgia, serif;
  line-height: 1.35;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================
   Header
   ========================= */

.container{
  width: 100%;
  background: var(--bg);
  padding: 10px 12px 14px;
}

.display{
  text-align: center;
  margin: 0;
}

.siteHeading{
  color: #fff;
  margin: 0;
  padding: 10px 0 0;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: .2px;
}

.divider{
  width: min(900px, 92vw);
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
}

/* =========================
   Filters
   ========================= */

.dropdownRow{
  background: #c7c7c7;
  color: #0b2a6b;
  padding: 12px 12px 10px;
  font-size: 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  max-width: 1100px;
  margin: 0 auto;
}

.filter{
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.filterGrow{
  flex: 1 1 280px;
  min-width: 220px;
}

.filterLabel{
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: rgba(0,0,0,.75);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.select,
.textInput,
.btn,
.audioBtn{
  font: inherit;
}

.select,
.textInput{
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: #111;
  padding: 6px 10px;
}

.select{
  width: clamp(12rem, 20vw, 16rem);
  cursor: pointer;
}

.textInput{
  width: 100%;
  font-family: "Roboto", Arial, sans-serif;
}

.select:focus,
.textInput:focus,
.btn:focus,
.audioBtn:focus{
  outline: none;
}

.select:focus-visible,
.textInput:focus-visible,
.btn:focus-visible,
.audioBtn:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn{
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--control-border);
  background: #fff;
  padding: 6px 12px;
  cursor: pointer;

  font-family: "Roboto", Arial, sans-serif;
  font-weight: 700;
}

.btn:hover{ filter: brightness(0.98); }
.btn:active{ transform: translateY(1px); }

.resultsMeta{
  max-width: 1100px;
  margin: 10px auto 0;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 13px;
  color: rgba(0,0,0,.7);
}

/* =========================
   Results list
   ========================= */

#filteredGlossary{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px 30px;
}

/* =========================
   Cards
   ========================= */

.glossaryCard{
  width: min(1100px, 96vw);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);

  /* squallfight feel */
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

.cardTerm{
  padding: 15px 20px 15px 40px;
  line-height: 1.5;
  text-align: left;
}

/* Prevent long terms/URLs from breaking layout */
.termName,
.termText,
.exampleText,
.connection{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Default term heading (used by older rendering) */
.termName{
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  text-transform: capitalize;
  margin: 0 0 8px 0;
}

/* Inline term + definition rendering (new layout) */
.termNameInline{
  margin-left: -15px;
  color: var(--accent);
  text-transform: capitalize;
  font-size: 18px;
  font-weight: 600;
}

.termDefInline{
  color: #000;
  font-weight: 500;
  font-size: 14px;
  font-family: "Roboto", Arial, sans-serif;
}

.termText{
  font-family: "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 12px 0;
  color: #111;
}

/* Meta */
.metaRow{
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
   /*   margin: 15px 0 15px 0px 0; */
   /*   top, right, bottom , left */
  padding: 5px 15px 5px 3px !important;
  margin: 5px 10px 5px 7px !important;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 13px;
  margin-left: var(--cardInsetLeft);
  padding-left: var(--cardInsetPad);
}

/* Align all meta items to the bottom edge of the line */
.metaRowPiped{
  align-items: bottom;
}

/* Ensure the audio item itself bottoms out cleanly */
.metaRowPiped .metaAudio{
  align-self: flex-end;
}

/* Make the button and icon behave like text sitting on the baseline */
.metaRowPiped .metaAudio .audioBtn{
  display: inline-flex;
  align-items: flex-end;
  vertical-align: text-bottom;
  padding: 0;
  line-height: 1;
}

.metaRowPiped .metaAudio .fa{
  display: inline-block;
  line-height: 1;
  vertical-align: text-bottom;
}

/* Piped meta row: remove labels and colons entirely */
.metaRowPiped .metaKey{
  display: none;
}

/* Pipe separators between meta items */
.metaRowPiped .metaItem + .metaItem::before{
  content: "|";
  margin: 0;
  color: rgba(0,0,0,.5);
  font-weight: 600;
}

.metaItem{
  display: inline-flex;
  gap: 6px;
  align-items: bottom;
}

.metaKey{
  font-weight: 800;
  color: rgba(0,0,0,.78);
}

.metaVal{
  font-weight: 600;
  color: rgba(0,0,0,.9);
}

.metaVal.category{
  color: darkmagenta;
  text-transform: capitalize;
}

.metaVal.type{
  color: darkred;
  text-transform: capitalize;
}

.metaVal.origin{
  color: black;
  font-weight:400;
  text-transform: capitalize;
}

.metaVal.pronunciation{
  color: darkGreen;
  font-weight:600;
}

/* Example (old block style) */
.example{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.12);
}

.exampleTitle{
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 800;
  color: #0b6b2f;
  margin: 0 0 4px 0;
}

.exampleText{
  font-family: "Roboto", Arial, sans-serif;
  color: #0a1a4b;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  white-space: pre-wrap;
}

/* Example (inline style) */
.exampleLine{
  line-height: 1.25em;
  font-size: 13px;
  margin-left: var(--cardInsetLeft);
  padding-left: var(--cardInsetPad);
}

.exampleLabel{
  color: darkgreen;
  font-weight: 600;
}

.exampleTextInline{
  color: navy;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.pronounceRow{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Audio */
.audioBtn{
  border: 1px solid rgba(0,0,0,.25);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;

  font-family: "Roboto", Arial, sans-serif;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.audioBtn .fa{
  font-size: 16px;
  color: navy;
}

.audioBtn:hover{ filter: brightness(0.98); }
.audioBtn:active{ transform: translateY(1px); }

.audioBtn:hover .fa{
  filter: brightness(0.85);
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 520px){
  .filters{ align-items: stretch; }
  .filter, .filterGrow{ min-width: 100%; }
  .select, .btn{ width: 100%; }
}

/* Screen-reader only helper */
.srOnly{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
