/**
 * PJD Directory — frontend styles.
 *
 * Covers:
 *   – Search form and autocomplete dropdown
 *   – Result card grid (24-up, responsive)
 *   – Map container and popup
 *   – Amenity icon strip
 *   – Coastal badge
 *   – Pagination
 *
 * Colour tokens
 * ─────────────
 * --pjd-navy       #051435  Midnight Navy (primary brand)
 * --pjd-navy-20    #d3d6e1  Navy 20% tint (very subtle tint backgrounds)
 * --pjd-navy-10    #e9eaf0  Navy 10% tint (near-white section backgrounds)
 * --pjd-oxblood    #800020  Oxblood (actions, CTAs)
 * --pjd-gold       #c19a5f  Heritage Gold (accents, prices)
 * --pjd-blush      #F5E6E9  Soft pink (gallery/image placeholder backgrounds)
 * --pjd-pale-blue  #E8EDF5  Pale blue (thumbnail strip backgrounds)
 * --pjd-grey-1     #f5f5f5  Page background / card backgrounds
 * --pjd-grey-2     #e0e0e0  Borders
 * --pjd-grey-3     #757575  Secondary text
 * --pjd-text       #212121  Body text
 * --pjd-white      #ffffff
 *
 * @package PJD_Directory
 */

/* ─── Custom properties ──────────────────────────────────────────────────── */

:root {
    --pjd-navy:      #051435;
    --pjd-navy-20:   #d3d6e1;  /* 20% navy — borders on white */
    --pjd-navy-10:   #e9eaf0;  /* 10% navy — hover backgrounds */
    --pjd-navy-5:    #f4f5f9;  /* 5% navy — section backgrounds */
    --pjd-oxblood:   #800020;
    --pjd-gold:      #c19a5f;
    --pjd-blush:     #F5E6E9;  /* Soft pink — gallery/image backgrounds */
    --pjd-pale-blue: #E8EDF5;  /* Pale blue — thumbnail strip backgrounds */
    --pjd-grey-1:    #f5f5f5;
    --pjd-grey-2:    #e0e0e0;
    --pjd-grey-3:    #757575;
    --pjd-text:      #212121;
    --pjd-white:     #ffffff;
    --pjd-pet:       #2e7d52;  /* Semantic green — "Dogs welcome" pill (not a brand colour) */
    --pjd-pet-bg:    #e7f3ec;  /* Pale green — pet pill background */
    --pjd-radius:    6px;
    --pjd-shadow:    0 2px 8px rgba(0, 0, 0, 0.10);
    --pjd-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ─── Search form ────────────────────────────────────────────────────────── */

.pjd-search {
    background: var(--pjd-white);
    padding: 28px 20px;
    border-top: 4px solid var(--pjd-navy);
    box-shadow: 0 2px 12px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.08);
}

.pjd-search__inner {
    max-width: 960px;
    margin: 0 auto;
}

.pjd-search__heading {
    color: var(--pjd-navy);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.pjd-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.pjd-search__location-wrap {
    position: relative;
    flex: 1 1 260px;
}

.pjd-search__input {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    border: 1.5px solid var(--pjd-navy-20);
    border-radius: var(--pjd-radius);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
    color: var(--pjd-text);
    background: var(--pjd-white);
}

.pjd-search__input:focus {
    border-color: var(--pjd-navy);
    box-shadow: 0 0 0 3px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.1);
}

.pjd-search__near-me {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--pjd-grey-3);
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.pjd-search__near-me:hover {
    color: var(--pjd-navy);
}

.pjd-search__near-me svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Autocomplete dropdown */

.pjd-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--pjd-white);
    border: 1px solid var(--pjd-grey-2);
    border-radius: var(--pjd-radius);
    box-shadow: var(--pjd-shadow-lg);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pjd-autocomplete__item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--pjd-text);
    transition: background 0.1s;
}

.pjd-autocomplete__item:hover,
.pjd-autocomplete__item--active {
    background: var(--pjd-grey-1);
}

/* Filter row */

