@charset "utf-8";

/* Variables globales unificadas */
:root {
    /* Tipografías */
    --default-font: "Funnel Sans", sans-serif;
    --heading-font: "Funnel Display", sans-serif;
    --nav-font: "Funnel Sans", sans-serif;
    /* Paleta corporativa */
    --background-color: #f8f9fa;
    /* Gris claro para profundidad */
    --default-color: #000;
    /* Color de texto principal */
    --heading-color: #1a252f;
    /* Slate oscuro para encabezados */
    --accent-color: #000;
    --accent-green: #69A82F;
    /* Variante oscura del verde de marca (≈4.9:1 sobre blanco) para usarla
       SOLO como color de texto/enlace sobre fondos claros y cumplir WCAG AA.
       El verde de marca #69A82F se conserva para fondos, botones y gráficos. */
    --accent-green-ink: #4c7d1e;
    --accent-color-rgb: 0, 0, 0;
    --surface-color: #fff;
    --contrast-color: #fff;
    /* Variables de UI */
    --box-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --box-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.1);
    --border-radius-card: 12px;
    /* Colores de navegación */
    --nav-color: #000000;
    --nav-hover-color: var(--accent-green-ink);
    --nav-mobile-background-color: #fff;
    --nav-dropdown-background-color: #fff;
    --nav-dropdown-color: #2c3e50;
    --nav-dropdown-hover-color: var(--accent-green-ink);
    /* Header background - Efecto vidrio (glassmorphism) */
    --header-background-color: rgba(255, 255, 255, 0.9);
    /* Comportamiento de scroll */
    scroll-behavior: smooth
}

/* Presets de color */
.light-background {
    --background-color: #f8f9fa;
    --surface-color: #fff
}

/*--------------------------------------------------------------
# General Styling & Shared Classes
--------------------------------------------------------------*/
body {
    color: var(--default-color);
    background-color: var(--background-color);
    font-family: var(--default-font);
    line-height: 1.7;
    /* Mejora la legibilidad */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: 0.3s
}

a:hover {
    color: color-mix(in srgb, var(--accent-green), transparent 25%);
    text-decoration: none
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    font-family: var(--heading-font)
}

/* Accesibilidad: estilos de foco visible para navegación por teclado (WCAG 2.4.7) */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px
}


/*--------------------------------------------------------------
# Global Page Titles & Breadcrumbs
--------------------------------------------------------------*/
.page-title {
    --background-color: color-mix(in srgb, var(--default-color), transparent 96%);
    color: var(--default-color);
    background-color: var(--background-color);
    padding: clamp(1rem, 2vw, 1.5rem) 0;
    position: relative
}

.page-title h1 {
    font-size: clamp(1.25rem, 1.5vw + 0.75rem, 1.5rem);
    font-weight: 600
}

.page-title .breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--fs-small, 0.875rem);
    font-weight: 400
}

.page-title .breadcrumbs ol li+li {
    padding-left: 10px
}

.page-title .breadcrumbs ol li+li::before {
    content: "/";
    display: inline-block;
    padding-right: 10px;
    color: color-mix(in srgb, var(--default-color), transparent 70%)
}

/*--------------------------------------------------------------
# Portfolio Details Section
--------------------------------------------------------------*/
.portfolio-details {
    --section-spacing: 5rem;
    --content-spacing: 4rem;
    --subtle-border: 1px solid color-mix(in srgb, var(--default-color), transparent 92%);

    /* Energy class scale — official CECB / EU energy-label ramp
       (dark green A → red G), matching the standard étiquette. */
    --energy-A: #0a8a3f;
    --energy-B: #56ad32;
    --energy-C: #c2cf00;
    --energy-D: #ffe800;
    --energy-E: #f7b000;
    --energy-F: #ea6909;
    --energy-G: #df1b1b;

    /* Gallery "frame" stage — light "studio" passe-partout: a soft cool-white
       mat that keeps the airy feel of the rest of the site while still framing
       the photo as a matted print. contain keeps the photo whole, never cropped. */
    --gallery-mat: radial-gradient(120% 120% at 50% 0%, #fbfbfc 0%, #eef0f2 55%, #e6e9ec 100%);
    --gallery-radius: 20px;
    --gallery-pad: clamp(0.75rem, 2vw, 1.75rem);
    --gallery-before: var(--energy-G);
    --gallery-after: var(--accent-green)
}

/* =============================================================
   1. HERO — identity + factual one-liner
============================================================= */
.portfolio-details .project-hero {
    margin-bottom: var(--section-spacing)
}

.portfolio-details .project-hero .hero-content {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 3rem
}

.portfolio-details .project-hero .hero-tags {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.portfolio-details .project-hero .project-category {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-color);
    font-weight: 500
}

.portfolio-details .project-hero .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #fff;
    vertical-align: middle;
}

.portfolio-details .project-hero .status-badge.status-in-progress {
    background: color-mix(in srgb, var(--accent-color), transparent 15%);
}

.portfolio-details .project-hero .project-title {
    font-size: var(--fs-h1);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: var(--heading-color);
    letter-spacing: -0.02em
}

.portfolio-details .project-hero .project-summary {
    font-size: var(--fs-lead);
    line-height: 1.7;
    color: color-mix(in srgb, var(--default-color), transparent 20%);
    font-weight: 400;
    margin: 0 auto;
    max-width: 640px;
}

/* --- Key facts grid (5 columns of real client data + safe derivations) --- */
.portfolio-details .project-hero .project-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: clamp(1.25rem, 2vw, 2rem);
    padding-top: 3rem;
    border-top: var(--subtle-border)
}

