/* ==================================================================
   LOULÉ 28 · style.css
   Desktop reference: 1728 px wide, 12 columns, 100 px margins, 20 px gutters.

   Layout system
   .grid        margin | 12 columns | margin, with named lines
   .full-bleed  edge to edge          .no-bleed  inside the margins
   .subgrid     the 12 columns of the parent .grid
   .span-N      N columns (desktop)
   .span-t-N    N columns on tablet (≤ 1100 px)
   .span-m-N    N columns on mobile (≤ 768 px, 4 columns); without it, an
                element takes the full width on mobile
   .hide-t / .hide-m   hide (e.g. empty .span-1 spacers) on tablet / mobile
   ================================================================== */

/* ------------------------------------------------------------------
   FONTS
------------------------------------------------------------------ */
@font-face { font-family: "Sul Sans"; src: url("../fonts/Sul_Sans_Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Sul Sans"; src: url("../fonts/Sul_Sans_Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sul Sans"; src: url("../fonts/Sul_Sans_Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Sul Sans"; src: url("../fonts/Sul_Sans_Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Sul Sans"; src: url("../fonts/Sul_Sans_Black.otf") format("opentype"); font-weight: 900; font-display: swap; }

/* ------------------------------------------------------------------
   VARIABLES (colours = Figma "Cores")
------------------------------------------------------------------ */
:root {
    --white: #FFFFFF;
    --white-off: #F4F2EE;
    --black: #231F20;
    --grey: #6B6567;
    --background: var(--white);

    --green: #80DE8F;
    --blue: #5C7DFA;
    --pink: #A12154;
    --red: #FF383C;
    --brown: #C9A875;
    --brightGreen: #CFFC5E;
    --orange: #EB4C33;

    --green-2: #E3F7E6;
    --blue-2: #E1E7FE;
    --pink-2: #FDEDEB;
    --red-2: #FCE3DE;
    --brown-2: #F3ECE1;
    --brightGreen-2: #F6FEDF;

    --placeholder: #969696;
    --placeholder-light: #D9D9D9;

    /* layout */
    --columns: 12;
    --gap20px: 20px;
    --gutter: var(--gap20px);
    --page-margin: clamp(20px, 5.79vw, 100px);          /* 100 px at 1728 */
    --margin: calc(var(--page-margin) - var(--gap20px)); /* margin column of .grid */
    --header-height: 58px;
    --section-gap: 100px;
    --padding: 100px;

    /* set by mosaic.js (defaults = 1728 px screen) */
    --cell-w: 24.69px;
    --cell-h: 81px;

    /* type */
    --font: "Sul Sans", system-ui, sans-serif;
    --font-serif: "skolar-latin", Georgia, serif;
    --fs-h1: clamp(44px, 5.21vw, 90px);
    --fs-h2: clamp(30px, 2.9vw, 50px);
    --fs-h3: clamp(22px, 1.74vw, 30px);
    --fs-highlight: clamp(18px, 1.27vw, 22px);
    --fs-body: 18px;
    --fs-display: clamp(44px, 5.56vw, 96px);
}

/* ------------------------------------------------------------------
   BASE
------------------------------------------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-wrap: pretty;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--background);
    color: var(--black);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

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

ul,
ol {
    list-style: none;
}

input {
    font: inherit;
    color: inherit;
}

button {
    font-family: var(--font);
    color: inherit;
    margin: 0;
    border: none;
    border-radius: 0;
    background: none;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: var(--page-margin);
    top: -100px;
    z-index: 2000;
    background: var(--black);
    color: var(--white);
    padding: 8px 15px;
}

.skip-link:focus {
    top: 10px;
}

/* ------------------------------------------------------------------
   GRID
------------------------------------------------------------------ */
.grid {
    display: grid;
    grid-template-columns:
        [full-start] var(--margin) [content-start] repeat(var(--columns), minmax(0, 1fr)) [content-end] var(--margin) [full-end];
    column-gap: var(--gap20px);
}

.no-bleed {
    grid-column: content-start / content-end;
}

.full-bleed {
    grid-column: full-start / full-end;
}

.subgrid {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: content-start / content-end;
}

.inner-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
    column-gap: var(--gap20px);
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; }
.span-12 { grid-column: span 12; }

/* ------------------------------------------------------------------
   TYPE (Figma text styles)
------------------------------------------------------------------ */
/* h1 · Sul Sans Regular 90 */
h1,
.h1 {
    font-family: var(--font);
    font-size: var(--fs-h1);
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.025em;
}

/* h2 · Sul Sans Bold 50 */
h2,
.h2 {
    font-family: var(--font);
    font-size: var(--fs-h2);
    font-weight: 700;
    line-height: normal;
    letter-spacing: -0.015em;
}

/* h3 · Sul Sans Bold 30 / 120% */
h3,
.h3 {
    font-family: var(--font);
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.005em;
}

/* body · Skolar Latin 18 */
p {
    font-family: var(--font-serif);
    font-size: var(--fs-body);
    font-weight: 400;
    line-height: normal;
}

/* body-highlight · Skolar Latin 22 / 140% */
.p-highlight {
    font-family: var(--font-serif);
    font-size: var(--fs-highlight);
    line-height: 1.4;
    letter-spacing: -0.002em;
}

/* body-highlight-sans · Sul Sans Regular 22 / 140% */
.p-highlight-sans {
    font-family: var(--font);
    font-size: var(--fs-highlight);
    line-height: 1.4;
    letter-spacing: -0.002em;
}

/* label · Sul Sans Regular 12, +12% */
.label {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.12em;
}

/* etiqueta (BidBook) · Sul Sans Medium 12, +16% */
.label-medium {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.16em;
}

/* button · Sul Sans Regular 14, +1% */
.p-button {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.01em;
}

/* ficha técnica (BidBook) · Sul Sans 13 / 140% */
.p-small {
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.4;
}

/* display (BidBook) · Sul Sans Light 96 — the "2034" */
.h1-light {
    font-family: var(--font);
    font-size: var(--fs-display);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.01em;
}

.uper {
    text-transform: uppercase;
}

.grey {
    color: var(--grey);
}

/* ------------------------------------------------------------------
   BACKGROUNDS
------------------------------------------------------------------ */
.background-black {
    background-color: var(--black) !important;
    color: var(--white);
}

.background-offwhite { background-color: var(--white-off) !important; }
.background-white { background-color: var(--white) !important; }
.background-blue { background-color: var(--blue) !important; }
.background-pink { background-color: var(--pink) !important; }
.background-green { background-color: var(--green) !important; }
.background-brightGreen { background-color: var(--brightGreen) !important; }
.background-red { background-color: var(--red) !important; }
.background-brown { background-color: var(--brown) !important; }
.background-orange { background-color: var(--orange) !important; }

.background-blue-2 { background-color: var(--blue-2) !important; }
.background-pink-2 { background-color: var(--pink-2) !important; }
.background-green-2 { background-color: var(--green-2) !important; }
.background-brightGreen-2 { background-color: var(--brightGreen-2) !important; }
.background-red-2 { background-color: var(--red-2) !important; }
.background-brown-2 { background-color: var(--brown-2) !important; }

.placeholder {
    position: relative;
    background-color: var(--placeholder);
}

.placeholder-light {
    background-color: var(--placeholder-light);
}

.placeholder[data-label]::after {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    bottom: 10px;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

/* provisional photos (assets/data/placeholder/ph-XX.jpg) filling an image box */
.ph-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ------------------------------------------------------------------
   BUTTONS
------------------------------------------------------------------ */
.button-black,
.button-white,
.button-stroke-black,
.button-stroke-white {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 15px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.button-black:hover,
.button-white:hover,
.button-stroke-black:hover,
.button-stroke-white:hover {
    opacity: 0.5;
}

.button-black { background-color: var(--black); color: var(--white); }
.button-white { background-color: var(--white); color: var(--black); }
.button-stroke-black { background-color: transparent; border-color: var(--black); color: var(--black); }
.button-stroke-white { background-color: transparent; border-color: var(--white); color: var(--white); }

.button-large { padding: 16px 24px; }
.button-icon { border-width: 1.5px; }
.button-icon img { width: 24px; height: 24px; }

/* ------------------------------------------------------------------
   FLEX UTILITIES
------------------------------------------------------------------ */
.flex-gap-0 { display: flex; flex-direction: row; }
.flex-row-5 { display: flex; flex-direction: row; gap: 5px; }
.flex-row-10 { display: flex; flex-direction: row; gap: 10px; }
.flex-row-20 { display: flex; flex-direction: row; gap: 20px; }
.flex-row-40 { display: flex; flex-direction: row; gap: 40px; }
.flex-col-5 { display: flex; flex-direction: column; gap: 5px; }
.flex-col-10 { display: flex; flex-direction: column; gap: 10px; }
.flex-col-20 { display: flex; flex-direction: column; gap: 20px; }
.flex-col-40 { display: flex; flex-direction: column; gap: 40px; }

.flex-bottom-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.vertical-center {
    display: flex;
    align-items: center;
}

.padding-100 {
    padding: var(--padding) 0;
}

.main-flex {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
}

/* vertical rule on the left of a block */
.line-side {
    padding-left: var(--gap20px);
    border-left: 1px solid var(--black);
}

/* section label: small bar + label */
.label-chapter {
    align-items: center;
}

.chapter-rect {
    flex: none;
    width: 4px;
    height: 16px;
    background-color: var(--black);
}

.background-black .chapter-rect {
    background-color: var(--white);
}

.chapter-title {
    padding-top: 20px;
    margin-bottom: 40px;
}

.section-button {
    margin-top: 40px;
}

/* ------------------------------------------------------------------
   MOSAIC (pattern built by mosaic.js)
------------------------------------------------------------------ */
.mosaic {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.mosaic-bar {
    position: absolute;
    transform-origin: top;
}

.mosaic-rise .mosaic-bar {
    transform-origin: bottom;
}

/* a mosaic in the flow: its height is set in whole cells by JS */
.mosaic-band {
    position: relative;
    inset: auto;
    width: 100%;
    height: var(--cell-h);
}

@media (prefers-reduced-motion: no-preference) {
    .mosaic .mosaic-bar {
        transform: scaleY(0);
        transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
        transition-delay: calc(var(--i, 0) * 12ms);
    }

    .mosaic.is-in .mosaic-bar {
        transform: scaleY(1);
    }

    /* reset off screen, or rebuilt after a resize: no transition */
    .mosaic.is-static .mosaic-bar {
        transition: none;
    }
}

/* ------------------------------------------------------------------
   HEADER
------------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white);
    grid-template-rows: 5px 53px;
}

.color-header {
    display: flex;
    flex-direction: row;
    height: 5px;
}

.color-header > * {
    flex: 1;
    height: 100%;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
}

#logo-header {
    width: 118px;
    height: auto;
}

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-menu a {
    padding-block: 6px;
    background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
    transition: background-size 0.3s ease;
}

.header-menu a:hover,
.header-menu a[aria-current="true"] {
    background-size: 100% 1px;
}

.header-others {
    align-items: center;
}

.header-lang a:not([aria-current]) {
    opacity: 0.45;
}

.header-social a,
.footer-social a {
    display: block;
    transition: opacity 0.3s ease;
}

.header-social a:hover,
.footer-social a:hover {
    opacity: 0.5;
}

.header-social img,
.footer-social img {
    width: 24px;
    height: 24px;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 36px;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
    display: block;
    width: 22px;
    height: 2px;
    margin-inline: auto;
    background: var(--black);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle-lines {
    position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-toggle-lines::before { top: -7px; }
.menu-toggle-lines::after { top: 7px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-lines { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::after { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------------------------------------------
   HERO
------------------------------------------------------------------ */
.hero-landing {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: max(560px, calc(100svh - var(--header-height)));
    background-color: var(--black);
    color: var(--white);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-background img,
.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-background-top {
    position: absolute;
    inset: 0;
    /* 18% shade + a soft gradient so the title stays readable */
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 55%),
        rgba(0, 0, 0, 0.18);
}

.hero-text {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 120px 0 64px;
}

.hero-text h1 {
    max-width: 11em;
}

.hero-text .flex-col-20 {
    gap: 30px;
}

.hero-more {
    padding-bottom: 8px;
}

/* ------------------------------------------------------------------
   CONCEITO
------------------------------------------------------------------ */
.concept-text {
    padding-top: 20px;
    gap: 32px;
}

.subgrid-img img {
    width: 100%;
    height: auto;
}

/* ------------------------------------------------------------------
   CAPITAL PORTUGUESA + CALENDÁRIO
------------------------------------------------------------------ */
.cpc-section {
    padding-bottom: 0;
}

.calendar-item {
    align-items: center;
    padding: 16px 0;
}

.calendar-item + .calendar-item {
    border-top: 1px solid var(--black);
}

.calendar-bullet {
    flex: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--black);
    border-radius: 100%;
}

.calendar-bullet.active {
    background-color: var(--black);
}

.cpc-bars {
    margin-top: 64px;
}

/* ------------------------------------------------------------------
   EMBAIXADORES
------------------------------------------------------------------ */
.vertical-image {
    position: relative;
    aspect-ratio: 5 / 6;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.vertical-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ambassador-item {
    padding-left: 24px;
    gap: 15px;
}

.ambassador-item .vertical-image {
    aspect-ratio: 471 / 593;
    background-color: var(--white-off);
}

/* ------------------------------------------------------------------
   DIREÇÃO ARTÍSTICA + PROGRAMA
------------------------------------------------------------------ */
.program-block {
    display: flex;
    flex-direction: column;
}

.direction-section {
    position: relative;
    padding-bottom: max(var(--padding), calc(var(--cell-h) + 32px));
}

.direction-bars.mosaic-band {
    position: absolute;
    left: 0;
    bottom: 0;
}

.program-text {
    padding-top: 20px;
    gap: 24px;
}

.program-axes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.program-axis {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: var(--white);
}

.program-axis span {
    flex: none;
    width: 8px;
    height: 31px;
    transition: width 0.3s ease;
}

.program-axis:hover span {
    width: 16px;
}

/* ------------------------------------------------------------------
   CASAS
------------------------------------------------------------------ */
.casa {
    display: grid;
    grid-template-columns: 5fr 7fr;
}

/* the left panel is a whole number of mosaic columns (5/12 of them),
   so the pattern runs right up to the vertical divider */
@supports (width: calc(round(nearest, 7.5, 1) * 1px)) {
    .casa {
        grid-template-columns: calc(round(nearest, var(--grid-cols, 70) * 5 / 12, 1) * var(--cell-w)) minmax(0, 1fr);
    }
}

.casa-intro {
    position: relative;
    padding: 100px 100px 100px var(--page-margin);
    min-height: 100%;
}

.casa-intro-text {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.casa-kicker {
    margin-bottom: -20px;
}

.casa-projects {
    display: flex;
    flex-direction: column;
    gap: 100px;
    padding: 100px var(--page-margin) 100px clamp(24px, 6vw, 104px);
}

.project-media {
    position: relative;
}

.project-main .project-media {
    aspect-ratio: 803 / 356;
}

.project-main .project-body {
    padding-top: 20px;
}

.project-body > p:not(.p-highlight):not(.p-small) {
    margin-top: 10px;
}

.project-side {
    display: grid;
    grid-template-columns: minmax(0, 364fr) minmax(0, 439fr);
    align-items: start;
}

.project-side .project-media {
    aspect-ratio: 364 / 428;
}

.project-side .project-body {
    padding-left: 20px;
}

/* stamps (assets/data/stamps): projeto âncora in the colour of its casa,
   projeto grua always black */
.stamp {
    position: absolute;
    z-index: 1;
    top: 8px;
    width: clamp(72px, 6vw, 104px);
    height: auto;
}

.stamp-right { right: 8px; }
.stamp-left { left: 8px; }

.casa-authors {
    padding-top: 16px;
    border-top: 1px solid var(--black);
}

/* ------------------------------------------------------------------
   GALERIA
------------------------------------------------------------------ */
.gallery {
    row-gap: 20px;
}

.gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    background-color: var(--placeholder-light);
    cursor: zoom-in;
    overflow: hidden;
}

.gallery-open img {
    width: 100%;
    height: min(35.2vw, 680px);
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.3s ease;
}

.gallery-open:hover img {
    transform: scale(1.02);
    opacity: 0.9;
}

.gallery-item figcaption {
    font-family: var(--font-serif);
    font-size: var(--fs-body);
}

/* ------------------------------------------------------------------
   DEPOIS DE 2028
------------------------------------------------------------------ */
.after-section {
    position: relative;
    min-height: calc(var(--padding) * 2 + 365px);
}

.after-text {
    position: relative;
    z-index: 1;
    padding-top: 20px;
    padding-left: 24px;
}

.after-logo {
    width: 107px;
    height: 46px;
}

.after-bars {
    inset: auto auto 0 0;
    width: 44%;
}

/* ------------------------------------------------------------------
   REDES SOCIAIS
------------------------------------------------------------------ */
.social-head {
    align-items: end;
    margin-bottom: 40px;
}

.social-head .chapter-title {
    margin-bottom: 0;
}

.social-buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feed {
    row-gap: 20px;
}

.feed-item {
    position: relative;
    aspect-ratio: 1;
}

.feed-source {
    position: absolute;
    z-index: 1;
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 2px;
    background-color: var(--white);
    font-family: var(--font);
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ------------------------------------------------------------------
   PARTICIPAR
------------------------------------------------------------------ */
.join-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 80px;
}

.join-count .h1 {
    line-height: 1.1;
}

.join-field input {
    width: 100%;
    padding: 8px 0;
    border: 0;
    border-bottom: 1.5px solid var(--black);
    border-radius: 0;
    background: transparent;
    font-family: var(--font);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    outline: none;
}

.join-field input::placeholder {
    color: var(--grey);
    opacity: 1;
}

.join-field input:focus {
    border-bottom-width: 3px;
    padding-bottom: 6.5px;
}

.join-field input[aria-invalid="true"] {
    border-color: var(--red);
}

.join-check {
    cursor: pointer;
}

.join-check input {
    appearance: none;
    flex: none;
    display: grid;
    place-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--black);
    background: transparent;
    cursor: pointer;
}

.join-check input::before {
    content: "";
    width: 10px;
    height: 10px;
    background-color: var(--black);
    transform: scale(0);
    transition: transform 0.15s ease;
}

.join-check input:checked::before {
    transform: scale(1);
}

.join-check a {
    text-decoration: underline;
}

/* honeypot: off screen, never shown to people */
.join-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.join-captcha {
    min-height: 65px;
}

.join-form button[disabled] {
    opacity: .5;
    cursor: wait;
}

.join-status:empty {
    display: none;
}

/* ------------------------------------------------------------------
   NOTÍCIAS (home list + noticias.html)
------------------------------------------------------------------ */
.news-list li {
    border-top: 1px solid var(--black);
}

.news-list li:last-child {
    border-bottom: 1px solid var(--black);
}

.news-item {
    display: grid;
    grid-template-columns: calc((100% - 11 * var(--gap20px)) / 12 * 2 + var(--gap20px)) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--gap20px);
    padding-block: 20px;
}

.news-arrow {
    transition: transform 0.3s ease;
}

.news-item:hover .news-arrow {
    transform: translateX(-8px);
}

.news-item:hover .p-highlight-sans:not(.news-arrow) {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

/* full list: date | title | source | arrow */
.news-full .news-item {
    grid-template-columns: calc((100% - 11 * var(--gap20px)) / 12 * 2 + var(--gap20px)) minmax(0, 1fr) auto auto;
}

.news-source {
    text-align: right;
}

.news-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.news-filter-btn[aria-pressed="true"] {
    background-color: var(--black);
    color: var(--white);
}

.news-filter-count {
    margin-left: auto;
}

.news-empty {
    padding-block: 20px;
    border-top: 1px solid var(--black);
}

[hidden] {
    display: none !important;
}

/* sub-pages: the title sits close to the content */
.main-flex.page {
    gap: 40px;
}

.page-head {
    padding-top: 80px;
}

.page-back {
    width: fit-content;
    transition: opacity 0.3s ease;
}

.page-back:hover {
    opacity: 0.6;
}

.news-page {
    margin-bottom: 40px;
}

/* ------------------------------------------------------------------
   MAPA — white + light blue map, orange numbered points
------------------------------------------------------------------ */
.map-section {
    --map-blue: #7F95F8;      /* town names */
}

.map-stage {
    position: relative;
    height: clamp(640px, 56vw, 960px);
    background-color: var(--blue-2);
    overflow: hidden;
}

.map-canvas {
    position: absolute;
    inset: 0;
}

/* list of places, over the left side of the map */
.map-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-panel {
    align-self: start;
    max-height: calc(100% - 80px);
    margin-top: 40px;
    padding: 20px 24px 20px 20px;
    background-color: rgba(255, 255, 255, 0.94);
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
}

.map-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-list-btn {
    display: grid;
    grid-template-columns: 22px 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 6px 0;
    text-align: left;
}

.map-list-name,
.map-list-also {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.3;
}

.map-list-btn:hover .map-list-name,
.map-list-btn.is-hover .map-list-name,
.map-list-btn[aria-pressed="true"] .map-list-name {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.map-list-sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 2px 0 4px;
}

.map-list-also {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 6px 0 6px 34px;
}

.map-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--black);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-num,
.map-point {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--orange);
    color: var(--white);
    font-family: var(--font);
    font-weight: 700;
    line-height: 1;
}

.map-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

/* points on the map */
.map-point {
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 12px;
    /* never transition "transform": MapLibre uses it to place the point */
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.map-point:hover,
.map-point.is-hover,
.map-point.is-active {
    box-shadow: 0 0 0 6px rgba(235, 76, 51, 0.25);
    z-index: 2;
}

.map-point.is-active {
    background-color: var(--black);
}

/* town names */
.map-town {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--map-blue);
    pointer-events: none;
    white-space: nowrap;
}

.map-town::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--map-blue);
}

.map-town-main {
    font-size: 16px;
    font-weight: 700;
    color: var(--orange);
}

.map-town-main::before {
    display: none;
}

.map-close .map-town:not(.map-town-main) {
    opacity: 0;
}

/* card (MapLibre popup) */
.map-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(35, 31, 32, 0.15);
}

