/**
 * EstiConnect Pro — Frontend Styles
 *
 * Theme-agnostic: NO max-width, NO container.
 * The theme controls page structure, width, and sidebar.
 * We only style what's inside the content area.
 */

:root {
    --ec-primary: #1a2b4a;
    --ec-accent: #c8102e;
    --ec-accent-hover: #a00d24;
    --ec-gold: #96805a;
    --ec-hero-height: 560px;
    --ec-hero-height-mobile: 340px;
    --ec-text: #2c3e50;
    --ec-text-light: #6b7b8d;
    --ec-text-muted: #95a5b6;
    --ec-border: #e8ecf0;
    --ec-bg: #fff;
    --ec-bg-light: #f7f9fb;
    --ec-radius: 14px;
    --ec-radius-sm: 8px;
    --ec-shadow: 0 2px 14px rgba(26, 43, 74, 0.07);
    --ec-shadow-lg: 0 20px 40px -8px rgba(26, 43, 74, 0.22);
    --ec-gap: 28px;
    --ec-ease: cubic-bezier(0.22, 1, 0.36, 1);
}


/* ═══════════════════════════════════════════════════════
   GRID / CARDS (archive pages & shortcodes)
   ═══════════════════════════════════════════════════════ */

.esticonnect-grid {
    display: grid;
    gap: var(--ec-gap);
    grid-template-columns: repeat(3, 1fr);
}

.esticonnect-grid--2col { grid-template-columns: repeat(2, 1fr); }
.esticonnect-grid--3col { grid-template-columns: repeat(3, 1fr); }
.esticonnect-grid--4col { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .esticonnect-grid--3col,
    .esticonnect-grid--4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .esticonnect-grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.esticonnect-card {
    background: var(--ec-bg);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    box-shadow: var(--ec-shadow);
    transition: box-shadow 0.4s var(--ec-ease), transform 0.4s var(--ec-ease), border-color 0.4s var(--ec-ease);
}

.esticonnect-card:hover {
    box-shadow: var(--ec-shadow-lg);
    transform: translateY(-6px);
    border-color: transparent;
}

.esticonnect-card__image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--ec-bg-light);
}

.esticonnect-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ec-ease);
}

.esticonnect-card:hover .esticonnect-card__image::after { opacity: 1; }

.esticonnect-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ec-ease);
}

.esticonnect-card:hover .esticonnect-card__image img {
    transform: scale(1.08);
}

.esticonnect-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: var(--ec-accent);
    color: #fff;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.35);
}

.esticonnect-card__price-tag {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    color: var(--ec-primary);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.2px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(4px);
    opacity: 0.94;
    transition: transform 0.4s var(--ec-ease), opacity 0.4s var(--ec-ease);
}

.esticonnect-card:hover .esticonnect-card__price-tag {
    transform: translateY(0);
    opacity: 1;
}

.esticonnect-card__body { padding: 20px 20px 22px; }

.esticonnect-card__title {
    margin: 0 0 6px;
    font-size: 16.5px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.esticonnect-card__title a {
    color: var(--ec-primary);
    text-decoration: none;
    transition: color 0.2s;
    background-image: linear-gradient(var(--ec-accent), var(--ec-accent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 2px;
    transition: color 0.25s ease, background-size 0.35s var(--ec-ease);
}

.esticonnect-card__title a:hover {
    color: var(--ec-accent);
    background-size: 100% 2px;
}

.esticonnect-card__price {
    font-size: 20px;
    font-weight: 700;
    color: var(--ec-primary);
    margin-bottom: 10px;
}

.esticonnect-card__price small {
    font-size: 13px;
    font-weight: 400;
    color: var(--ec-text-light);
}

.esticonnect-card__price-m2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-accent);
    margin-bottom: 12px;
}

.esticonnect-card__meta {
    list-style: none;
    margin: 0 0 12px;
    padding: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ec-text-light);
    border-top: 1px solid var(--ec-border);
    border-bottom: 1px solid var(--ec-border);
}