/* C2 — at tablet (≤768px) auto-fit packs 5 fields into too-narrow cols;
   force 2 cols. On very small phones go single-column. */
@media (max-width: 767.98px) {
    .portfolio-details .project-hero .project-meta-grid {
        grid-template-columns: repeat(2, 1fr);
        padding-top: 2rem;
    }
}
@media (max-width: 419.98px) {
    .portfolio-details .project-hero .project-meta-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-details .project-hero .project-meta-grid .meta-column {
    text-align: center
}

.portfolio-details .project-hero .project-meta-grid .meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: color-mix(in srgb, var(--default-color), transparent 50%);
    margin-bottom: 0.5rem
}

.portfolio-details .project-hero .project-meta-grid .meta-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--heading-color);
    line-height: 1.3;
}

.portfolio-details .project-hero .project-meta-grid .meta-sub {
    font-size: 0.78rem;
    color: color-mix(in srgb, var(--default-color), transparent 45%);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.portfolio-details .project-hero .project-meta-grid .meta-sub:empty {
    display: none;
}


/* =============================================================
   2. PHOTO GALLERY — Before / After tabs + swiper
============================================================= */
.portfolio-details .gallery-showcase {
    margin-bottom: var(--section-spacing)
}

/* --- Before / After: sliding segmented control ("magic ink") -----------
   Two states of ONE building, so a single thumb glides between them and
   morphs colour (red→green) to narrate the renovation, instead of two
   independent pills lighting up. */
.portfolio-details .gallery-tabs {
    --seg-pad: 0.3rem;
    position: relative;
    display: flex;
    width: min(320px, 100%);
    padding: var(--seg-pad);
    margin-bottom: 1.5rem;
    background-color: color-mix(in srgb, var(--heading-color), transparent 92%);
    border-radius: 999px;
    border: var(--subtle-border);
}

.portfolio-details .gallery-tab-thumb {
    position: absolute;
    top: var(--seg-pad);
    bottom: var(--seg-pad);
    left: var(--seg-pad);
    width: calc(50% - var(--seg-pad));
    border-radius: 999px;
    background-color: var(--gallery-before);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1),
                background-color 0.4s ease;
    z-index: 0;
}

.portfolio-details .gallery-tabs[data-active="after"] .gallery-tab-thumb {
    transform: translateX(100%);
    background-color: var(--gallery-after);
}

/* Single-phase projects (only before OR only after) have one tab hidden,
   so the 50% thumb can't map cleanly — drop it and tint the lone active tab. */
.portfolio-details .gallery-tabs:has(.gallery-tab[hidden]) .gallery-tab-thumb {
    display: none;
}

.portfolio-details .gallery-tab {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.portfolio-details .gallery-tab:hover {
    color: var(--heading-color);
}

.portfolio-details .gallery-tab.is-active {
    color: #fff;
    font-weight: 600;
}

/* Fallback tint when the thumb is hidden (single-phase projects). */
.portfolio-details .gallery-tabs:has(.gallery-tab[hidden]) .gallery-tab[data-phase="before"].is-active {
    background-color: var(--gallery-before);
}
.portfolio-details .gallery-tabs:has(.gallery-tab[hidden]) .gallery-tab[data-phase="after"].is-active {
    background-color: var(--gallery-after);
}

.portfolio-details .gallery-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    padding: 0 0.4rem;
    height: 1.3rem;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--default-color), transparent 88%);
    font-size: 0.72rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.portfolio-details .gallery-tab.is-active .gallery-tab-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* --- The stage: dark passe-partout that frames the photo ---------------- */
.portfolio-details .main-visual {
    position: relative;
    padding: var(--gallery-pad);
    border-radius: var(--gallery-radius);
    background: var(--gallery-mat);
    border: var(--subtle-border);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 18px 44px -22px rgba(26, 37, 47, 0.28),
        0 6px 16px -10px rgba(26, 37, 47, 0.16);
    overflow: hidden;
}

/* Each slide carries its OWN blurred ambient fill (set inline by main.js with
   an absolute URL). It sits behind that slide's contained photo and slides
   along with it, so a horizontal slide transition stays coherent. The outer
   mat ring of .main-visual stays the clean studio frame. */
.portfolio-details .main-visual .slide-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(12px) saturate(1.2) brightness(0.99);
    transform: scale(1.08);
    pointer-events: none;
}

.portfolio-details .portfolio-details-slider {
    position: relative;
    z-index: 2;
    /* 16:9 is the design base — the laptop-screen canvas. The contained photo
       (any ratio, never cropped) sits centered and the ambient blur fills the
       16:9 frame around it. Width stays 100% so the blur reaches both edges. */
    aspect-ratio: 16 / 9;
}

/* Smooth fade between Before / After gallery tabs.
   The .is-fading class is toggled by main.js around the swiper rebuild;
   the slider eases out, the slides swap while invisible, then it eases in. */
.portfolio-details .portfolio-details-slider {
    border-radius: calc(var(--gallery-radius) - 8px);
    overflow: hidden;
    transition: opacity 0.28s ease, transform 0.28s ease;
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
    will-change: opacity, transform;
}

.portfolio-details .portfolio-details-slider.is-fading {
    opacity: 0;
    transform: scale(0.985);
}

.portfolio-details .main-visual .swiper-wrapper {
    position: relative;
    z-index: 1;
    height: 100% !important;
    /* Premium easing for the horizontal slide (easeOutQuint-ish). */
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-details .main-visual .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: transparent;
}

/* Always show the whole photo — never crop. The image keeps its natural
   aspect ratio (width-driven); max-height + contain only kicks in as a
   safety net for unusually tall/portrait images, letterboxing onto the dark
   mat instead of cropping. autoHeight on the Swiper (main.js) adapts height. */
