/* =========================================================
   CSS ARCHITECTURE REFACTOR
   Structure:
   1. Base
   2. Layout
   3. Components
   ========================================================= */

/* =========================
1. BASE
========================= */

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

:root {
  --bg: #f5f2ec;
  --text: #2b2b2b;
  --muted: #5f5f5f;
  --accent: #6f8f80;
  --accent-2: #c7a2ab;
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(111, 143, 128, 0.25);
  --shadow: 0 20px 60px rgba(0,0,0,0.08);
  --radius: 22px;
  --max: 1200px;
}

body {
  font-family: Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================
2. LAYOUT
========================= */

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.content-section {
  padding: 4rem 2rem;
  box-shadow: var(--shadow);
  border-radius: 0;
}

.alt-light {
  background: var(--card);
  backdrop-filter: blur(10px);
}

.alt-dark {
  background: linear-gradient(135deg, #5f7f70, #7b5f6b);
  color: white;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  background: rgba(245, 242, 236, 0.85);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.header-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-shell,
.header-container {
  width: 100%;
}

.site-footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 3rem;
}

/* =========================
3. COMPONENTS
========================= */

/* HERO */
.hero-section {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background: url('assets/title_background.jpg') center/cover no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 2rem;
}

.hero-frame {
  max-width: 650px;
  width: 90%;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 2.5rem 2rem;
  backdrop-filter: blur(10px);
  background: rgba(0,0,0,0.25);
}

.hero-kicker {
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  opacity: 0.9;
}

.hero-frame h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin: 1rem 0;
  font-weight: 400;
}

.hero-slogan {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* NAV */
.main-nav {
  display: flex;
  gap: 1rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  transition: 0.3s ease;
}

.main-nav a:hover {
  background: rgba(111,143,128,0.12);
  color: var(--accent);
}

/* BRAND */
.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.4rem;
  color: var(--accent);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--muted);
}

/* UNIVERS GRID */
.universe-grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  justify-content: center;
  gap: 1.5rem;
}

.universe-card {
  width: 280px;
  aspect-ratio: 2 / 3;

  display: flex;
  align-items: flex-end;

  color: white;
  overflow: hidden;
  position: relative;

  border-radius: var(--radius);
  box-shadow: var(--shadow);

  transition: transform 0.3s ease;
}

.card-cover {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  transition: transform 0.4s ease;
}

.universe-card:hover .card-cover{
    transform: scale(1.05);
}

.card-overlay{
    position:absolute;
    left:0;
    right:0;
    bottom:0;

    z-index:2;

    text-align:center;

    padding:2rem 1rem;

    background:linear-gradient(
        to top,
        rgba(0,0,0,0.85),
        rgba(0,0,0,0)
    );
}

