/* === Portfolio Single Page — CasaXpert v1.1.5 === */

/* Hero */
.cx-portfolio-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}
.cx-portfolio-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.78) 100%);
}
.cx-portfolio-hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 60px 50px;
    width: 100%;
}
.cx-portfolio-hero-tag {
    display: inline-block;
    background: #FB5B11;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 14px;
    border-radius: 2px;
    margin-bottom: 16px;
    font-family: 'Barlow', sans-serif;
}
.cx-portfolio-hero-content h1 {
    color: #fff;
    font-size: 50px;
    font-weight: 800;
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
    margin: 0;
    max-width: 900px;
    line-height: 1.1;
}

/* Breadcrumbs */
.cx-breadcrumbs {
    background: #fff;
    padding: 14px 0;
    border-bottom: 1px solid #e8e8e8;
}
.cx-breadcrumbs-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.cx-breadcrumbs a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    font-family: 'Barlow', sans-serif;
    transition: color 0.2s;
}
.cx-breadcrumbs a:hover { color: #FB5B11; }
.cx-breadcrumbs .cx-bc-sep {
    color: #ccc;
    font-size: 13px;
    margin: 0 8px;
}
.cx-breadcrumbs .cx-bc-current {
    color: #FB5B11;
    font-size: 13px;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
}

/* === Section title style === */
.cx-pf-section-title {
    font-family: 'Jost', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0E0E0E;
    text-transform: uppercase;
    margin: 0 0 12px;
    text-align: center;
    letter-spacing: 0.03em;
    line-height: 1.2;
}
.cx-pf-section-sub {
    text-align: center;
    color: #888;
    font-size: 15px;
    font-family: 'Barlow', sans-serif;
    margin-bottom: 40px;
}
.cx-pf-section-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #FB5B11;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: 'Barlow', sans-serif;
    margin-bottom: 14px;
}
.cx-pf-section-label::before,
.cx-pf-section-label::after {
    content: '';
    width: 30px;
    height: 2px;
    background: #FB5B11;
    display: block;
}

/* Container helpers */
.cx-pf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}
.cx-pf-container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 30px;
}

/* === Details + Before/After section === */
.cx-pf-details-section {
    padding: 72px 0 80px;
    background: #fff;
}
.cx-pf-details-section .cx-pf-container {
    max-width: 1400px;
    padding: 0 40px;
}
.cx-pf-details-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 48px;
    align-items: start;
}
/* Prevent grid items from overflowing their track */
.cx-pf-details-grid > * {
    min-width: 0;
    overflow: hidden;
}

/* Project info card */
.cx-pf-info-card {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #efefef;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.cx-pf-info-card-header {
    background: #0E0E0E;
    padding: 20px 28px;
}
.cx-pf-info-card h3 {
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.cx-pf-info-body {
    padding: 8px 28px 20px;
}
.cx-pf-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cx-pf-info-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f3f3f3;
    font-size: 15px;
    color: #444;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
}
.cx-pf-info-list li:last-child { border-bottom: none; }
.cx-pf-info-list li i {
    color: #FB5B11;
    font-size: 19px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* === Before/After drag comparison slider === */
.cx-ba-section { position: relative; }

.cx-compare {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    height: 420px;
    cursor: ew-resize;
    user-select: none;
    touch-action: none;
    background: #111;
}
.cx-compare-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    max-width: none;
}
.cx-compare-before {
    z-index: 1;
    clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.cx-compare-after {
    z-index: 2;
    clip-path: inset(0 0 0 var(--pos, 50%));
}
.cx-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos, 50%);
    width: 3px;
    background: rgba(255,255,255,0.95);
    z-index: 10;
    transform: translateX(-50%);
    pointer-events: none;
}
.cx-compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    background: #FB5B11;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    gap: 1px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
.cx-compare-lbl {
    position: absolute;
    top: 14px;
    background: rgba(0,0,0,0.62);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 13px;
    border-radius: 3px;
    z-index: 5;
    pointer-events: none;
    font-family: 'Barlow', sans-serif;
}
.cx-compare-lbl-l { left: 14px; }
.cx-compare-lbl-r { right: 14px; }

/* Hidden pair */
.cx-compare-pair { display: block; }
.cx-compare-hidden { display: none; }

/* Fade-in when showing a comparison pair */
@keyframes cx-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cx-compare-pair:not(.cx-compare-hidden) {
    animation: cx-fade-in 0.3s ease;
}

/* Pair navigation (shown only when >1 pair) */
.cx-ba-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}
.cx-ba-prev, .cx-ba-next {
    width: 40px;
    height: 40px;
    background: #FB5B11;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}
.cx-ba-prev:hover, .cx-ba-next:hover { background: #e04d00; }
.cx-ba-counter {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    min-width: 44px;
    text-align: center;
}

/* === Cosa abbiamo fatto === */
.cx-pf-works {
    padding: 72px 0;
    background: #f8f8f8;
}
.cx-pf-work-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 48px;
}
.cx-pf-work-list li {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    color: #444;
    padding: 11px 0 11px 26px;
    position: relative;
    border-bottom: 1px solid #e8e8e8;
    break-inside: avoid;
    line-height: 1.5;
}
.cx-pf-work-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #FB5B11;
    border-radius: 50%;
}

/* === Description === */
.cx-pf-description {
    padding: 72px 0;
    background: #fff;
}
.cx-pf-description-text {
    font-size: 16px;
    line-height: 1.9;
    color: #555;
    font-family: 'Barlow', sans-serif;
}
.cx-pf-description-text p { margin-bottom: 18px; }

