/* ============================================================
   Guilde des Lapidaires de France — front page
   Themeable via [data-theme] on <html>. Three directions:
   blason (héraldique noble) · atelier (épuré) · facette (géométrique)
   ============================================================ */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---------- design tokens (shared semantic names) ---------- */
:root {
  --azur:       #1F44EB;
  --azur-soft:  #2A6FDB;
  --outremer:   #1430B0;
  --navy:       #0A1430;
  --navy-2:     #0E1A3E;
  --cream:      #F7F5EC;
  --paper:      #F4F1E8;
  --gold:       #C9A24B;
  --ink:        #14161F;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);

  /* overridable by tweaks */
  --accent: var(--azur);
  --accent-ink: #ffffff;
}

/* ===================== THEME: BLASON ===================== */
[data-theme="blason"] {
  --bg:        #0A1430;
  --bg-2:      #0C1838;
  --surface:   rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --border:    rgba(201,162,75,0.28);
  --hairline:  rgba(247,245,236,0.14);
  --text:      #EFEAD9;
  --text-soft: rgba(239,234,217,0.66);
  --hero-bg:   radial-gradient(120% 90% at 78% 12%, #15235A 0%, #0A1430 58%);
  --font-display: "Lora", Georgia, serif;
  --font-body:    "Lora", Georgia, serif;
  --shadow: 0 30px 70px -30px rgba(0,0,0,0.7);
  --ornament: var(--gold);
}
[data-theme="blason"] .nav { border-bottom: 1px solid var(--hairline); }

/* ===================== THEME: ATELIER ===================== */
[data-theme="atelier"] {
  --bg:        #F4F1E8;
  --bg-2:      #ECE7D9;
  --surface:   #FCFBF6;
  --surface-2: #ffffff;
  --border:    rgba(20,22,31,0.12);
  --hairline:  rgba(20,22,31,0.12);
  --text:      #181B24;
  --text-soft: rgba(24,28,36,0.62);
  --hero-bg:   linear-gradient(180deg, #F7F4EC 0%, #F1EDE2 100%);
  --font-display: "Lora", Georgia, serif;
  --font-body:    "Lora", Georgia, serif;
  --shadow: 0 24px 50px -28px rgba(30,40,70,0.32);
  --ornament: var(--accent);
}

/* ===================== THEME: FACETTE ===================== */
[data-theme="facette"] {
  --bg:        #FBFAF6;
  --bg-2:      #F1EFE8;
  --surface:   #ffffff;
  --surface-2: #ffffff;
  --border:    rgba(10,20,48,0.14);
  --hairline:  rgba(10,20,48,0.12);
  --text:      #0A1430;
  --text-soft: rgba(10,20,48,0.6);
  --hero-bg:   var(--accent);
  --font-display: "Lora", Georgia, serif;
  --font-body:    "Lora", Georgia, serif;
  --shadow: 0 26px 56px -30px rgba(10,20,48,0.42);
  --ornament: var(--accent);
}

/* ---------- base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}

/* paper grain toggle */
[data-grain="on"] body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}
[data-theme="blason"][data-grain="on"] body::before { mix-blend-mode: screen; opacity: .04; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.04; letter-spacing: -0.01em; }
p { margin: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
[data-theme="atelier"] .eyebrow, [data-theme="facette"] .eyebrow { color: var(--text-soft); }

.section-label {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-body);
  font-size: .8rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent);
}
.section-label::before { content: ""; width: 30px; height: 1px; background: currentColor; opacity: .6; }

/* caps toggle */
[data-caps="on"] h1, [data-caps="on"] h2 { text-transform: uppercase; letter-spacing: .005em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 10px;
  padding: 14px 26px; border-radius: 2px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  letter-spacing: .02em; text-decoration: none;
  transition: transform .16s ease, background .2s ease, box-shadow .2s ease, color .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text); }
