/* ======================================================
   ESTIL GLOBAL: RAMON FOLCH I CAMARASA (CENTENARI)
   JERARQUIA DE CAPES: 1 (Fons) -> 5 (Vel) -> 10 (Text)
   ====================================================== */

:root {
  --header-height: 60px;
  --gold: #d4af37;
  --bg: #000;
  --text: #f4f4f4;
  --total-offset: 140px; 
}

/* RESET I CONFIGURACIÓ BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Merriweather", serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden; /* Evita scroll horitzontal en mòbil */
}

/* EL VEL VERMELLÓ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 550px; 
  background: linear-gradient(to bottom, rgba(139, 0, 0, 0.5) 0%, transparent 100%);
  z-index: 5; 
  pointer-events: none;
}

/* ESTRUCTURA DE PÀGINA */
.page {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  padding-bottom: 1rem !important; 
  flex: 1 0 auto;
  position: relative;
  z-index: 10;
}

.content {
  width: 100%;
  max-width: 850px; 
  margin: 0 auto;   
  padding: 2.5rem 1rem; 
}

/* SUBMENÚ ADAPTATIU */
.submenu {
  display: flex;
  flex-wrap: wrap; /* Permet que els enllaços baixin de línia en mòbil */
  gap: 0.8rem; 
  justify-content: center;
  padding: 0.8rem;
  background: transparent !important; 
  z-index: 10;
  width: 100%; 
  position: relative;
}

.submenu.fixed {
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important;
  width: 100% !important;
  background: rgba(0, 0, 0, 0.95) !important; 
  border-bottom: 2px solid var(--gold) !important;
  z-index: 9999 !important;
}

.submenu a {
  color: white; 
  text-decoration: none;
  padding: 0.5em 0.8em;
  border-radius: 0.4em;
  font-weight: 500;
  transition: background 0.3s;
  background: rgba(255, 255, 255, 0.1); /* Més visible en pantalles petites */
}

.submenu a.active, .submenu a:hover {
  background: var(--gold);
  color: #000;
}

/* TÍTOLS I TEXT */
h1 {
  color: var(--gold);
  text-align: center;
  font-size: clamp(1.8rem, 8vw, 2.5rem); /* Dinàmic segons pantalla */
  margin: 2rem 0; 
}

h2 {
  color: var(--gold);
  margin: 3rem 0 1.5rem; 
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.3em;
  font-size: clamp(1.4rem, 6vw, 2rem);
}

h3 {
  margin-top: 2rem;    
  margin-bottom: 1rem; 
  color: var(--text);  
  font-size: 1.3rem;
}

p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

ul, ol {
  padding-left: 1.2rem;
  margin-bottom: 2rem;
}

li {
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

a { 
  color: var(--gold); 
  text-decoration: none; 
}

a:hover {
  text-decoration: underline;
}

/* SECCIONS ESPECÍFIQUES */
.obra-section {
  scroll-margin-top: var(--total-offset) !important;
  margin-top: 2rem !important; 
  display: block;
  clear: both;
}

/* Contenidor per a la secció inèdita */
.inedita-container {
  text-align: left;
  margin-top: 2rem;
}

/* MEDIA QUERIES */
@media (max-width: 600px) {
  .submenu a {
    flex: 1 1 40%; /* Dos botons per fila en mòbil */
    text-align: center;
    font-size: 0.85rem;
  }
  h2 { margin-top: 2rem; }
}

@media (min-width: 769px) {
  .inedita-container {
    padding: 4rem 1rem; /* Padding gran només en escriptori */
  }
}

.site-footer {
  width: 100%;
  text-align: center;
  padding: 30px 20px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}