.pjd-search__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.pjd-search__select,
.pjd-search__check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pjd-white);
    border: 1.5px solid var(--pjd-navy-20);
    border-radius: var(--pjd-radius);
    padding: 6px 12px;
    color: var(--pjd-navy);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.pjd-search__select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23051435'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.pjd-search__check-label:hover,
.pjd-search__select:hover {
    background: var(--pjd-navy-10);
    border-color: var(--pjd-navy);
}

.pjd-search__check-label input[type="checkbox"] {
    accent-color: var(--pjd-navy);
    width: 15px;
    height: 15px;
}

.pjd-search__btn {
    padding: 10px 24px;
    background: var(--pjd-oxblood);
    color: var(--pjd-white);
    border: none;
    border-radius: var(--pjd-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.pjd-search__btn:hover {
    background: #600018;
}

/* ─── Results layout (Pattern B — single card column + sticky map) ────────── */
/* SEARCH page wraps cards + map aside in .pjd-results; the ARCHIVE results-first
   variant reuses it with .pjd-archive--results. The ARCHIVE default (setting
   off) renders cards in a bare .pjd-archive grid with NO .pjd-results wrapper —
   the base vertical .pjd-card below carries that context. */

.pjd-results {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr);
    gap: 32px;
    max-width: 1320px;
    margin: 0 auto;
    align-items: start;
}

.pjd-results__main {
    min-width: 0;
}

.pjd-results__aside {
    min-width: 0;
    /* The ASIDE is the sticky element (not the map inside it): with the grid's
       align-items:start it stays content-height, so it has scroll range to stick
       within the tall results column while the cards scroll past. */
    align-self: start;
    position: sticky;
    top: 90px;
}

/* No-map variant (country page: PHP adds .pjd-results--no-map and emits no aside).
   Collapse to a single column, then cap + centre it so the wide horizontal card
   stays readable. */
.pjd-results--no-map {
    grid-template-columns: 1fr;
}

.pjd-results--no-map .pjd-results__main {
    max-width: 900px;
    margin: 0 auto;
}

/* ─── Card list ──────────────────────────────────────────────────────────── */
/* The page scrolls as one — no inner-scroll panel. */

.pjd-cards {
    min-width: 0;
}

.pjd-cards__meta {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--pjd-grey-3);
}

.pjd-cards__meta strong {
    color: var(--pjd-text);
}

.pjd-cards__list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
}

/* Results-first archive: the card grid collapses to the same vertical stack.
   !important is required to beat the base `.pjd-archive { display:grid !important }`
   rule (which itself exists to override theme/Divi styles). */
.pjd-archive--results .pjd-archive {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none !important;
    gap: 18px;
}

/* ─── Property card ──────────────────────────────────────────────────────── */
/* Base = VERTICAL (used by the archive default grid). Inside .pjd-results the
   card switches to the HORIZONTAL media-rail layout further below. */

.pjd-card {
    position: relative; /* required for stretched link ::after */
    background: var(--pjd-white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.10);
    transition: box-shadow 0.2s, transform 0.15s;
    color: inherit;
}

.pjd-card:hover,
.pjd-card--hovered,
.pjd-card--pin-hover {
    box-shadow: 0 10px 30px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.16);
    transform: translateY(-2px);
}

/* Stretched link — the property name <a> expands to cover the whole card */
.pjd-card__link {
    color: inherit;
    text-decoration: none;
}

.pjd-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Colour-lock the title link. When the shared card is embedded in a Divi page
   via a shortcode, the theme's anchor colour (gold/orange) leaks into the title
   through `color: inherit` above. !important is required to beat Divi's
   `.et_pb_text_inner a` specificity tie (same precedent as .pjd-properties below);
   the value stays the --pjd-navy TOKEN so it remains rebrandable. */
.pjd-card .pjd-card__name a,
.pjd-card .pjd-card__link {
    color: var(--pjd-navy) !important;
}

.pjd-card__name a:hover {
    text-decoration: underline;
}

/* ── Media ── */
/* Vertical (base): full-width image with an aspect ratio. */

.pjd-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--pjd-navy-10), var(--pjd-pale-blue));
}

