/* ============================================================
   ROTARY CLUB — main.css
   Variables, reset, typographie, layout, utilitaires
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ── Variables CSS ── */
:root {
  /* Couleurs Rotary officiel */
  --rotary-blue:        #003F87;
  --rotary-blue-dark:   #002A5C;
  --rotary-blue-light:  #1A5CA8;
  --rotary-gold:        #F7A81B;
  --rotary-gold-dark:   #D4880D;
  --rotary-gold-light:  #FFC94D;

  /* Neutres */
  --color-dark:         #0F1923;
  --color-text:         #2C3E50;
  --color-muted:        #6B7A8D;
  --color-border:       #DDE3EC;
  --color-bg:           #F7F9FC;
  --color-white:        #FFFFFF;
  --color-surface:      #EEF2F8;

  /* Catégories */
  --color-action:       #1A7A4A;
  --color-action-bg:    #E8F5ED;
  --color-projet:       #7B3FA0;
  --color-projet-bg:    #F3EBF9;
  --color-divers:       #0077B6;
  --color-divers-bg:    #E6F3FA;

  /* Typographie */
  --font-heading:       'Playfair Display', Georgia, serif;
  --font-body:          'Source Sans 3', 'Helvetica Neue', sans-serif;

  /* Tailles de police */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;

  /* Espacements */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-5:    1.25rem;
  --space-6:    1.5rem;
  --space-8:    2rem;
  --space-10:   2.5rem;
  --space-12:   3rem;
  --space-16:   4rem;
  --space-20:   5rem;
  --space-24:   6rem;

  /* Layout */
  --max-width:        1200px;
  --nav-height:       72px;
  --radius-sm:        4px;
  --radius-md:        8px;
  --radius-lg:        16px;
  --radius-xl:        24px;
  --radius-full:      9999px;

  /* Ombres */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 8px rgba(0,63,135,0.08);
  --shadow-md:  0 4px 20px rgba(0,63,135,0.12);
  --shadow-lg:  0 8px 40px rgba(0,63,135,0.16);
  --shadow-xl:  0 16px 60px rgba(0,63,135,0.20);

  /* Transitions */
  --transition-fast:    0.15s ease;
  --transition-base:    0.25s ease;
  --transition-slow:    0.4s ease;

  /* Z-index */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
}

/* ── Reset & Normalize ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typographie de base ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-dark);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  max-width: 68ch;
}

a {
  color: var(--rotary-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--rotary-blue-light);
}

a:focus-visible {
  outline: 3px solid var(--rotary-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
}

.section {
  padding: var(--space-20) 0;
}

.section--sm {
  padding: var(--space-12) 0;
}

.section--lg {
  padding: var(--space-24) 0;
}

/* ── Grille ── */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

@media (max-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
}

/* ── Flexbox utils ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2       { gap: var(--space-2); }
.gap-4       { gap: var(--space-4); }
.gap-6       { gap: var(--space-6); }
.gap-8       { gap: var(--space-8); }

/* ── Utilitaires couleurs ── */
.text-blue  { color: var(--rotary-blue); }
.text-gold  { color: var(--rotary-gold); }
.text-muted { color: var(--color-muted); }
.text-white { color: var(--color-white); }
.text-dark  { color: var(--color-dark); }

.bg-blue    { background-color: var(--rotary-blue); }
.bg-gold    { background-color: var(--rotary-gold); }
.bg-surface { background-color: var(--color-surface); }
.bg-dark    { background-color: var(--color-dark); }

/* ── Utilitaires texte ── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.font-light   { font-weight: 300; }
.font-normal  { font-weight: 400; }
.font-semi    { font-weight: 600; }
.font-bold    { font-weight: 700; }

.uppercase    { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.1em; }

/* ── Utilitaires espacement ── */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

/* ── Visibilité ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ── Section header (titre de section) ── */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rotary-gold);
  margin-bottom: var(--space-3);
}

.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--rotary-gold);
  border-radius: 2px;
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--color-muted);
  margin-bottom: 0;
}

/* ── Divider ── */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--rotary-blue), var(--rotary-gold));
  border-radius: var(--radius-full);
  margin: var(--space-4) 0 var(--space-6);
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* ── Animation d'apparition ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
