/* ========================================
   VARIABLES I RESET - MODERN TECH
   ======================================== */

:root {
    /* Colors Modern Tech */
    --color-primary: #667eea;
    --color-primary-dark: #5568d3;
    --color-secondary: #543277;
    --color-text: #1a1a2e;
    --color-text-light: #4a4a4a;
    --color-background: #ffffff;
    --color-background-alt: #f5f7fa;
    --color-border: #e5e7eb;
    --color-card-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    
    /* Tipografia */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 18px;
    --line-height-base: 1.7;
    
    /* Espais */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.2rem;
    --spacing-md: 1rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Altres */
    --border-radius: 15px;
    --max-width: 1200px;
    --max-width-content: 850px;
    
    /* Ombres */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Reset bÃ sic */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: linear-gradient(74deg, #8271dd 0%, #a2faff 100%);
    min-height: 100vh;
    position: relative;
}

/* Pattern de fons - Estil llibreta (sense forats d'espiral) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* LÃ­nia vertical del marge esquerre (vermella) */
        linear-gradient(90deg, transparent 0, transparent 60px, rgba(239, 68, 68, 0.15) 60px, rgba(239, 68, 68, 0.15) 62px, transparent 62px),
        /* LÃ­nies horitzontals (com una llibreta) */
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 31px,
            rgba(59, 130, 246, 0.08) 31px,
            rgba(59, 130, 246, 0.08) 32px
        );
    background-size: 
        100% 100%,
        100% 100%;
    background-position: 
        0 0,
        0 0;
    z-index: 0;
    pointer-events: none;
}

/* Forma geomÃ¨trica decorativa */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   ELEMENTS BÃ€SICS
   ======================================== */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container general per centrar contingut */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* ========================================
   CAPÇALERA DEL LLOC
   ======================================== */

.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: none;
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

/* Header Top: Logo (left) + Idioma (right) */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.site-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.site-title a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title a:hover {
    opacity: 0.8;
}

/* Selector d'idioma */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-btn {
    color: var(--color-text);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-primary);
}

.lang-btn.active {
    background: var(--color-primary);
    color: white;
}

.lang-separator {
    color: var(--color-border);
}

/* Navegació - Bottom full width */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;  /* ← Canviat de var(--spacing-md) a 0.5rem */
    justify-content: center;
}

.main-nav a {
    color: var(--color-text);
    font-weight: 600;
    padding: 0.3rem 0.6rem;  /* ← Canviat directament aquí */
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 80%;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
    background-color: transparent;
}

/* ========================================
   CONTINGUT PRINCIPAL
   ======================================== */

.main-content {
    min-height: 60vh;
    padding: var(--spacing-xl) 0;
}

/* TÃ­tols */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

h1 { font-size: 2.5rem; }
h2 { 
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

/* LÃ­nia decorativa sota h2 */
h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

h3 { font-size: 1.5rem; }

/* ParÃ grafs */
p {
    margin-bottom: var(--spacing-sm);
    text-align: justify;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    background: transparent !important;
    padding: 4rem 0;
    margin-bottom: 3rem;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    color: white;
}

.hero-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    color: white;
}

.hero-subscribe {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-subscribe:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hero-subscribe h3 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: #1f2937;
    letter-spacing: -0.02em;
}

.hero-subscribe h3::after {
    display: none;
}