.esticonnect-card__meta li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.esticonnect-card__meta li svg {
    color: var(--ec-accent);
    opacity: 0.85;
    flex-shrink: 0;
}

.esticonnect-card__excerpt {
    font-size: 13.5px;
    color: var(--ec-text-light);
    line-height: 1.6;
    margin-bottom: 14px;
}

.esticonnect-card__excerpt p { margin: 0; }

.esticonnect-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ec-primary);
    text-decoration: none;
    letter-spacing: 0.1px;
    transition: gap 0.3s var(--ec-ease), color 0.25s ease;
}

.esticonnect-card__cta svg { transition: transform 0.3s var(--ec-ease); }

.esticonnect-card__cta:hover {
    gap: 11px;
    color: var(--ec-accent);
}

.esticonnect-empty {
    text-align: center;
    color: var(--ec-text-light);
    padding: 40px 20px;
}


/* ═══════════════════════════════════════════════════════
   SINGLE PROPERTY (ec-property)
   Injected via the_content — lives inside theme's container.
   ═══════════════════════════════════════════════════════ */

.ec-property {
    color: var(--ec-text);
}

/* ── Hero (gallery slider — full photo visible, no crop) ─── */

.ec-hero-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

/* Thumbs on the right (default) or left, via modifier class */
.ec-hero-wrap--thumbs-left { flex-direction: row-reverse; }

/* Peek previews turned off in settings — main photo takes the full width */
.ec-hero-wrap--no-peek .ec-hero__main {
    max-width: 100%;
    flex: 1 1 auto;
}

.ec-hero {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.ec-hero__stage {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: var(--ec-hero-height);
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow-lg);
    /* Transparent on purpose — the gap between main photo and peeks (and any
       leftover space around them) shows whatever page background sits behind
       it, so it always matches the theme instead of a hardcoded brand color. */
    background: transparent;
}

/* Side previews of the prev/next photo — replace what would otherwise be an
   empty margin, while also inviting further browsing. Desktop only; hidden
   on mobile where the stage is edge-to-edge (see media query below). */
.ec-hero__peek {
    position: relative;
    flex: 1 1 0;
    min-width: 36px;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--ec-radius-sm);
    background: transparent;
}

.ec-hero__peek img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.5);
    transition: filter 0.3s ease, transform 0.6s var(--ec-ease);
}

.ec-hero__peek:hover img {
    filter: brightness(0.75);
    transform: scale(1.06);
}

/* Sized to the ACTUAL photo's own aspect ratio (set inline per-slide from
   attachment metadata), so there's no internal letterboxing — the box is
   exactly as tall and as wide as the photo, nothing more. */
.ec-hero__main {
    position: relative;
    flex: 0 1 auto;
    width: auto;
    height: 100%;
    aspect-ratio: 3 / 2; /* fallback only — overridden inline per photo */
    max-width: 88%;
    overflow: hidden;
    border-radius: var(--ec-radius-sm);
}

.ec-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Slider arrows */
.ec-hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(10, 16, 28, 0.45);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s var(--ec-ease);
    padding: 0;
}

.ec-hero__arrow:hover {
    background: rgba(10, 16, 28, 0.7);
    transform: translateY(-50%) scale(1.08);
}

.ec-hero__arrow--prev { left: 16px; }
.ec-hero__arrow--next { right: 16px; }

/* Top row — badges + price (left, wraps if needed) + photo counter (right),
   all sharing one line at the top of the photo. Scoped to .ec-hero__main
   only, so it never spills into the peek zones on either side. Absolutely
   positioned = doesn't add height to .ec-hero, keeping it exactly the same
   height as the thumbnail rail regardless of how much wraps here. */
.ec-hero__top-row {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.ec-hero__badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.ec-hero__photo-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(10, 16, 28, 0.5);
    backdrop-filter: blur(6px);
    padding: 6px 12px;
    border-radius: 20px;
}

