/*
 * Embajada del Reino de Marruecos en La Habana
 * Feuille de style partagée (multi-pages)
 * DA marocaine officielle : rouge #C1272D, vert #006233, navy #0E2A47, or #C9A24B, crème
 * Police : Roboto (identique au réseau diplomatie.ma)
 * Support trilingue ES / FR / AR (RTL)
 */

:root {
  --red: #C1272D;
  --red-dark: #9E1F24;
  --green: #006233;
  --navy: #0E2A47;
  --navy-dark: #0A1F36;
  --gold: #C9A24B;
  --cream: #FBF8F1;
  --cream-soft: #F4EEE2;
  --bg: #ffffff;
  --text: #1E2330;
  --text-soft: #5A6175;
  --border: #E6E0D3;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --shadow-sm: 0 1px 3px rgba(14,42,71,0.06);
  --shadow-md: 0 4px 12px rgba(14,42,71,0.10);
  --shadow-lg: 0 12px 30px rgba(14,42,71,0.14);
  --radius: 3px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Roboto', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Roboto', sans-serif; font-weight: 700; line-height: 1.25; color: var(--navy); }
a { color: var(--red); text-decoration: none; transition: color 200ms ease; }
a:hover { color: var(--red-dark); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-lg); }

/* Motif zellige décoratif */
.zellige-strip {
  height: 5px;
  background: repeating-linear-gradient(135deg, var(--red) 0 14px, var(--green) 14px 28px, var(--gold) 28px 42px, var(--navy) 42px 56px);
}

/* ===== HEADER niveau 1 : emblème + ministère + langue ===== */
.header-top { background: #fff; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.header-top .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.header-brand { display: flex; align-items: center; gap: var(--space-md); }
.header-brand img { width: 60px; height: auto; }
.header-brand .ministry .kingdom { font-weight: 700; color: var(--red); font-size: 1.05rem; line-height: 1.2; }
.header-brand .ministry .dept { font-size: 0.7rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

.lang-switch { display: flex; gap: 0.3rem; flex-shrink: 0; }
.lang-switch button {
  background: transparent; color: var(--navy);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem; font-size: 0.8rem; border-radius: var(--radius);
  transition: all 200ms ease; font-weight: 500;
}
.lang-switch button:hover { border-color: var(--navy); }
.lang-switch button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ===== NAV niveau 2 : barre navy avec sous-menus ===== */
.nav-main { background: var(--navy); position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow-sm); }
.nav-main .container { display: flex; align-items: center; justify-content: space-between; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; }
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block; color: #fff; padding: 0.95rem 1.05rem;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em;
  text-transform: uppercase; transition: background 200ms ease; white-space: nowrap;
}
.nav-list > li > a:hover, .nav-list > li.open > a { background: rgba(255,255,255,0.1); color: var(--gold); }
.nav-list > li > a.current { box-shadow: inset 0 -3px 0 var(--gold); }

/* Dropdown */
.nav-list .dropdown {
  position: absolute; top: 100%;
  left: 0; min-width: 240px;
  background: #fff; border-top: 3px solid var(--red);
  box-shadow: var(--shadow-lg); list-style: none;
  padding: 0.4rem 0; opacity: 0; visibility: hidden;
  transform: translateY(6px); transition: all 180ms ease; z-index: 210;
}
.nav-list > li:hover .dropdown, .nav-list > li.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-list .dropdown li a {
  display: block; padding: 0.6rem 1.2rem; color: var(--navy);
  font-size: 0.85rem; font-weight: 500; transition: all 150ms ease;
}
.nav-list .dropdown li a:hover { background: var(--cream); color: var(--red); padding-left: 1.45rem; }

.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; padding: 0.7rem 0; }

/* ===== RTL (arabe) ===== */
html[dir="rtl"] body { font-family: 'Roboto', 'Tahoma', sans-serif; }
html[dir="rtl"] .header-top .container,
html[dir="rtl"] .nav-main .container { flex-direction: row-reverse; }
html[dir="rtl"] .header-brand { flex-direction: row-reverse; }
html[dir="rtl"] .nav-list .dropdown { left: auto; right: 0; }
html[dir="rtl"] .nav-list .dropdown li a:hover { padding-left: 1.2rem; padding-right: 1.45rem; }
html[dir="rtl"] .hero .inner { margin-right: 0; }

