/**
 * DIBA 2025 - FUENTES Y TIPOGRAFÍA
 * 
 * Basado en: maqueta.html de Seu Electrònica Diputació de Barcelona
 * Componente: Definición de fuentes, tamaños y estilos de texto
 * 
 * Fuentes principales: DiBa Screen (custom font), fallback: Arial, Helvetica, sans-serif
 * Aplicado a: Todo el sitio web
 */

/* ========================================
   CARGA DE FUENTES PERSONALIZADAS
   ======================================== */

/**
 * Fuentes DiBa Screen desde CDN oficial de Diputació de Barcelona
 * Fuente: https://media.diba.cat/diba/font/
 * 
 * Variantes disponibles:
 * - Regular (400): Texto normal
 * - SemiBold (600): Énfasis medio
 * - Bold (700-900): Títulos y texto destacado
 * 
 * Formatos incluidos para máxima compatibilidad:
 * - woff2: Navegadores modernos (Chrome, Firefox, Edge, Safari)
 * - woff: Navegadores antiguos
 * - ttf: Fallback universal
 * - otf: Máxima calidad tipográfica
 */

/* DiBa Screen Regular - Peso 400 (normal) */
@font-face {
    font-family: 'DiBa';
    font-display: swap;
    font-weight: 400;
    font-style: normal;
    src: url('https://media.diba.cat/diba/font/DiBaScreen-Regular.woff2') format('woff2'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Regular.woff') format('woff'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Regular.ttf') format('truetype'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Regular.otf') format('opentype');
}

/* DiBa Screen SemiBold - Peso 600 */
@font-face {
    font-family: 'DiBa';
    font-display: swap;
    font-weight: 600;
    font-style: normal;
    src: url('https://media.diba.cat/diba/font/DiBaScreen-SemiBold.woff2') format('woff2'),
         url('https://media.diba.cat/diba/font/DiBaScreen-SemiBold.woff') format('woff'),
         url('https://media.diba.cat/diba/font/DiBaScreen-SemiBold.ttf') format('truetype'),
         url('https://media.diba.cat/diba/font/DiBaScreen-SemiBold.otf') format('opentype');
}

/* DiBa Screen Bold - Peso 700-900 (bold) */
@font-face {
    font-family: 'DiBa';
    font-display: swap;
    font-weight: 700 900;
    font-style: normal;
    src: url('https://media.diba.cat/diba/font/DiBaScreen-Bold.woff2') format('woff2'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Bold.woff') format('woff'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Bold.ttf') format('truetype'),
         url('https://media.diba.cat/diba/font/DiBaScreen-Bold.otf') format('opentype');
}

/* ========================================
   FUENTES BASE
   ======================================== */

/* Font-family y font-size definidos en diba2025-00-base.css */

body {
    line-height: 1.5;
    color: #333;
}

/* ========================================
   TAMAÑOS DE TEXTO
   ======================================== */

/* Headings */
h1 {
    font-size: 2rem; /* 32px */
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

h2 {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #333;
}

h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

h4 {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

h5, h6 {
    font-size: 1rem; /* 16px */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #333;
}

/* ========================================
   PÁRRAFOS Y TEXTO
   ======================================== */

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

small {
    font-size: 0.875rem; /* 14px */
}

strong, b {
    font-weight: 700;
}

/* ========================================
   ENLACES
   ======================================== */

a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #9D2235;
    text-decoration: none;
}

/* Enlaces en contenido */
.journal-content-article a,
#contingut a {
    color: #0076ad;
    font-weight: 700;
}

/* COMENTADO: No afecta a elementos marco, puede interferir con formularios
.journal-content-article a:hover,
#contingut a:hover {
    color: #9D2235;
    text-decoration: underline;
}
*/

/* ========================================
   UTILIDADES DE TEXTO
   ======================================== */

.text-uppercase {
    text-transform: uppercase;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

body.diba .text-dark {
    color: #333;
}

body.diba .text-white {
    color: #fff;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    body {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.75rem; /* 28px */
    }
    
    h2 {
        font-size: 1.375rem; /* 22px */
    }
    
    h3 {
        font-size: 1.125rem; /* 18px */
    }
}