.pjd-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder — the brand-tinted gradient on .pjd-card__media shows through */
.pjd-card__image--placeholder {
    width: 100%;
    height: 100%;
}

/* ── Media badges ── */

.pjd-card__badge {
    position: absolute;
    z-index: 2; /* above the stretched link */
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    line-height: 1.3;
    color: var(--pjd-white);
}

.pjd-card__badge--coastal {
    top: 10px;
    left: 10px;
    background: rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.85);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pjd-card__badge--provider {
    bottom: 10px;
    left: 10px;
    background: var(--pjd-oxblood);
}

/* ── Body ── */

.pjd-card__body {
    padding: 22px 24px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pjd-card__name {
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
    font-weight: 600;
    color: var(--pjd-navy);
    margin: 0;
    line-height: 1.25;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* harden the clamp: a long unbroken token can't blow the card width */
    overflow-wrap: anywhere;
}

.pjd-card__location {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--pjd-grey-3);
    margin: 0;
}

.pjd-card__location-icon {
    width: 14px;
    height: 14px;
    fill: var(--pjd-oxblood);
    flex-shrink: 0;
}

.pjd-card__location-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 2; /* above the stretched link */
}

.pjd-card__location-link:hover {
    text-decoration: underline;
}

.pjd-card__excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--pjd-grey-3);
    margin: 0;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pjd-card__distance {
    font-size: 0.8rem;
    color: var(--pjd-grey-3);
    margin: 0;
}

/* ── Pills ── */

.pjd-card__pills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pjd-card__pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: var(--pjd-pale-blue);
    color: var(--pjd-navy);
    font-size: 0.78rem;
    padding: 4px 11px;
}

.pjd-card__pill-icon {
    width: 13px;
    height: 13px;
    fill: currentColor;
    flex-shrink: 0;
}

.pjd-card__pill--pet {
    background: var(--pjd-pet-bg);
    color: var(--pjd-pet);
}

/* ── Footer ── */

.pjd-card__footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.pjd-card__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pjd-oxblood);
    margin: 0;
}

.pjd-card__price--cta {
    font-size: 0.95rem;
    font-weight: 400;
}

.pjd-card__cta {
    background: var(--pjd-navy);
    color: var(--pjd-white);
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ── Horizontal card (results-first: search + archive-results) ── */

.pjd-results .pjd-card {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: stretch;
}

.pjd-results .pjd-card__media {
    aspect-ratio: auto;
    min-height: 230px;
    height: 100%;
}

/* ─── Search-widget slot (below the map in the aside) ─────────────────────── */

.pjd-search-widget {
    margin-top: 18px;
}

.pjd-search-widget:empty {
    display: none;
}

/* Amenity icon strip */

.pjd-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.pjd-amenity {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: var(--pjd-grey-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.pjd-amenity svg {
    width: 13px;
    height: 13px;
    fill: var(--pjd-navy);
}

/* Tooltip on amenity hover */

.pjd-amenity[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--pjd-text);
    color: var(--pjd-white);
    font-size: 0.7rem;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
}

/* ─── Map container ──────────────────────────────────────────────────────── */

.pjd-map {
    /* Stickiness lives on .pjd-results__aside; the map just fills it. */
    height: 420px;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--pjd-grey-2);
}

/* Archive results-first map (rendered server-side in the aside) */

.pjd-archive-map {
    height: 420px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--pjd-grey-2);
}

/* Single-property map (property detail page) */

.pjd-map--single {
    position: relative;
    height: 340px;
    border-radius: var(--pjd-radius);
    overflow: hidden;
    box-shadow: var(--pjd-shadow);
    margin-bottom: 24px;
}

/* Leaflet overrides */

.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--pjd-radius);
    box-shadow: var(--pjd-shadow-lg);
}

.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.pjd-popup__name {
    font-weight: 600;
    color: var(--pjd-text);
    margin-bottom: 4px;
}

.pjd-popup__price {
    color: var(--pjd-gold);
    font-weight: 700;
}

.pjd-popup__link {
    display: inline-block;
    margin-top: 6px;
    color: var(--pjd-navy);
    text-decoration: none;
    font-size: 0.8rem;
}

