@font-face {
    font-family: 'Raleway';
    src: url('/Raleway-VariableFont_wght.ttf') format('truetype');
}

/*Paleta de colores mejorada*/
:root
{
    /* Colores */
    --beish: #F1E9E5;
    --blue: #1A3858;
    --red: #DE3C36;
    --grey: #98A5B1;
    --light-red: #E1787E;
    --light-blue: #7494A4;
    
    /* Escala de grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Colores semánticos */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --border-color: var(--gray-200);
    --background-light: var(--gray-50);
    
    /* Sistema de espaciado basado en 8px */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    
    /* Espaciado específico para secciones */
    --section-padding: clamp(1.5rem, 4vw, 3rem);
    --article-gap: clamp(1rem, 3vw, 2rem);
    
    /* Escala tipográfica */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 4rem;      /* 64px */
    
    /* Pesos de fuente */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Altura de línea */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Sistema de sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Sistema de bordes */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Bordes */
    --border-width: 1px;
    --border-color: var(--gray-200);
}

/*FLEX ELEMENTS*/
body, header, main, article, section, figure, footer
{
    display: flex;
}
/*FLEX DIRECTION*/
body, main, section, figure, footer
{
    flex-direction: column;
}
header, article
{
    flex-direction: row;
}
/*FLEX CENTRED*/
body, header, main, article, figure, footer
{
    align-items: center;
    justify-content: center;
}
/*A SIN DECORACION POR DEFECTO*/
a
{
    text-decoration: none;
}
/*HOVER TRANSITION SCALE mejorado*/
header>svg, header>a>h1, main>a>article, .donations-button, .pay-button
{
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
header>svg:hover, header>a>h1:hover, .donations-button:hover, .pay-button:hover
{
    transform: scale(1.02);
    filter: brightness(1.1);
}
/* Focus states para accesibilidad */
header>a:focus, main>a:focus
{
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}
main>a>article:hover
{
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

h1
{
    color: var(--red);
    white-space: nowrap;
    overflow: hidden;
    font-size: clamp(var(--text-4xl), 8vw, var(--text-5xl));
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}
h2, h3, h4
{
    color: var(--blue);
}
h2
{
    text-align: center;
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-lg);
}
h3
{
    text-align: left;
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-lg);
}
h4
{
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-md);
}
body
{
    background-color: var(--beish);
    margin: 0;
    font-family: 'Raleway', sans-serif;
    color: var(--text-primary);
}

header  /*HEADER mejorado - integrado visualmente*/
{
    text-align: center;
    height: 15vh;
    width: 80%;
    padding: var(--section-padding);
    background-color: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

header>a /*H1 DEL HEADER*/
{
    flex: 5; 
}


header>svg /*LOGO DEL HEADER*/
{
    flex: 1;
    height: 100%;
    cursor: pointer;
    min-width: 75px;
    min-height: 75px;
}

header::before /*DIV CENTRALIZADOR*/
{
    content: "";
    flex: 1;
}

main
{
    width: clamp(75%, 85vw, 95%);
    min-height: 65vh;
    padding: var(--section-padding);
    /*gap: var(--article-gap);*/
}

main>a>article /*ARTICLE mejorado*/
{
    padding: var(--space-lg);
    gap: var(--space-md);
    margin-top: var(--article-gap);
    margin-bottom: var(--space-xl);
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: var(--border-width) solid var(--border-color);
}

main>a>article>section>p
{
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-md);
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

main>a>article>figure>figcaption, main>figure>figcaption
{
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-style: italic;
}

/*A ARTICLE TEXT SECTION*/
main>a>article>section
{
    margin-bottom: var(--space-lg);
}

main>a>article>*
{
    flex: 1;
}

main>a>article>figure/*home*/
{
    margin: 0;
    text-align: center;
}
main>figure /*Publicacion*/
{
    width: clamp(100px, 80vw, 400px);
}
/* NO centres figure si es el contenedor del scroll */
figure.tableFigure { 
  display: block;           /* deja de ser flex */
  justify-content: initial; /* por si acaso */
  align-items: initial;
}

ul, ol
{
	align-self: baseline; /* no centrado */
}

ul>li, ol>li
{
	margin: 20px;
}

/* Caja de scroll horizontal */
.tableFigure {
  inline-size: min(80vw, 100%);
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-inline: auto;      /* para centrar la caja en la página */
  min-inline-size: 0;       /* por si su padre es flex */
}
.tableFigure>figcaption
{
    margin: 20px;
    text-align: center;
}

/* La tabla usa su ancho intrínseco => fuerza el scroll desde la izquierda */
.tableFigure > table {
  width: 70vw;
}
main>a>article>figure>img, main>figure>img
{
    border-radius: var(--border-radius-md);
    border: var(--border-width) solid var(--border-color);
    width: 100%;
}

/*separadores mejorados*/
hr
{
    width: 95%;
    height: 2px;
    background-color: var(--light-blue);
    border: none;
    opacity: 0.8;
    margin: var(--space-md) 0;
}

footer
{
    width: 90%;
}
footer>p
{
    margin: 5px;
}

main>p
{
	width: 100%;
}

/*CLASSES*/
.invisible
{
    opacity: 0;
}
.visible
{
    opacity: 1;
}

.curtain /*CURTAIN*/
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--beish);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scrollbar-width: none;
}

.curtain>.loader
{
    width: 90%;
    animation: blink 2s ease-out infinite;
}

/*ANIMATIONS*/
@keyframes fadeIn
{
    to
    {
        opacity: 1;
    }
}

@keyframes fadeOut
{
    to
    {
      opacity: 0;
    }
}  

@keyframes blink
{
    0%
    {
        opacity: 0;
    }
    50%
    {
        opacity: 1;
    }
    100%
    {
        opacity: 0;
    }
}

.fade-in
{
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}  
.fade-out
{
    opacity: 1;
    animation: fadeOut 0.5s ease-out forwards;
}

.donations-button, .pay-button
{
    width: 12vw;
    height: 12vw;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background-color: transparent;
    min-width: 100px;
    min-height: 100px;
    max-width: 300px;
    max-height: 300px;
}
.donations-button
{
    position: fixed;
    bottom: 1vw;
    right: 1vw;
}

.donations-button>img, .pay-button>img
{
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pay-button
{
    flex-direction: column;
    flex: 1;
    margin-top: var(--space-3xl);
}
.pay-buttons
{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.right
{
    text-align: right;
    width: 100%;
}
.left
{
    text-align: left;
    width: 100%;
}

/*MOBILE RESPONSIVE mejorado*/
@media (max-width: 640px) {
    :root {
        --section-padding: 1rem;
        --article-gap: 0.75rem;
    }
    
    main>a>article {
        padding: var(--space-md);
    }
    
    header>a
    {
        flex: 4; /*un pleito menos*/
    }
    h1 {

        white-space: normal;
    }
}

@media (max-width: 480px)
{
    main
    {
        width: 90%;
    }
    header
    {
        width: 90%;
    }
    main>a>article
    {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    main>a>article>figure>img {
        width: 100%;
        max-width: 300px;
    }
}

/* Smartphones pequeños */
@media (max-width: 375px) {
    main, header
    {
        width: 95%;
    }
}