/* ===== HERO slider ===== */
.hero { position: relative; min-height: 72vh; display: flex; align-items: center; overflow: hidden; color: #fff; padding: 5rem 0; }
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slider .slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; animation: heroFade 18s infinite ease-in-out; animation-fill-mode: both;
}
.hero-slider .slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(10,31,54,0.85) 0%, rgba(14,42,71,0.55) 60%, rgba(193,39,45,0.30) 100%); }
.hero-slider .slide.s1 { background-image: url('../assets/photos/hassan-tower-rabat.webp'); animation-delay: 0s; }
.hero-slider .slide.s2 { background-image: url('../assets/photos/hassan2-mosque.webp'); animation-delay: -9s; }
@keyframes heroFade { 0%{opacity:1} 45%{opacity:1} 55%{opacity:0} 95%{opacity:0} 100%{opacity:1} }
@media (prefers-reduced-motion: reduce) { .hero-slider .slide{animation:none;opacity:1} .hero-slider .slide.s2{display:none} }
.hero .container { position: relative; z-index: 2; }
.hero .inner { max-width: 640px; }
.hero .eyebrow { display: inline-block; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: var(--space-md); font-weight: 700; }
.hero h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.5rem); margin-bottom: var(--space-md); }
.hero .lede { font-size: 1.05rem; opacity: 0.92; margin-bottom: var(--space-xl); }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.5rem; border-radius: var(--radius); font-weight: 700; font-size: 0.9rem; transition: all 200ms ease; border: 0; text-transform: uppercase; letter-spacing: 0.03em; }
.btn-primary { background: var(--gold); color: var(--navy-dark) !important; }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }

