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

:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --red-light: #f9ebea;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #ddd;
  --white: #fff;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-sans);
  background-color: #f5f5f5;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ───────────────────────────────────────────── */

header {
  background-color: var(--red);
  color: var(--white);
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--red-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.header-banner {
  height: 80px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text {
  flex: 1;
}

header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

header .subtitle {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.85;
  font-style: italic;
}

/* ── Main ─────────────────────────────────────────────── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 2.5rem;
}

/* ── Bloc personnalisé ────────────────────────────────── */

.custom-block {
  max-width: 680px;
  width: 100%;
}

.custom-block:empty {
  display: none;
}

/* ── Quote card ───────────────────────────────────────── */

.quote-card {
  background: var(--white);
  border-left: 5px solid var(--red);
  border-radius: 2px;
  padding: 2.5rem 2rem;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  min-height: 180px;
  display: flex;
  align-items: center;
}

#quote {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.75;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#quote.visible {
  opacity: 1;
}

/* ── Button ───────────────────────────────────────────── */

#btn-generate {
  background-color: var(--red);
  color: var(--white);
  border: none;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#btn-generate:hover {
  background-color: var(--red-dark);
}

#btn-generate:active {
  transform: scale(0.98);
}

/* ── Lien soutenir ────────────────────────────────────── */

.soutenir-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.soutenir-link:hover {
  color: var(--red);
}

/* ── Modal ────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: 4px;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.modal-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}

.modal-cta {
  display: inline-block;
  background-color: var(--red);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.65rem 1.5rem;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.modal-cta:hover {
  background-color: var(--red-dark);
}

/* ── Footer ───────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

footer a {
  color: var(--red);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 480px) {
  .header-banner {
    display: none;
  }

  .quote-card {
    padding: 1.5rem 1.25rem;
  }

  #btn-generate {
    width: 100%;
  }
}