.map-popup .maplibregl-popup-close-button {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    font-size: 20px;
    color: var(--black);
}

.map-card-body {
    padding: 20px 40px 22px 24px;
}

.map-card-body h3 {
    font-size: clamp(20px, 1.5vw, 24px);
}

.map-card-link {
    width: fit-content;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.3s ease;
}

.map-card-link:hover {
    opacity: 0.6;
}

.map-card-also {
    padding-top: 10px;
    border-top: 1px solid var(--black);
}

.maplibregl-ctrl-attrib {
    font-family: var(--font);
    font-size: 11px;
}

/* ------------------------------------------------------------------
   FOOTER
------------------------------------------------------------------ */
.site-footer {
    row-gap: 40px;
}

.footer-top {
    row-gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    width: 187px;
    height: auto;
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-social {
    gap: 16px;
}

.footer-social img {
    filter: invert(1);
}

.footer-partners,
.footer-legal {
    border-top: 1px solid var(--white);
    padding-top: 24px;
}

.footer-partner-list {
    flex-wrap: wrap;
}

.footer-partner-list li {
    width: 174px;
    height: 42px;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px 24px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.margin-footer{
    margin-bottom: 100px;
}

/* ------------------------------------------------------------------
   FLOATING SCREENS: video player + gallery viewer
------------------------------------------------------------------ */
.video-modal,
.gallery-viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--white);
    overflow: hidden;
}