.portfolio-details .main-visual .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    /* A soft drop shadow lifts the sharp photo off its own blurred fill. */
    filter: drop-shadow(0 10px 26px rgba(15, 20, 26, 0.35));
    margin: 0 auto
}

/* --- Phase badge + position counter (editorial corners) ----------------- */
.portfolio-details .gallery-phase-badge,
.portfolio-details .gallery-counter {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background-color: rgba(15, 20, 26, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-details .gallery-phase-badge {
    top: calc(var(--gallery-pad) + 0.5rem);
    left: calc(var(--gallery-pad) + 0.5rem);
}

/* Coloured dot before the label, tinted by phase via the stage class. */
.portfolio-details .gallery-phase-badge::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--gallery-after);
}

.portfolio-details .main-visual.is-before .gallery-phase-badge::before {
    background-color: var(--gallery-before);
}

.portfolio-details .gallery-counter {
    top: calc(var(--gallery-pad) + 0.5rem);
    right: calc(var(--gallery-pad) + 0.5rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

/* --- Navigation arrows: frosted glass, reveal on hover ------------------ */
.portfolio-details .main-visual .swiper-button-next,
.portfolio-details .main-visual .swiper-button-prev {
    width: 48px;
    height: 48px;
    margin-top: -24px;
    background-color: rgba(15, 20, 26, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, background-color 0.25s ease, transform 0.25s ease;
    --swiper-navigation-color: #fff;
}

/* Reveal arrows when the stage is hovered (desktop pointers only). */
@media (hover: hover) and (pointer: fine) {
    .portfolio-details .main-visual:hover .swiper-button-next,
    .portfolio-details .main-visual:hover .swiper-button-prev {
        opacity: 1;
        transform: scale(1);
    }
}

/* Touch / coarse pointers: keep arrows softly visible (no hover to reveal). */
@media (hover: none), (pointer: coarse) {
    .portfolio-details .main-visual .swiper-button-next,
    .portfolio-details .main-visual .swiper-button-prev {
        opacity: 0.85;
        transform: scale(1);
    }
}

.portfolio-details .main-visual .swiper-button-next::after,
.portfolio-details .main-visual .swiper-button-prev::after {
    font-family: 'bootstrap-icons';
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.portfolio-details .main-visual .swiper-button-prev::after {
    content: '\f284';
}

.portfolio-details .main-visual .swiper-button-next::after {
    content: '\f285';
}

.portfolio-details .main-visual .swiper-button-next:hover,
.portfolio-details .main-visual .swiper-button-prev:hover {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
    transform: scale(1.08);
}

.portfolio-details .main-visual .swiper-button-prev { left: calc(var(--gallery-pad) + 0.5rem) }
.portfolio-details .main-visual .swiper-button-next { right: calc(var(--gallery-pad) + 0.5rem) }

/* --- Pagination: slim segments tinted by phase -------------------------- */
.portfolio-details .main-visual .swiper-pagination {
    bottom: calc(var(--gallery-pad) + 0.5rem);
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.portfolio-details .main-visual .swiper-pagination-bullet {
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
    transition: background-color 0.3s ease, width 0.3s ease;
}

.portfolio-details .main-visual .swiper-pagination-bullet-active {
    width: 40px;
    background-color: var(--gallery-after);
}

.portfolio-details .main-visual.is-before .swiper-pagination-bullet-active {
    background-color: var(--gallery-before);
}

.portfolio-details .gallery-note {
    margin-top: 1rem;
    font-size: var(--fs-small);
    color: color-mix(in srgb, var(--default-color), transparent 40%);
    text-align: center;
}

/* --- Gallery responsive: tablet & mobile -------------------------------- */
@media (max-width: 767.98px) {
    .portfolio-details .gallery-tabs {
        width: 100%;
    }

    .portfolio-details .main-visual {
        --gallery-radius: 14px;
    }

    /* Keep the 16:9 base on phones too. Landscape photos fill it almost
       edge-to-edge; the ambient blur takes the small remainder. */
    .portfolio-details .portfolio-details-slider {
        aspect-ratio: 16 / 9;
    }

    .portfolio-details .main-visual .swiper-button-next,
    .portfolio-details .main-visual .swiper-button-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }

    .portfolio-details .main-visual .swiper-button-next::after,
    .portfolio-details .main-visual .swiper-button-prev::after {
        font-size: 0.9rem;
    }

    .portfolio-details .main-visual .swiper-pagination-bullet {
        width: 20px;
    }

    .portfolio-details .main-visual .swiper-pagination-bullet-active {
        width: 30px;
    }
}

@media (max-width: 575.98px) {
    .portfolio-details .gallery-phase-badge,
    .portfolio-details .gallery-counter {
        font-size: 0.65rem;
        padding: 0.3rem 0.65rem;
    }

    .portfolio-details .gallery-tab {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}


/* =============================================================
   3. ENERGY CLASS — Before vs After (the centerpiece)
============================================================= */
.portfolio-details .energy-ratings-showcase {
    padding: clamp(2rem, 4vw, 4rem) clamp(1.5rem, 3vw, 3rem);
    background-color: color-mix(in srgb, var(--surface-color), transparent 50%);
    margin: var(--section-spacing) 0;
    border-radius: 8px;
}

.portfolio-details .energy-ratings-showcase[hidden] { display: none }

.portfolio-details .energy-ratings-showcase .ratings-header {
    text-align: center;
    margin-bottom: clamp(2rem, 3vw, 2.75rem);
}

.portfolio-details .energy-ratings-showcase .ratings-header h3 {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
    font-weight: 300;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

.portfolio-details .energy-ratings-showcase .ratings-header p {
    font-size: var(--fs-body);
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto;
}

.portfolio-details .energy-ratings-showcase .ratings-list {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    max-width: 980px;
    margin: 0 auto;
}

/* --- One CECB-style certificate card per metric (envelope / global / co2) --- */
.portfolio-details .rating-card {
    padding: clamp(1.5rem, 2.5vw, 2rem) clamp(1.5rem, 3vw, 2.125rem);
    background-color: var(--surface-color);
    border-radius: 18px;
    border: var(--subtle-border);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

/* --- Left: meta column --------------------------------------- */
.portfolio-details .rating-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.portfolio-details .rating-meta-head {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.portfolio-details .rating-card-title {
    font-size: clamp(1.1rem, 1.4vw + 0.5rem, 1.3rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--heading-color);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

/* Category icon next to each rating title (house / lightning / cloud),
   mirroring the official CECB étiquette legend. */
.portfolio-details .rating-card-icon {
    flex-shrink: 0;
    font-size: 1.15em;
    line-height: 1;
    color: var(--heading-color);
}

/* "+N classes" gain badge */
.portfolio-details .rating-gain {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #10331f;
    color: #9be7b4;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    padding: 0.3125rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.portfolio-details .rating-gain::before {
    content: "\25B2"; /* ▲ */
    font-size: 0.7rem;
    line-height: 1;
}

.portfolio-details .rating-gain[data-direction="down"] {
    background-color: color-mix(in srgb, var(--energy-G), black 22%);
    color: #ffd9d4;
}

.portfolio-details .rating-gain[data-direction="down"]::before {
    content: "\25BC"; /* ▼ */
}

.portfolio-details .rating-gain[data-direction="flat"] {
    background-color: color-mix(in srgb, var(--default-color), transparent 88%);
    color: color-mix(in srgb, var(--default-color), transparent 20%);
}

.portfolio-details .rating-gain[data-direction="flat"]::before {
    content: "\2013"; /* – */
    font-size: 0.85rem;
}

.portfolio-details .rating-note {
    margin: 0;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 24rem;
}

/* before → after class chips */
.portfolio-details .rating-chips {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
}

.portfolio-details .rating-chip-group {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.4375rem;
}

.portfolio-details .rating-chip-label {
    grid-column: 1 / -1;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: color-mix(in srgb, var(--default-color), transparent 45%);
}

.portfolio-details .rating-chip-arrow {
    color: color-mix(in srgb, var(--default-color), transparent 55%);
    font-size: 1.35rem;
    padding-bottom: 0.3rem;
}

.portfolio-details .rating-chip-after-text {
    font-weight: 800;
    font-size: 1.05rem;
    white-space: nowrap;
    /* colour set inline by the JS loader to match the class */
}

/* Class letter chip — colour-coded to the A→G ramp */
.portfolio-details .class-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 7px;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    color: #fff;
    background-color: color-mix(in srgb, var(--default-color), transparent 60%);
}

.portfolio-details .class-chip[data-class="A"] { background-color: var(--energy-A) }
.portfolio-details .class-chip[data-class="B"] { background-color: var(--energy-B) }
.portfolio-details .class-chip[data-class="C"] { background-color: var(--energy-C) }
.portfolio-details .class-chip[data-class="D"] { background-color: var(--energy-D) }
.portfolio-details .class-chip[data-class="E"] { background-color: var(--energy-E) }
.portfolio-details .class-chip[data-class="F"] { background-color: var(--energy-F) }
.portfolio-details .class-chip[data-class="G"] { background-color: var(--energy-G) }

/* --- Right: vertical stepped "étiquette" ladder -------------- */
.portfolio-details .energy-ladder {
    position: relative;
    justify-self: end;
    flex-shrink: 0;
}

.portfolio-details .ladder-bar {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    /* Letter sits in the arrow head (right side), like the official CECB étiquette.
       padding-right clears the chevron tip so the glyph stays on the full-height part. */
    justify-content: flex-end;
    padding-right: 1.1rem;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    border-radius: 2px 0 0 2px;
    /* Right-pointing chevron tip (13px) — replaces the old square right edge. */
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
    opacity: 0;
    transition: width 1.1s cubic-bezier(.2, .8, .25, 1), opacity 0.8s ease;
}

.portfolio-details .ladder-bar[data-class="A"] { background-color: var(--energy-A) }
.portfolio-details .ladder-bar[data-class="B"] { background-color: var(--energy-B) }
.portfolio-details .ladder-bar[data-class="C"] { background-color: var(--energy-C) }
.portfolio-details .ladder-bar[data-class="D"] { background-color: var(--energy-D) }
.portfolio-details .ladder-bar[data-class="E"] { background-color: var(--energy-E) }
.portfolio-details .ladder-bar[data-class="F"] { background-color: var(--energy-F) }
.portfolio-details .ladder-bar[data-class="G"] { background-color: var(--energy-G) }

/* opacity is driven inline by main.js on reveal; keep only the desaturation */
.portfolio-details .ladder-bar.is-dim {
    filter: saturate(0.7);
}

/* Active bar highlight. An inset box-shadow would be clipped away by the
   chevron clip-path, so the emphasis comes from a slight brightness lift plus a
   drop-shadow filter that follows the clipped (arrow) outline. */
.portfolio-details .ladder-bar.is-active {
    filter: brightness(1.06) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

/* C / D / E swatches are light — switch to dark text for contrast */
.portfolio-details .class-chip[data-class="C"],
.portfolio-details .class-chip[data-class="D"],
.portfolio-details .class-chip[data-class="E"],
.portfolio-details .ladder-bar[data-class="C"],
.portfolio-details .ladder-bar[data-class="D"],
.portfolio-details .ladder-bar[data-class="E"] {
    color: rgba(0, 0, 0, 0.82);
}

/* before / after flags in the right gutter */
.portfolio-details .ladder-flag {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.9s ease, transform 1.1s cubic-bezier(.2, .8, .25, 1);
}

.portfolio-details .ladder-flag-notch {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.portfolio-details .ladder-flag-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    padding: 5px 11px 5px 9px;
    white-space: nowrap;
}

.portfolio-details .ladder-flag-letter {
    font-weight: 800;
    font-size: 1.0625rem;
    line-height: 1;
}

.portfolio-details .ladder-flag-kind {
    font-size: 0.59rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.8;
}

.portfolio-details .ladder-flag.is-before .ladder-flag-notch {
    border-right: 8px solid #d3d7d2;
}

.portfolio-details .ladder-flag.is-before .ladder-flag-body {
    background: #fff;
    color: #5b6168;
    border: 1px solid #d3d7d2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.portfolio-details .ladder-flag.is-after .ladder-flag-notch {
    border-right: 8px solid #15181c;
}

.portfolio-details .ladder-flag.is-after .ladder-flag-body {
    background: #15181c;
    color: #fff;
    box-shadow: 0 4px 14px rgba(20, 24, 28, 0.18);
}

/* jump connector — vertical line + arrowhead from before to after row */
.portfolio-details .ladder-jump {
    position: absolute;
    width: 2px;
    background: linear-gradient(to top, #cfd3ce, #15181c);
    transform-origin: bottom;
    transform: scaleY(0);
    transition: transform 1.1s cubic-bezier(.2, .8, .25, 1) 0.8s;
}

.portfolio-details .ladder-jump::after {
    content: "";
    position: absolute;
    top: -5px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid #15181c;
    opacity: 0;
    transition: opacity 0.5s ease 1.7s;
}

/* revealed state — toggled by the IntersectionObserver in main.js */
.portfolio-details .energy-ladder.is-revealed .ladder-flag {
    opacity: 1;
    transform: translateX(0);
}

.portfolio-details .energy-ladder.is-revealed .ladder-jump {
    transform: scaleY(1);
}

.portfolio-details .energy-ladder.is-revealed .ladder-jump::after {
    opacity: 1;
}

.portfolio-details .ratings-note {
    margin: 1.75rem auto 0;
    max-width: 620px;
    text-align: center;
    font-size: var(--fs-small);
    color: color-mix(in srgb, var(--default-color), transparent 35%);
    font-style: italic;
}

/* --- Responsive: stack meta over ladder on narrow viewports --- */
@media (max-width: 767.98px) {
    .portfolio-details .rating-card {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .portfolio-details .energy-ladder {
        justify-self: center;
    }
}

@media (max-width: 575.98px) {
    .portfolio-details .rating-meta-head {
        gap: 0.625rem;
    }

    .portfolio-details .rating-chips {
        gap: 1rem;
    }
}

/* =============================================================
   4. FOOTER
============================================================= */
.portfolio-details .project-footer {
    padding-top: 3rem;
    border-top: var(--subtle-border)
}

.portfolio-details .project-footer .footer-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.portfolio-details .project-footer .footer-navigation .nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.3s ease
}

.portfolio-details .project-footer .footer-navigation .nav-link.all-projects {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid color-mix(in srgb, var(--default-color), transparent 85%);
    border-radius: 25px;
    color: var(--heading-color);
    font-weight: 500;
    transition: all 0.3s ease
}

.portfolio-details .project-footer .footer-navigation .nav-link.all-projects i {
    font-size: 1rem
}

.portfolio-details .project-footer .footer-navigation .nav-link.all-projects:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
    transform: translatey(-3px)
}


/* =============================================================
   5. TECHNICAL SYSTEMS — legacy project data (no CECB ratings)
   Mirrors the energy-ratings showcase styling so a project that
   shows this section instead of ratings still looks finished.
============================================================= */
.portfolio-details .technical-systems {
    padding: clamp(2rem, 4vw, 4rem) clamp(1.5rem, 3vw, 3rem);
    background-color: color-mix(in srgb, var(--surface-color), transparent 50%);
    margin: var(--section-spacing) 0;
    border-radius: 8px;
}

.portfolio-details .technical-systems[hidden] { display: none }

.portfolio-details .technical-systems .systems-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.portfolio-details .technical-systems .systems-header h3 {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
    font-weight: 300;
    margin: 0;
    color: var(--heading-color);
}

.portfolio-details .technical-systems .systems-desc {
    text-align: center;
    max-width: 620px;
    margin: 0 auto clamp(1.5rem, 3vw, 2.25rem);
    font-size: var(--fs-body);
    line-height: 1.7;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
}

.portfolio-details .technical-systems .systems-desc[hidden] { display: none }

.portfolio-details .technical-systems .systems-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.125rem;
    max-width: 900px;
    margin: 0 auto;
}

.portfolio-details .technical-systems .systems-chips[hidden] { display: none }

.portfolio-details .technical-systems .system-chip {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.5rem;
    background-color: var(--surface-color);
    border: var(--subtle-border);
    border-radius: 14px;
    min-width: 220px;
    flex: 0 1 auto;
}

.portfolio-details .technical-systems .system-chip i {
    font-size: 1.5rem;
    color: var(--accent-green);
    flex-shrink: 0;
}

.portfolio-details .technical-systems .system-chip-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.portfolio-details .technical-systems .system-chip-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: color-mix(in srgb, var(--default-color), transparent 50%);
}

.portfolio-details .technical-systems .system-chip-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.2;
}

@media (max-width: 575.98px) {
    .portfolio-details .technical-systems .system-chip {
        width: 100%;
        min-width: 0;
    }
}

/* Defensive: hide-when-empty for blocks JS may toggle off
   (kept explicit so a future display override can't leak them back). */
.portfolio-details .gallery-showcase[hidden] { display: none }
.portfolio-details .project-hero .project-meta-grid .meta-column[hidden] { display: none }


/*--------------------------------------------------------------
# Terms Of Service Section
--------------------------------------------------------------*/
.terms-of-service .tos-header {
    margin-bottom: clamp(2rem, 4vw, 3.75rem)
}

.terms-of-service .tos-header .last-updated {
    display: inline-block;
    padding: 8px 20px;
    background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
    border-radius: 30px;
    color: var(--accent-color);
    font-size: var(--fs-small);
    margin-bottom: 20px
}

.terms-of-service .tos-header h2 {
    font-size: var(--fs-h2);
    margin-bottom: 15px
}

.terms-of-service .tos-header p {
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    font-size: var(--fs-lead);
    max-width: min(700px, 92vw);
    margin: 0 auto
}

.terms-of-service .tos-content .content-section {
    margin-bottom: clamp(2rem, 4vw, 3.125rem);
    scroll-margin-top: 100px
}

.terms-of-service .tos-content .content-section:last-child {
    margin-bottom: 0
}

.terms-of-service .tos-content .content-section h3 {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.8rem);
    margin-bottom: 20px;
    color: var(--heading-color)
}

.terms-of-service .tos-content .content-section p {
    color: color-mix(in srgb, var(--default-color), transparent 20%);
    line-height: 1.7;
    margin-bottom: 20px
}

.terms-of-service .tos-content .content-section p:last-child {
    margin-bottom: 0
}

.terms-of-service .tos-content .content-section .info-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background-color: color-mix(in srgb, var(--accent-color), transparent 95%);
    border-radius: 15px;
    margin-top: 20px
}

.terms-of-service .tos-content .content-section .info-box i {
    font-size: 1.5rem;
    color: var(--accent-color);
    flex-shrink: 0
}

.terms-of-service .tos-content .content-section .info-box p {
    margin: 0;
    font-size: 0.95rem
}

.terms-of-service .tos-content .content-section .list-items {
    list-style: none;
    padding: 0;
    margin: 20px 0
}

.terms-of-service .tos-content .content-section .list-items li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: color-mix(in srgb, var(--default-color), transparent 20%)
}

.terms-of-service .tos-content .content-section .list-items li:last-child {
    margin-bottom: 0
}

.terms-of-service .tos-content .content-section .list-items li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-color)
}

.terms-of-service .tos-content .content-section .alert-box {
    display: flex;
    gap: 20px;
    padding: 25px;
    background-color: var(--surface-color);
    border-radius: 15px;
    border-left: 4px solid var(--accent-color);
    margin-top: 20px
}

.terms-of-service .tos-content .content-section .alert-box i {
    font-size: 2rem;
    color: var(--accent-color);
    flex-shrink: 0
}

.terms-of-service .tos-content .content-section .alert-box .alert-content h5 {
    font-size: 1.1rem;
    margin-bottom: 8px
}

.terms-of-service .tos-content .content-section .alert-box .alert-content p {
    margin: 0;
    font-size: 0.95rem
}

.terms-of-service .tos-content .content-section .prohibited-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 20px;
    margin-top: 20px
}