.pjd-popup__link:hover {
    text-decoration: underline;
}

/* "Search this area" pill on the search map (#54) */

.pjd-search-area {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000; /* above Leaflet tile/marker panes */
    padding: 8px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    color: var(--pjd-navy);
    background: #fff;
    border: 1px solid var(--pjd-navy);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.28);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pjd-search-area:hover,
.pjd-search-area:focus {
    background: var(--pjd-navy);
    color: #fff;
}

.pjd-search-area[hidden] {
    display: none;
}

/* Bouncing marker (card hover sync) */

@keyframes pjd-bounce {
    0%, 100% { transform: translateY(0);   }
    40%       { transform: translateY(-12px); }
    70%       { transform: translateY(-6px);  }
}

.pjd-marker-bounce {
    animation: pjd-bounce 0.6s ease;
}

/* Card pulse (map-pin click sync) — the reverse of the marker bounce. */
/* The 0%/100% frames hold translateY(-2px), NOT translateY(0): a pulsing card
   may ALSO be hover/pin-hover lifted (.pjd-card--hovered/--pin-hover), and an
   animation owns `transform` for its run, so resting at 0 would visibly drop the
   card 2px at pulse start/end. Peak scale stays calm at 1.02. */
@keyframes pjd-card-pulse {
    0%, 100% { transform: translateY(-2px) scale(1); }
    50%      {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 12px 34px rgba(var(--pjd-navy-rgb, 5, 20, 53), 0.22);
    }
}

.pjd-card--pulse {
    animation: pjd-card-pulse 0.6s ease;
}

/* Honour reduced-motion: suppress the MOVEMENT (pulse + marker bounce) but leave
   the static hover/pin-hover highlight intact so the card<->map link still gives
   feedback. */
@media (prefers-reduced-motion: reduce) {
    .pjd-card--pulse,
    .pjd-marker-bounce {
        animation: none;
    }
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */

.pjd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 24px 12px 8px;
}

.pjd-pagination__btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--pjd-grey-2);
    border-radius: 999px;
    background: var(--pjd-white);
    color: var(--pjd-text);
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pjd-pagination__btn:hover {
    background: var(--pjd-grey-1);
    border-color: var(--pjd-navy);
}

.pjd-pagination__btn--active {
    background: var(--pjd-navy);
    border-color: var(--pjd-navy);
    color: var(--pjd-white);
    font-weight: 700;
    cursor: default;
}

.pjd-pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Loading / empty states ─────────────────────────────────────────────── */

.pjd-cards--loading {
    opacity: 0.5;
    pointer-events: none;
}

.pjd-cards__empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--pjd-grey-3);
}

.pjd-cards__empty p {
    margin: 0 0 8px;
    font-size: 1rem;
}

.pjd-cards__empty small {
    font-size: 0.875rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* Below 1024px: single column — the aside (map + widget) drops under the list.
   The map is no longer sticky on one column. Cards keep their horizontal rail. */
@media (max-width: 1023px) {
    .pjd-results {
        grid-template-columns: 1fr;
    }

    .pjd-results__aside {
        position: static;
    }

    .pjd-map,
    .pjd-archive-map {
        height: 340px;
    }
}

/* Below 600px: stack the card — media on top, body below. */
@media (max-width: 600px) {
    .pjd-results .pjd-card {
        grid-template-columns: 1fr;
    }

    .pjd-results .pjd-card__media {
        aspect-ratio: 16 / 10;
        min-height: 0;
    }

    .pjd-card__footer {
        flex-wrap: wrap;
    }
}

@media (max-width: 599px) {
    .pjd-search {
        padding: 20px 14px;
    }

    .pjd-search__btn {
        width: 100%;
        justify-content: center;
    }

    .pjd-search__filters {
        gap: 8px;
    }
}

/* ─── Property page — gallery ─────────────────────────────────────────────── */
/* Carousel styles are emitted inline by sc_pjd_gallery() (class-shortcodes.php)
   scoped to #pjd-gallery-{id}. No static rules needed here. */

/* ─── Property page — booking URL ────────────────────────────────────────── */

.pjd-property__book-url {
    margin: 8px 0 0;
    font-size: 0.85em;
    word-break: break-all;
}

.pjd-property__book-url a {
    color: inherit;
    opacity: 0.7;
    text-decoration: underline;
}

.pjd-property__book-url a:hover {
    opacity: 1;
}

/* ─── Sidebar search variant ─────────────────────────────────────────────── */

/* [pjd_search type="sidebar"] — location input + submit only, stacked. */
/* Inherits white background from the base .pjd-search rule; top border accent is retained. */

.pjd-search--sidebar {
    padding: 16px !important;
}

.pjd-search--sidebar .pjd-search__inner {
    max-width: none !important;
    margin: 0 !important;
}

.pjd-search--sidebar .pjd-search__row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
}