.video-modal::backdrop {
    background: rgba(35, 31, 32, 0.94);
}

.gallery-viewer::backdrop {
    background: rgba(35, 31, 32, 0.96);
}

body.video-open {
    overflow: hidden;
}

/* video */
.video-modal {
    display: none;
    place-items: center;
    padding: calc(var(--header-height) + 24px) var(--page-margin) 40px;
}

.video-modal[open] {
    display: grid;
}

.video-modal-frame {
    width: min(100%, calc((100svh - var(--header-height) - 64px) * 16 / 9));
}

.video-modal-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.video-modal-close,
.gallery-viewer-close {
    padding: 8px 0;
    color: var(--white);
    transition: opacity 0.3s ease;
}

.video-modal-close {
    position: absolute;
    top: 20px;
    right: var(--page-margin);
}

.video-modal-close:hover,
.gallery-viewer-close:hover,
.gallery-viewer-nav:hover {
    opacity: 0.6;
}

/* gallery */
.gallery-viewer {
    padding: 0;
}

.gallery-viewer[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.gallery-viewer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px var(--page-margin) 12px;
}

.gallery-viewer-stage {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 16px;
    min-height: 0;
    padding-inline: max(8px, calc(var(--page-margin) - 80px));
}

.gallery-viewer-figure {
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 100%;
    min-height: 0;
}