/* === Gallery === */
.cx-pf-gallery {
    padding: 72px 0 80px;
    background: #fff;
}
.cx-gallery-main-slider .cx-gallery-slide {
    background: #0E0E0E;
    border-radius: 4px;
    cursor: zoom-in;
}
.cx-gallery-main-slider .cx-gallery-slide img {
    width: 100%;
    height: 560px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}
.cx-gallery-main-slider .slick-prev,
.cx-gallery-main-slider .slick-next {
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.6) !important;
    border-radius: 50%;
    z-index: 5;
    transition: background 0.2s;
}
.cx-gallery-main-slider .slick-prev { left: 16px; }
.cx-gallery-main-slider .slick-next { right: 16px; }
.cx-gallery-main-slider .slick-prev:before,
.cx-gallery-main-slider .slick-next:before {
    color: #fff;
    font-size: 18px;
}
.cx-gallery-main-slider .slick-prev:hover,
.cx-gallery-main-slider .slick-next:hover { background: #FB5B11 !important; }

.cx-gallery-thumbs-slider {
    margin-top: 12px;
}
.cx-gallery-thumbs-slider .cx-gallery-thumb {
    padding: 4px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    outline: none;
}
.cx-gallery-thumbs-slider .cx-gallery-thumb:hover { opacity: 0.85; }
.cx-gallery-thumbs-slider .slick-current .cx-gallery-thumb {
    opacity: 1;
    outline: 2px solid #FB5B11;
    outline-offset: 2px;
}
.cx-gallery-thumbs-slider .cx-gallery-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

/* === Review — dark testimonial block === */
.cx-pf-review {
    padding: 80px 0;
    background: #0E0E0E;
    position: relative;
    overflow: hidden;
}
.cx-pf-review::before {
    content: '\201C';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 240px;
    color: rgba(251,91,17,0.12);
    font-family: 'Jost', serif;
    line-height: 1;
    pointer-events: none;
    font-weight: 800;
}
.cx-review-card {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 30px;
}
.cx-review-stars {
    color: #FB5B11;
    font-size: 24px;
    letter-spacing: 4px;
    margin-bottom: 28px;
    display: block;
}
.cx-review-text {
    font-size: 20px;
    line-height: 1.8;
    color: rgba(255,255,255,0.85);
    font-style: italic;
    font-family: 'Barlow', sans-serif;
    margin-bottom: 28px;
}
.cx-review-author {
    font-size: 15px;
    font-weight: 700;
    color: #FB5B11;
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === CTA contact section === */
.cx-pf-contact {
    padding: 80px 0 90px;
    background: #f8f8f8;
    border-top: 4px solid #FB5B11;
}
.cx-pf-contact-lead {
    text-align: center;
    color: #666;
    font-size: 17px;
    font-family: 'Barlow', sans-serif;
    margin: 0 0 40px;
    line-height: 1.7;
}

/* Contact Form 7 styling */
.cx-pf-contact .wpcf7-form-control:not(.wpcf7-submit) {
    border: 1.5px solid #1a1a1a !important;
    border-radius: 3px;
    background: #fff;
}
.cx-pf-contact .wpcf7-form-control::placeholder {
    color: #555 !important;
    opacity: 1;
}
.cx-pf-contact input[type="submit"],
.cx-pf-contact .wpcf7-submit {
    background: #FB5B11 !important;
    border: 2px solid #FB5B11 !important;
    color: #fff !important;
    cursor: pointer;
    display: block !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    float: none !important;
}
.cx-pf-contact input[type="submit"]:hover,
.cx-pf-contact .wpcf7-submit:hover {
    background: #e04d00 !important;
    border-color: #e04d00 !important;
}

/* === Back to portfolio button === */
.cx-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FB5B11;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Barlow', sans-serif;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 40px;
    transition: color 0.2s;
}
.cx-back-btn:hover { color: #e04d00; }
.cx-back-btn i { font-size: 16px; }

/* === Mobile === */
@media (max-width: 1024px) {
    .cx-pf-details-grid { grid-template-columns: 1fr; gap: 30px; }
    .cx-pf-info-card { max-width: 520px; }
}
@media (max-width: 767px) {
    .cx-portfolio-hero { height: 60vh; min-height: 320px; }
    .cx-portfolio-hero-content { padding: 30px 20px 24px; }
    .cx-portfolio-hero-content h1 { font-size: 28px; }
    .cx-portfolio-hero-tag { font-size: 11px; }
    .cx-pf-container, .cx-pf-container-narrow { padding: 0 16px; }
    .cx-pf-details-section,
    .cx-pf-description,
    .cx-pf-gallery,
    .cx-pf-review,
    .cx-pf-contact { padding: 48px 0; }
    .cx-compare { height: 260px; }
    .cx-pf-work-list { columns: 1; }
    .cx-gallery-main-slider .cx-gallery-slide img { height: 280px; }
    .cx-gallery-thumbs-slider .cx-gallery-thumb img { height: 52px; }
    .cx-review-text { font-size: 16px; }
    .cx-pf-section-title { font-size: 24px; }
    .cx-pf-review::before { font-size: 160px; }
}

/* === Lightbox === */
.cx-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.94);
    align-items: center;
    justify-content: center;
}
.cx-lightbox.cx-lb-open { display: flex; }
.cx-lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}
.cx-lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s;
    z-index: 1;
    padding: 0;
}
.cx-lb-close:hover { opacity: 1; }
.cx-lb-prev, .cx-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s, background 0.2s;
}
.cx-lb-prev { left: 20px; }
.cx-lb-next { right: 20px; }
.cx-lb-prev:hover, .cx-lb-next:hover { opacity: 1; background: #FB5B11; }
body.cx-lb-lock { overflow: hidden; }