.terms-of-service .tos-content .content-section .prohibited-list .prohibited-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background-color: var(--surface-color);
    border-radius: 12px
}

.terms-of-service .tos-content .content-section .prohibited-list .prohibited-item i {
    color: #dc3545;
    font-size: 1.2rem
}

.terms-of-service .tos-content .content-section .prohibited-list .prohibited-item span {
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--default-color), transparent 20%)
}

.terms-of-service .tos-content .content-section .disclaimer-box {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px
}

.terms-of-service .tos-content .content-section .disclaimer-box p {
    margin-bottom: 15px;
    font-weight: 500
}

.terms-of-service .tos-content .content-section .disclaimer-box ul {
    list-style: none;
    padding: 0;
    margin: 0
}

.terms-of-service .tos-content .content-section .disclaimer-box ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: color-mix(in srgb, var(--default-color), transparent 20%);
    font-size: 0.95rem
}

.terms-of-service .tos-content .content-section .disclaimer-box ul li:last-child {
    margin-bottom: 0
}

.terms-of-service .tos-content .content-section .disclaimer-box ul li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--accent-color)
}

.terms-of-service .tos-content .content-section .notice-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background-color: color-mix(in srgb, var(--accent-color), transparent 95%);
    border-radius: 15px;
    margin-top: 20px
}