.ec-badge--location-hero {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ec-badge--location-hero svg { color: #fff; }

/* Gold branded price pill */
.ec-hero__price-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--ec-gold);
    border-radius: 30px;
    padding: 5px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ec-hero__price {
    font-size: 1.05em;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
}

.ec-hero__price-m2 {
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

/* Title + date, as small badge pills over the bottom-left of the photo —
   scoped to .ec-hero__main only (never bleeds into the peek zones), and a
   solid-ish dark pill means readability never depends on the photo's own
   colors underneath. */
.ec-hero__bottom-overlay {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* This is a real <h1> (see property-content.php / case-study-content.php) —
   the theme's own title header is turned off when "tytuł na zdjęciu" is on,
   so this badge is the page's only H1 and needs to read as a proper headline,
   not get clipped to one line. */
.ec-badge--hero-title {
    background: rgba(10, 16, 28, 0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 15px;
    line-height: 1.35;
    max-width: 100%;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.ec-badge--hero-date {
    background: rgba(10, 16, 28, 0.45);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.2px;
}

.ec-property__id-row {
    margin: 14px 0 20px;
}

/* Thumbnail rail — vertical column beside the hero on desktop */
.ec-hero-thumbs-wrap {
    flex: 0 0 88px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: var(--ec-hero-height);
}

.ec-hero-thumbs__scroll {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    border: none;
    border-radius: var(--ec-radius-sm);
    background: var(--ec-bg-light);
    color: var(--ec-text-light);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ec-hero-thumbs__scroll:hover {
    background: var(--ec-primary);
    color: #fff;
}

.ec-hero-thumbs {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.ec-hero-thumbs__item {
    flex: 0 0 auto;
    width: 100%;
    height: 68px;
    border-radius: var(--ec-radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.25s ease, border-color 0.25s ease;
}

.ec-hero-thumbs__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ec-hero-thumbs__item:hover { opacity: 0.9; }

.ec-hero-thumbs__item.is-active {
    opacity: 1;
    border-color: var(--ec-gold);
}

@media (max-width: 900px) {
    /* Mobile/tablet: thumbs always go back to a horizontal strip under the photo,
       regardless of the left/right setting (that's a desktop-only preference).
       Side previews only make sense with the extra desktop width, so they're
       hidden here and the main photo takes the full stage. */
    .ec-hero-wrap,
    .ec-hero-wrap--thumbs-left {
        flex-direction: column;
        align-items: stretch;
    }
    .ec-hero__stage { height: var(--ec-hero-height-mobile); }
    .ec-hero__peek { display: none; }
    .ec-hero__main { max-width: 100%; flex: 1 1 auto; aspect-ratio: auto !important; }
    .ec-badge--hero-title { font-size: 12px; }
    .ec-hero-thumbs-wrap { flex-direction: row; height: auto; }
    .ec-hero-thumbs__scroll { display: none; }
    .ec-hero__price-pill { padding: 5px 14px; }
    .ec-hero-thumbs {
        flex-direction: row;
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .ec-hero-thumbs__item { flex: 0 0 auto; width: 84px; height: 60px; }
    .ec-hero__top-row { top: 8px; left: 8px; right: 8px; gap: 5px; }
    .ec-hero__badges-inline { gap: 4px; }

    /* Compact everything in the top row — badges, location pill, price pill —
       smaller type and tighter padding so it takes up less of the photo. */
    .ec-hero__badges-inline .ec-badge {
        padding: 3px 8px;
        font-size: 9px;
        letter-spacing: 0.2px;
        gap: 3px;
    }
    .ec-hero__badges-inline .ec-badge--location-hero svg { width: 10px; height: 10px; }

    .ec-hero__price-pill { padding: 3px 9px; gap: 5px; }
    .ec-hero__price { font-size: 0.78em; }
    .ec-hero__price-m2 { font-size: 0.68em; }

    .ec-hero__photo-count { font-size: 9.5px; padding: 3px 8px; gap: 4px; }
    .ec-hero__photo-count svg { width: 11px; height: 11px; }
}

/* ── Price Bar ────────────────────────────────────── */

.ec-property__price-bar {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ec-property__price {
    font-size: 1.9em;
    font-weight: 800;
    color: var(--ec-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.ec-property__price-m2 {
    font-size: 0.9em;
    color: var(--ec-text-light);
}

/* ── Badges ───────────────────────────────────────── */

.ec-property__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ec-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
}

.ec-badge--type {
    background: var(--ec-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 43, 74, 0.25);
}

.ec-badge--transaction {
    background: var(--ec-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.ec-badge--casestudy {
    background: #1e7e4f;
    color: #fff;
    box-shadow: 0 4px 12px rgba(30, 126, 79, 0.3);
}

.ec-badge--casestudy svg { flex-shrink: 0; }

.ec-badge--location {
    background: var(--ec-bg-light);
    color: var(--ec-text);
    border: 1px solid var(--ec-border);
    text-transform: none;
    font-weight: 500;
}

.ec-badge--location svg {
    color: var(--ec-accent);
    flex-shrink: 0;
}

.ec-badge--id {
    background: var(--ec-bg-light);
    color: var(--ec-text-muted);
    border: 1px solid var(--ec-border);
    font-weight: 500;
    font-size: 11px;
}


/* ═══════════════════════════════════════════════════════
   GALLERY — 2-column equal grid with lightbox
   ═══════════════════════════════════════════════════════ */

.ec-gallery-section {
    margin-bottom: 32px;
}

.ec-gallery-section__count {
    font-weight: 400;
    color: var(--ec-text-muted);
    font-size: 0.85em;
}

.ec-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ec-gallery-grid--2col { grid-template-columns: repeat(2, 1fr); }
.ec-gallery-grid--3col { grid-template-columns: repeat(3, 1fr); }
.ec-gallery-grid--4col { grid-template-columns: repeat(4, 1fr); }
.ec-gallery-grid--5col { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 768px) {
    .ec-gallery-grid--3col,
    .ec-gallery-grid--4col,
    .ec-gallery-grid--5col {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ec-gallery-grid__item {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--ec-radius-sm);
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.ec-gallery-grid__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.ec-gallery-grid__item:hover .ec-gallery-grid__img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

@media (max-width: 480px) {
    .ec-gallery-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════
   QUICK FACTS
   ═══════════════════════════════════════════════════════ */

.ec-facts {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(180deg, var(--ec-bg-light), var(--ec-bg));
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: var(--ec-shadow);
}

.ec-fact {
    flex: 1;
    min-width: 100px;
    padding: 18px 16px;
    text-align: center;
    border-right: 1px solid var(--ec-border);
    transition: background 0.3s ease;
}

.ec-fact:hover { background: rgba(200, 16, 46, 0.04); }

.ec-fact:last-child { border-right: none; }

.ec-fact__icon {
    display: block;
    margin: 0 auto 8px;
    color: var(--ec-accent);
}

.ec-fact__value {
    display: block;
    font-size: 1.3em;
    font-weight: 800;
    color: var(--ec-primary);
    line-height: 1.2;
    margin-bottom: 3px;
    letter-spacing: -0.3px;
}

.ec-fact__label {
    display: block;
    font-size: 11px;
    color: var(--ec-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .ec-fact {
        min-width: 48%;
        border-bottom: 1px solid var(--ec-border);
    }
    .ec-fact:nth-child(even) { border-right: none; }
    .ec-fact:nth-last-child(-n+2) { border-bottom: none; }
    /* A lone last item in an odd-count list (e.g. 5 facts → 2+2+1) would
       otherwise flex-grow to fill the whole row on its own; keep it the
       same width as the others and just leave the remaining space empty. */
    .ec-fact:last-child:nth-child(odd) { flex-grow: 0; }
}


/* (No multi-column grid — single column, theme controls sidebar) */


/* ── Section Title ────────────────────────────────── */

.ec-section-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--ec-primary);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ec-border);
}


/* ── Details Table ────────────────────────────────── */

.ec-details {
    margin-bottom: 32px;
    background: var(--ec-bg-light);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    padding: 0;
}

.ec-details .ec-section-title {
    padding: 16px 20px 12px;
    margin: 0;
    border-bottom: 2px solid var(--ec-border);
    border-radius: 0;
}

.ec-details__table {
    width: 100%;
    border-collapse: collapse;
}

.ec-details__table tr {
    border-bottom: 1px solid var(--ec-border);
}

.ec-details__table tr:last-child {
    border-bottom: none;
}

/* Zebra-striping for readability */
.ec-details__table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.ec-details__table tr {
    transition: background 0.2s ease;
}

.ec-details__table tr:hover {
    background: rgba(200, 16, 46, 0.04);
}

.ec-details__table th,
.ec-details__table td {
    padding: 12px 20px;
    font-size: 0.9em;
    vertical-align: top;
}

.ec-details__table th {
    font-weight: 500;
    color: var(--ec-text-light);
    text-align: left;
    width: 45%;
}

.ec-details__table td {
    font-weight: 600;
    color: var(--ec-text);
    text-align: left;
}


/* ── Description ──────────────────────────────────── */

.ec-description { margin-bottom: 28px; }

/* Clearfix: inline floated photos inside .ec-description__text must not
   bleed past the description block into the sections that follow (map,
   gallery, related) — without this, a tall float can squeeze/overlap the
   next section's heading instead of stacking cleanly below it. */
.ec-description::after {
    content: "";
    display: table;
    clear: both;
}

/* The heading right above the article body should read at the same size
   as the article's own <h3> sub-headings, not the smaller boxed section
   label used elsewhere on the page. */
.ec-description > .ec-section-title {
    font-size: 1.9em;
    font-weight: 600;
    color: var(--ec-gold);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 18px;
}

.ec-description__text {
    font-size: 0.95em;
    line-height: 1.75;
    color: var(--ec-text);
}

.ec-description__text p { margin: 0 0 1em; }

.ec-description__text ul,
.ec-description__text ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.ec-description__text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ec-radius-sm);
}

/* Photo breaks woven into the case-study article — floated so the article's
   own text wraps around them (alternating sides), a more editorial/magazine
   treatment than the plain gallery grid further down the page. Headings
   always clear the float so a heading never gets squeezed next to a photo. */
.ec-cs-inline-photo {
    width: 42%;
    margin: 0.3em 0 1.2em;
}

.ec-cs-inline-photo--left {
    float: left;
    margin-right: 1.5em;
}

.ec-cs-inline-photo--right {
    float: right;
    margin-left: 1.5em;
}

.ec-cs-inline-photo__img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-shadow);
}

.ec-description__text h3,
.ec-description__text h4 {
    clear: both;
}

@media (max-width: 640px) {
    .ec-cs-inline-photo,
    .ec-cs-inline-photo--left,
    .ec-cs-inline-photo--right {
        float: none;
        width: 100%;
        margin: 1.2em 0;
    }
}


/* ═══════════════════════════════════════════════════════
   CONTACT (inline horizontal bar)
   ═══════════════════════════════════════════════════════ */

.ec-contact {
    background: var(--ec-bg-light);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 20px 24px;
    margin-bottom: 32px;
}

.ec-contact__title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--ec-primary);
    margin: 0 0 14px;
}

.ec-contact__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ec-contact__name {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--ec-text);
    margin-right: 8px;
}

.ec-contact__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--ec-radius-sm);
    font-size: 0.9em;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.3s var(--ec-ease);
    box-sizing: border-box;
    white-space: nowrap;
}

.ec-contact__btn:hover { transform: translateY(-2px); }

.ec-contact__btn svg { flex-shrink: 0; }

.ec-contact__btn--phone {
    background: var(--ec-accent);
    color: #fff !important;
}

.ec-contact__btn--phone:hover {
    background: var(--ec-accent-hover);
    color: #fff !important;
}

.ec-contact__btn--phone svg { stroke: #fff; }

.ec-contact__btn--email {
    background: var(--ec-bg);
    color: var(--ec-primary) !important;
    border: 1px solid var(--ec-border);
}

.ec-contact__btn--email:hover {
    background: var(--ec-primary);
    color: #fff !important;
    border-color: var(--ec-primary);
}

.ec-contact__btn--email:hover svg { stroke: #fff; }

@media (max-width: 600px) {
    .ec-contact__row {
        flex-direction: column;
        align-items: stretch;
    }
    .ec-contact__btn {
        justify-content: center;
    }
}


/* ── Map Section (in main column) ─────────────────── */

.ec-map-section {
    margin-bottom: 32px;
}

.ec-map__embed {
    border-radius: var(--ec-radius);
    overflow: hidden;
    border: 1px solid var(--ec-border);
}

.ec-map__embed iframe {
    display: block;
    width: 100%;
}


/* ═══════════════════════════════════════════════════════
   ARCHIVE HEADER & PAGINATION
   ═══════════════════════════════════════════════════════ */

.ec-archive-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--ec-border);
}

.ec-archive-header__title {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--ec-primary);
    margin: 0 0 8px;
}

.ec-archive-header__desc {
    font-size: 1em;
    color: var(--ec-text-light);
    margin: 0;
}

.ec-cs-archive-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 36px;
}

.ec-cs-archive-intro__logo {
    margin-bottom: 16px;
}

.ec-cs-archive-intro__logo img {
    max-height: 56px;
    width: auto;
    margin: 0 auto;
}

.ec-cs-archive-intro__text {
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--ec-text-light);
    margin: 0;
}

.ec-cs-archive-cta {
    text-align: center;
    margin-top: 48px;
    padding: 40px 24px;
    background: var(--ec-bg-light);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
}

.ec-cs-archive-cta__title {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--ec-primary);
    margin: 0 0 10px;
}

.ec-cs-archive-cta__text {
    font-size: 0.98em;
    color: var(--ec-text-light);
    max-width: 520px;
    margin: 0 auto 22px;
    line-height: 1.6;
}

/* Placeholder when no image */
.esticonnect-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--ec-bg-light);
    aspect-ratio: 16 / 10;
}

