/* ============================================================
   Investir-Maroc.com — Feuille de style principale
   Design moderne, touche marocaine subtile (terracotta, zellige discret)
   ============================================================ */

:root {
  --terracotta: #c05a34;
  --terracotta-dark: #9c4526;
  --nuit: #1b2a35;
  --nuit-2: #24394a;
  --sable: #faf7f2;
  --sable-2: #f3ede3;
  --or: #c9a04e;
  --encre: #2b2b2b;
  --gris: #6b7280;
  --ligne: #e7dfd2;
  --vert: #2f7d5f;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(27, 42, 53, 0.08);
  --shadow-lg: 0 16px 48px rgba(27, 42, 53, 0.14);
  --font-titre: "Fraunces", Georgia, serif;
  --font-texte: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-texte);
  color: var(--encre);
  background: var(--sable);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--terracotta-dark); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ---------- Motif zellige discret (étoile 8 branches) ---------- */
.motif {
  background-image: url("data:image/svg+xml,%3Csvg width='56' height='56' viewBox='0 0 56 56' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c05a34' stroke-opacity='0.07' stroke-width='1'%3E%3Cpath d='M28 6l6.2 15.8L50 28l-15.8 6.2L28 50l-6.2-15.8L6 28l15.8-6.2z'/%3E%3Ccircle cx='28' cy='28' r='4'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ligne);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-titre);
  font-weight: 700; font-size: 1.35rem; color: var(--nuit);
  display: flex; align-items: center; gap: 10px;
}
.logo:hover { color: var(--nuit); }
.logo .dot { color: var(--terracotta); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  background: linear-gradient(135deg, var(--terracotta), var(--or));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-family: var(--font-texte); font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--nuit); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--terracotta); }
.nav-links a.active { color: var(--terracotta); }
.btn-nav {
  background: var(--nuit); color: #fff !important;
  padding: 10px 20px; border-radius: 999px; font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.btn-nav:hover { background: var(--terracotta); transform: translateY(-1px); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--nuit); cursor: pointer; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; padding: 14px 30px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; transition: all 0.2s; cursor: pointer;
  border: none;
}
.btn-primary { background: var(--terracotta); color: #fff; box-shadow: 0 6px 18px rgba(192, 90, 52, 0.35); }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--nuit); color: var(--nuit); background: transparent; }
.btn-outline:hover { background: var(--nuit); color: #fff; }
.btn-light { background: #fff; color: var(--nuit); }
.btn-light:hover { background: var(--sable-2); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--nuit) 0%, var(--nuit-2) 60%, #2c4a42 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero.motif { background-blend-mode: overlay; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1'%3E%3Cpath d='M36 8l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 90px 0 100px; max-width: 720px; }
.hero h1 {
  font-family: var(--font-titre); font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.15; font-weight: 700; margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--or); }
.hero p.lead { font-size: 1.15rem; color: #cfd8dd; margin-bottom: 34px; max-width: 580px; }
.hero-badges { display: flex; gap: 22px; margin-top: 44px; flex-wrap: wrap; }
.hero-badge { font-size: 0.88rem; color: #b8c4cb; display: flex; align-items: center; gap: 8px; }
.hero-badge strong { color: #fff; font-size: 1.25rem; font-family: var(--font-titre); display: block; }

.kicker {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.78rem; font-weight: 700; color: var(--terracotta); margin-bottom: 14px;
}
.hero .kicker { color: var(--or); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--sable-2); }
.section-titre { font-family: var(--font-titre); font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--nuit); margin-bottom: 14px; line-height: 1.25; }
.section-sub { color: var(--gris); max-width: 640px; margin-bottom: 44px; }
.center { text-align: center; }
.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Grilles de cartes ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border-radius: var(--radius); padding: 30px;
  border: 1px solid var(--ligne); box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icone {
  width: 48px; height: 48px; border-radius: 12px 12px 12px 3px;
  background: linear-gradient(135deg, rgba(192,90,52,0.12), rgba(201,160,78,0.12));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 18px;
}
.card h3 { font-family: var(--font-titre); font-size: 1.2rem; color: var(--nuit); margin-bottom: 10px; }
.card h3 a { color: var(--nuit); }
.card h3 a:hover { color: var(--terracotta); }
.card p { color: var(--gris); font-size: 0.95rem; flex-grow: 1; }
.card .lire { margin-top: 16px; font-weight: 600; font-size: 0.92rem; }
.card .lire::after { content: " →"; }

/* ---------- Bloc livre (CTA) ---------- */
.bloc-livre {
  background: linear-gradient(150deg, var(--nuit), var(--nuit-2));
  border-radius: 22px; color: #fff; overflow: hidden;
  display: grid; grid-template-columns: 300px 1fr; gap: 0;
  box-shadow: var(--shadow-lg); position: relative;
}
.bloc-livre::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c9a04e' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M36 8l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.bloc-livre .visuel { padding: 40px 0 40px 40px; position: relative; z-index: 1; }
.bloc-livre .visuel img {
  border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  transform: rotate(-2deg); transition: transform 0.3s;
}
.bloc-livre:hover .visuel img { transform: rotate(0deg) scale(1.02); }
.bloc-livre .contenu { padding: 48px; position: relative; z-index: 1; }
.bloc-livre .kicker { color: var(--or); }
.bloc-livre h2, .bloc-livre h3 { font-family: var(--font-titre); font-size: 1.7rem; margin-bottom: 14px; line-height: 1.3; }
.bloc-livre p { color: #cfd8dd; margin-bottom: 14px; font-size: 0.98rem; }
.bloc-livre ul { list-style: none; margin: 18px 0 26px; }
.bloc-livre li { padding-left: 28px; position: relative; margin-bottom: 9px; color: #e3e9ec; font-size: 0.95rem; }
.bloc-livre li::before { content: "✓"; position: absolute; left: 0; color: var(--or); font-weight: 700; }
.prix-note { font-size: 0.82rem; color: #9fb0b9; margin-top: 12px; }

/* CTA compact fin d'article */
.cta-livre-inline {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: center;
  background: var(--nuit); color: #fff; border-radius: 16px; padding: 26px 30px;
  margin: 48px 0 10px;
}
.cta-livre-inline img { border-radius: 5px; box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.cta-livre-inline .titre { font-family: var(--font-titre); font-size: 1.15rem; margin-bottom: 6px; }
.cta-livre-inline p { font-size: 0.9rem; color: #c3ced5; margin: 0; }
.cta-livre-inline .btn { white-space: nowrap; padding: 12px 24px; font-size: 0.92rem; }

/* ---------- Articles / pages éditoriales ---------- */
.page-hero { background: var(--nuit); color: #fff; padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.04' stroke-width='1'%3E%3Cpath d='M36 8l8 20 20 8-20 8-8 20-8-20-20-8 20-8z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.page-hero .container-narrow, .page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { font-family: var(--font-titre); font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.2; margin-bottom: 16px; }
.page-hero .meta { color: #9fb0b9; font-size: 0.88rem; display: flex; gap: 16px; flex-wrap: wrap; }
.page-hero .lead { color: #cfd8dd; font-size: 1.08rem; margin-top: 14px; max-width: 640px; }

.fil-ariane { font-size: 0.82rem; color: #9fb0b9; margin-bottom: 18px; }
.fil-ariane a { color: var(--or); }

.article { padding: 56px 0 72px; }
.article h2 { font-family: var(--font-titre); font-size: 1.55rem; color: var(--nuit); margin: 44px 0 16px; line-height: 1.3; }
.article h3 { font-family: var(--font-titre); font-size: 1.2rem; color: var(--nuit); margin: 30px 0 12px; }
.article p { margin-bottom: 18px; }
.article ul, .article ol { margin: 0 0 20px 24px; }
.article li { margin-bottom: 10px; }
.article strong { color: var(--nuit); }

.encadre {
  background: #fff; border-left: 4px solid var(--terracotta);
  border-radius: 0 12px 12px 0; padding: 22px 26px; margin: 28px 0;
  box-shadow: var(--shadow); font-size: 0.96rem;
}
.encadre .titre-encadre { font-weight: 700; color: var(--terracotta); display: block; margin-bottom: 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

.tableau { width: 100%; border-collapse: collapse; margin: 26px 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 0.93rem; }
.tableau th { background: var(--nuit); color: #fff; text-align: left; padding: 13px 16px; font-weight: 600; }
.tableau td { padding: 12px 16px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau tr:last-child td { border-bottom: none; }
.tableau tr:nth-child(even) td { background: var(--sable); }

/* Sommaire */
.sommaire {
  background: var(--sable-2); border: 1px solid var(--ligne); border-radius: 12px;
  padding: 22px 28px; margin: 0 0 36px; font-size: 0.93rem;
}
.sommaire .titre-sommaire { font-weight: 700; color: var(--nuit); margin-bottom: 10px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.sommaire ol { margin: 0 0 0 20px; }
.sommaire li { margin-bottom: 5px; }

/* Liens connexes */
.connexes { background: var(--sable-2); border-radius: 14px; padding: 26px 30px; margin-top: 40px; }
.connexes .titre-connexes { font-family: var(--font-titre); font-size: 1.05rem; color: var(--nuit); margin-bottom: 12px; }
.connexes ul { list-style: none; margin: 0; }
.connexes li { margin-bottom: 8px; padding-left: 20px; position: relative; }
.connexes li::before { content: "→"; position: absolute; left: 0; color: var(--terracotta); }

/* FAQ */
.faq details { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 18px 24px; margin-bottom: 12px; }
.faq summary { font-weight: 600; color: var(--nuit); cursor: pointer; font-size: 1rem; }
.faq details p { margin: 12px 0 0; color: var(--gris); font-size: 0.95rem; }

/* ---------- Liste blog ---------- */
.liste-articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.carte-article {
  background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.carte-article:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.carte-article .tag {
  align-self: flex-start; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--terracotta); background: rgba(192,90,52,0.1);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.carte-article h3 { font-family: var(--font-titre); font-size: 1.25rem; line-height: 1.35; margin-bottom: 10px; }
.carte-article h3 a { color: var(--nuit); }
.carte-article h3 a:hover { color: var(--terracotta); }
.carte-article p { color: var(--gris); font-size: 0.94rem; flex-grow: 1; }
.carte-article .meta-carte { font-size: 0.8rem; color: #a8a29e; margin-top: 16px; }

/* ---------- Chiffres clés ---------- */
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.chiffre { text-align: center; padding: 28px 16px; background: #fff; border-radius: var(--radius); border: 1px solid var(--ligne); }
.chiffre .valeur { font-family: var(--font-titre); font-size: 2rem; color: var(--terracotta); font-weight: 700; }
.chiffre .label { font-size: 0.85rem; color: var(--gris); margin-top: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--nuit); color: #b8c4cb; padding: 64px 0 32px; margin-top: 0; position: relative; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--terracotta), var(--or), var(--vert), var(--terracotta));
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; position: relative; z-index: 1; }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #b8c4cb; font-size: 0.92rem; }
.site-footer a:hover { color: var(--or); }
.site-footer .logo { color: #fff; margin-bottom: 14px; }
.site-footer .desc { font-size: 0.9rem; max-width: 300px; }
.footer-bas { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Divers ---------- */
.note-legale { font-size: 0.82rem; color: var(--gris); font-style: italic; margin-top: 30px; padding-top: 18px; border-top: 1px dashed var(--ligne); }
.maj { font-size: 0.82rem; color: var(--gris); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .chiffres { grid-template-columns: repeat(2, 1fr); }
  .bloc-livre { grid-template-columns: 1fr; }
  .bloc-livre .visuel { padding: 40px 40px 0; max-width: 260px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--sable); flex-direction: column; padding: 24px; gap: 18px;
    border-bottom: 1px solid var(--ligne); box-shadow: var(--shadow-lg);
  }
  .nav-links.ouvert { display: flex; }
  .nav-toggle { display: block; }
}
@media (max-width: 620px) {
  .grid-3, .grid-2, .liste-articles, .chiffres { grid-template-columns: 1fr; }
  .cta-livre-inline { grid-template-columns: 1fr; text-align: center; }
  .cta-livre-inline img { margin: 0 auto; max-width: 120px; }
  .hero-inner { padding: 60px 0 70px; }
  .section { padding: 56px 0; }
}