.terms-of-service .tos-content .content-section .notice-box i {
    font-size: 1.5rem;
    color: var(--accent-color);
    flex-shrink: 0
}

.terms-of-service .tos-content .content-section .notice-box p {
    margin: 0;
    font-size: 0.95rem
}

.terms-of-service .tos-contact {
    margin-top: 60px
}

.terms-of-service .tos-contact .contact-box {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color), transparent 95%) 0%, color-mix(in srgb, var(--accent-color), transparent 98%) 100%);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px
}


.terms-of-service .tos-contact .contact-box .contact-icon {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.terms-of-service .tos-contact .contact-box .contact-icon i {
    font-size: 1.8rem;
    color: var(--contrast-color)
}

.terms-of-service .tos-contact .contact-box .contact-content {
    flex: 1
}

.terms-of-service .tos-contact .contact-box .contact-content h4 {
    font-size: 1.4rem;
    margin-bottom: 8px
}

.terms-of-service .tos-contact .contact-box .contact-content p {
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    margin-bottom: 15px
}

.terms-of-service .tos-contact .contact-box .contact-content .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background-color: var(--accent-color);
    color: var(--contrast-color);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s
}

.terms-of-service .tos-contact .contact-box .contact-content .contact-link:hover {
    transform: translatey(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1)
}