.pjd-search--sidebar .pjd-search__location-wrap {
    flex: 0 0 auto !important;
    width: 100% !important;
}

.pjd-search--sidebar .pjd-search__input {
    padding-right: 40px !important;
}

.pjd-search--sidebar .pjd-search__btn {
    width: 100%;
}

.pjd-search--sidebar .pjd-search__filters {
    display: none;
}

/* ─── Simple search variant ──────────────────────────────────────────────── */

/* [pjd_search type="simple"] — transparent wrapper, input + button in a navy row.
   Intended for embedding in hero/dark sections. */

.pjd-search--simple {
    background: transparent;
    padding: 8px 0;
    border-top: none;
    box-shadow: none;
}

.pjd-search--simple .pjd-search__row {
    background: var(--pjd-navy);
    border-radius: var(--pjd-radius);
    padding: 8px 10px;
    flex-wrap: nowrap;
}

/* On the navy row the input should blend in with white text */
.pjd-search--simple .pjd-search__input {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: var(--pjd-white);
}

.pjd-search--simple .pjd-search__input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.pjd-search--simple .pjd-search__input:focus {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.pjd-search--simple .pjd-search__near-me {
    color: rgba(255, 255, 255, 0.7);
}

.pjd-search--simple .pjd-search__near-me:hover {
    color: var(--pjd-white);
}

.pjd-search--simple .pjd-search__location-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 480px) {
    .pjd-search--simple .pjd-search__row {
        flex-direction: column;
        padding: 10px;
    }

    .pjd-search--simple .pjd-search__btn {
        width: 100%;
    }
}

/* [pjd_search type="home"] — homepage hero search bar.
   Completely transparent wrapper; Divi code block provides background and spacing.
   Input and button are taller and more prominent. No near-me button. */

.pjd-search--home {
    background: transparent;
    padding: 0;
    border-top: none;
    box-shadow: none;
}

.pjd-search--home .pjd-search__inner {
    max-width: 680px;
    margin: 0 auto;
}

.pjd-search--home .pjd-search__row {
    background: transparent;
    gap: 0;
    flex-wrap: nowrap;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
}

.pjd-search--home .pjd-search__location-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.pjd-search--home .pjd-search__input {
    height: 54px;
    padding: 0 20px;
    font-size: 1rem;
    font-family: var(--pjd-font-body);
    border: none;
    border-radius: 0;
    background: #ffffff;
    color: var(--pjd-charcoal);
    box-shadow: none;
}

.pjd-search--home .pjd-search__input::placeholder {
    color: #999;
    font-style: italic;
}

.pjd-search--home .pjd-search__input:focus {
    border-color: transparent;
    box-shadow: inset 0 0 0 2px var(--pjd-oxblood);
    outline: none;
}

.pjd-search--home .pjd-search__btn {
    height: 54px;
    padding: 0 36px;
    font-size: 1rem;
    font-family: var(--pjd-font-body);
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 0;
    flex-shrink: 0;
}

