/* Erasmus+ page (page 72 `/erasmus/`, and pages 8/9 which render the same
   pattern through templates/page-programos.html and page-programs.html).
   Every rule here is one of the inline `style="..."` attributes the old
   wp:html blob carried, lifted verbatim so the sections could become real
   core blocks. Two-class selectors are deliberate: the section groups set
   blockGap 0, and core's layout rule (`.wp-container-x > * {margin-block-
   start:0; margin-block-end:0}`) is a single class, so a one-class margin
   rule here would lose the tie. */

.erasmus-page { background: #FAF7F5; }

/* ---------- shared section title ---------- */
.erasmus-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: #381219;
    text-align: center;
}
.erasmus-projects > .erasmus-title   { margin: 0 0 3rem; }
.erasmus-preparation > .erasmus-title { margin: 0 0 4rem; }
.erasmus-gallery > .erasmus-title    { margin: 0 0 3.5rem; }
.erasmus-stories > .erasmus-title    { margin: 0 0 4rem; }

/* ---------- shared pill CTA (was <a class="btn" style="...">) ---------- */
.wp-block-buttons.erasmus-cta { display: flex; flex-wrap: wrap; justify-content: center; }
.erasmus-cta .wp-block-button__link {
    background: #23582D;
    color: #FFFFFF;
    border-radius: 999px;
    padding: 0.85rem 3.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(35, 88, 45, 0.25);
    transition: all 0.2s ease;
}
.erasmus-cta .wp-block-button__link:hover,
.erasmus-cta .wp-block-button__link:focus { background: #23582D; color: #FFFFFF; }
.erasmus-stories > .erasmus-cta--stories { margin-top: 3.5rem; }

/* ---------- projects ---------- */
.erasmus-projects > .erasmus-projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 0 0 3rem;
}
.erasmus-project { transition: transform 0.25s ease; }
.erasmus-project:hover { transform: translateY(-6px); }
.erasmus-project > .erasmus-project__media {
    border-radius: 24px;
    overflow: hidden;
    background: #EAE5DF;
    aspect-ratio: 16 / 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    margin: 0;
}
.erasmus-project__media a { display: block; width: 100%; height: 100%; }
.erasmus-project__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.erasmus-project > .erasmus-project__label {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1F2421;
    margin: 1.25rem 0 0;
}
.erasmus-project__label a { color: inherit; text-decoration: none; }

/* ---------- gallery ---------- */
.erasmus-gallery > .erasmus-album { margin: 0 0 3.5rem; }
.erasmus-album > .erasmus-album__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1F2421;
    margin: 0 0 1.25rem;
}
.erasmus-album > .erasmus-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 0;
}
.erasmus-gallery .erasmus-photo {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #EAE5DF;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.25s ease;
    margin: 0;
}
.erasmus-gallery .erasmus-photo:hover { transform: scale(1.02); }
.erasmus-gallery .erasmus-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.erasmus-gallery__save {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* ---------- gallery lightbox (the wp:html island) ---------- */
.erasmus-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.erasmus-lightbox__inner { position: relative; max-width: 90vw; max-height: 90vh; }
.erasmus-lightbox__img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.erasmus-lightbox__close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #FFFFFF;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ---------- stories ---------- */
.erasmus-stories > .erasmus-stories__list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
}
.erasmus-story {
    display: flex;
    align-items: flex-start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    flex-wrap: wrap;
}
.erasmus-story > .erasmus-story__avatar { margin: 0; flex-shrink: 0; }
.erasmus-story__avatar img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.erasmus-story > .erasmus-story__body { flex: 1; min-width: 280px; }
.erasmus-story__body > .erasmus-story__name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.6;
    color: #1F2421;
    margin: 0 0 0.75rem;
}
.erasmus-story__body > .erasmus-story__text {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1F2421;
    margin: 0;
}
.erasmus-stories__list > .erasmus-story__rule {
    border: none;
    border-top: 1px solid #1F2421;
    width: 100%;
    height: 0;
    opacity: 1;
    background: none;
    margin: 1.5rem 0;
}