@media print {
    .terms-of-service .tos-contact {
        display: none
    }

    .terms-of-service .content-section {
        page-break-inside: avoid
    }
}

/*--------------------------------------------------------------
# Privacy 2 Section
--------------------------------------------------------------*/
.privacy-2 {
    font-size: var(--fs-body);
    line-height: 1.7
}

.privacy-2 .privacy-header {
    margin-bottom: clamp(2rem, 4vw, 3.75rem);
    text-align: center;
    border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem)
}

.privacy-2 .privacy-header .header-content {
    max-width: min(800px, 94vw);
    margin: 0 auto
}

.privacy-2 .privacy-header .header-content .last-updated {
    font-size: var(--fs-small);
    color: color-mix(in srgb, var(--default-color), transparent 40%);
    margin-bottom: 20px
}

.privacy-2 .privacy-header .header-content h2 {
    font-size: var(--fs-h1);
    color: var(--heading-color);
    margin-bottom: 20px;
    font-weight: 600
}

.privacy-2 .privacy-header .header-content .intro-text {
    font-size: var(--fs-lead);
    color: color-mix(in srgb, var(--default-color), transparent 20%);
    line-height: 1.6
}

.privacy-2 .privacy-content {
    max-width: min(800px, 94vw);
    margin: 0 auto clamp(2rem, 4vw, 3.75rem)
}

