/* ============================================================
   global.css – Mil anys Pau i Treva
   Variables CSS, reset, tipografies, utilitats globals
   ============================================================ */

/* --- Google Fonts: carregat via <link> als HTML per evitar el bloqueig de renderitzat --- */

/* ========================
   VARIABLES DE DISSENY
   ======================== */
:root {
  /* Paleta pergamí antic */
  --color-primary:       #3B2507;   /* Marró fosc, tinta antiga */
  --color-accent:        #8B4513;   /* Marró saó / siena */
  --color-accent-light:  #C4873A;   /* Or envellit */
  --color-bg:            #F5E6C8;   /* Crema pergamí base */
  --color-white:         #FDF6E3;   /* Blanc ivori */
  --color-text:          #2C1A06;   /* Text tinta fosca */
  --color-text-light:    #6B4F2A;   /* Text secundari */
  --color-border:        #C4A882;   /* Vora paper envellit */
  --color-surface:       #EED9A8;   /* Superfície cards */
  --color-overlay:       rgba(59, 37, 7, 0.75); /* Overlay fosc */
  --color-navbar-bg:     #3B2507;   /* Fons navbar: igual que el fons del logo */

  /* Tipografies */
  --font-serif:  'IM Fell English', 'Palatino Linotype', Georgia, serif;
  --font-sans:   'Cormorant Garamond', Garamond, 'Times New Roman', serif;

  /* Espaiats */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  3rem;
  --space-xl:  5rem;

  /* Contenidor */
  --container-max: 1200px;
  --container-pad: 1.5rem;

  /* Transicions */
  --transition: all 0.3s ease;

  /* Ombres */
  --shadow:    0 2px 12px rgba(59, 37, 7, 0.15);
  --shadow-lg: 0 8px 32px rgba(59, 37, 7, 0.22);

  /* Bordes */
  --border-radius: 2px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Escala tipogràfica (font-size tokens) */
  --fs-xs:   0.75rem;   /* 12px – etiquetes, micro-text */
  --fs-sm:   0.875rem;  /* 14px – text secundari */
  --fs-base: 1.05rem;   /* 17px – cos */
  --fs-md:   1.15rem;   /* 18px – lead, h4 */
  --fs-lg:   1.4rem;    /* h3 mòbil */
  --fs-xl:   1.8rem;    /* h3 desktop / h2 mòbil */
  --fs-2xl:  2.5rem;    /* h2 desktop */
  --fs-3xl:  3.5rem;    /* h1 desktop */

  /* Color hover viu per a botons */
  --color-hover-vivid: #E8A030;

  /* Textura de fons (referència per als components) */
  --bg-texture: none; /* s'aplica via parchment.css al body */
}

/* ========================
   RESET I BASE
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text);
  /* El fons de pergamí ve de parchment.css (aplicat a html).
     El body ha de ser transparent perquè es vegi. */
  background: transparent;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary);
}

ul, ol {
  list-style: none;
}

/* ========================
   TIPOGRAFIA
   ======================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--color-primary);
  line-height: 1.25;
  font-weight: 400;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
h4 { font-size: var(--fs-md); }
h5 { font-size: 1rem; font-family: var(--font-serif); color: var(--color-primary); line-height: 1.3; }
h6 { font-size: var(--fs-sm); font-family: var(--font-serif); color: var(--color-primary); line-height: 1.3; text-transform: uppercase; letter-spacing: 1px; }
small, .text-small { font-size: var(--fs-sm); }

p {
  margin-bottom: var(--space-sm);
}

.text-italic {
  font-style: italic;
}

.text-center { text-align: center; }
.text-muted   { color: var(--color-text-light); }

/* ========================
   CONTENIDOR
   ======================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ========================
   ORNAMENTS I SEPARADORS
   ======================== */
.ornament {
  text-align: center;
  color: var(--color-accent-light);
  font-size: 2rem;
  letter-spacing: 0.9rem;
  margin: var(--space-lg) 0;
  opacity: 0.85;
  user-select: none;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
  position: relative;
}

.divider::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg);
  padding: 0 var(--space-sm);
  color: var(--color-accent-light);
  font-size: 0.8rem;
}

/* ========================
   UTILITATS
   ======================== */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

/* ========================
   ENLLAÇOS LEGALS AL FOOTER
   (visibles a totes les pàgines, per això van a global)
   ======================== */
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.footer__legal a {
  font-size: 0.85rem;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
  :root {
    --space-lg: 2rem;
    --space-xl: 3rem;
  }
}