@media (max-width: 560px) {
    .pjd-search--home .pjd-search__row {
        flex-direction: column;
        border-radius: var(--pjd-radius);
        overflow: visible;
        box-shadow: none;
    }

    .pjd-search--home .pjd-search__input {
        height: 48px;
        border-radius: var(--pjd-radius);
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    }

    .pjd-search--home .pjd-search__btn {
        height: 48px;
        border-radius: var(--pjd-radius);
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
}

/* ─── Location taxonomy links ────────────────────────────────────────────── */
/* [pjd_location] outputs bare <a> tags (no class) — styled by theme/Divi.
   [pjd_county] and [pjd_country] retain their own classes. (Card location links
   are styled with .pjd-card__location-link in the card region above.) */

.pjd-county__link,
.pjd-country__link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--pjd-navy-20);
    transition: border-color 0.15s, color 0.15s;
}

.pjd-county__link:hover,
.pjd-country__link:hover {
    color: var(--pjd-navy);
    border-bottom-color: var(--pjd-navy);
}

/* ─── Internal-links nav ([pjd_location_links] + archive foot) ───────────────── */
/* Related-places navigation: an "up" breadcrumb, plus grouped "Places in X" /
   "Nearby places" link lists. Every link stays in the DOM (an SEO asset); long
   lists are capped into a tidy scroll-area rather than collapsed. */

.pjd-archive-links {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--pjd-navy-20);
}

.pjd-archive-links__up {
    font-size: 0.85rem;
    color: var(--pjd-grey-3);
    margin: 0 0 16px;
}

.pjd-archive-links__up a {
    color: inherit;
    text-decoration: none;
}

.pjd-archive-links__up a:hover {
    text-decoration: underline;
}

.pjd-archive-links__group {
    margin-bottom: 20px;
}

/* Reset the oversized default h2 down to a modest section label. */
.pjd-archive-links__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pjd-navy);
    margin: 0 0 10px;
}

/* Multi-column on wide screens; auto-fill reflows to fewer columns as the
   viewport narrows (no media query needed). The max-height cap turns a long
   single-column list (e.g. 60 places on a phone) into a tidy scroll-area; on
   desktop the grid is short enough that the cap never bites. */
.pjd-archive-links__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 4px 20px;
    max-height: 22rem;
    overflow-y: auto;
}

.pjd-archive-links__list li a {
    font-size: 0.9rem;
    color: var(--pjd-navy);
    text-decoration: none;
    line-height: 1.5;
}

.pjd-archive-links__list li a:hover {
    text-decoration: underline;
}

/* ─── Book Now button ────────────────────────────────────────────────────── */
/* style="button" (default) — oxblood CTA. colour="#hex" on the shortcode
   applies an inline background-color that overrides the CSS default.
   style="link" outputs a bare <a> with no class — no CSS needed here.      */

.pjd-book-now-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--pjd-oxblood);
    color: var(--pjd-white);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--pjd-radius);
    border: 2px solid transparent;
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.pjd-book-now-btn:hover {
    background: #600018;
    transform: translateY(-1px);
    color: var(--pjd-white);
    text-decoration: none;
}

.pjd-book-now-btn:active {
    transform: translateY(0);
}

/* style="info" — blush background, navy border and text. Lower-weight CTA. */

.pjd-book-now-btn--info {
    background: var(--pjd-blush);
    color: var(--pjd-navy);
    border-color: var(--pjd-navy);
}

.pjd-book-now-btn--info:hover {
    background: #ecd0d6;  /* slightly deeper blush on hover */
    color: var(--pjd-navy);
    border-color: var(--pjd-navy);
    transform: translateY(-1px);
}

/* ─── Provider logo ([pjd_provider_logo]) ────────────────────────────────── */
/* A bare brand <img>, no link or caption. Renders at the source file's natural
   size, capped only at the container width so it never overflows. */

.pjd-provider-logo {
    display: inline-block;
    width: auto;
    max-width: 100%;
}

/* ─── Panel utility ──────────────────────────────────────────────────────── */
/* Left-border panel pattern — shared by stations, coastal, and similar blocks. */

.pjd-panel {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--pjd-pale-blue);
    border-radius: var(--pjd-radius);
    border-left: 3px solid var(--pjd-navy);
}

/* ─── Nearby rail stations ───────────────────────────────────────────────── */

