/* ===========================================================
   styles.css — French Pronunciation
   Beginner notes:
   - Colors live as "variables" in :root below. Change them once
     here and the whole site updates.
   - No build tools. Just edit and refresh the browser.
   =========================================================== */

:root {
  --bg: #0f1220;
  --surface: #191d2e;
  --surface-2: #212740;
  --text: #e7e9f2;
  --muted: #a2a7bd;
  --accent: #6ea8fe;
  --accent-strong: #3d7bfd;
  --border: #2a3048;
  --radius: 14px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ---- Top bar ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(15, 18, 32, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav__brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---- Page container ---- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.intro { text-align: center; margin-bottom: 1.5rem; }
.intro h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 0.5rem; }
.intro p { color: var(--muted); margin: 0 auto; max-width: 620px; }

/* ---- Controls (speed + hint) ---- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.25rem 0 1.75rem;
}
.controls .label { color: var(--muted); font-size: 0.9rem; }

.pill {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); border-color: var(--accent); }

.panel { display: none; }
.panel.active { display: block; }

.section-title {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}

/* ---- Tile grid ---- */
.grid {
  display: grid;
  gap: 0.85rem;
}
.grid--alphabet { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.grid--combos   { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* A clickable pronunciation tile */
.tile {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  cursor: default;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: transform 0.06s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
/* Alphabet tiles are <button>s — the whole tile is clickable. */
button.tile { cursor: pointer; }
button.tile:hover { border-color: var(--accent); background: var(--surface-2); }
button.tile:active { transform: scale(0.97); }
.tile.speaking { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(110,168,254,0.35); }

.tile__grapheme { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tile__ipa { color: var(--accent); font-size: 0.95rem; }
.tile__hint { color: var(--muted); font-size: 0.85rem; }

/* The two play buttons inside a combo tile */
.tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip .play { color: var(--accent); margin-right: 0.15rem; font-size: 0.75rem; }

/* The "sound" button is the primary one — give it a subtle accent tint. */
.chip--sound {
  background: rgba(61, 123, 253, 0.15);
  border-color: var(--accent-strong);
  font-weight: 600;
}
.chip--sound:hover { background: rgba(61, 123, 253, 0.28); }

/* Small speaker icon on alphabet tiles */
.tile__row { display: flex; align-items: baseline; justify-content: space-between; }
.tile__spk { color: var(--muted); font-size: 0.9rem; }

/* ---- Warning banner (no French voice) ---- */
.warn {
  background: #3a2a12;
  border: 1px solid #6b4e1f;
  color: #ffd79a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* ---- Ad space placeholder ----
   Replace the contents of any .ad-slot with your Google AdSense
   snippet when you're approved. Until then it just shows a label. */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 1.75rem auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: #5b6180;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Readable content / FAQ section ---- */
.prose {
  max-width: 720px;
  margin: 3rem auto 0;
}
.prose h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.5rem;
}
.prose p { color: var(--muted); }
.prose [lang="fr"] { color: var(--text); }

.faq { margin-top: 0.75rem; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style-position: inside;
}
.faq summary:hover { color: var(--accent); }
.faq details[open] summary { margin-bottom: 0.5rem; }
.faq p { margin: 0; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
}
