@font-face {
    font-family: 'Barlow-Regular';
    src: url('Barlow-Regular.woff') format('woff'),
         url('Barlow-Regular.ttf')  format('truetype');
}

@font-face {
    font-family: 'ITCAvantGardeStd-Bk';
    src: url('ITCAvantGardeStd-Bk.woff') format('woff'),
         url('ITCAvantGardeStd-Bk.otf')  format('opentype');
}

body {
    background-color: #FBFBFB;
    font-family: 'Barlow-Regular';
    font-size: 14pt;
    color: black;
}

.section h1,
.section h2 {
    font-size: 120%;
    color: #D52016;
}

.section h3 {
    font-size: 110%;
    color: black;
}

.icon {
    width: 1.5em;
}

header {
    position: relative;
    margin: 0;
    border: 0;
    padding: 0;
    background-image: url("imatge-portada-contacte-editada.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    height: calc(100vw * 0.4625);
}

/* --- Navigation --- */

header nav {
    position: absolute;
    right: 0;
    top: 0;
}

header ul {
    margin: 0;
    margin-top: 4em;
    margin-right: 2em;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    list-style-type: none;
}

header ul.lang-menu {
    margin-top: 1.5em;
}

header ul li {
    padding: 0.5em;
    border-radius: 5px;
    margin-right: 1em;
    font-weight: bold;
}

header a {
    text-decoration: none;
    color: black;
}

header .contact { background-color: #D52016; }
header .contact a { color: white; }


/* --- Hamburger --- */

.hamburger {
    display: none;
    position: absolute;
    right: 1em;
    top: 1em;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.5em;
    z-index: 200;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    border-radius: 2px;
    transition: background 0.2s;
}

/* --- Logo & motto --- */

header #logo {
    position: absolute;
    margin: 0;
    border: 0;
    padding: 0;
    top: 5vw;
    left: 10vw;
    width: 20vw;
}

header .moto {
    position: absolute;
    top: calc(5vw + min(400px, 20vw));
    left: 10vw;
    font-size: clamp(2rem, 5vw, 4rem);
}

header .moto .red {
    font-family: 'ITCAvantGardeStd-Bk';
    font-weight: bold;
    color: #D52016;
}

#decoration-header {
    position: absolute;
    margin: 0;
    border: 0;
    padding: 0;
    bottom: -13px;
    background-image: url("grafic-inici.svg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: -16px 0;
    width: 470px;
    height: 288px;
}

/* --- Footer --- */

footer {
    position: relative;
    margin: 0;
    border: 0;
    padding: 0;
    background-color: #D52016;
    background-image: url("imatge-portada-contacte-editada.jpg");
    background-size: cover;
    background-repeat: no-repeat;
}

footer #logo {
    margin: auto;
    border: 0;
    padding: 3em 5em 1em 5em;
    max-width: 200px;
    border-bottom: solid #D52016 2px;
}

footer .moto {
    margin-top: 10px;
    font-size: clamp(2rem, 5vw, 4rem);
    font-family: 'ITCAvantGardeStd-Bk';
}

footer .moto .red {
    font-weight: bold;
    color: #D52016;
}

footer .page-bottom {
    margin-top: 2em;
    padding: 2em;
    background-color: #D52016;
    color: white;
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* --- Layout --- */

main.container {
    margin: 0 5px;
    padding: 0;
}

.subtitle {
    margin-bottom: inherit;
}

.subtitle-line {
    border-top: solid #D52016 2px;
    margin-bottom: 2em;
    width: 2.5em;
}

/* misc */
.text-align-center { text-align: center; }
.text-align-right  { text-align: right; }
.text-align-left   { text-align: left; }

/* spacing */
.m-1  { margin: 1em; }
.mt-1 { margin-top: 1em; }
.mb-2 { margin-bottom: 2em; }
.mb-3 { margin-bottom: 3em; }
.mb-5 { margin-bottom: 5em; }
.p-1  { padding: 1em; }

.row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0;
    border: 0;
    padding: 0;
}