[data-theme="facette"] .hero .btn-ghost { color: var(--accent-ink); border-color: rgba(255,255,255,.5); }
[data-theme="facette"] .hero .btn-ghost:hover { border-color: #fff; }
[data-theme="facette"] .hero .btn-primary { background: #fff; color: var(--accent); }

/* radius per theme */
[data-theme="atelier"] .btn { border-radius: 999px; }
[data-theme="facette"] .btn { border-radius: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
}
.nav-inner { display: flex; align-items: center; gap: 28px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-right: auto; }
.brand img { width: 38px; height: auto; }
.brand .bname { font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; line-height: 1.05; letter-spacing: 0; }
.brand .bsub { display: block; font-family: var(--font-body); font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--text-soft); margin-top: 3px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; font-size: .92rem; color: var(--text-soft); transition: color .18s; position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: inline-flex; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); }
[data-theme="facette"] .hero { color: var(--accent-ink); }
.hero-inner {
  display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; padding-block: clamp(64px, 9vw, 120px);
}
[data-hero="center"] .hero-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; max-width: 920px; margin-inline: auto; }
[data-hero="center"] .hero-emblem { display: none; }
[data-hero="center"] .hero-cta { justify-content: center; }
[data-hero="center"] .hero-meta { justify-content: center; }