.pjd-nearby-stations__heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--pjd-navy);
    margin: 0 0 10px;
}

.pjd-nearby-stations__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pjd-nearby-stations__item {
    font-size: 0.9rem;
    color: var(--pjd-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pjd-nearby-stations__item a {
    color: var(--pjd-navy);
    text-decoration: none;
    font-weight: 500;
}

.pjd-nearby-stations__item a:hover {
    text-decoration: underline;
}

.pjd-nearby-stations__dist {
    color: var(--pjd-grey-3);
    font-size: 0.825rem;
}

/* ─── Coastal panel ──────────────────────────────────────────────────────── */
/* The PHP now adds .pjd-panel for the structural pattern; these rules handle
   the coastal-specific layout (icon + label in a row). */

.pjd-coastal-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--pjd-navy);
    font-weight: 500;
}

.pjd-coastal-panel__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--pjd-navy);
}

/* ─── National park panel ([pjd_national_park]) ──────────────────────────── */

.pjd-national-park-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--pjd-navy);
    font-weight: 500;
}

.pjd-national-park-panel__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--pjd-navy);
}

/* ─── Area panel ([pjd_area]) ────────────────────────────────────────────── */
/* Covers all listing_area types: National Parks, National Landscapes,
   AONBs, and notable regions. The icon colour deepens slightly from the
   coastal navy to give natural-landscape panels their own visual identity. */

.pjd-area-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--pjd-navy);
    font-weight: 500;
}

.pjd-area-panel__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--pjd-oxblood);
}

/* ─── Amenities combo box ([pjd_amenities]) ──────────────────────────────── */
/* Wrapper that groups all active amenity chips in a single flex-wrap row.
   The individual .pjd-amenity-item chips are styled below. */

.pjd-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

/* ─── Amenity items ──────────────────────────────────────────────────────── */

.pjd-amenity-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--pjd-text);
    padding: 4px 10px;
    background: var(--pjd-pale-blue);
    border-radius: var(--pjd-radius);
    border: 1px solid var(--pjd-navy-20);
}

.pjd-amenity-item svg {
    flex-shrink: 0;
    color: var(--pjd-navy);
}

.pjd-amenity-item__label {
    line-height: 1.3;
}

/* ─── Star rating ────────────────────────────────────────────────────────── */

.pjd-rating {
    display: inline-block;
    font-size: 1.1rem;
    color: var(--pjd-gold);
    letter-spacing: 0.05em;
    line-height: 1;
}

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

.pjd-description {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pjd-description__section {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--pjd-grey-2);
}

.pjd-description__section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pjd-description__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pjd-navy);
    margin: 0 0 10px;
}

.pjd-description__body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--pjd-text);
}

.pjd-description__body p {
    margin: 0 0 0.75em;
}

.pjd-description__body p:last-child {
    margin-bottom: 0;
}

/* ─── [pjd_properties] curated grid ─────────────────────────────────────── */
/* !important on display and grid-template-columns is required to override    */
/* Divi's stylesheet which applies display: block / display: flex to div      */
/* descendants inside .et_pb_text_inner at higher specificity.                */

.pjd-properties {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px;
    margin: 24px 0;
}

/* Column count overrides — !important required for same Divi specificity reason */
.pjd-properties--cols-1 { grid-template-columns: 1fr !important; }
.pjd-properties--cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.pjd-properties--cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.pjd-properties--cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
/* cols-5 / cols-6 are used by [pjd_close_by] (col up to 6); [pjd_properties] caps at 4. */
.pjd-properties--cols-5 { grid-template-columns: repeat(5, 1fr) !important; }
.pjd-properties--cols-6 { grid-template-columns: repeat(6, 1fr) !important; }