.col {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.row-vcenter { justify-content: center; }
.row-hcenter { align-items: center; }
.col-vcenter { align-items: center; }
.col-hcenter { justify-content: center; }

.row img {
    margin: auto;
    max-width: 90%;
    height: auto;
}

.section {
    margin: 5em 0 0 0;
    border: 0;
    padding: 0;
}

.card {
    position: relative;
    background-color: white;
    border-radius: 10px;
    box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
    font-size: 10pt;
}

.card h3 {
    color: #D52016;
}

.card p {
    margin-top: 0.5em;
}

.vflex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.col-3  { width: 25%; }
.col-4  { width: 32%; }
.col-5  { width: 41%; }
.col-6  { width: 50%; }
.col-12 { width: 100%; }

/* --- Mobile (< 500px) --- */
@media screen and (max-width: 499px) {
    .col-3  { width: 25%; }
    .col-4  { width: 32%; }
    .col-5  { width: 41%; }
    .col-6  { width: 50%; }
    .col-12 { width: 100%; }

    .hamburger { display: block; }

    .menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.97);
        padding: 4em 2em 2em 2em;
        z-index: 150;
        min-width: 220px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        overflow-y: auto;
        margin: 0;
        align-items: flex-start;
    }

    .menu.open {
        display: flex;
    }

    .menu li {
        margin: 0.5em 0;
    }
}

/* --- Tablet (500px – 1023px) --- */
@media screen and (min-width: 500px) and (max-width: 1023px) {
    main.container {
        margin: 0 5em;
    }

    .col-md-3  { width: 25% !important; }
    .col-md-4  { width: 32% !important; }
    .col-md-5  { width: 41% !important; }
    .col-md-6  { width: 50% !important; }
    .col-md-12 { width: 100% !important; }

    .text-align-md-center { text-align: center !important; }
    .text-align-md-right  { text-align: right !important; }
    .text-align-md-left   { text-align: left !important; }

    .hamburger { display: block; }

    .menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.97);
        padding: 4em 2em 2em 2em;
        z-index: 150;
        min-width: 220px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        overflow-y: auto;
        margin: 0;
        align-items: flex-start;
    }

    .menu.open {
        display: flex;
    }

    .menu li {
        margin: 0.5em 0;
    }
}

/* --- Desktop (≥ 1024px) --- */
@media screen and (min-width: 1024px) {
    main.container {
        margin: 0 5em;
    }

    .col-md-3  { width: 25% !important; }
    .col-md-4  { width: 32% !important; }
    .col-md-5  { width: 41% !important; }
    .col-md-6  { width: 50% !important; }
    .col-md-12 { width: 100% !important; }

    .col-lg-3  { width: 25% !important; }
    .col-lg-4  { width: 32% !important; }
    .col-lg-6  { width: 50% !important; }
    .col-lg-12 { width: 100% !important; }

    .text-align-md-center { text-align: center !important; }
    .text-align-md-right  { text-align: right !important; }
    .text-align-md-left   { text-align: left !important; }
}

/* --- Decorative elements --- */

.relative {
    position: relative;
}

#gnaltros1 {
    position: absolute;
    z-index: 10;
    height: 5em;
}

#gnaltros2 {
    position: absolute;
    margin: 17px;
    padding: 0;
    z-index: -1;
    bottom: -50%;
}

#gnaltros3 {
    position: absolute;
    margin-left: 17px;
    padding: 0;
    z-index: -1;
    bottom: 0;
}

#gsom {
    position: absolute;
    margin-left: -6.3em;
    padding: 0;
    z-index: -1;
    bottom: 0;
    left: 0;
    width: 40vw;
}

#gserveis1 {
    position: absolute;
    margin-left: -6.3em;
    padding: 0;
    z-index: -1;
    top: -3em;
    left: 0;
    width: 30vw;
}

#gserveis2 {
    position: absolute;
    margin-right: -6.3em;
    padding: 0;
    z-index: -1;
    bottom: 0;
    right: 0;
    width: 40vw;
}

/* --- Footer nav --- */

.page-bottom nav ul {
    list-style-type: none;
    color: white;
    padding-left: 0;
}

.page-bottom nav ul li a {
    color: white;
    text-decoration: none;
}

/* --- Breadcrumb --- */

.breadcrumb {
    margin: 2em 0 0;
    font-size: 0.85em;
    color: #888;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
}

.breadcrumb ol li + li::before {
    content: "›";
    margin-right: 0.3em;
    color: #bbb;
}