.hero h1 { font-size: clamp(2.7rem, 5.2vw, 5rem); margin-bottom: 22px; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--accent); }
[data-theme="facette"] h1, [data-theme="facette"] h2 { font-weight: 700; letter-spacing: -0.02em; }
[data-theme="facette"] .hero h1 em { color: #fff; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.hero .lead { font-size: clamp(1.12rem, 1.6vw, 1.42rem); line-height: 1.55; color: var(--text-soft); max-width: 36ch; }
[data-theme="facette"] .hero .lead, [data-theme="facette"] .hero .eyebrow { color: rgba(255,255,255,.82); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-meta { display: flex; gap: 26px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta .m { display: flex; flex-direction: column; gap: 2px; }
.hero-meta .mv { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; }
.hero-meta .ml { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); }
[data-theme="facette"] .hero-meta .ml { color: rgba(255,255,255,.7); }
.hero-meta .sep { width: 1px; background: var(--hairline); }

.hero-emblem { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-emblem img { width: min(340px, 80%); filter: drop-shadow(0 24px 50px rgba(0,0,0,.45)); }
[data-theme="atelier"] .hero-emblem img { filter: drop-shadow(0 20px 40px rgba(40,60,120,.22)); }
.hero-emblem .ring { position: absolute; inset: -6%; border: 1px solid var(--border); border-radius: 50%; opacity: .5; }
[data-theme="facette"] .hero-emblem .ring { display: none; }

/* facette decorative facets */
.facets { display: none; position: absolute; inset: 0; pointer-events: none; }
[data-theme="facette"] .facets { display: block; }
[data-theme="facette"] .facets span { position: absolute; background: rgba(255,255,255,.07); }
.facets .f1 { top: -10%; right: -4%; width: 46%; height: 130%; clip-path: polygon(40% 0, 100% 20%, 78% 100%, 0 70%); }
.facets .f2 { bottom: -20%; left: -6%; width: 30%; height: 90%; clip-path: polygon(0 30%, 70% 0, 100% 80%, 20% 100%); background: rgba(255,255,255,.05); }

/* mobile hero: keep emblem top-aligned with the title */
@media (max-width: 640px) {
  [data-hero="split"] .hero-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 18px;
    column-gap: 18px;
  }
  .hero-copy { grid-column: 1; }
  .hero-emblem { grid-column: 2; grid-row: 1; align-self: start; align-items: flex-start; }
  .hero-emblem img { width: clamp(64px, 20vw, 96px); }
  .hero h1 { margin-top: 0; font-size: clamp(2rem, 7.5vw, 2.7rem); }
  .hero .lead { font-size: 1.05rem; }
}

/* ---------- sections ---------- */
section { position: relative; }
.section-pad { padding-block: clamp(64px, 9vw, 120px); }
.bg-alt { background: var(--bg-2); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); margin-top: 18px; }
.section-head .sub { margin-top: 18px; font-size: 1.12rem; color: var(--text-soft); line-height: 1.6; }

/* divider ornament */
.ornament { display: flex; align-items: center; justify-content: center; gap: 18px; color: var(--ornament); margin: 0 auto; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: clamp(40px, 14vw, 130px); background: currentColor; opacity: .4; }
.ornament svg { width: 26px; height: 26px; opacity: .9; }

/* ---------- about / manifesto ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.about-lead p { font-size: clamp(1.18rem, 1.9vw, 1.5rem); font-family: var(--font-display); line-height: 1.5; }
[data-theme="atelier"] .about-lead p, [data-theme="facette"] .about-lead p { font-weight: 500; }
.about-lead p + p { margin-top: 1em; color: var(--text-soft); font-size: 1.06rem; font-family: var(--font-body); }
.about-photo { position: relative; }
.about-photo image-slot { width: 100%; aspect-ratio: 4/5; }
.about-photo .tag { position: absolute; left: 16px; bottom: 16px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding: 7px 12px; font-weight: 600; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* value pillars */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: clamp(48px, 6vw, 80px); background: var(--hairline); border: 1px solid var(--hairline); }
.pillar { background: var(--bg); padding: 30px 26px; }
.bg-alt .pillar { background: var(--bg-2); }
.pillar .n { font-family: var(--font-display); font-size: .9rem; color: var(--accent); letter-spacing: .1em; }
.pillar h3 { font-size: 1.3rem; margin: 14px 0 10px; }
.pillar p { font-size: .96rem; color: var(--text-soft); line-height: 1.55; }
@media (max-width: 880px) { .pillars { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- activities ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
[data-theme="atelier"] .card, [data-theme="facette"] .card { border-radius: 0; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.card .ic { width: 46px; height: 46px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--border); border-radius: 50%; }
[data-theme="facette"] .card .ic { border-radius: 0; }
.card .ic svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.3rem; }
.card p { color: var(--text-soft); font-size: .95rem; line-height: 1.5; }
@media (max-width: 980px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

/* ---------- events ---------- */
.events-band { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.events-card { border: 1px dashed var(--border); padding: clamp(32px, 4vw, 52px); background: var(--surface); text-align: center; }
[data-theme="facette"] .events-card { border-radius: 0; }
.events-card .badge { display: inline-block; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.events-card h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 14px; }
.events-card p { color: var(--text-soft); max-width: 42ch; margin: 0 auto 26px; }
@media (max-width: 820px) { .events-band { grid-template-columns: 1fr; } }

/* ---------- lieu / carte ---------- */
.lieu-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 4vw, 56px); align-items: stretch; }
.lieu-info { display: flex; flex-direction: column; gap: 26px; }
.lieu-row { display: flex; gap: 16px; align-items: flex-start; }
.lieu-row .ic { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--border); border-radius: 50%; }
[data-theme="facette"] .lieu-row .ic { border-radius: 0; }
.lieu-row .ic svg { width: 20px; height: 20px; }
.lieu-row h4 { margin: 0 0 4px; font-family: var(--font-body); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-soft); font-weight: 600; }
.lieu-row p { font-size: 1.1rem; }
.lieu-row a { color: var(--accent); text-decoration: none; }
.lieu-row a:hover { text-decoration: underline; }
.lieu-row .soc a { display: inline-flex; align-items: center; gap: 9px; }
.lieu-row .soc .soc-ic { width: 18px; height: 18px; flex: 0 0 auto; }
.map { position: relative; min-height: 340px; border: 1px solid var(--border); overflow: hidden; background: var(--bg-2); }
[data-theme="facette"] .map { border-radius: 0; }
.map svg.grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.map iframe { position: absolute; inset: 0; border: 0; }
.map .pin { position: absolute; top: 46%; left: 52%; transform: translate(-50%,-100%); color: var(--accent); filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.map .pin svg { width: 42px; height: 42px; }
.map .maplabel { position: absolute; left: 18px; bottom: 18px; background: var(--surface-2); border: 1px solid var(--border); padding: 10px 14px; font-size: .82rem; color: var(--text); }
.map .maplabel a { color: var(--accent); text-decoration: none; font-weight: 600; }
@media (max-width: 820px) { .lieu-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--hairline); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: clamp(48px, 6vw, 72px); }
.footer .brand img { width: 56px; }
.footer .brand { margin-bottom: 18px; }
.footer .fdesc { color: var(--text-soft); max-width: 34ch; font-size: .98rem; }
.footer h5 { font-family: var(--font-body); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-soft); margin: 0 0 16px; font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { text-decoration: none; color: var(--text); opacity: .8; font-size: .98rem; }
.footer ul a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 22px; border-top: 1px solid var(--hairline); font-size: .84rem; color: var(--text-soft); }
.footer-bottom .tag { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* image-slot theming */
image-slot { --is-bg: var(--surface); border: 1px solid var(--border); }