/* Card tags row */
.esticonnect-card__tags {
    margin-top: 10px;
}

/* Pagination */
.esticonnect-pagination {
    margin-top: 40px;
    text-align: center;
}

.esticonnect-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.esticonnect-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--ec-text);
    text-decoration: none;
    transition: all 0.2s;
}

.esticonnect-pagination .page-numbers:hover {
    background: var(--ec-primary);
    color: #fff;
    border-color: var(--ec-primary);
}

.esticonnect-pagination .page-numbers.current {
    background: var(--ec-accent);
    color: #fff;
    border-color: var(--ec-accent);
}


/* ═══════════════════════════════════════════════════════
   CASE STUDY — COMPACT 2-COL CARDS WITH MINI GALLERY
   ═══════════════════════════════════════════════════════ */

.ec-cs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

@media (max-width: 768px) {
    .ec-cs-grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.ec-cs-card {
    background: var(--ec-bg);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    box-shadow: var(--ec-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ec-cs-card:hover {
    box-shadow: var(--ec-shadow-lg);
    transform: translateY(-3px);
}

/* Gallery link wrapper */
.ec-cs-card__gallery {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Main image */
.ec-cs-card__main-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.ec-cs-card__main-img > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.ec-cs-card:hover .ec-cs-card__main-img > img {
    transform: scale(1.04);
}

/* Overlay — gradient + info */
.ec-cs-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 14px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ec-cs-card__overlay-badges {
    display: flex;
    gap: 6px;
}

.ec-cs-card__tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

.ec-cs-card__overlay-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.ec-cs-card__info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.ec-cs-card__info-item svg {
    opacity: 0.8;
}

/* Photo count badge */
.ec-cs-card__photo-count {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* Mini thumbnails row (3 under main) */
.ec-cs-card__thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 3px 0 0;
    background: var(--ec-border);
}

.ec-cs-card__thumb {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ec-bg-light);
}

.ec-cs-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ec-cs-card:hover .ec-cs-card__thumb img {
    transform: scale(1.06);
}

.ec-cs-card__thumb--empty {
    background: var(--ec-bg-light);
}

/* Body */
.ec-cs-card__body {
    padding: 14px 16px 16px;
}

.ec-cs-card__title {
    margin: 0 0 6px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.35;
}

.ec-cs-card__title a {
    color: var(--ec-text);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-cs-card__title a:hover {
    color: var(--ec-primary);
}

.ec-cs-card__excerpt {
    font-size: 0.82em;
    line-height: 1.55;
    color: var(--ec-text-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-cs-card__excerpt p {
    margin: 0;
}

.ec-cs-card__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--ec-primary);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.ec-cs-card__link:hover {
    gap: 9px;
    color: var(--ec-accent);
}


/* ═══════════════════════════════════════════════════════
   CASE STUDY — LIST LAYOUT (image left, text right)
   ═══════════════════════════════════════════════════════ */

.ec-cs-listview {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ec-cs-listitem {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--ec-bg);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    box-shadow: var(--ec-shadow);
    transition: box-shadow 0.3s ease;
}

.ec-cs-listitem:hover {
    box-shadow: var(--ec-shadow-lg);
}

/* Image */
.ec-cs-listitem__img-wrap {
    display: block;
    position: relative;
    overflow: hidden;
}

.ec-cs-listitem__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.ec-cs-listitem:hover .ec-cs-listitem__img {
    transform: scale(1.04);
}

.ec-cs-listitem__photo-count {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* Body */
.ec-cs-listitem__body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ec-cs-listitem__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ec-cs-listitem__tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--ec-primary);
    color: #fff;
}

.ec-cs-listitem__tag--muted {
    background: var(--ec-bg-light);
    color: var(--ec-text-light);
    border: 1px solid var(--ec-border);
}

.ec-cs-listitem__title {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.35;
}

.ec-cs-listitem__title a {
    color: var(--ec-text);
    text-decoration: none;
    transition: color 0.2s;
}

.ec-cs-listitem__title a:hover {
    color: var(--ec-primary);
}

.ec-cs-listitem__meta {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.85em;
    color: var(--ec-text-light);
}

.ec-cs-listitem__meta li {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ec-cs-listitem__meta li svg {
    opacity: 0.6;
}

.ec-cs-listitem__meta li + li::before {
    content: '·';
    margin-right: 4px;
    color: var(--ec-border);
    font-weight: 700;
}

.ec-cs-listitem__excerpt {
    font-size: 0.88em;
    line-height: 1.6;
    color: var(--ec-text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-cs-listitem__excerpt p {
    margin: 0;
}

.ec-cs-listitem__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--ec-primary);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.ec-cs-listitem__link:hover {
    gap: 9px;
    color: var(--ec-accent);
}

@media (max-width: 768px) {
    .ec-cs-listitem {
        grid-template-columns: 1fr;
    }
    .ec-cs-listitem__img-wrap {
        aspect-ratio: 16 / 9;
    }
}


/* ═══════════════════════════════════════════════════════
   OPTIONAL TWO-COLUMN LAYOUT (main + WP widget sidebar)
   Only kicks in when the "EstiConnect — sidebar oferty"
   widget area actually has widgets in it.
   ═══════════════════════════════════════════════════════ */

.ec-property__layout--with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.ec-property__aside {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 900px) {
    .ec-property__layout--with-sidebar {
        grid-template-columns: 1fr;
    }
    .ec-property__aside {
        position: static;
    }
}

.ec-widget {
    background: var(--ec-bg-light);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 20px;
}

.ec-widget__title {
    font-size: 1em;
    font-weight: 700;
    color: var(--ec-primary);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ec-border);
}


/* ═══════════════════════════════════════════════════════
   RELATED PROPERTIES
   ═══════════════════════════════════════════════════════ */

.ec-related {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--ec-border);
}

.ec-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .ec-related__grid { grid-template-columns: 1fr; }
}

.ec-related__card {
    display: block;
    background: var(--ec-bg);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--ec-shadow);
    transition: box-shadow 0.35s var(--ec-ease), transform 0.35s var(--ec-ease);
}

.ec-related__card:hover {
    box-shadow: var(--ec-shadow-lg);
    transform: translateY(-4px);
}

.ec-related__img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ec-bg-light);
}