.gallery-viewer-figure .color-header {
    width: min(100%, 360px);
}

.gallery-viewer-img {
    max-height: calc(100svh - 280px);
    object-fit: contain;
}

.gallery-viewer-caption {
    font-family: var(--font-serif);
    font-size: var(--fs-body);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
}

.gallery-viewer-nav {
    width: 64px;
    height: 64px;
    color: var(--white);
    font-size: 28px;
    transition: opacity 0.3s ease;
}

.gallery-viewer-thumbs {
    display: flex;
    gap: 8px;
    padding: 16px var(--page-margin) 20px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

.gallery-viewer-thumb {
    display: block;
    flex: none;
    width: 96px;
    height: 64px;
    padding: 0;
    background-color: #000;
    opacity: 0.45;
    outline: 2px solid transparent;
    outline-offset: -2px;
    transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.gallery-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-viewer-thumb:hover {
    opacity: 0.8;
}

.gallery-viewer-thumb[aria-current="true"] {
    opacity: 1;
    outline-color: var(--white);
}

@media (prefers-reduced-motion: no-preference) {
    .video-modal[open],
    .gallery-viewer[open] {
        animation: modal-in 0.35s ease;
    }

    .video-modal[open]::backdrop,
    .gallery-viewer[open]::backdrop {
        animation: modal-fade 0.35s ease;
    }

    @keyframes modal-in {
        from { opacity: 0; transform: translateY(16px); }
    }

    @keyframes modal-fade {
        from { opacity: 0; }
    }
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */

/* ---- menu becomes a drawer ---- */
@media (max-width: 1180px) {
    .menu-toggle {
        display: block;
    }

    .header-nav {
        position: fixed;
        inset: var(--header-height) 0 0 0;
        z-index: 999;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 48px;
        padding: 40px var(--page-margin) 48px;
        background-color: var(--white);
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    }

    .header-nav.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .header-menu {
        flex-direction: column;
        gap: 12px;
        font-size: var(--fs-h2);
        font-weight: 700;
        letter-spacing: -0.015em;
    }

    .header-others {
        flex-wrap: wrap;
        gap: 24px;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* ---- tablet ---- */
@media (max-width: 1100px) {
    :root {
        --section-gap: 80px;
        --padding: 80px;
    }

    .subgrid {
        row-gap: 40px;
    }

    .span-t-1 { grid-column: span 1; }
    .span-t-2 { grid-column: span 2; }
    .span-t-3 { grid-column: span 3; }
    .span-t-4 { grid-column: span 4; }
    .span-t-5 { grid-column: span 5; }
    .span-t-6 { grid-column: span 6; }
    .span-t-7 { grid-column: span 7; }
    .span-t-8 { grid-column: span 8; }
    .span-t-9 { grid-column: span 9; }
    .span-t-10 { grid-column: span 10; }
    .span-t-11 { grid-column: span 11; }
    .span-t-12 { grid-column: span 12; }

    .hide-t { display: none; }

    .hero-text .flex-bottom-end { justify-content: flex-start; }

    .ambassadors-row,
    .gallery { row-gap: 48px; }

    .casa { grid-template-columns: 1fr; }
    .casa-intro { padding: 80px var(--page-margin) calc(var(--cell-h) * 3 + 24px); }
    .casa-intro-text { max-width: 640px; }
    .casa-projects {
        border-left: 0;
        border-top: 1px solid var(--black);
        padding: 80px var(--page-margin);
        gap: 80px;
    }

    .after-section { padding-bottom: calc(var(--padding) + var(--cell-h) * 3); }
    .after-bars { width: 100%; }

    .social-buttons { justify-content: flex-start; }

    .join-text { gap: 48px; }

    .map-stage { height: auto; overflow: visible; background: none; }
    .map-canvas { position: relative; height: min(75vh, 620px); background-color: var(--blue-2); }
    .map-overlay { position: static; pointer-events: auto; }
    .map-panel { max-height: none; margin-top: 32px; padding: 0 0 0 20px; background: none; }
    .map-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap20px); }
}

/* ---- mobile: 4 columns ---- */
@media (max-width: 768px) {
    :root {
        --columns: 4;
        --page-margin: 20px;
        --gap20px: 10px;
        --section-gap: 48px;
        --padding: 56px;
        --fs-highlight: 18px;
        --fs-body: 17px;
    }

    /* without a span-m-N an element takes the full width */
    [class*="span-"] { grid-column: 1 / -1; }

    .span-m-1 { grid-column: span 1; }
    .span-m-2 { grid-column: span 2; }
    .span-m-3 { grid-column: span 3; }
    .span-m-4 { grid-column: span 4; }

    .hide-m { display: none; }

    .header-content { gap: 16px; }
    .header-others .button-black { order: -1; }

    .hero-text { padding-bottom: 40px; }
    .hero-text .flex-col-20 { gap: 20px; }

    .concept-text { gap: 20px; }

    .ambassador-item { padding-left: 16px; }

    .direction-section .vertical-center { margin-top: 0; }

    .program-axes { grid-template-columns: 1fr; }

    .casa-intro { padding-top: 56px; }
    .casa-projects { padding-block: 56px; gap: 48px; }
    .project-side { grid-template-columns: 1fr; }
    .project-side .project-body { padding-left: 0; padding-top: 20px; }

    .gallery-open img { height: auto; aspect-ratio: 4 / 3; }

    .feed { row-gap: 10px; }
    .feed-source { right: 6px; bottom: 6px; max-width: calc(100% - 12px); font-size: 9px; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .news-item,
    .news-full .news-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
    .news-item time,
    .news-full .news-source { grid-column: 1 / -1; text-align: left; }
    .news-full .news-source { order: 3; }
    .news-filter-count { flex-basis: 100%; margin-left: 0; }

    .page-head { padding-top: 48px; }

    .map-list { grid-template-columns: 1fr; }

    .footer-legal,
    .footer-links { flex-direction: column; }

    .gallery-viewer-stage { grid-template-columns: 1fr; padding-inline: var(--page-margin); }
    .gallery-viewer-nav { display: none; }              /* swipe or use the bar */
    .gallery-viewer-img { max-height: calc(100svh - 240px); }
    .gallery-viewer-thumb { width: 72px; height: 48px; }
}