.breadcrumb a {
    color: #D52016;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* --- Article full page --- */

.article-full {
    max-width: 780px;
    margin: 2.5em auto 4em;
}

.article-header {
    margin-bottom: 2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5em;
    max-height: 7em;
}

.news-category-tag {
    display: inline-block;
    background-color: #D52016;
    color: white;
    font-size: 0.72em;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3em 0.9em;
    border-radius: 20px;
    margin-bottom: 0.8em;
}

.article-header h1 {
    font-size: 150%;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0.4em 0 0.6em;
}

.article-meta {
    font-size: 0.85em;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
}

.article-meta time {
    font-weight: bold;
}

.article-meta .article-author {
    color: #555;
}

.article-body {
    font-size: 11pt;
    line-height: 1.75;
    color: #333;
}

.article-body h2 {
    font-size: 115%;
    color: #D52016;
    margin: 2em 0 0.6em;
}

.article-body p {
    margin: 0 0 1.2em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.2em 1.5em;
    padding: 0;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body strong {
    color: #1a1a1a;
}

.article-cta {
    background: #f7f0ef;
    border-left: 4px solid #D52016;
    border-radius: 0 8px 8px 0;
    padding: 1.2em 1.5em;
    margin: 2em 0;
}

.article-cta p {
    margin: 0;
}

.article-footer {
    margin-top: 3em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}

.back-to-news {
    color: #D52016;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
}

.back-to-news:hover {
    text-decoration: underline;
}

/* Related articles */

.related-articles {
    max-width: 780px;
    margin: 0 auto 4em;
}

.related-articles > h2 {
    font-size: 115%;
    color: #D52016;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #D52016;
    display: inline-block;
}

.news-grid--small {
    grid-template-columns: repeat(3, 1fr);
}

@media screen and (max-width: 499px) {
    .article-full,
    .related-articles {
        margin-left: 0;
        margin-right: 0;
    }
    .news-grid--small {
        grid-template-columns: 1fr;
    }
}

@media screen and (min-width: 500px) and (max-width: 1023px) {
    .news-grid--small {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Active nav item --- */

header .active a {
    color: #D52016;
}

/* --- News page --- */

.news-hero {
    text-align: center;
    padding: 2em 1em 1em;
}

.news-hero h1 {
    font-size: 160%;
    color: #D52016;
    margin-bottom: 0.3em;
}

.news-hero-subtitle {
    font-size: 110%;
    color: #555;
    margin-top: 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    margin: 2em 0 4em;
}

.news-card {
    background: white;
    border-radius: 12px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.18);
}

.news-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2em 1em 1.5em;
    gap: 0.8em;
}

.news-card-header--red  { background-color: #D52016; }
.news-card-header--dark { background-color: #222; }

.news-card-icon {
    width: 3.5em;
    height: 3.5em;
    filter: brightness(0) invert(1);
    margin: 0;
}

.news-category {
    font-size: 0.7em;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3em 0.8em;
    border-radius: 20px;
}

.news-card-body {
    padding: 1.2em 1.4em 1.6em;
    display: flex;
    flex-direction: column;
    flex: 1;
    font-size: 10pt;
}

.news-date {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 0.5em;
    display: block;
}

.news-card-body h2 {
    font-size: 1em;
    color: #1a1a1a;
    margin: 0 0 0.7em;
    line-height: 1.4;
}

.news-card-body p {
    color: #444;
    line-height: 1.6;
    flex: 1;
    margin: 0 0 1.2em;
}

.news-btn {
    display: inline-block;
    color: #D52016;
    font-weight: bold;
    font-size: 0.85em;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    align-self: flex-start;
}

.news-btn:hover {
    border-bottom-color: #D52016;
}

.news-more {
    text-align: center;
    margin: 2rem 0 1rem;
}

.news-more-btn {
    display: inline-block;
    padding: .6rem 2rem;
    border: 2px solid #D52016;
    border-radius: 4px;
    color: #D52016;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s, color .2s;
}

.news-more-btn:hover {
    background: #D52016;
    color: #fff;
}

@media screen and (max-width: 499px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (min-width: 500px) and (max-width: 1023px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Cookie advisory --- */

.cookie-advisory {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #D52016;
    padding: 15px;
    text-align: center;
    border-top: solid black 1px;
    color: white;
    z-index: 300;
}

.cookie-advisory button {
    margin-left: 10px;
    padding: 5px 10px;
}