.ec-related__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ec-ease);
}

.ec-related__card:hover .ec-related__img img {
    transform: scale(1.06);
}

.ec-related__price {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ec-primary);
    font-weight: 800;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 16px;
}

.ec-related__body { padding: 14px 16px; }

.ec-related__title {
    margin: 0 0 8px;
    font-size: 0.95em;
    font-weight: 700;
    color: var(--ec-primary);
    line-height: 1.35;
}

.ec-related__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12.5px;
    color: var(--ec-text-light);
}

.ec-related__cta {
    text-align: center;
}

.ec-related__cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ec-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 28px;
    border-radius: 30px;
    transition: background 0.25s ease, gap 0.3s var(--ec-ease);
}

.ec-related__cta-btn:hover {
    background: var(--ec-accent);
    gap: 12px;
    color: #fff;
}


/* ═══════════════════════════════════════════════════════
   SIDEBAR WIDGETS — recent posts / related properties
   ═══════════════════════════════════════════════════════ */

.ec-widget-posts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ec-widget-posts__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ec-widget-posts__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: var(--ec-radius-sm);
    overflow: hidden;
    display: block;
    background: var(--ec-border);
}

.ec-widget-posts__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ec-widget-posts__thumb--empty {
    display: block;
    width: 100%;
    height: 100%;
}