@media (max-width: 1099px) {
    .pjd-properties--cols-4,
    .pjd-properties--cols-5,
    .pjd-properties--cols-6 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 899px) {
    .pjd-properties,
    .pjd-properties--cols-3,
    .pjd-properties--cols-4,
    .pjd-properties--cols-5,
    .pjd-properties--cols-6 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 599px) {
    .pjd-properties,
    .pjd-properties--cols-2,
    .pjd-properties--cols-3,
    .pjd-properties--cols-4,
    .pjd-properties--cols-5,
    .pjd-properties--cols-6 {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Archive grid ───────────────────────────────────────────────────────── */

.pjd-archive {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px;
    margin: 24px 0;
}

@media (max-width: 899px) {
    .pjd-archive {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 599px) {
    .pjd-archive {
        grid-template-columns: 1fr !important;
    }
}

.pjd-archive__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--pjd-grey-3);
    padding: 40px 0;
}

/* Archive pagination (WordPress paginate_links output) */

.pjd-archive-pagination {
    margin: 32px 0 16px;
    display: flex;
    justify-content: center;
}

.pjd-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pjd-archive-pagination .page-numbers li a,
.pjd-archive-pagination .page-numbers li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--pjd-grey-2);
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--pjd-text);
    background: var(--pjd-white);
    transition: background 0.15s, border-color 0.15s;
}

.pjd-archive-pagination .page-numbers li a:hover {
    background: var(--pjd-grey-1);
    border-color: var(--pjd-navy);
}

.pjd-archive-pagination .page-numbers li span.current {
    background: var(--pjd-navy);
    border-color: var(--pjd-navy);
    color: var(--pjd-white);
    font-weight: 700;
}


/* ─── Specs grid ([pjd_specs]) ───────────────────────────────────────────── */
/* Icon + number + label stacked vertically, displayed in a flex row.
   Typically shows sleeps / bedrooms / bathrooms on a property page. */

.pjd-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0;
}

.pjd-specs__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
    padding: 12px 16px;
    background: var(--pjd-pale-blue);
    border-radius: var(--pjd-radius);
    border: 1px solid var(--pjd-navy-20);
    text-align: center;
}

.pjd-specs__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pjd-navy);
}

.pjd-specs__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pjd-navy);
    line-height: 1.1;
}

.pjd-specs__label {
    font-size: 0.75rem;
    color: var(--pjd-grey-3);
    text-transform: none;
}

/* ─── Price panel ([pjd_price_panel]) ────────────────────────────────────── */
/* Self-contained card for property listing pages. Gold left border anchors
   it to the brand palette without competing with the navy CTA buttons. */

.pjd-price-panel {
    margin: 20px 0;
    padding: 20px 24px;
    background: var(--pjd-white);
    border-left: 4px solid var(--pjd-gold);
    border-radius: var(--pjd-radius);
    box-shadow: var(--pjd-shadow);
}

.pjd-price-panel__main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.pjd-price-panel__from {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pjd-grey-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    align-self: center;
}

.pjd-price-panel__price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--pjd-navy);
    line-height: 1;
}

.pjd-price-panel__period {
    font-size: 0.85rem;
    color: var(--pjd-grey-3);
    align-self: flex-end;
    padding-bottom: 3px;
}

.pjd-price-panel__peak {
    font-size: 0.875rem;
    color: var(--pjd-grey-3);
    margin: 0 0 12px;
}

.pjd-price-panel__disclaimer {
    font-size: 0.775rem;
    color: var(--pjd-grey-3);
    font-style: italic;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--pjd-grey-2);
    line-height: 1.5;
}

/* "Click here to check latest price" CTA — shown when a listing has no price.
   A line of text with a link, matching the look of the priced panel — never a
   button. On cards/popups it is plain text inside an already-clickable card. */

.pjd-price-cta,
.pjd-card__price--cta,
.pjd-popup__price--cta {
    font-weight: 600;
    color: var(--pjd-gold);
    text-decoration: underline;
}

.pjd-price-panel__cta {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.pjd-price-panel__cta a {
    color: var(--pjd-gold);
    text-decoration: underline;
}

.pjd-price-panel__cta a:hover {
    text-decoration: none;
}

/* Small inline disclaimer appended by [pjd_price_range disclaimer="1"] */

.pjd-price__disclaimer {
    display: block;
    font-size: 0.775rem;
    color: var(--pjd-grey-3);
    font-style: italic;
    margin-top: 4px;
    line-height: 1.5;
}