.card-1 { background: linear-gradient(135deg, #4e6b5e, #c7a2ab); }
.card-2 { background: linear-gradient(135deg, #8d7d72, #5f7f70); }
.card-3 { background: linear-gradient(135deg, #c7a2ab, #5f7f70); }

.free-badge{
  position:absolute;
  top:16px;
  right:16px;

  padding:6px 12px;

  border-radius:999px;

  font-size:0.8rem;
  font-weight:600;

  background:rgba(255,255,255,0.9);
  color:#222;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: center;
}

.about-photo-frame img {
  box-shadow: var(--shadow);
}

.about-content h2 {
  font-size: 2.2rem;
  color: var(--accent);
}

/* NEWSLETTER */
.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 600px;
  margin: 2rem auto 0;
}

.newsletter-form input {
  flex: 1;
  padding: 1rem;
}

.newsletter-form button {
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}

/* CONTACT */
.contact-wrapper {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  color: var(--text);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.contact-form textarea {
  min-height: 180px;
  resize: vertical;
}

/* =========================
FIX - CENTERING + RADIUS RESTORE
========================= */

/* Centrage global des titres */
h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

/* Centrage des blocs de section */
.section-heading {
  text-align: center;
}

/* Hero text box arrondie restaurée */
.hero-frame {
  border-radius: var(--radius);
}

/* Vignettes de livres arrondies */
.universe-card {
  border-radius: var(--radius);
  overflow: hidden;
}


/* =========================
FINAL POLISH (TYPO + HERO + NEWSLETTER)
========================= */

/* 1. Uniformisation titres sections */
.section-heading h2 {
  color: var(--accent);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.section-heading p {
  margin-top: 0.75rem;
}

/* 2. Fix newsletter titre (même style que les autres sections) */
.newsletter-section h2 {
  color: var(--accent);
  font-size: 2.5rem;
}

/* 3. Espacement titre / texte dans toutes sections */
.section-heading h2 {
  margin-bottom: 0.75rem;
}

.section-heading p {
  margin-top: 0.75rem;
  opacity: 0.9;
}

/* 4. Newsletter champs ARRONDIS */
.newsletter-form input,
.newsletter-form button {
  border-radius: var(--radius);
}

/* 5. Hero image moins sombre (overlay ajusté) */
.hero-overlay {
  background: rgba(0,0,0,0.2);
}


/* =========================
FIX - BACKGROUND + CONTACT + CONSISTENCY
========================= */

/* 1. Background sections (remove white card effect) */
.alt-light {
  background: var(--bg);
  backdrop-filter: none;
}

/* 2. Reduce overall darkening perception (ambient glow too strong) */
.ambient-glow {
  opacity: 0.7;
}

.ambient-glow {
  background:
    radial-gradient(circle at 20% 20%, rgba(111, 143, 128, 0.10), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(199, 162, 171, 0.08), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(111, 143, 128, 0.05), transparent 55%);
}

/* 3. Contact form spacing (gap between intro and form) */
.contact-form {
  margin-top: 2.5rem;
}

.contact-intro {
  margin-bottom: 2rem;
}

/* 4. Contact form - unify style with newsletter */
.contact-form input,
.contact-form textarea {
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
}

.contact-form button {
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-form button:hover {
  background: #5f7f70;
  transform: translateY(-2px);
}


/* =========================
FINAL UI POLISH - CARDS + CONTACT + SOCIAL
========================= */

/* 1. Vignette titles (univers cards) */
.card-overlay h3 {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
  text-decoration: none;
}

.card-overlay span {
  font-size: 0.9rem;
  opacity: 0.85;
  font-style: italic;
}

/* légère variation visuelle entre cartes */
.universe-card:nth-child(1) .card-overlay h3 { font-size: 1.5rem; }
.universe-card:nth-child(2) .card-overlay h3 { font-size: 1.35rem; }
.universe-card:nth-child(3) .card-overlay h3 { font-size: 1.45rem; }

/* 2. Contact background = newsletter */
#contact.content-section {
  background: linear-gradient(135deg, #5f7f70, #7b5f6b);
  color: white;
}

#contact .section-heading h2,
#contact .contact-intro {
  color: white;
  opacity: 0.9;
}

/* 3. Social icon spacing (preparation for icon display) */
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0;
}


/* =========================
FINAL FIX - CARDS CENTERING + COLORS + ICON + BUTTONS
========================= */

/* 1. Center titles/subtitles in cards */
.card-overlay {
  text-align: center;
}

.card-overlay h3,
.card-overlay span {
  margin-left: auto;
  margin-right: auto;
}

/* ensure subtitle stays clean on new line */
.card-overlay span {
  display: block;
  line-height: 1.4;
}

/* 2. Newsletter + Contact titles unified white */
.newsletter-section h2,
#contact h2 {
  color: #ffffff;
}

.newsletter-section p,
#contact .contact-intro {
  color: rgba(255,255,255,0.85);
}

/* 3. Instagram icon centering fix */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-links img {
  display: block;
}

/* 4. Button color suggestions (newsletter + contact) */
/* newsletter: soft cream elegant */
.newsletter-form button {
  background: #e6dccf;
  color: #2b2b2b;
}

.newsletter-form button:hover {
  background: #d8cbb8;
}

/* contact: slightly deeper cream for contrast */
.contact-form button {
  background: #d9c7b6;
  color: #2b2b2b;
}

.contact-form button:hover {
  background: #cbb39f;
}


/* =========================
FINAL THEME ADJUSTMENT - GREEN BUTTONS + INSTAGRAM SIZE FIX
========================= */

/* BUTTONS - ENCRE ÉDITORIALE (VERT) */
.newsletter-form button,
.contact-form button,
.cta-button {
  background: #5f7f70;
  color: #f5f2ec;
  border: none;
  transition: all 0.3s ease;
}

.newsletter-form button:hover,
.contact-form button:hover,
.cta-button:hover {
  background: #4e6b5e;
  transform: translateY(-2px);
}

/* INSTAGRAM ICON FIX (TROP GRAND → NORMALISÉ) */
.social-links img {
  width: 22px;
  height: 22px;
  display: block;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* =========================
FORM SECTION TITLES - GREEN ACCENT RESTORE
========================= */

.newsletter-section h2,
#contact h2 {
  color: #5f7f70;
}


/* =========================
CONTACT TITLE FIX (SPECIFICITY)
========================= */

#contact .section-heading h2 {
  color: #5f7f70 !important;
}

/* =========================
ABOUT SECTION - CENTER BIO + ROUND IMAGE
========================= */

/* center bio text */
.about-content {
  text-align: center;
}

/* circular image frame */
.about-photo-frame {
  width: 260px;
  height: 260px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.about-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* =========================
NEWSLETTER FORM - VERTICAL LAYOUT FIX
========================= */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: white;
  outline: none;
}

.newsletter-form input[type="email"]::placeholder {
  color: rgba(255,255,255,0.6);
}

.checkbox-line {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.newsletter-form button {
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.small-text {
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: center;
}

.newsletter-success {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: white;
  animation: fadeIn 0.6s ease forwards;
}

.newsletter-success h3 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.newsletter-success p {
  font-size: 0.95rem;
  opacity: 0.9;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
TITLE COLOR OVERRIDE - WHITE HEADINGS
========================= */

/* Force newsletter + contact section titles to white */
.newsletter-section h2,
#contact .section-heading h2 {
  color: #ffffff !important;
}

.book-hero-split {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.book-cover img {
  width:400px;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.book-subtitle{
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.book-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.book-tags span{
  background: rgba(111,143,128,0.12);
  color: var(--accent);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.book-synopsis{
  margin-bottom: 1.5rem;
  color: var(--text);
}

.book-quote{
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-left: 3px solid var(--accent);
  background: rgba(111,143,128,0.08);
  font-style: italic;
  color: var(--text);
}

.book-info h1 {
  color: var(--accent);
  text-align: left;
  margin-bottom: 0.5rem;
}

@media (max-width: 900px){
  .book-hero-split{
    grid-template-columns: 1fr;
    text-align: center;
  }

  .book-tags{
    justify-content: center;
  }
}

/* =========================
RELATED BOOKS
========================= */

.related-books {
  padding-top: 2rem;
}

.related-grid {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}
