/* estil-nou.css */

/* Estils Generals */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa; /* Un gris molt clar per al fons */
    color: #212529; /* Color de text principal fosc */
}

.container {
    max-width: 960px; /* Amplada màxima del contingut */
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

a {
    color: #007bff; /* Blau estàndard per enllaços */
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Per evitar espais extra sota la imatge */
}

/* Capçalera (Header) */
.site-header {
    background-color: #1c1e21; /* Color de fons si la imatge no carrega o és semitransparent */
    color: #ffffff;
    padding: 60px 0; /* Augmentem el padding per donar espai a la imatge de fons */
    text-align: center;
    border-bottom: 3px solid #007bff; /* Accent de color */

    /* --- PROPIETATS PER LA IMATGE DE FONS --- */
    background-image: url('imatge-capcalera.jpg'); /* !!! CANVIA AIXÒ PEL NOM DE LA TEVA IMATGE !!! */
    background-size: cover; /* Perquè la imatge cobreixi tot l'espai disponible sense deformar-se */
    background-position: center center; /* Centra la imatge */
    background-repeat: no-repeat; /* Evita que la imatge es repeteixi */
    position: relative; /* Necessari per al posicionament de l'overlay */
}

/* --- Overlay per a la imatge de fons --- */
.site-header::before {
    content: ""; /* Obligatori per als pseudo-elements */
    position: absolute; /* Per posicionar-lo sobre la imatge */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Negre semitransparent (0.5 és 50% d'opacitat) */
    z-index: 1; /* Per asegurar que l'overlay està entre el fons i el contingut */
}

/* Assegurem que el contingut de la capçalera estigui sobre l'overlay */
.site-header .container {
    position: relative; /* Perquè pugui tenir un z-index major */
    z-index: 2; /* Per sobre de l'overlay */
}

.site-branding h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
}

.site-branding h1 a, .site-branding h1 a:hover { /* Per si el títol és un enllaç */
    color: #ffffff;
    text-decoration: none;
}

.site-description {
    margin: 5px 0 0;
    font-size: 1em;
    color: #e9ecef; /* Un blanc una mica menys intens per a la descripció sobre fons fosc */
}

/* Navegació Principal */
.main-navigation {
    margin-top: 20px;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Per alinear horitzontalment en escriptori */
    justify-content: center; /* Centrar els ítems */
    flex-wrap: wrap; /* Permet que els ítems passin a la següent línia si no caben */
}

.main-navigation li {
    margin: 0 10px;
}

.main-navigation a {
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 500; /* Una mica més de pes per als enllaços del menú */
}

.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation a[aria-current="page"]:hover, /* Mantenir estil hover per a l'actual */
.main-navigation a[aria-current="page"]:focus {
    background-color: #007bff;
    text-decoration: none;
    color: #ffffff;
}

/* Estil per a la pàgina actual en el menú */
.main-navigation a.current-page, /* Per compatibilitat amb la classe antiga */
.main-navigation a[aria-current="page"] { /* Mètode modern i accessible */
    background-color: #0056b3; /* Un blau més fosc o el color d'accent */
    color: #ffffff; /* Assegurar el color del text */
    font-weight: bold;
}


/* Contingut Principal (Main) */
.site-main {
    padding-top: 30px;
    padding-bottom: 30px;
    background-color: #ffffff; /* Fons blanc per al contingut principal */
    margin-top: 20px; /* Separació de la capçalera */
    margin-bottom: 20px; /* Separació del peu de pàgina */
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.updates-section { /* Secció "Darreres Notícies" a index.html */
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6; /* Separador suau */
}

.updates-section h2, .updates-section h3 {
    color: #343a40;
}

.updates-section h2 {
    font-size: 1.5em; /* Mida una mica més gran per a DARRERA ACTUALITZACIÓ */
}

.updates-section h3 {
    font-size: 1.2em; /* Mida per a "Articles nous:" */
    margin-top: 1em;
}

.updates-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 0.5em;
}

.highlight-text {
    color: #dc3545; /* Vermell per al text destacat (com la data d'actualització) */
    font-weight: bold;
}

.page-content .entry-header h2 { /* Títol principal de la pàgina de contingut */
    font-size: 2em;
    margin-bottom: 10px; /* Reduït per apropar el subtítol/meta */
    color: #343a40;
    text-align: center;
}

/* Per a la informació de l'autor i font de l'article (biojoan.html, lesfeines.html, etc.) */
.article-meta,
.article-meta-source {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
    text-align: center;
}
.article-meta-source {
    margin-bottom: 25px; /* Més espai després de la font de l'article */
}

.entry-content p {
    margin-bottom: 1em;
    text-align: justify; /* Mantingut del codi original, si es desitja */
}

/* Per contenir els floats dins d'un element pare */
.entry-content {
    display: flow-root; /* Mètode modern per contenir floats */
}

/* Subtítols dins del contingut (H3) */
.entry-content h3,
.list-header { /* Aplicat a l'inventari de fonts */
    font-size: 1.5em;
    color: #343a40;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Estil per a H4 dins de .entry-content (com noms de carrers) */
.entry-content h4 {
    font-size: 1.3em; /* Mida entre h3 i text normal */
    color: #343a40;
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: 600; /* Semi-negreta */
}

/* Estils per a figures centrades (com a index.html) */
.aligncenter {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

.aligncenter img {
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #dee2e6;
    padding: 4px;
    border-radius: 4px;
}

.aligncenter figcaption {
    margin-top: 8px;
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}


/* Estils per a GRUPS d'imatges flotants (rourasaba.html) */
.floated-image-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.floated-image-group.align-right {
    float: right;
    width: 35%;
    margin-left: 20px;
}

.floated-image-group.align-left {
    float: left;
    width: 35%;
    margin-right: 20px;
}

.figure-in-group {
    margin: 0;
}

.figure-in-group img {
    border: 1px solid #dee2e6;
    padding: 4px;
    border-radius: 4px;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.figure-in-group figcaption {
    text-align: center;
    margin-top: 5px;
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

/* Estils per a figures flotants INDIVIDUALS (biojoan.html i altres) */
.figure-floated {
    margin-bottom: 15px;
}

.figure-floated.align-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 15px;
    max-width: 40%;
}

.figure-floated.align-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 15px;
    max-width: 40%;
}

.figure-floated img {
    border: 1px solid #dee2e6;
    padding: 4px;
    border-radius: 4px;
    background-color: #fff;
}

.figure-floated figcaption {
    text-align: center;
    margin-top: 5px;
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}


/* Llista d'enllaços (com a sotdelclos.html i índex intern d'articles) */
.link-list {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

.link-list li {
    margin-bottom: 10px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    transition: background-color 0.2s ease-in-out;
}
.link-list li:hover {
    background-color: #f0f0f0;
}

.link-list li a {
    text-decoration: none;
    font-weight: 500;
    display: block;
}

/* Estils per a la llista d'articles (articles.html) */
.article-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.article-item {
    padding: 15px 10px;
    border-bottom: 1px solid #e9ecef;
}

.article-item:first-child {
    border-top: 1px solid #e9ecef;
}

.article-item:hover {
    background-color: #f8f9fa;
}

.article-item a {
    font-weight: 500;
    color: #007bff;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.article-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.author-credit {
    font-size: 0.9em;
    color: #6c757d;
    display: block;
}

/* Estils per a la llista d'enllaços d'interès (links.html) */
.interest-links-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.interest-link-item {
    padding: 15px 10px;
    border-bottom: 1px solid #e9ecef;
}

.interest-link-item:first-child {
    border-top: 1px solid #e9ecef;
}

.interest-link-item:hover {
    background-color: #f8f9fa;
}

.interest-link-item a.link-url {
    font-weight: 500;
    color: #007bff;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    word-break: break-all;
}

.interest-link-item a.link-url:hover {
    color: #0056b3;
    text-decoration: underline;
}

.link-description {
    font-size: 0.9em;
    color: #6c757d;
    display: block;
}

/* Estils per a la Galeria de Fotos (fotos.html) */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.gallery-item {
    display: block;
    text-decoration: none;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item figure {
    margin: 0;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-item figcaption {
    padding: 8px;
    font-size: 0.85em;
    text-align: center;
    color: #333;
    background-color: #f9f9f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-subtitle {
    font-size: 1em;
    color: #6c757d;
    text-align: center;
    margin-bottom: 20px;
}

/* Notes al peu (biojoan.html, lesfeines.html, etc.) */
.note-ref {
    font-size: 0.8em;
    vertical-align: super;
    color: #007bff;
}
.note-ref:hover {
    color: #0056b3;
}

.content-separator-line {
    border: 0;
    height: 1px;
    background-color: #dee2e6;
    margin: 40px 0;
}

.notes-section {
    margin-top: 30px;
    padding-top: 20px;
    font-size: 0.9em;
    color: #495057;
}

.notes-section h3 { /* Estil heretat de .entry-content h3, però podem sobreescriure si cal */
    font-size: 1.2em; /* Més petit que els h3 de seccions principals */
    color: #343a40;
    margin-bottom: 10px;
    border-bottom: none; /* Traiem el separador si els h3 generals el tenen */
    padding-bottom: 0;
}

.notes-section ol {
    padding-left: 20px;
    line-height: 1.5;
}

.notes-section ol li {
    margin-bottom: 8px;
}

/* ESTILS PER A LES TABLES DE DADES DINS DE .entry-content */
.entry-content .data-table-container {
    margin-top: 1.5em;
    margin-bottom: 2em;
    overflow-x: auto; /* Permet scroll horitzontal si la taula és massa ampla */
}

.entry-content table {
    width: auto; /* Permet que la taula s'ajusti al contingut, però respectant el contenidor */
    min-width: 320px; /* Una amplada mínima per a la llegibilitat */
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse;
    border: 1px solid #bfbfbf;
    font-size: 0.95em;
}

.entry-content table caption {
    caption-side: top;
    font-weight: bold;
    padding: 10px 12px;
    color: #1a1a1a;
    text-align: center;
    font-size: 1.1em;
    background-color: #e0e0e0;
    border: 1px solid #bfbfbf;
    border-bottom: 2px solid #adadad;
}

.entry-content th,
.entry-content td {
    border: 1px solid #cccccc;
    padding: 9px 13px;
    text-align: left;
    vertical-align: middle;
    color: #222222;
}

.entry-content thead th {
    background-color: #e8e8e8;
    font-weight: 600;
    color: #111111;
    border-bottom-width: 2px;
    border-bottom-color: #adadad;
}

.entry-content tbody tr:nth-child(even) {
    background-color: #f7f7f7;
}
.entry-content tbody tr:hover {
    background-color: #e0e5e9;
}

.entry-content tfoot th,
.entry-content tfoot td {
    background-color: #e8e8e8;
    font-weight: bold;
    color: #111111;
    border-top-width: 2px;
    border-top-color: #adadad;
}

/* Classe específica per a valors numèrics a les taules */
.entry-content td.data-value {
    text-align: center; /* O right si són números per alinear pel decimal */
    font-family: Consolas, "Lucida Console", Monaco, monospace;
    font-size: 1em;
    color: #000000;
}

.entry-content td.data-value strong,
.entry-content tfoot td strong {
    font-weight: bold;
    color: #000000;
}
/* FI DELS ESTILS PER A LES TABLES DE DADES */


/* ESTILS PER A LA PÀGINA DE FOTOGRAFIA ÚNICA */
.page-content.photo-page .entry-header h2 {
    margin-bottom: 20px;
}

.photo-showcase { /* Aquest és el <figure> */
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center; /* Per centrar la imatge si té un max-width menor que el figure */
}

.photo-showcase img#main-photo, /* Aplica a la imatge amb ID 'main-photo' o genèricament a les img dins de photo-showcase */
.photo-showcase img {
    width: 100%; /* Intenta ocupar tot l'ample del seu contenidor pare (.photo-showcase) */
    max-width: 920px; /* Amplada màxima desitjada. (960px del .container - 2*15px padding - 2*5px padding de la imatge - 2*2px de la vora) */
                      /* Això farà que la imatge sigui gran però respecti els paddings del container i els seus propis. */
    height: auto;
    display: block;
    margin-left: auto; /* Centra la imatge si max-width és menor que l'ample disponible */
    margin-right: auto;
    
    /* Estils visuals */
    border: 2px solid #ced4da;
    padding: 5px; /* Aquest padding ja està considerat al max-width */
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    background-color: #ffffff;
}

.photo-showcase figcaption {
    margin-top: 12px;
    font-size: 0.95em;
    color: #495057;
    text-align: center;
    font-style: italic;
}
/* FI DELS ESTILS PER A LA PÀGINA DE FOTOGRAFIA ÚNICA */


/* ESTILS PER A LA LLISTA DE NOMS DE CASA (.noms-cases) i LLISTA DE FONTS (.list-fonts) */
.entry-content .noms-cases,
.entry-content .list-fonts { /* Aplica a la secció sencera o a la llista dl */
    margin-top: 20px;
}

.entry-content .noms-cases h4 { /* Títols de carrer */
    font-size: 1.2em;
    color: #495057;
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: 600;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}

.noms-cases dl,
.list-fonts dl, /* Si apliques .list-fonts al contenidor de la dl */
.list-fonts { /* Si apliques .list-fonts directament a la dl */
    margin-bottom: 15px;
}

.noms-cases dt,
.list-fonts dt {
    font-weight: bold;
    color: #212529;
    margin-top: 0.8em; /* Espai entre ítems */
}
.list-fonts dt { /* Específic per a noms de fonts, si vols destacar-los més */
    font-size: 1.1em;
    color: #0056b3; /* Un color diferent per al nom de la font */
}


.noms-cases dd,
.list-fonts dd {
    margin-left: 20px; /* Sagnia per a la descripció */
    margin-bottom: 0.3em;
    color: #495057;
    padding-left: 0;
}
/* FI DELS ESTILS PER A LLISTES */


/* ESTILS PER A LLISTES DE DEFINICIONS GENÈRIQUES DINS DE .entry-content (com list-secretaris) */
.entry-content dl.list-secretaris dt { /* Específic per a la llista de secretaris */
    font-weight: bold;
    color: #343a40;
    margin-top: 1em;
}

.entry-content dl.list-secretaris dd {
    margin-left: 0;
    margin-bottom: 0.5em;
    padding-left: 1.5em;
    border-left: 3px solid #007bff;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
}

.entry-content dl.list-secretaris dd:last-of-type {
    margin-bottom: 1em;
}
/* FI DELS ESTILS PER A LLISTES DE DEFINICIONS GENÈRIQUES */


/* Pàgina de Contacte (contactar.html) - Estils opcionals */
.contact-info-container {
    text-align: center;
    padding: 20px 0;
}

.contact-info-container p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.contact-email a {
    font-size: 1.3em;
    font-weight: bold;
    padding: 10px 20px;
    border: 1px solid #007bff;
    border-radius: 5px;
    display: inline-block;
    background-color: #f0f8ff;
}

.contact-email a:hover {
    background-color: #e6f2ff;
}

/* Classe per a text centrat (per al poema, etc.) */
.text-center {
    text-align: center;
}
.poem p {
    margin-bottom: 0.5em; /* Menys espai entre paràgrafs del poema */
    text-align: center; /* Assegurar que cada línia del poema estigui centrada */
}
.poem h4 { /* Títol del poema */
    font-style: italic;
    font-weight: normal;
    margin-bottom: 1em;
    border-bottom: none; /* No volem la línia dels h4 generals */
    padding-bottom: 0;
    text-align: center;
}

/* Classe per espaiat extra (com a sotdelclos.html) */
.extra-spacing-top {
    margin-top: 40px;
}

.signature {
    text-align: right;
    font-style: italic;
    margin-top: 30px;
    color: #495057;
}

.signature strong {
    font-weight: normal; 
    font-style: normal; 
}

/* Separador de contingut (com a rourasaba.html, * * *) */
.content-separator {
    text-align: center;
    color: #6c757d;
    margin: 40px 0;
    font-size: 1.2em;
    letter-spacing: 0.2em;
}

/* Peu de Pàgina (Footer) */
.site-footer {
    background-color: #343a40;
    color: #adb5bd;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9em;
}

.site-footer p {
    margin: 0;
}

/* Classe per ocultar visualment però mantenir per a lectors de pantalla */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Adaptacions per a pantalles (Responsive) */
@media (min-width: 768px) { /* Estils per a escriptori per a llistes d'articles */
    .article-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 5px;
    }

    .article-item a {
        margin-bottom: 0;
        margin-right: 15px;
        flex-grow: 1;
    }

    .author-credit {
        white-space: nowrap;
        display: inline;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) { /* Estils generals per a mòbils i tablets */
    .site-header {
        padding: 40px 0;
    }

    .site-branding h1 {
        font-size: 2em;
    }

    .main-navigation ul {
        flex-direction: column;
    }

    .main-navigation li {
        margin: 8px 0;
    }

    .main-navigation a {
        display: block;
        padding: 10px 15px;
    }

    .page-content .entry-header h2 {
        font-size: 1.8em;
    }

    .floated-image-group.align-right,
    .floated-image-group.align-left {
        float: none;
        width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .figure-floated.align-right,
    .figure-floated.align-left {
        float: none;
        margin-left: auto;
        margin-right: auto;
        max-width: 80%; /* Permet que les imatges flotants siguin més grans en mòbil si no hi ha text al costat */
    }

    .entry-content .data-table-container {
        /* El overflow-x: auto; ja gestiona les taules amples. */
    }
    .entry-content table {
        min-width: 280px; /* Reduïm el min-width per a pantalles més petites */
    }
    .entry-content td.data-value {
        font-size: 0.9em; /* Reduïm una mica la font dels números si cal */
    }

    .photo-showcase img#main-photo,
    .photo-showcase img {
        max-width: 95%; /* En pantalles més petites, que ocupi gairebé tot l'ample disponible dins del seu padding */
        padding: 3px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .gallery-item img {
        height: 120px;
    }
}

@media (max-width: 480px) { /* Estils per a mòbils molt petits */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    .site-main { /* Reduir padding lateral del contenidor principal del contingut */
        padding-left: 10px;
        padding-right: 10px;
    }


    .floated-image-group.align-right,
    .floated-image-group.align-left {
        width: 100%;
    }

    .figure-floated.align-right,
    .figure-floated.align-left {
        max-width: 100%;
    }

    .entry-content table caption {
        font-size: 1em;
    }
    .entry-content th,
    .entry-content td {
        padding: 6px 8px; /* Menys padding en pantalles petites */
        font-size: 0.85em; /* Font més petita per a les cel·les */
    }
    .entry-content td.data-value {
        font-size: 0.85em;
    }

    .photo-showcase img#main-photo,
    .photo-showcase img {
        padding: 2px;
        border-width: 1px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* O fins i tot 2 columnes fixes */
        /* grid-template-columns: repeat(2, 1fr); */
        gap: 8px;
    }
    .gallery-item img {
        height: 100px; /* O ajustar segons el nombre de columnes */
    }

    /* Ajust per a llistes de noms de casa en mòbils petits */
    .entry-content .noms-cases h4 {
        font-size: 1.1em;
    }
    .noms-cases dt, .list-fonts dt {
        margin-top: 0.3em;
    }
    .noms-cases dd, .list-fonts dd {
        margin-left: 15px; /* Menys sagnia */
        margin-bottom: 0.2em;
    }
}