.hero-subscribe .subscribe-form input[type="email"] {
    padding: 0.875rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.hero-subscribe .subscribe-form input[type="email"]:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hero-subscribe .subscribe-form button {
    padding: 0.875rem 2rem;
    background: #1f2937;
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.hero-subscribe .subscribe-form button:hover {
    background: #111827;
    transform: translateY(-1px);
}

.hero-subscribe .form-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* ========================================
   ESTILS PER A NEWSLETTERS
   ======================================== */

/* SecciÃ³ de newsletters */
/* SecciÃ³ de newsletters */
.recent-newsletters {
    background: #fff;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 10;
}

/* ForÃ§ar opacitat total */
.recent-newsletters {
    background-color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
}

.recent-newsletters::before,
.recent-newsletters::after {
    content: none !important;
    display: none !important;
}

.recent-newsletters h2 {
    margin-bottom: 2rem;
}

/* Targeta de newsletter */
.newsletter-card {
    background: var(--color-card-bg);
    border: 4px solid #eb85ff;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: all 1s ease;
}

.newsletter-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.newsletter-card h2 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.5rem;
}

.newsletter-card h2::after {
    display: none;
}

.newsletter-meta {
    color: var(--color-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.newsletter-meta .separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.newsletter-meta .reading-time {
    font-weight: 500;
    opacity: 0.9;
}

.newsletter-excerpt {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.read-more {
    display: inline-block;
    font-weight: 700;
    color: var(--color-primary);
}

/* Newsletter individual */
.newsletter-content {
    max-width: var(--max-width-content);
    margin: 0 auto;
    background: #fff;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

/* ForÃ§ar opacitat total - CRÃTIC */
.newsletter-content,
.newsletter-content .container {
    background-color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
}

.newsletter-content::before,
.newsletter-content::after {
    content: none !important;
    display: none !important;
}

.newsletter-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
}

.newsletter-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.newsletter-body img {
    margin: var(--spacing-md) 0;
    border-radius: var(--border-radius);
}

/* Tipografia especÃ­fica dins del contingut de newsletters */
.newsletter-body h1 {
    font-size: 2.2rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.newsletter-body h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
}

.newsletter-body h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: var(--color-text);
}

.newsletter-body h4 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.newsletter-body h5,
.newsletter-body h6 {
    font-size: 1.05rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Eliminar la lÃ­nia decorativa dels h2 dins del body */
.newsletter-body h2::after {
    display: none;
}

/* Millor espaiat per parÃ grafs dins de newsletters */
.newsletter-body p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

/* Estils per llistes dins de newsletters */
.newsletter-body ul,
.newsletter-body ol {
    margin: 1rem 0 1.5rem 2rem;
    line-height: 1.8;
}

.newsletter-body li {
    margin-bottom: 0.6rem;
    text-align: justify;
}

/* Estils per cites dins de newsletters */
.newsletter-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--color-primary);
    background: var(--color-background-alt);
    font-style: italic;
    color: var(--color-text-light);
}

/* Estils per codi dins de newsletters */
.newsletter-body code {
    background: var(--color-background-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-primary);
}

.newsletter-body pre {
    background: var(--color-background-alt);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.newsletter-body pre code {
    background: none;
    padding: 0;
    color: var(--color-text);
}

/* ========================================
   PÃ€GINA SOBRE MI
   ======================================== */

.about-page {
    max-width: var(--max-width-content);
    margin: 0 auto;
    background: #fff;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

/* ForÃ§ar opacitat total */
.about-page {
    background-color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
}

.about-page::before,
.about-page::after {
    content: none !important;
    display: none !important;
}

.about-page h1 {
    margin-bottom: 2rem;
    color: var(--color-text);
}

.about-page h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.about-page ul {
    margin: var(--spacing-sm) 0 var(--spacing-md) 2rem;
}

.about-page li {
    margin-bottom: 0.8rem;
    line-height: 1.8;
    color: var(--color-text-light);
}

/* ========================================
   PEU DE PÃ€GINA
   ======================================== */

.site-footer {
    background: rgba(26, 26, 46, 0.95);
    border-top: none;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
    color: rgba(255,255,255,0.8);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.footer-section h3 {
    margin-bottom: var(--spacing-sm);
    color: white;
}

.footer-section h3::after {
    background: white;
}

/* Formulari de subscripciÃ³ */
.subscribe-form {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
    flex: 1;
    min-width: 250px;
    padding: var(--spacing-sm);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
}

.subscribe-form button {
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    color: var(--color-primary);
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.subscribe-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.form-note {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    opacity: 0.9;
}

.footer-info {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.footer-links a {
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: white;
}

/* ========================================
   RESPONSIVE (MÃ’BIL)
   ======================================== */

@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;
        --spacing-md: 1rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }
    
    /* Header en mòbil manté la mateixa estructura */
    .header-top {
        margin-bottom: 0.75rem;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .main-nav ul {
        gap: 0.3rem;  /* ← AIXÒ ÉS CRÍTIC - sobrescriu var(--spacing-md) */
        flex-wrap: wrap;
    }
    
    .main-nav a {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-text {
        font-size: 1.1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .footer-info {
        text-align: left;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .newsletter-content,
    .recent-newsletters {
        padding: var(--spacing-md);
    }
}
/* ========================================
   MILLORES D'ANIMACIONS I TRANSICIONS
   ======================================== */

/* Transicions mÃ©s suaus per enllaÃ§os */
a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* AnimaciÃ³ d'apariciÃ³ per targetes de newsletter */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.newsletter-card {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

/* Delays progressius per mÃºltiples targetes */
.newsletter-card:nth-child(1) { animation-delay: 0.1s; }
.newsletter-card:nth-child(2) { animation-delay: 0.2s; }
.newsletter-card:nth-child(3) { animation-delay: 0.3s; }
.newsletter-card:nth-child(4) { animation-delay: 0.4s; }
.newsletter-card:nth-child(5) { animation-delay: 0.5s; }

/* Millor transiciÃ³ per botons */
button, .subscribe-form button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active, .subscribe-form button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Focus visible per accessibilitat */
*:focus-visible {
    outline: 3px solid rgba(52, 211, 153, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Millor hover per read-more links */
.read-more {
    position: relative;
    transition: all 0.3s ease;
}

.read-more:hover {
    transform: translateX(5px);
}

/* Suavitzar scroll */
html {
    scroll-behavior: smooth;
}

/* TransiciÃ³ suau per imatges que carreguen */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Assegurar opacitat completa del contenidor de newsletter */
article.newsletter-content {
    background: rgb(255, 255, 255) !important;
    background-color: rgb(255, 255, 255) !important;
}

.newsletter-content .container {
    background: transparent;
}

/* ForÃ§ar fons blanc opac en TOTS els contenidors principals */
.newsletter-content,
article.newsletter-content,
.recent-newsletters,
.about-page {
    background: rgb(255, 255, 255) !important;
    background-color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}