.ec-widget-posts__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ec-widget-posts__title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ec-primary);
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-widget-posts__title:hover { color: var(--ec-accent); }

.ec-widget-posts__date {
    font-size: 11.5px;
    color: var(--ec-text-muted);
}

.ec-widget-posts__price {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ec-accent);
}

.ec-widget-posts__btn {
    display: block;
    text-align: center;
    margin-top: 16px;
    padding: 11px 16px;
    background: var(--ec-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    border-radius: var(--ec-radius-sm);
    transition: background 0.25s ease;
}

.ec-widget-posts__btn:hover {
    background: var(--ec-accent);
    color: #fff;
}

/* Contact widget — big call-to-action buttons */
.ec-widget-contact__row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ec-widget-contact__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--ec-radius-sm);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: transform 0.25s var(--ec-ease), background 0.25s ease;
}

.ec-widget-contact__btn:hover { transform: translateY(-2px); }

.ec-widget-contact__btn--phone {
    background: var(--ec-accent);
    color: #fff !important;
}

.ec-widget-contact__btn--phone:hover { background: var(--ec-accent-hover); }

.ec-widget-contact__btn--email {
    background: var(--ec-bg);
    color: var(--ec-primary) !important;
    border: 1px solid var(--ec-border);
}

.ec-widget-contact__btn--email:hover { background: var(--ec-bg-light); }

.ec-widget-contact__btn--blog {
    background: var(--ec-primary);
    color: #fff !important;
}

.ec-widget-contact__btn--blog:hover { background: var(--ec-accent); }

.ec-widget-contact__btn--instagram {
    background: linear-gradient(135deg, #405de6, #833ab4, #c13584, #e1306c, #fd1d1d, #f77737, #fcaf45);
    color: #fff !important;
}

.ec-widget-contact__btn--instagram:hover { filter: brightness(1.08); }

.ec-widget-contact__name {
    display: block;
    font-weight: 600;
    color: var(--ec-text);
    margin-bottom: 2px;
}