.privacy-2 .privacy-content .content-section {
    margin-bottom: clamp(2rem, 4vw, 3.125rem)
}

.privacy-2 .privacy-content .content-section:last-child {
    margin-bottom: 0
}

.privacy-2 .privacy-content .content-section h2 {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.8rem);
    color: var(--heading-color);
    margin-bottom: 25px;
    font-weight: 600
}

.privacy-2 .privacy-content .content-section h3 {
    font-size: clamp(1.125rem, 1.2vw + 0.5rem, 1.4rem);
    color: var(--heading-color);
    margin: 30px 0 20px;
    font-weight: 500
}

.privacy-2 .privacy-content .content-section p {
    margin-bottom: 20px
}

.privacy-2 .privacy-content .content-section p:last-child {
    margin-bottom: 0
}

.privacy-2 .privacy-content .content-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px
}

.privacy-2 .privacy-content .content-section ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px
}

.privacy-2 .privacy-content .content-section ul li:last-child {
    margin-bottom: 0
}

.privacy-2 .privacy-content .content-section ul li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--accent-color)
}

.privacy-2 .privacy-contact {
    max-width: min(800px, 94vw);
    margin: 0 auto;
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 90%)
}

.privacy-2 .privacy-contact h2 {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.8rem);
    color: var(--heading-color);
    margin-bottom: 20px;
    font-weight: 600
}

.privacy-2 .privacy-contact p {
    margin-bottom: 20px
}

.privacy-2 .privacy-contact .contact-details {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 10px
}

.privacy-2 .privacy-contact .contact-details p {
    margin-bottom: 10px
}

.privacy-2 .privacy-contact .contact-details p:last-child {
    margin-bottom: 0
}

.privacy-2 .privacy-contact .contact-details p strong {
    color: var(--heading-color);
    font-weight: 600
}

@media print {
    .privacy-2 {
        font-size: 12pt;
        line-height: 1.5
    }

    .privacy-2 .privacy-header {
        text-align: left;
        border-bottom: 1pt solid #000;
        padding-bottom: 20pt;
        margin-bottom: 30pt
    }

    .privacy-2 h1 {
        font-size: 24pt
    }

    .privacy-2 h2 {
        font-size: 18pt;
        page-break-after: avoid
    }

    .privacy-2 h3 {
        font-size: 14pt;
        page-break-after: avoid
    }

    .privacy-2 p,
    .privacy-2 ul {
        page-break-inside: avoid
    }

    .privacy-2 .contact-details {
        border: 1pt solid #000;
        padding: 15pt
    }
}







/*--------------------------------------------------------------
# Universal Responsiveness & Giant Monitor Overrides
--------------------------------------------------------------*/
/* Large Screens (Laptop/Desktop) - Standard Bootstrap adjustments usually suffice up to 1400px, 
   but we ensure container width maximizes available space */

/* Extra Large Screens (Large Desktop/Monitors) */

/* Giant / Ultra-Wide Monitors (4K+) */

/* Mobile Refinements */


/*--------------------------------------------------------------
# Portfolio Section
--------------------------------------------------------------*/
.portfolio .portfolio-filters-wrapper {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 5rem)
}

.portfolio .portfolio-filters {
    display: inline-flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 0;
    margin: 0;
    list-style: none;
    position: relative;
    flex-wrap: wrap;
    justify-content: center
}

.portfolio .portfolio-filters::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background: color-mix(in srgb, var(--default-color), transparent 90%)
}

.portfolio .portfolio-filters li {
    position: relative;
    cursor: pointer;
    padding: 12px 0;
    font-size: var(--fs-small);
    font-weight: 400;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    transition: all 0.4s ease-out;
    letter-spacing: 0.5px;
    min-height: 44px;
    display: inline-flex;
    align-items: center
}

.portfolio .portfolio-filters li::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.4s ease-out;
    transform: translatex(-50%)
}

.portfolio .portfolio-filters li:hover {
    color: var(--default-color)
}

.portfolio .portfolio-filters li.filter-active {
    color: var(--default-color)
}

