/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variáveis ──────────────────────────────────────────────────────────── */
:root {
  --blue:       #4e90c0;
  --blue-dark:  #3a7aaa;
  --gold:       #e8951c;
  --bg:         #2d2d2d;
  --bg-pattern: url('/dicionario/img/grid-pattern.png');
  --card-bg:    #ffffff;
  --card-gray:  #eeeeee;
  --text:       #1a1a1a;
  --text-light: #555555;
  --border:     #cccccc;
  --radius:     10px;
  --font:       'Courier New', Courier, monospace;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: underline; }
a:hover { color: var(--gold); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--blue);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.site-header .logo { font-size: 1.5rem; font-weight: bold; color: #fff; text-decoration: none; }
.logo-sub { font-weight: normal; font-size: .7rem; color: #f9f6ee; font-style: italic; letter-spacing: .02em; }
.logo-sub-link { color: #f9f6ee; text-decoration: none; }
.logo-sub-link:hover { text-decoration: underline; }
.site-header nav { margin-left: auto; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-header nav a { color: #fff; text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--gold); text-decoration: underline; }

/* ── Layout principal ───────────────────────────────────────────────────── */
.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.5rem;
}
@media (max-width: 700px) {
  .page-wrapper { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}
.main-content { min-width: 0; }

/* ── Banner ─────────────────────────────────────────────────────────────── */
.banner {
  background: var(--card-gray);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .85rem;
  text-align: center;
  padding: .5rem;
}
.banner-top    { height: 90px;  margin-bottom: 1.5rem; }
.banner-side   { height: 250px; margin-bottom: 1rem; }
.banner-bottom { height: 90px;  margin-top: 1.5rem; }

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-gray { background: var(--card-gray); }

/* ── Abas de busca ──────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; margin-bottom: 0; }
.tab-btn {
  flex: 1;
  padding: .65rem 1rem;
  background: var(--card-gray);
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-light);
  transition: background .15s, color .15s;
}
.tab-btn:first-child { margin-right: -2px; }
.tab-btn.active {
  background: var(--card-bg);
  color: var(--blue);
  border-color: var(--border);
  border-bottom: 2px solid var(--card-bg);
  position: relative;
  z-index: 1;
}
.tab-panel {
  display: none;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.5rem;
}
.tab-panel.active { display: block; }

/* ── Campo de busca ─────────────────────────────────────────────────────── */
.search-row { display: flex; gap: .5rem; }
.search-input {
  flex: 1;
  padding: .6rem .8rem;
  font-size: 1.1rem;
  font-family: var(--font);
  border: 2px solid var(--border);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.search-input:focus { outline: none; border-color: var(--blue); }
.search-btn {
  padding: .6rem 1.2rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}
.search-btn:hover { background: var(--blue-dark); }
.search-hint { font-size: .82rem; color: var(--text-light); margin-top: .5rem; }
.search-hint code { background: var(--card-gray); padding: .1rem .3rem; border-radius: 3px; }

/* ── Resultados de busca ─────────────────────────────────────────────────── */
.results-area { margin-top: 1.2rem; }
.results-count { font-size: .9rem; color: var(--text-light); margin-bottom: .7rem; }
.results-list { list-style: none; }
.results-list li { border-bottom: 1px solid var(--card-gray); }
.results-list li:last-child { border-bottom: none; }
.results-list a {
  display: block;
  padding: .5rem .3rem;
  font-size: 1.05rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: bold;
  letter-spacing: .04em;
}
.results-list a:hover { color: var(--gold); background: #fafafa; }
.results-list .clue-termo { font-size: .8rem; color: var(--text-light); font-weight: normal; margin-left: .3rem; }
.results-list .clue-text { font-size: .95rem; }
.no-results { color: var(--text-light); font-style: italic; padding: .5rem 0; }

/* Termos em texto corrido */
.results-inline { line-height: 2.2; margin-top: .3rem; }
.results-inline a {
  color: var(--blue);
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: .03em;
  white-space: nowrap;
}
.results-inline a:hover { color: var(--gold); }

/* ── Página de termo ─────────────────────────────────────────────────────── */
.termo-header { margin-bottom: 1.5rem; }
.termo-titulo {
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: .08em;
  color: var(--text);
  line-height: 1.2;
}
.termo-meta { color: var(--text-light); font-size: .9rem; margin-top: .3rem; }
.termo-meta strong { color: var(--blue); }

.dicas-titulo { font-size: 1.2rem; font-weight: bold; color: var(--blue); margin-bottom: .8rem; }
.dicas-list { list-style: none; counter-reset: dica-counter; }
.dicas-list li {
  counter-increment: dica-counter;
  padding: .6rem 0 .6rem 2rem;
  border-bottom: 1px solid var(--card-gray);
  position: relative;
  font-size: 1rem;
  line-height: 1.5;
}
.dicas-list li:last-child { border-bottom: none; }
.dicas-list li::before {
  content: counter(dica-counter);
  position: absolute;
  left: 0;
  top: .6rem;
  font-size: .8rem;
  color: var(--gold);
  font-weight: bold;
  min-width: 1.5rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar .card { padding: 1rem; }
.sidebar h3 { font-size: 1rem; color: var(--blue); margin-bottom: .6rem; }
.sidebar ul { list-style: none; }
.sidebar ul li { padding: .25rem 0; border-bottom: 1px solid var(--card-gray); }
.sidebar ul li:last-child { border-bottom: none; }
.sidebar ul a { font-size: .9rem; color: var(--blue); text-decoration: none; }
.sidebar ul a:hover { color: var(--gold); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 1rem;
  font-size: .85rem;
  margin-top: 2rem;
}
.site-footer a { color: var(--gold); }

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.spinner { display: none; width: 22px; height: 22px; border: 3px solid var(--card-gray);
           border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.active { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