/* ===== Sections ===== */
section { padding: var(--space-3xl) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto var(--space-2xl); }
.eyebrow-s { color: var(--green); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; display: inline-block; margin-bottom: 0.5rem; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.section-head p { color: var(--text-soft); margin-top: 0.6rem; }

/* QUIERO */
.quiero { background: var(--cream); border-bottom: 1px solid var(--border); }
.quiero h2 { text-align: center; font-size: 1.7rem; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.02em; }
.quiero .underline { width: 60px; height: 3px; background: var(--gold); margin: 0 auto var(--space-2xl); }
.quiero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem 2rem; max-width: 860px; margin: 0 auto; }
.quiero-grid a { display: block; text-align: center; padding: 0.85rem 1rem; color: var(--navy); font-weight: 500; border-radius: var(--radius); transition: all 200ms ease; border: 1px solid transparent; }
.quiero-grid a:hover { background: #fff; border-color: var(--border); color: var(--red); box-shadow: var(--shadow-sm); }

/* Actualités Royales */
.royales { background: var(--navy); color: #fff; }
.royales .section-head h2 { color: #fff; }
.royales .eyebrow-s { color: var(--gold); }
.royales .section-head p { color: rgba(255,255,255,0.75); }
.royal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.royal-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); overflow: hidden; transition: all 200ms ease; }
.royal-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }
.royal-card .img { aspect-ratio: 16/9; background-size: cover; background-position: center; }
.royal-card .body { padding: var(--space-lg); }
.royal-card .date { font-size: 0.74rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.royal-card h3 { color: #fff; font-size: 1.02rem; margin: 0.4rem 0; }
.royal-card p { color: rgba(255,255,255,0.75); font-size: 0.88rem; }

/* Ambassadeur */
.amb-grid { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-3xl); align-items: center; }
.amb-photo { aspect-ratio: 3/4; background: linear-gradient(180deg, var(--navy), var(--navy-dark)); border-radius: var(--radius); position: relative; box-shadow: var(--shadow-lg); }
.amb-photo .ribbon { position: absolute; top: 0; left: 0; background: var(--gold); color: var(--navy-dark); padding: 0.35rem 0.9rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.amb-photo::after { content: 'FOTO OFICIAL'; position: absolute; bottom: 1rem; left: 1rem; color: rgba(255,255,255,0.4); font-size: 0.66rem; letter-spacing: 0.12em; }
.amb-text .title { color: var(--green); font-weight: 700; margin: 0.3rem 0 1.2rem; }
.amb-text blockquote { border-left: 3px solid var(--gold); padding-left: 1.1rem; font-style: italic; color: var(--text-soft); margin: 1.1rem 0; }
html[dir="rtl"] .amb-text blockquote { border-left: 0; border-right: 3px solid var(--gold); padding-left: 0; padding-right: 1.1rem; }
.signature { font-weight: 700; color: var(--navy); margin-top: var(--space-lg); }

/* Descubrir */
.regard { background: var(--cream); }
.regard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.regard-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; transition: all 200ms ease; }
.regard-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.regard-card .img { aspect-ratio: 4/3; background-size: cover; background-position: center; }
.regard-card .body { padding: var(--space-lg); }
.regard-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.regard-card p { color: var(--text-soft); font-size: 0.88rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
.stat { background: #fff; padding: 1.8rem 1.2rem; text-align: center; border-radius: var(--radius); border-bottom: 3px solid var(--red); box-shadow: var(--shadow-sm); }
.stat .num { font-size: 2.1rem; font-weight: 900; color: var(--navy); line-height: 1; }
.stat .lbl { font-size: 0.76rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.5rem; }

/* Contact */
.contact { background: var(--navy); color: #fff; }
.contact .container { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3xl); align-items: center; }
.contact h2 { color: #fff; }
.contact .intro { opacity: 0.85; margin: var(--space-md) 0 var(--space-lg); }
.contact-info { background: rgba(255,255,255,0.08); padding: var(--space-xl); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.12); }
.contact-info dl { display: grid; grid-template-columns: 110px 1fr; gap: 0.7rem 1rem; font-size: 0.95rem; }
.contact-info dt { color: var(--gold); font-weight: 700; }
.contact-info dd { opacity: 0.92; }

/* Page header (sous-pages) */
.page-header { background: var(--navy); color: #fff; padding: var(--space-2xl) 0; position: relative; }
.page-header::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: repeating-linear-gradient(135deg, var(--red) 0 14px, var(--green) 14px 28px, var(--gold) 28px 42px); }
.page-header h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-header .crumb { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.page-content { padding: var(--space-3xl) 0; max-width: 860px; margin: 0 auto; }
.page-content h2 { font-size: 1.4rem; margin: var(--space-xl) 0 var(--space-md); color: var(--navy); }
.page-content p { margin-bottom: var(--space-md); color: var(--text); }
.page-content ul { margin: 0 0 var(--space-md) 1.5rem; }
.page-content li { margin-bottom: 0.4rem; }
.placeholder-note { background: var(--cream-soft); border-left: 3px solid var(--gold); padding: var(--space-md); font-size: 0.9rem; color: var(--text-soft); margin: var(--space-md) 0; }

/* Footer */
footer.main { background: var(--navy-dark); color: #fff; padding: var(--space-3xl) 0 var(--space-lg); }
footer.main .grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--space-2xl); margin-bottom: var(--space-2xl); }
footer.main h4 { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--space-md); }
footer.main p, footer.main li { font-size: 0.86rem; opacity: 0.8; line-height: 1.7; }
footer.main ul { list-style: none; }
footer.main a { color: #fff; opacity: 0.8; }
footer.main a:hover { opacity: 1; color: var(--gold); }
.footer-brand { display: flex; gap: var(--space-md); align-items: center; margin-bottom: var(--space-md); }
.footer-brand img { width: 50px; }
.footer-brand strong { font-weight: 700; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-lg); display: flex; justify-content: space-between; font-size: 0.78rem; opacity: 0.6; flex-wrap: wrap; gap: var(--space-md); }

/* Responsive */
@media (max-width: 980px) {
  .nav-main .container { flex-wrap: wrap; }
  .nav-list { display: none; flex-direction: column; width: 100%; }
  .nav-list.open { display: flex; }
  .nav-list > li { width: 100%; }
  .nav-list .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border-top: 0; background: rgba(0,0,0,0.15); display: none; }
  .nav-list > li.open .dropdown { display: block; }
  .nav-list .dropdown li a { color: #fff; }
  .nav-list .dropdown li a:hover { background: rgba(255,255,255,0.1); color: var(--gold); }
  .menu-toggle { display: block; }
  .hero .inner, .amb-grid, .contact .container { grid-template-columns: 1fr; }
  .amb-grid { gap: var(--space-2xl); }
  .quiero-grid, .royal-grid, .regard-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  footer.main .grid { grid-template-columns: 1fr 1fr; }
  section { padding: var(--space-2xl) 0; }
}
@media (max-width: 560px) {
  .quiero-grid, .royal-grid, .regard-grid, .stats { grid-template-columns: 1fr; }
  footer.main .grid { grid-template-columns: 1fr; }
  .header-brand .ministry .dept { display: none; }
}