.portfolio .portfolio-filters li.filter-active::after {
    width: 100%
}


.portfolio .portfolio-card {
    background: var(--surface-color);
    transition: all 0.4s ease-out;
    overflow: hidden
}

.portfolio .portfolio-card:hover {
    transform: translatey(-8px)
}

.portfolio .portfolio-card:hover .image-container img {
    transform: scale(1.3)
}

.portfolio .portfolio-card:hover .overlay {
    opacity: 1;
    visibility: visible
}

.portfolio .portfolio-card:hover .content h3 {
    color: var(--accent-color)
}

.portfolio .image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    border-radius: 8px
}

.portfolio .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease-out
}

/* Status badge — shown on portfolio cards for in-progress projects. */
.portfolio .image-container .status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.portfolio .image-container .status-badge.status-in-progress {
    background: color-mix(in srgb, var(--accent-color), transparent 15%);
}

.portfolio .image-container .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--accent-color), transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-out;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px)
}

.portfolio .image-container .overlay-content {
    display: flex;
    gap: 20px;
    transform: translatey(20px);
    transition: transform 0.4s ease-out 0.1s
}

.portfolio .portfolio-card:hover .image-container .overlay-content {
    transform: translatey(0)
}

.portfolio .image-container .overlay-content a {
    width: 50px;
    height: 50px;
    min-width: 44px;
    min-height: 44px;
    background: var(--surface-color);
    color: var(--heading-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 18px
}

.portfolio .image-container .overlay-content a:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.2)
}

.portfolio .content {
    padding: 30px 0;
    text-align: center
}

.portfolio .content h3 {
    font-size: clamp(1rem, 0.8vw + 0.875rem, 1.25rem);
    font-weight: 400;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    letter-spacing: 0.5px
}

.portfolio .content p {
    color: color-mix(in srgb, var(--default-color), transparent 40%);
    font-size: var(--fs-small);
    line-height: 1.6;
    margin: 0;
    letter-spacing: 0.3px
}

/* Portfolio usa Bootstrap col-lg-4 col-md-6; no se necesita CSS Grid manual */

/*--------------------------------------------------------------
# Service Details Page Custom Styles
--------------------------------------------------------------*/
.service-details-page .page-title {
    background-size: cover;
    background-position: center;
    /* fixed no funciona bien en iOS; usar scroll como default y
       mantener el efecto en pantallas grandes si el usuario tiene hover */
    background-attachment: scroll;
    color: #fff;
    padding: clamp(3rem, 6vw + 1rem, 7.5rem) 0;
    position: relative
}

@media (hover: hover) and (min-width: 992px) {
    .service-details-page .page-title {
        background-attachment: fixed;
    }
}

.service-details-page .page-title::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6)
}

.service-details-page .page-title .container {
    position: relative;
    z-index: 2
}

.service-details-page .page-title h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px
}

.service-details-page .page-title p {
    font-size: var(--fs-lead);
    color: rgba(255, 255, 255, 0.9);
    max-width: min(600px, 92vw)
}

.service-details-page .breadcrumbs ol {
    margin-top: 20px
}

.service-details-page .breadcrumbs ol li,
.service-details-page .breadcrumbs ol li a {
    color: rgba(255, 255, 255, 0.8)
}

.service-details-page .breadcrumbs ol li+li::before {
    color: rgba(255, 255, 255, 0.6)
}

/* Service Cards */
/* Large Icon */
/* Infrared Thermography Apps List */
/* CTA Section */
#contact-cta {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(../img/parallax-bg.webp) center center no-repeat;
    background-size: cover;
    background-attachment: scroll;
    padding: clamp(2.5rem, 5vw, 5rem) 0
}

@media (hover: hover) and (min-width: 992px) {
    #contact-cta { background-attachment: fixed; }
}

/* Corrige background-attachment: fixed para iOS/móviles */

/* PHP Email Form Messages (needed on inner pages that don't load main.css)
------------------------------*/
.php-email-form .error-message {
    display: none;
}

.php-email-form .sent-message {
    display: none;
}

.php-email-form .loading {
    display: none;
}


/*--------------------------------------------------------------
# Mobile polish — portfolio + inner pages (Tier 2: C1, C3, C5, C8)
#   C1 — portfolio filter chips wrap tighter at <576px
#   C3 — rating markers / labels shrink at <576px
#   C5 — gallery swiper navigation moves closer to edges at <576px
#   C8 — breadcrumbs reduce size at <576px
--------------------------------------------------------------*/
@media (max-width: 575.98px) {

    /* C8 — Breadcrumbs */
    .page-title .breadcrumbs ol {
        font-size: 0.8rem;
    }
    .page-title .breadcrumbs ol li + li {
        padding-left: 8px;
    }
    .page-title .breadcrumbs ol li + li::before {
        padding-right: 8px;
    }

    /* C1 — Portfolio filters */
    .portfolio .portfolio-filters {
        gap: 0.5rem 1rem;
        font-size: 0.875rem;
        padding-bottom: 0.5rem;
    }
    .portfolio .portfolio-filters::after {
        display: none;
    }
    .portfolio .portfolio-filters li {
        padding: 8px 0;
        min-height: 40px;
    }

    /* C5 — Gallery swiper buttons closer to slide edges, smaller hit area */
    .portfolio-details .main-visual .swiper-button-prev {
        left: 10px;
        width: 38px;
        height: 38px;
    }
    .portfolio-details .main-visual .swiper-button-next {
        right: 10px;
        width: 38px;
        height: 38px;
    }
    .portfolio-details .main-visual .swiper-button-next::after,
    .portfolio-details .main-visual .swiper-button-prev::after {
        font-size: 0.9rem;
    }
}