/**
 * Ranch Listings - Template Styles
 * Minimal design system inspired by Grommet v2
 */

/* ==========================================================================
   Grommet-Inspired Base Styles
   ========================================================================== */

/* Typography */
:root {
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    --font-size-base: 16px;
    --font-size-small: 13px;
    --font-size-large: 20px;
    --font-size-xlarge: 32px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;
    --font-weight-display: 700;
    --line-height-base: 1.65;
    --line-height-heading: 1.15;
    
    /* Colors — resolved from theme global styles where available.
       WP block themes emit --wp--preset--color--{slug} from theme.json,
       but slug names differ per theme. Fallback chains cover the most
       common patterns: TT4 (base/contrast), TT3 (background/foreground),
       community themes (primary/accent/white/black).
       Hard-coded fallbacks keep the plugin usable on classic themes. */
    --color-brand:               var(--wp--preset--color--primary,
                                     var(--wp--preset--color--accent,
                                     var(--wp--preset--color--vivid-cyan-blue,
                                     #1a1a1a)));
    --color-text:                var(--wp--preset--color--contrast,
                                     var(--wp--preset--color--foreground,
                                     var(--wp--preset--color--black,
                                     #1f1f1f)));
    --color-text-weak:           var(--wp--preset--color--contrast-2,
                                     var(--wp--preset--color--secondary,
                                     #5f5f5f));
    --color-border:              #CCCCCC;
    --color-border-weak:         #EEEEEE;
    --color-background:          var(--wp--preset--color--base,
                                     var(--wp--preset--color--background,
                                     var(--wp--preset--color--white,
                                     #FFFFFF)));
    --color-background-contrast: var(--wp--preset--color--base-2,
                                     var(--wp--preset--color--tertiary,
                                     var(--wp--preset--color--light-gray,
                                     #F8F8F8)));
    --color-focus:               var(--wp--preset--color--primary,
                                     var(--wp--preset--color--accent,
                                     #1a1a1a));
    --color-active:              var(--wp--preset--color--contrast,
                                     var(--wp--preset--color--foreground,
                                     #000000));
    
    /* Spacing - Grommet scale */
    --space-xxsmall: 6px;
    --space-xsmall: 12px;
    --space-small: 24px;
    --space-medium: 48px;
    --space-large: 96px;
    
    /* Border radius */
    --border-radius-xs: 1px;
    --border-radius-sm: 3px;
    --border-radius: 4px;
}

.ranch-plugin {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    /* Cascade theme body text color; --color-text is the resolved fallback
       for contexts that need an explicit value (e.g. cards, overlays). */
    color: inherit;
}

/* Headings (scoped). The `:not(.ranch-single--mag)` carve-out keeps the
   magazine single-property template from inheriting these font/weight
   overrides, so the theme's `styles.elements.heading.typography` (Site
   Editor → Styles → Typography → Headings) can cascade through there. */
.ranch-plugin:not(.ranch-single--mag) h1,
.ranch-plugin:not(.ranch-single--mag) h2,
.ranch-plugin:not(.ranch-single--mag) h3,
.ranch-plugin:not(.ranch-single--mag) h4,
.ranch-plugin:not(.ranch-single--mag) h5,
.ranch-plugin:not(.ranch-single--mag) h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin: 0;
}

/* ---- Button reset (all plugin buttons, no visual styles) ---- */
.ranch-plugin button {
    font-family: var(--font-family);
    line-height: var(--line-height-base);
    box-sizing: border-box;
    cursor: pointer;
}

/* ---- Action button base (.ranch-btn + legacy .button alias) ---- */
.ranch-btn,
.ranch-plugin .button,
.ranch-plugin input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    padding: var(--space-xsmall) var(--space-small);
    border: 1px solid var(--color-brand);
    border-radius: var(--border-radius);
    background: var(--color-brand);
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    outline: none;
}

.ranch-btn:hover,
.ranch-plugin .button:hover,
.ranch-plugin input[type="submit"]:hover {
    background: var(--color-active);
    border-color: var(--color-active);
}

.ranch-btn:focus-visible,
.ranch-plugin .button:focus-visible,
.ranch-plugin input[type="submit"]:focus-visible {
    box-shadow: 0 0 0 2px var(--color-focus);
    outline: none;
}

/* ---- Button variants ---- */
.ranch-btn-primary,
.ranch-plugin .button-primary {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: #ffffff;
}

.ranch-btn-primary:hover,
.ranch-plugin .button-primary:hover {
    background: var(--color-active);
    border-color: var(--color-active);
}

.ranch-btn-secondary,
.ranch-plugin .button-secondary {
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.ranch-btn-secondary:hover,
.ranch-plugin .button-secondary:hover {
    background: var(--color-background-contrast);
    color: white;
}

/* Inputs - Grommet style (scoped) */
.ranch-plugin input[type="text"],
.ranch-plugin input[type="number"],
.ranch-plugin input[type="email"],
.ranch-plugin input[type="search"],
.ranch-plugin select,
.ranch-plugin textarea {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    padding: var(--space-xsmall);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    /* background: var(--color-background); */
    color: var(--color-text);
    outline: none;
    transition: all 0.2s ease;
}

.ranch-plugin .back-to-list-btn {
    position: absolute;
    top: var(--space-small);
    left: var(--space-small);
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-text);
    border: 1px solid var(--color-border-weak);
    padding: var(--space-xxsmall) var(--space-small);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.ranch-plugin .back-to-list-btn:hover,
.ranch-plugin .back-to-list-btn:focus-visible {
    background: white;
    color: var(--color-brand);
    transform: translateY(-1px);
}

.ranch-plugin input:focus,
.ranch-plugin select:focus,
.ranch-plugin textarea:focus {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 1px var(--color-focus);
}

.ranch-plugin input::placeholder {
    color: var(--color-text-weak);
}

/* Cards - Grommet style (scoped) */
.ranch-plugin .card,
.featured-grid-item {
    background: var(--color-background);
    border: 1px solid var(--color-border-weak);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.2s ease;
}

.ranch-plugin .card:hover,
.ranch-card:hover,
.featured-grid-item:hover {
    border-color: var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Single Ranch Property Template
   ========================================================================== */

.ranch-single {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-bottom: var(--space-large);
    background-color: var(--color-background);
    box-sizing: border-box;
    margin-top: 0;
}

/* Hero Area - Two Column Layout */
.ranch-hero-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    height: 600px;
    background: #000;
}

.ranch-hero-area.no-map {
    grid-template-columns: 1fr;
}

@media (max-width: 768px) {
    .ranch-hero-area {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Hero Image */
.ranch-hero-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

@media (max-width: 768px) {
    .ranch-hero-image {
        height: 400px;
    }
}

.ranch-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Hero Map */
.ranch-hero-map {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .ranch-hero-map {
        height: 400px;
    }
}

.ranch-map-hero {
    width: 100%;
    height: 100%;
}

.ranch-idland-embed {
    display: block;
    border: 0;
}

.ranch-hero-image.hero-image-position-top img {
    object-position: center top;
}

.ranch-hero-image.hero-image-position-bottom img {
    object-position: center bottom;
}

.ranch-hero-image.hero-image-position-left img {
    object-position: left center;
}

.ranch-hero-image.hero-image-position-right img {
    object-position: right center;
}

/* View Gallery Button */
.ranch-plugin .view-gallery-btn {
    position: absolute;
    bottom: var(--space-small);
    right: var(--space-small);
    padding: var(--space-xsmall) var(--space-small);
    cursor: pointer;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: var(--space-xxsmall);
    transition: all 0.2s ease;
}

/* .ranch-plugin .view-gallery-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
} */

.gallery-icon {
    font-size: 20px;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.gallery-modal.active {
    display: block;
}

.gallery-modal-content {
    position: relative;
    margin: 40px auto;
    padding: 40px;
    max-width: 1400px;
}

.gallery-close {
    position: fixed;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.gallery-close:hover {
    color: #ccc;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Property Header */
.ranch-header {
    background: var(--color-background);
    padding: var(--space-medium);
    /* border-bottom: 1px solid var(--color-border-weak);
    margin-bottom: var(--space-small); */
}

.ranch-header-content {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.ranch-title {
    font-size: clamp(26px, 3.5vw, 40px);
    margin: 0 0 var(--space-xsmall) 0;
    color: var(--color-text);
    font-weight: var(--font-weight-display);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Status + type badges in single property header */
.ranch-header-content .listing-badge {
    margin: 0 4px 8px;
    vertical-align: middle;
}

.ranch-location {
    font-size: 15px;
    color: var(--color-text-weak);
    margin-bottom: var(--space-medium);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.01em;
}

.ranch-listing-status,
.ranch-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    max-width: max-content;
}

.ranch-listing-status::before,
.ranch-card-status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.7;
}

.ranch-listing-status {
    margin-bottom: var(--space-xsmall);
}

.ranch-card-status {
    margin-bottom: var(--space-xsmall);
}


.ranch-header-actions {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-top: var(--space-small);
}

.ranch-header-actions .button {
    border-radius: 0;
    border-right: 0;
}

.ranch-header-actions .button:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.ranch-header-actions .button:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-right: 1px solid var(--color-border);
}

.ranch-scroll-summary {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border-weak);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ranch-scroll-summary.visible {
    opacity: 1;
    transform: translateY(0);
}

.ranch-scroll-summary-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-medium);
}

.scroll-summary-info {
    display: flex;
    align-items: center;
    gap: var(--space-small);
    flex-wrap: wrap;
    padding: var(--space-xsmall) var(--space-medium);
}

.scroll-summary-actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.scroll-summary-actions .button {
    margin: 0;
    border-radius: 0;
    height: 100%;
    padding: var(--space-xsmall) var(--space-small);
    border-right: 0;
}

.scroll-summary-actions .button:last-child {
    border-right: 1px solid var(--color-border);
}

.scroll-summary-item {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.scroll-summary-item + .scroll-summary-item {
    position: relative;
    padding-left: var(--space-small);
}

.scroll-summary-item + .scroll-summary-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-text-weak);
    font-weight: var(--font-weight-normal);
}

/* .scroll-summary-location,
.scroll-summary-price,
.scroll-summary-acres {
    color: var(--color-white);
} */

body.admin-bar .ranch-scroll-summary {
    top: 32px;
}

.ranch-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-small);
    padding: var(--space-xsmall) 0;
    border-top: 1px solid var(--color-border-weak);
    border-bottom: 1px solid var(--color-border-weak);
    margin: var(--space-xsmall) 0;
}

.ranch-meta-bar .meta-item {
    font-size: var(--font-size-base);
}

.ranch-meta-bar .meta-item.price strong {
    color: var(--color-text);
    font-size: var(--font-size-large);
}

.ranch-meta-bar .meta-item.acres strong {
    color: var(--color-text);
    font-size: var(--font-size-base);
}

.ranch-taxonomies {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xsmall);
    margin-top: var(--space-xsmall);
}

.ranch-taxonomies .taxonomy-group {
    font-size: var(--font-size-small);
}

.ranch-taxonomies .taxonomy-group strong {
    color: var(--color-text);
    margin-right: var(--space-xxsmall);
}

/* Content Wrapper — full browser width */
.ranch-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-small) var(--space-medium) var(--space-medium);
}


/* Property Details Bar */
.property-details-bar {
    background: var(--color-background);
    border: 1px solid var(--color-border-weak);
    border-radius: var(--border-radius);
    padding: 0 !important;
    margin: 0 0 var(--space-medium) 0 !important;
    overflow: hidden;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
}

.detail-item {
    padding: var(--space-small);
    text-align: center;
    border-right: 1px solid var(--color-border-weak);
    transition: background 0.15s ease;
}

.detail-item:last-child {
    border-right: none;
}

.detail-item:hover {
    background: var(--color-background-contrast);
}

.detail-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-weak);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xxsmall);
    font-weight: var(--font-weight-bold);
}

.detail-value {
    display: block;
    font-size: var(--font-size-large);
    color: var(--color-text);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.5px;
}

.price-original {
    text-decoration: line-through;
    color: var(--color-text-weak);
    font-weight: var(--font-weight-normal);
    font-size: 0.85em;
    margin-right: 4px;
}

.fact-card-price-reduced {
    border: 1px solid #f59e0b;
    background: #fffbeb;
}

.fact-card-price-reduced .fact-label {
    color: #b45309;
}

.contact-agent-box,
.quick-facts-box,
.property-map-box {
    background: var(--color-background);
    border: 1px solid var(--color-border-weak);
    padding: var(--space-small);
    margin-bottom: var(--space-small);
    border-radius: var(--border-radius);
    transition: box-shadow 0.2s ease;
}

.contact-agent-box:hover,
.quick-facts-box:hover,
.property-map-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contact-agent-box h3,
.quick-facts-box h3,
.property-map-box h3 {
    margin: 0 0 var(--space-xsmall) 0;
    color: var(--color-text);
    font-size: var(--font-size-base);
    border-bottom: 1px solid var(--color-border-weak);
    padding-bottom: var(--space-xsmall);
    font-weight: var(--font-weight-bold);
}

.contact-agent-box .button {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--space-xsmall);
    margin-bottom: var(--space-xxsmall);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-bold);
}


.ranch-map {
    width: 100%;
    height: 250px;
    background: var(--color-background-contrast);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border-weak);
}

/* Main Content Sections */
.ranch-main-content {
    background: var(--color-background);
}

.ranch-section {
    margin-top: var(--space-large);
    margin-bottom: var(--space-large);
}

.ranch-section:last-child {
    margin-bottom: 0;
}

/* ===== Unified Overlay System (Bottom Slide) ===== */
.ranch-overlay {
    position: fixed;
    inset: 0;
    z-index: 960;
    display: none;
    overflow: hidden;
}

.ranch-overlay[hidden]:not(.active) {
    display: none !important;
}

.ranch-overlay.active {
    display: block !important;
}

/* Semi-transparent backdrop */
.ranch-overlay-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- Drawer panel (slides from bottom) ---- */
.ranch-overlay-drawer {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 961;
    width: 100%;
    max-width: 1080px;
    height: auto;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-background);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin: 0 auto;
}

.ranch-overlay.active .ranch-overlay-drawer {
    transform: translateY(0);
}

/* Video drawer - taller for video content */
.ranch-overlay-drawer-video {
    max-height: 90vh;
}

/* ---- Overlay header ---- */
.ranch-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border-weak);
    flex-shrink: 0;
    background-color: var(--color-background);
}

.ranch-overlay-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

/* ---- Overlay body ---- */
.ranch-overlay-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
    background-color: var(--color-background);
}

.ranch-overlay-body > p:first-child {
    margin-top: 0;
}

/* ---- Close button ---- */
.ranch-overlay-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-text-weak);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ranch-overlay-close:hover {
    color: var(--color-text);
}

.ranch-overlay-close:focus-visible {
    outline: 2px solid #374151;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Video container ---- */
.ranch-video-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.ranch-video-container iframe {
    display: block;
    width: 100%;
    border: 0;
}

/* ---- Mobile adjustments ---- */
@media (max-width: 640px) {
    .ranch-overlay-drawer {
        max-height: 90vh;
    }
    
    .ranch-overlay-drawer-video {
        max-height: 95vh;
    }
    
    .ranch-overlay-body {
        padding: 16px;
    }
    
    .ranch-video-container iframe {
        height: 300px;
    }
}

/* ---- Inline contact form (overlay disabled) ---- */
.ranch-contact-inline {
    width: 100%;
    max-width: 1400px;
    background-color: #ffffff;
    padding: 32px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    margin-bottom: var(--space-large);
}

.ranch-contact-inline h2 {
    margin-top: 0;
}

.ranch-section h2 {
    font-size: var(--font-size-large);
    color: var(--color-text);
    margin-bottom: var(--space-small);
    font-weight: var(--font-weight-display);
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.ranch-section h3 {
    font-size: var(--font-size-base);
    color: var(--color-text);
    margin: var(--space-small) 0 var(--space-xsmall) 0;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}

.section-content {
    line-height: 1.7;
    color: var(--color-text);
    font-size: var(--font-size-base);
}

.section-content p {
    margin-bottom: var(--space-xsmall);
}

.subsection {
    margin-bottom: var(--space-medium);
}

.subsection:last-child {
    margin-bottom: 0;
}

.ranch-section .subsection {
    margin-bottom: var(--space-small);
}

.ranch-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: var(--space-medium);
    align-items: start;
    margin: var(--space-small) 0 var(--space-large) 0;
}

.ranch-overview-layout.no-highlights,
.ranch-overview-layout.no-sidebar {
    grid-template-columns: 1fr;
}

.ranch-overview-layout .ranch-section {
    margin-bottom: 0;
}

.ranch-editor-content {
    margin-top: 0;
}

.ranch-editor-content .excerpt {
    font-size: clamp(1.125rem, 0.95rem + 0.9vw, 1.45rem);
    line-height: 1.55;
    color: var(--color-text);
    margin-bottom: var(--space-small);
    font-weight: 500;
}

.ranch-editor-content .excerpt p {
    margin-bottom: 0;
}

.ranch-highlights-panel,
.ranch-broker-panel {
    margin-top: 0;
    background: linear-gradient(130deg, var(--color-background-contrast) 0%, var(--color-background) 100%);
    border: 1px solid var(--color-border-weak);
    border-radius: var(--border-radius);
    padding: var(--space-small);
}

.ranch-highlights-panel h2,
.ranch-broker-panel h2 {
    margin-bottom: var(--space-xsmall);
}

.ranch-highlights-panel .section-content,
.ranch-broker-panel .section-content {
    font-size: var(--font-size-small);
}

.ranch-broker-panel .section-content > *:last-child {
    margin-bottom: 0;
}

.ranch-broker-panel p {
    margin-bottom: var(--space-xxsmall);
    line-height: 1.4;
}

.ranch-contact-list {
    display: grid;
    gap: var(--space-small);
}

.ranch-contact-card {
    padding-bottom: var(--space-small);
    border-bottom: 1px solid var(--color-border-weak);
}

.ranch-contact-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ranch-contact-photo {
    margin-bottom: var(--space-xsmall);
}

.ranch-contact-photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--color-border-weak);
}

.ranch-contact-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 2px;
}

.ranch-contact-name a {
    color: var(--color-text);
    text-decoration: none;
}

.ranch-contact-name a:hover,
.ranch-contact-name a:focus-visible {
    color: var(--color-brand);
}

.ranch-contact-title {
    color: var(--color-text-weak);
    margin-bottom: var(--space-xxsmall);
}

.ranch-contact-detail a {
    color: var(--color-brand);
    text-decoration: none;
}

.ranch-contact-detail a:hover,
.ranch-contact-detail a:focus-visible {
    text-decoration: underline;
}

.ranch-broker-panel a {
    color: var(--color-brand);
    text-decoration: none;
}

.ranch-broker-panel a:hover,
.ranch-broker-panel a:focus-visible {
    text-decoration: underline;
}

.ranch-contact-btn {
    display: block;
    width: 100%;
    margin-top: var(--space-xsmall);
    padding: var(--space-xxsmall) var(--space-small);
    font-size: var(--font-size-small);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.ranch-broker-panel img {
    border-radius: var(--border-radius);
}

.ranch-highlights-section {
    margin-top: 0;
}

.ranch-grid-column {
    flex: 1;
    min-width: 0; /* prevent flex child from overflowing */
    overflow-y: auto;
}

.ranch-map-large {
    width: 100%;
    height: 500px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border-weak);
}


.map-info-window {
    width: 230px;
    overflow: hidden;
    border-radius: 4px;
}

/* Hero image — full bleed, no gap above */
.map-info-window__hero {
    position: relative;
    line-height: 0;
}

.map-info-window__thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

/* Gradient so the Google close button (top-right of bubble) stays legible */
.map-info-window__close-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0)    45%
    );
    pointer-events: none;
}

/* Body */
.map-info-window__body {
    padding: 10px 12px 12px;
}

.map-info-window__title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.map-info-window__title a {
    color: inherit;
    text-decoration: none;
}

.map-info-window__title a:hover {
    text-decoration: underline;
}

.map-info-window__location {
    margin: 0 0 3px;
    font-size: 11px;
    color: #666;
}

.map-info-window__price {
    margin: 0 0 3px;
    font-size: 13px;
}

.map-info-window__acres {
    margin: 0 0 8px;
    font-size: 11px;
    color: #666;
}

.map-info-window__cta {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-brand, #2e6b3e);
    text-decoration: none;
}

.map-info-window__cta:hover {
    text-decoration: underline;
}

.no-map-data {
    padding: var(--space-large) var(--space-small);
    text-align: center;
    background: var(--color-background-contrast);
    border-radius: var(--border-radius);
    border: 1px dashed var(--color-border);
}

.no-map-data p {
    font-size: var(--font-size-base);
    color: var(--color-text-weak);
    margin: 0 0 var(--space-xxsmall) 0;
}

.no-map-data p:last-child {
    margin-bottom: 0;
}

.map-notice {
    position: absolute;
    bottom: var(--space-small);
    left: var(--space-small);
    right: var(--space-small);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-xsmall) var(--space-small);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border-weak);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.map-notice p {
    margin: 0;
    font-size: var(--font-size-small);
    color: var(--color-text-weak);
}

.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--border-radius);
    padding: var(--space-small);
    text-align: center;
}

.map-error p {
    margin: 0;
    color: #856404;
    font-size: var(--font-size-base);
}

/* Admin Form Styles */
.label-text {
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

/* Property Grid */
.ranch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-small);
    margin-bottom: var(--space-medium);
}

.ranch-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ranch-card-image {
    position: relative;
    overflow: hidden;
    height: 280px;
}

.ranch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ── Listing Badge System ─────────────────────────────────────────────────── */
/* Single source of truth for status, featured, and type labels on all cards  */

.listing-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.6;
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(4px);
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.listing-badge:hover,
.listing-badge:focus {
    text-decoration: underline;
}

/* Status variants */
/* .listing-badge--available      { background: rgba(22, 101, 52, 0.85);  border-color: rgba(134,239,172,0.3); } */
.listing-badge--sold            { color: rgba(235, 53, 53, 1); background: rgba(255, 255, 255, 0.65); }
.listing-badge--under-contract  { color: rgba(56, 56, 56, 0.85); background: rgba(255, 255, 255, 0.65); }
.listing-badge--pending         { color: rgba(56, 56, 56, 0.85); background: rgba(255, 255, 255, 0.65); }
.listing-badge--off-market      { background: rgba(30, 30, 30, 0.85); color: white }
.listing-badge--new-listing     { color:#188ad4; background: rgba(255, 255, 255, 0.65); }

/* Featured */
.listing-badge--featured {
    background: rgba(180, 130, 30, 0.9);
}

/* Property type — light content area, not on image */
.listing-badge--type {
    background: #fff;
    color: var(--color-text);
    border-color: rgba(36, 61, 106, 0.18);
    backdrop-filter: none;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.listing-badge--type:hover {
    background: rgba(36, 61, 106, 0.14);
    border-color: rgba(36, 61, 106, 0.3);
    color: var(--color-text);
    text-decoration: none;
}

/* Badge row — positions badges at top of image for both card variants */
.ranch-card-badges {
    position: absolute;
    top: var(--space-xsmall);
    left: var(--space-xsmall);
    right: var(--space-xsmall);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
    gap: var(--space-xxsmall);
    pointer-events: none;
}

.ranch-card-badges .listing-badge {
    pointer-events: auto;
}

.ranch-card-content {
    padding: var(--space-small);
    flex: 1;
}

.ranch-card-title {
    margin: 0 0 var(--space-xxsmall) 0;
    font-size: var(--font-size-large);
}

.ranch-card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.ranch-card-title a:hover {
    text-decoration: underline;
}

.ranch-card-county {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}

.ranch-card-location {
    color: var(--color-text-weak);
    margin-bottom: var(--space-xsmall);
    font-size: var(--font-size-small);
}

.ranch-card.is-map-selected {
    outline: 2px solid var(--color-primary, #1a6e3c);
    outline-offset: -2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary, #1a6e3c) 20%, transparent);
}

/* ── Hero Card Variant ────────────────────────────────────────────────────── */

.ranch-card--hero {
    background: #111;
    position: relative;
    aspect-ratio: 3 / 4;
    min-height: 320px;
}

.ranch-card-hero-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.ranch-card-hero-bg {
    position: absolute;
    inset: 0;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    will-change: transform;
}

.ranch-card--hero:hover .ranch-card-hero-bg {
    transform: scale(1.04);
}

/* Gradient: subtle vignette top for badges, strong overlay bottom for text */
.ranch-card-hero-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            rgba(0,0,0,0.45) 0%,
            rgba(0,0,0,0)    30%,
            rgba(0,0,0,0)    45%,
            rgba(0,0,0,0.75) 70%,
            rgba(0,0,0,0.92) 100%
        );
    pointer-events: none;
}

/* Hero card uses .ranch-card-badges — defined above with .listing-badge system */

/* Body — pinned to bottom, above gradient */
.ranch-card-hero-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-small);
    z-index: 2;
}

.ranch-card-hero-title {
    margin: 0 0 6px;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    letter-spacing: -0.01em;
}

.ranch-card-hero-title a {
    color: inherit;
    text-decoration: none;
}

.ranch-card-hero-title a:hover {
    text-decoration: underline;
}

.ranch-card-hero-county {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
}

.ranch-card-hero-location {
    font-size: var(--font-size-small);
    color: rgba(255,255,255,0.65);
    margin-bottom: var(--space-xsmall);
    letter-spacing: 0.02em;
}

.ranch-card-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xsmall);
    align-items: baseline;
    padding-top: var(--space-xsmall);
    margin-top: var(--space-xsmall);
}

.hero-stat {
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-base);
}

.hero-stat--price {
    font-size: 1.05rem;
}

.hero-stat-original {
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.6;
    margin-right: 4px;
    font-size: 0.85em;
}

.hero-stat--acres {
    color: rgba(255,255,255,0.8);
    font-size: var(--font-size-small);
    font-weight: 500;
}

.ranch-card--hero:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

/* Dark mode: hero card needs no extra overrides — it's always dark */

/* ==========================================================================
   Related Properties section
   ========================================================================== */

.ranch-related-properties {
    padding: clamp(40px, 6vw, 72px) 0;
    background: var(--mag-bg-soft, var(--color-background-contrast, #f5f5f5));
}

.ranch-related-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

.ranch-related-heading {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    margin: 0 0 clamp(20px, 3vw, 32px);
    color: var(--color-text, #1a1a1a);
    letter-spacing: -0.01em;
}

.ranch-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(16px, 2.5vw, 24px);
}

/* Dark mode */
body.dcd-dark-mode .ranch-related-properties {
    background: var(--dark-surface);
}

body.dcd-dark-mode .ranch-related-heading {
    color: var(--dark-text);
}

.ranch-card-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xxsmall);
    padding: var(--space-xsmall) 0 0 0;
    border-top: 1px solid var(--color-border-weak);
    margin: var(--space-xsmall) 0 0 0;
}

.ranch-card-meta .meta-item {
    font-size: var(--font-size-small);
}

.ranch-card-meta .meta-item.price strong {
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
}

.ranch-card-meta .meta-label {
    color: var(--color-text-weak);
    margin-right: 5px;
}

/* Archive Ranch Listings Template */

/* Archive wrapper — always full-width, theme-isolated */
.ranch-archive-wrapper {
    /* width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw); */
    background-color: var(--wp--preset--color--light-background);
    box-sizing: border-box;
    margin-top: 0;
    overflow-x: clip; /* prevent 100vw scrollbar bleed from creating horizontal scroll */
}

.ranch-archive-wrapper .container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--space-medium);
    box-sizing: border-box;
}

/* Compact Filter Bar — full viewport width */
.ranch-filters-section {
    background: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 1;
    /* width: 100vw; */
    /* margin-left: calc(50% - 50vw); */
    /* box-shadow: 0 1px 0 rgba(0,0,0,0.07); */
}

.ranch-filters-section.is-stuck {
    z-index: 10;
}

body.admin-bar .ranch-filters-section {
    top: 32px;
}

/* Keep filter content centered and padded like a container */
.ranch-search-form {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xsmall) clamp(1rem, 4vw, 3rem);
}

.filter-bar {
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-bar-field {
    flex: 1 1 120px;
}

.filter-bar-field:first-child {
    flex: 2 1 180px;
}

.filter-bar-field input:focus,
.filter-bar-field select:focus {
    outline: 2px solid var(--wp--preset--color--primary, var(--color-brand, #2271b1));
    outline-offset: -2px;
    border-color: transparent;
    box-shadow: none;
}

.filter-bar-range {
    display: flex;
    align-items: center;
    gap: var(--space-xxsmall);
    flex: 1 1 180px;
}

.filter-bar-range input {
    flex: 1;
    min-width: 0;
}

.filter-bar-range .separator {
    color: var(--color-text-weak);
    font-size: var(--font-size-small);
    flex-shrink: 0;
}

.filter-bar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: stretch;
}

.filter-bar-actions .button {
    padding: 0 var(--space-small);
    font-size: var(--font-size-small);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-family: var(--font-family);
    white-space: nowrap;
    border: 1px solid transparent;
    transition: opacity 0.15s;
}

.filter-bar-actions .button-primary {
    background: var(--wp--preset--color--primary, var(--color-brand, #2271b1));
    color: #fff;
    border-color: transparent;
}

.filter-bar-actions .button-primary:hover {
    opacity: 0.85;
    color: #fff;
}

.filter-bar-actions .button-secondary {
    background: transparent;
    color: var(--color-text-weak);
    border-color: var(--color-border-weak, rgba(0,0,0,0.15));
}

.filter-bar-actions .button-secondary:hover {
    color: var(--color-text);
    border-color: var(--color-text-weak);
    background: transparent;
}

/* Results Section */
.ranch-results-section {
    padding: var(--space-medium) 0;
}

.ranch-results-section .container.full-width {
    max-width: 100%;
    padding: 0;
}

.ranch-results-section .container.full-width .results-header {
    padding-left: 0;
    padding-right: 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-small);
    padding-bottom: var(--space-xsmall);
    border-bottom: 1px solid var(--color-border-weak);
}

.results-count {
    font-size: var(--font-size-base);
    color: var(--color-text-weak);
}

.results-count strong {
    color: var(--color-text);
    font-size: var(--font-size-base);
}

.results-controls {
    display: flex;
    gap: var(--space-small);
}

.view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border-weak, rgba(0,0,0,0.15));
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.ranch-plugin .view-btn {
    background: white;
    color: var(--color-text-weak);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: 600;
    padding: 6px 16px;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}

/* .ranch-plugin .view-btn:hover {
    background: var(--color-background-contrast);
    color: var(--color-text);
} */

.ranch-plugin .view-btn.active {
    background: var(--wp--preset--color--primary, var(--color-brand, #2271b1));
    color: #fff;
}

.results-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: var(--font-size-small);
    color: var(--color-text-weak);
}

.results-sort select {
    padding: var(--space-xxsmall) var(--space-xsmall);
    border: 1px solid var(--color-border-weak);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    color: var(--color-text);
    background: white;
}

.ranch-view-container {
    display: flex;
    gap: var(--space-small);
    margin-bottom: var(--space-medium);
}

.ranch-view-container[data-view="grid"] .ranch-map-column {
    display: none;
}

.ranch-view-container[data-view="grid"] .ranch-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* .ranch-view-container[data-view="map"] .ranch-grid {
    grid-template-columns: 1fr;
} */

.ranch-map-column {
    flex: 0 0 50%;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    min-width: 0; /* prevent flex child from overflowing when 100vw wrapper is used */
    overflow: hidden;
}

/* Admin bar pushes sticky top down */
body.admin-bar .ranch-map-column {
    top: 52px; /* 32px admin bar + 20px spacing */
    height: calc(100vh - 72px);
}

/* Map view: wider map, single-column cards */
.ranch-view-container[data-view="map"] .ranch-map-column {
    flex: 0 0 65%;
}

.ranch-view-container[data-view="map"] .ranch-grid {
    grid-template-columns: 1fr;
}

.ranch-grid-column {
    flex: 1;
    min-width: 0; /* prevent flex child from overflowing */
    overflow-y: auto;
}

/* In map view, constrain list column height so it scrolls independently */
.ranch-view-container[data-view="map"] .ranch-grid-column {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.admin-bar .ranch-view-container[data-view="map"] .ranch-grid-column {
    max-height: calc(100vh - 72px);
}

.ranch-map-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.ranch-listings-map {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
}

/* Fullscreen filter overlay — injected into map div by JS, visible only when map is fullscreen */
.ranch-map-filter-overlay {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 120px); /* leave room for native map controls */
    max-width: 900px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    padding: var(--space-xsmall) var(--space-small);
}

.ranch-map-filter-overlay .filter-bar {
    flex-wrap: wrap;
    gap: var(--space-xsmall);
}

/* "View all on map" banner */
.dcd-map-all-banner {
    display: none; /* hidden in grid view */
    padding: var(--space-xsmall) 0 var(--space-xsmall);
}

.ranch-view-container[data-view="map"] .dcd-map-all-banner {
    display: flex;
    align-items: center;
    gap: var(--space-xsmall);
}

.dcd-load-all-pins-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--wp--preset--color--primary, #1a1a1a);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.dcd-load-all-pins-btn:hover {
    opacity: 0.85;
}

.dcd-load-all-pins-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.dcd-pins-max {
    font-size: 12px;
    opacity: 0.75;
    font-weight: 400;
}

/* All-pins loading state */
.ranch-map-wrap.map-pins-loading::after {
    content: 'Loading all pins\2026';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
}

/* Cap notice shown below the map when pins are truncated */
.map-cap-notice {
    margin: 6px 0 0;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--color-text-muted, #666);
    background: var(--color-bg-muted, #f5f5f5);
    border-left: 3px solid var(--color-border-weak, #ddd);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

body.dcd-dark-mode .map-cap-notice {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.6);
    border-left-color: rgba(255, 255, 255, 0.15);
}

/* Map pin card-hover highlight */
.dcd-pin-hovered {
    transform: scale(1.3);
    transform-origin: bottom center;
    transition: transform 0.15s ease;
    z-index: 1;
}

/* Map pin — active (clicked) state */
.dcd-pin-active {
    transform: scale(1.5);
    transform-origin: bottom center;
    transition: transform 0.15s ease;
    z-index: 2;
}

/* Card highlight when its map pin is clicked */
.ranch-card.is-map-selected {
    outline: 2px solid var(--wp--preset--color--primary, #1a1a1a);
    outline-offset: -2px;
    border-radius: var(--border-radius, 4px);
}

/* Admin Form Styles */
.label-text {
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

/* Archive Property Grid — matches featured card Grommet styles */

.ranch-card-meta .meta-value {
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.ranch-card-prop-types {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xxsmall);
    margin: var(--space-xsmall) 0 0;
    overflow: hidden;
}

.ranch-card-prop-types-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-weak);
    margin-right: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}


.ranch-card-excerpt {
    color: var(--color-text-weak);
    line-height: var(--line-height-base);
    margin: var(--space-xsmall) 0;
    font-size: var(--font-size-small);
}

.ranch-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xxsmall);
    margin: var(--space-xsmall) 0;
}

.ranch-card-view-details {
    display: flex;
    align-items: center;
    color: var(--color-text);
    background-color: white;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-small);
    text-decoration: none;
    padding: var(--space-xsmall) var(--space-small);
    margin: 0;
}

.ranch-card-view-details::after {
    content: '→';
    display: inline-block;
    margin-left: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, margin-left 0.18s ease;
}

.ranch-card:hover .ranch-card-view-details {
    text-decoration: none;
}

.ranch-card-view-details:hover::after {
    opacity: 1;
    transform: translateX(0);
    margin-left: 6px;
}

/* ==========================================================================
   Skeleton loading cards
   ========================================================================== */

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ranch-card-skeleton {
    pointer-events: none;
}

.ranch-card-skeleton .ranch-card-content {
    padding: var(--space-small);
}

.skeleton-slab,
.ranch-card-skeleton .skeleton-line {
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #f4f4f4 50%,
        #e8e8e8 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: var(--border-radius-xs, 3px);
}

.ranch-card-skeleton .skeleton-slab {
    border-radius: 0;
    width: 100%;
}

.ranch-card-skeleton .ranch-card-image.skeleton-slab {
    aspect-ratio: 16 / 9;
    height: auto;
}

.ranch-card-skeleton .skeleton-line {
    display: block;
}

/* Stagger shimmer phase so the wave doesn't pulse in sync across cards */
.ranch-card-skeleton:nth-child(2) .skeleton-slab,
.ranch-card-skeleton:nth-child(2) .skeleton-line { animation-delay: 0.10s; }
.ranch-card-skeleton:nth-child(3) .skeleton-slab,
.ranch-card-skeleton:nth-child(3) .skeleton-line { animation-delay: 0.20s; }
.ranch-card-skeleton:nth-child(4) .skeleton-slab,
.ranch-card-skeleton:nth-child(4) .skeleton-line { animation-delay: 0.30s; }
.ranch-card-skeleton:nth-child(5) .skeleton-slab,
.ranch-card-skeleton:nth-child(5) .skeleton-line { animation-delay: 0.15s; }
.ranch-card-skeleton:nth-child(6) .skeleton-slab,
.ranch-card-skeleton:nth-child(6) .skeleton-line { animation-delay: 0.25s; }

/* Load More */
.ranch-load-more-wrap {
    margin-top: var(--space-medium);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ranch-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    background: var(--wp--preset--color--primary, var(--color-primary, #2271b1));
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm, 4px);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ranch-load-more-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.ranch-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ranch-load-more-btn .load-more-count {
    font-weight: 400;
    opacity: 0.8;
    font-size: 0.82em;
}

.load-more-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.15);
    border-top-color: var(--wp--preset--color--primary, #2271b1);
    border-radius: 50%;
    animation: dcd-spin 0.7s linear infinite;
}

@keyframes dcd-spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--space-large) var(--space-small);
}

.no-results h2 {
    color: var(--color-text);
    font-size: var(--font-size-large);
    margin-bottom: var(--space-xsmall);
}

.no-results p {
    font-size: var(--font-size-base);
    color: var(--color-text-weak);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.ranch-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.ranch-lightbox img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.ranch-lightbox .close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.ranch-lightbox .close:hover {
    color: #ccc;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 968px) {
    .ranch-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ranch-sidebar {
        order: 2;
    }
    
    .ranch-main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .ranch-title {
        font-size: 1.8em;
    }

    .ranch-meta-bar {
        flex-direction: column;
        gap: var(--space-xxsmall);
    }

    /* Stack all filter fields as full-width rows */
    .filter-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-bar-field,
    .filter-bar-range {
        flex: 0 0 100%;
        min-width: 0;
        max-width: 100%;
    }

    /* Price (nth-last-child(3)) and Size (nth-last-child(2)) share one row */
    .filter-bar .filter-bar-field:nth-last-child(3),
    .filter-bar .filter-bar-field:nth-last-child(2) {
        flex: 0 0 calc(50% - 3px);
    }

    .filter-bar-actions {
        flex: 0 0 100%;
        width: 100%;
    }

    .filter-bar-actions .button {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 10px var(--space-small);
    }

    body.admin-bar .ranch-scroll-summary {
        top: 46px;
    }

    body.admin-bar .ranch-filters-section {
        top: 46px;
    }
    
    .facts-list-detailed {
        column-count: 1;
    }
    
    .ranch-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .results-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
        text-align: center;
    }
    
    .ranch-view-container {
        flex-direction: column;
    }
    
    .ranch-view-container[data-view="grid"] .ranch-grid {
        grid-template-columns: 1fr;
    }
    
    /* Override the map-view flex width so map stacks full-width on mobile */
    .ranch-view-container[data-view="map"] .ranch-map-column {
        flex: 0 0 auto;
    }

    .ranch-map-column {
        flex: 0 0 auto;
        position: relative;
        height: 55vw;
        min-height: 300px;
        max-height: 500px;
        top: 0;
    }

    .ranch-grid-column {
        overflow-y: visible;
    }
}

/* Featured badge — legacy alias; new card code uses .listing-badge--featured */
.featured-badge,
.featured-badge-large {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.6;
    backdrop-filter: blur(4px);
    background: rgba(180, 130, 30, 0.9);
    color: #fff;
    border: 1px solid rgba(255,220,100,0.3);
    text-decoration: none;
}

.featured-badge:hover {
    text-decoration: underline;
}

/* Vertical Tab Navigation — Grommet-inspired */
.ranch-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border-weak);
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 400px;
}

.ranch-tab-nav {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 220px;
    background: var(--color-background-contrast);
    border-right: 1px solid var(--color-border-weak);
}

.ranch-plugin .ranch-tab {
    background: white;
    border: none;
    border-left: 3px solid transparent;
    padding: var(--space-xsmall) var(--space-small);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-align: left;
}

.ranch-plugin .ranch-tab:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

.ranch-plugin .ranch-tab.active {
    color: var(--color-text);
    background: var(--color-background);
    border-left-color: var(--color-brand);
    font-weight: var(--font-weight-bold);
}

.ranch-plugin .ranch-tab.active:hover {
    background: var(--color-background);
}

.ranch-plugin .ranch-tab:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* Tab Panels */
.ranch-tab-panels {
    flex: 1;
    min-width: 0;
    padding: var(--space-small) var(--space-medium);
}

.content-section {
    display: none;
    animation: tabFadeIn 0.2s ease;
}

.content-section.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.content-section h2 {
    font-size: var(--font-size-large);
    color: var(--color-text);
    margin: 0 0 var(--space-small) 0;
    font-weight: var(--font-weight-bold);
    padding-bottom: var(--space-xsmall);
    border-bottom: 1px solid var(--color-border-weak);
}

.content-section h3 {
    font-size: var(--font-size-base);
    color: var(--color-text);
    margin: var(--space-small) 0 var(--space-xsmall) 0;
    font-weight: var(--font-weight-bold);
}

.content-section h3:first-child {
    margin-top: 0;
}

.content-section .section-content {
    line-height: 1.8;
    color: var(--color-text);
    font-size: var(--font-size-base);
}

.content-section .section-content p {
    margin-bottom: var(--space-small);
}

/* Property Highlights Section */
.highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xxsmall) var(--space-small);
}

.highlights-list li {
    padding: var(--space-xxsmall) 0 var(--space-xxsmall) var(--space-small);
    line-height: var(--line-height-base);
    position: relative;
}

.highlights-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-brand);
}

.overview-highlights {
    margin-top: var(--space-small);
    padding-top: var(--space-small);
    border-top: 1px solid var(--color-border-weak);
}

.facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.facts-list li {
    padding: var(--space-xsmall) 0;
    border-bottom: 1px solid var(--color-border-weak);
}

.facts-list li:last-child {
    border-bottom: none;
}

.facts-list strong {
    color: var(--color-text);
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-xsmall);
    margin-bottom: var(--space-small);
}

.fact-card {
    background: var(--color-background-contrast);
    border-radius: var(--border-radius);
    padding: var(--space-xsmall);
    display: flex;
    flex-direction: column;
    gap: var(--space-xxsmall);
    border: 1px solid transparent;
}

.fact-label {
    font-size: var(--font-size-small);
    color: var(--color-text-weak);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fact-value {
    font-size: var(--font-size-base);
    color: var(--color-text);
    font-weight: var(--font-weight-bold);
}

.facts-list-detailed {
    list-style: none;
    padding: 0;
    margin: var(--space-small) 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-xsmall);
}

.facts-list-detailed li {
    padding: var(--space-xsmall);
    background: var(--color-background-contrast);
    border-radius: var(--border-radius);
    font-size: var(--font-size-small);
}

.details-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-small);
}

/* .details-feature-card {
    background: var(--color-background-contrast);
    border-radius: var(--border-radius);
    padding: var(--space-small);
} */

.details-feature-card h3 {
    margin-top: 0;
    margin-bottom: var(--space-xsmall);
    padding-bottom: var(--space-xxsmall);
    border-bottom: 1px solid var(--color-border-weak);
}

.details-feature-item {
    margin-bottom: var(--space-xsmall);
}

.details-feature-item:last-child {
    margin-bottom: 0;
}

.details-feature-item h4 {
    margin: 0 0 var(--space-xxsmall) 0;
    color: var(--color-text);
    font-size: var(--font-size-small);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.details-feature-item p {
    margin: 0;
    color: var(--color-text);
    line-height: var(--line-height-base);
}

/* Featured Properties Section */
.featured-properties-section {
    padding: var(--space-large) 0;
    margin-bottom: var(--space-medium);
    border-top: 1px solid var(--color-border-weak);
    border-bottom: 1px solid var(--color-border-weak);
}

.featured-section-title {
    font-size: var(--font-size-xlarge);
    color: var(--color-text);
    text-align: center;
    margin: 0 0 var(--space-xsmall) 0;
    font-weight: var(--font-weight-bold);
}

.featured-section-subtitle {
    text-align: center;
    color: var(--color-text-weak);
    font-size: var(--font-size-base);
    margin: 0 0 var(--space-medium) 0;
}

/* .featured-properties-grid now uses .ranch-grid — see ranch-card rules above */

/* ==========================================================================
   Shortcode Styles
   ========================================================================== */

/* Featured Listings Showcase - Gallery Display */
.featured-showcase {
    margin: var(--space-medium) 0;
}

.featured-listings-cta {
    text-align: center;
    margin-top: var(--space-small);
}

.featured-gallery {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border-weak);
    background: var(--color-background-contrast);
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: white;
}

.gallery-slide-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: var(--space-medium);
    color: white;
}

.gallery-slide-title {
    font-size: var(--font-size-xlarge);
    margin: 0 0 var(--space-xsmall) 0;
    font-weight: var(--font-weight-bold);
    color: white;
}

.gallery-slide-meta {
    display: flex;
    gap: var(--space-small);
    margin-bottom: var(--space-small);
    font-size: var(--font-size-base);
}

.slide-location,
.slide-price,
.slide-acres {
    display: flex;
    align-items: center;
}

.slide-price {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-large);
}

.gallery-view-btn {
    display: inline-block;
    background: var(--color-brand);
    color: white;
    padding: var(--space-xsmall) var(--space-small);
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-small);
    transition: background 0.2s ease;
}

.gallery-slide-link:hover .gallery-view-btn {
    background: var(--color-active);
}

.ranch-plugin .gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-background);
    border: 2px solid var(--color-border);
    width: var(--space-medium);
    height: var(--space-medium);
    border-radius: 50%;
    font-size: var(--font-size-large);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: var(--color-text);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranch-plugin .gallery-nav:hover {
    border-color: var(--color-text);
    background: var(--color-background-contrast);
}

.ranch-plugin .gallery-nav:focus {
    box-shadow: 0 0 0 2px var(--color-focus);
}

.gallery-prev {
    left: var(--space-small);
}

.gallery-next {
    right: var(--space-small);
}

.gallery-dots {
    position: absolute;
    bottom: var(--space-small);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-xsmall);
    z-index: 10;
}

.gallery-dot {
    width: var(--space-xsmall);
    height: var(--space-xsmall);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.3);
}

/* Featured Listings Showcase - Grid Display */
.featured-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-small);
    max-width: 1200px;
    margin: 0 auto;
}

.featured-grid-item {
    background: var(--color-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--color-border-weak);
    transition: box-shadow 0.2s ease;
}

.featured-grid-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.featured-grid-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.featured-grid-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.featured-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-grid-content {
    padding: var(--space-small);
}

.featured-grid-title {
    font-size: var(--font-size-large);
    color: var(--color-text);
    margin: 0 0 var(--space-xxsmall) 0;
    font-weight: var(--font-weight-bold);
}

.featured-grid-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxsmall);
    color: var(--color-text-weak);
    font-size: var(--font-size-small);
    padding-top: var(--space-xsmall);
    border-top: 1px solid var(--color-border-weak);
}

.grid-price {
    font-size: var(--font-size-base);
    color: var(--color-text);
    font-weight: var(--font-weight-bold);
}

/* Quick Search Module — connected input + button bar */
.ranch-quick-search {
    margin: var(--space-small) 0;
}

.qsearch-bar {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.qsearch-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 54px;
    padding: 0 20px;
    font-size: 1rem;
    border: 2px solid var(--color-border-weak);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    background: var(--color-background-contrast);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s ease;
}

.qsearch-input:focus {
    border-color: var(--color-primary);
}

.qsearch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 54px;
    padding: 0 28px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    background: var(--color-primary);
    color: #fff;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.qsearch-btn:hover {
    background: var(--color-primary-dark, #555);
}

.qsearch-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner — hidden by default, visible during loading */
.qsearch-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: qsearch-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.qsearch-btn.is-loading .qsearch-spinner {
    display: block;
}

.qsearch-btn.is-loading .qsearch-btn-text {
    opacity: 0.75;
}

@keyframes qsearch-spin {
    to { transform: rotate(360deg); }
}

/* Property Search Module — uses shared .filter-bar styles */
.ranch-property-search {
    margin: var(--space-small) 0;
}

.ranch-property-search .filter-bar {
    max-width: 600px;
}

.ranch-property-search .filter-bar-field {
    max-width: none;
    flex: 1 1 auto;
}

/* ==========================================================================
   Monochrome Overrides + Shortcode Form Control Enforcement
   ========================================================================== */

/* Neutralise any <p> tags wpautop injects inside shortcode cards */
.ranch-plugin .ranch-card > p {
    margin: 0;
}

.ranch-plugin .ranch-pagination a,
.ranch-plugin .ranch-card-title a,
.ranch-plugin .featured-grid-title,
.ranch-plugin .ranch-card-view-details,
.ranch-plugin .grid-price,
.ranch-plugin .facts-list strong,
.ranch-plugin .quick-facts-box h3,
.ranch-plugin .property-map-box h3,
.ranch-plugin .results-count strong,
.ranch-plugin .no-results h2 {
    color: var(--color-text) !important;
}

.section-nav-btn.active,
.section-nav-btn:hover {
    background: var(--color-background-contrast) !important;
}

/* Enforce filter form controls against theme defaults */
.ranch-plugin .filter-bar-field select,
.ranch-plugin .filter-bar-field input[type="text"],
.ranch-plugin .filter-bar-field input[type="number"] {
    width: 100% !important;
    font-family: var(--font-family) !important;
    font-size: var(--font-size-small) !important;
    color: var(--color-text) !important;
    background: white !important;
    border: 1px solid var(--color-border-weak, rgba(0,0,0,0.18)) !important;
    margin: 0 !important;
    border-radius: var(--border-radius-sm) !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: 1.4 !important;
    transition: border-color 0.15s !important;
}

.ranch-plugin .filter-bar-field select:focus,
.ranch-plugin .filter-bar-field input:focus {
    border-color: var(--wp--preset--color--primary, var(--color-brand, #2271b1)) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wp--preset--color--primary, #2271b1) 20%, transparent) !important;
}

.ranch-plugin .filter-bar-field input::placeholder {
    color: var(--color-text-weak) !important;
    opacity: 0.7 !important;
}

.ranch-plugin .filter-bar-actions .button {
    font-family: var(--font-family) !important;
    font-size: var(--font-size-small) !important;
    font-weight: 600 !important;
    padding: 8px var(--space-small) !important;
    border-radius: var(--border-radius-sm) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    transition: opacity 0.15s !important;
}

/* Responsive Styles */
@media (max-width: 968px) {
    .ranch-content-wrapper {
        padding: var(--space-small) var(--space-xsmall);
    }

    .ranch-overview-layout {
        grid-template-columns: 1fr;
        gap: var(--space-small);
    }

    .ranch-overview-layout .ranch-highlights-panel,
    .ranch-overview-layout .ranch-broker-panel {
        margin-top: 0;
    }

    .ranch-scroll-summary-inner {
        padding: var(--space-xxsmall) var(--space-xsmall);
        gap: var(--space-xsmall);
    }

    .scroll-summary-item {
        font-size: var(--font-size-xsmall);
    }
    
    .ranch-content-layout {
        flex-direction: column;
        gap: var(--space-small);
    }
    
    /* Vertical tabs collapse to horizontal scrollable on mobile */
    .ranch-tabs {
        flex-direction: column;
        min-height: auto;
    }
    
    .ranch-tab-nav {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-right: none;
        border-bottom: 1px solid var(--color-border-weak);
    }
    
    .ranch-tab-nav::-webkit-scrollbar {
        display: none;
    }
    
    .ranch-plugin .ranch-tab {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: var(--space-xsmall) var(--space-xsmall);
        font-size: var(--font-size-small);
        text-align: center;
    }
    
    .ranch-plugin .ranch-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-brand);
    }
    
    .ranch-tab-panels {
        padding: var(--space-small) var(--space-xsmall);
    }
    
    .facts-list-detailed {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .detail-item {
        padding: var(--space-xsmall);
    }
    
    .detail-value {
        font-size: var(--font-size-base);
    }

    .highlights-list {
        grid-template-columns: 1fr;
    }
    
    /* Featured Properties Responsive */
    .featured-properties-section {
        padding: var(--space-medium) 0;
    }
    
    .featured-section-title {
        font-size: var(--font-size-large);
    }
    
}

@media (max-width: 640px) {
    .ranch-scroll-summary-inner {
        flex-direction: column;
        gap: 0;
    }
    
    .scroll-summary-info {
        width: 100%;
        justify-content: center;
        padding: 6px 8px;
        gap: 6px;
    }
    
    .scroll-summary-item {
        font-size: 11px;
    }
    
    .scroll-summary-item + .scroll-summary-item {
        padding-left: 6px;
    }
    
    .scroll-summary-actions {
        width: 100%;
        border-top: 1px solid var(--color-border-weak);
    }
    
    .scroll-summary-actions .button {
        flex: 1;
        justify-content: center;
        font-size: 11px;
        padding: 6px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Gallery Shortcode Responsive */
    .gallery-container {
        height: 400px;
    }
    
    .gallery-slide-overlay {
        padding: var(--space-small);
    }
    
    .gallery-slide-title {
        font-size: var(--font-size-large);
    }
    
    .gallery-slide-meta {
        flex-wrap: wrap;
        gap: var(--space-xsmall);
        margin-bottom: var(--space-xsmall);
        font-size: var(--font-size-small);
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
    
    .featured-grid-container {
        grid-template-columns: 1fr;
        gap: var(--space-small);
    }
    
    .featured-grid-image {
        height: 200px;
    }
}

/* ==========================================================================
   Dark Blue Plugin Theme  (body.dcd-dark-mode)
   Enabled via Admin → Property Manager Settings → Property Archive Theme.
   Scoped to body.dcd-dark-mode so it applies to ALL plugin components:
   archive, shortcodes, single property, etc.
   .ranch-archive--dark on the wrapper is kept as an alias for specificity
   on archive-specific background rules.
   ========================================================================== */

/* --- Design tokens (set on both scoping roots for specificity balance) ---
   Resolved from WP theme preset colors where available so the dark palette
   inherits from the active theme. Hardcoded values are fallbacks for themes
   that don't define these slugs or don't reassign them in dark mode.
   Common slug patterns covered: TT4 (base/contrast), TT3 (background/
   foreground/tertiary), community themes (primary/accent/secondary). */
body.dcd-dark-mode,
.ranch-archive--dark {
    --dark-bg:           var(--wp--preset--color--background,
                             var(--wp--preset--color--header-footer,
                             #101721));
    --dark-surface:      var(--wp--preset--color--light-background,
                             #1e2430);
    --dark-card:         var(--wp--preset--color--secondary,
                             #191d23);
    --dark-card-hover:   var(--wp--preset--color--primary,
                             #243d6a);
    --dark-border:       var(--wp--preset--color--lightgrey,
                             #253d6a);
    --dark-text:         var(--wp--preset--color--foreground,
                             #e4ecf7);
    --dark-text-muted:   var(--wp--preset--color--tertiary,
                             #7a9bc6);
    --dark-accent:       var(--wp--preset--color--tertiary,
                             #7a9bc6);
    --dark-accent-dim:   rgba(122, 155, 198, 0.35);
    --dark-input-bg:     var(--wp--preset--color--light-background,
                             #1e2430);
    --dark-input-border: var(--wp--preset--color--lightgrey,
                             #253d6a);
}

/* --- Page / wrapper backgrounds --- */
body.dcd-dark-mode,
.ranch-archive--dark.ranch-archive-wrapper {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-archive-wrapper,
.ranch-archive--dark.ranch-archive-wrapper {
    background-color: var(--dark-bg);
}

body.dcd-dark-mode .ranch-results-section {
    background-color: var(--dark-bg);
}

body.dcd-dark-mode .ranch-single {
    background-color: var(--dark-bg);
}

/* --- Filter bar --- */
body.dcd-dark-mode .ranch-filters-section,
body.dcd-dark-mode .ranch-quick-search {
    background: var(--dark-bg);
    border-bottom: 1px solid var(--dark-bg);
}

/* --- Quick search connected bar --- */
body.dcd-dark-mode .qsearch-input {
    background: var(--dark-input-bg) !important;
    border-color: var(--dark-input-border) !important;
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .qsearch-input:focus {
    border-color: var(--dark-border) !important;
}

body.dcd-dark-mode .qsearch-input::placeholder {
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .qsearch-btn {
    background: var(--dark-accent) !important;
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .qsearch-btn:hover {
    background: var(--dark-card) !important;
}

/* --- Form controls --- */
body.dcd-dark-mode .ranch-plugin .filter-bar-field input[type="text"],
body.dcd-dark-mode .ranch-plugin .filter-bar-field input[type="number"],
body.dcd-dark-mode .ranch-plugin .filter-bar-field select,
body.dcd-dark-mode .ranch-plugin input[type="text"],
body.dcd-dark-mode .ranch-plugin input[type="number"],
body.dcd-dark-mode .ranch-plugin input[type="email"],
body.dcd-dark-mode .ranch-plugin select,
body.dcd-dark-mode .ranch-plugin textarea {
    background: var(--dark-input-bg) !important;
    border-color: var(--dark-input-bg) !important;
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .ranch-plugin input::placeholder,
body.dcd-dark-mode .ranch-plugin textarea::placeholder,
body.dcd-dark-mode .ranch-plugin .filter-bar-field input::placeholder {
    color: var(--dark-text) !important;
    opacity: 0.55 !important;
}

body.dcd-dark-mode .ranch-plugin input:focus,
body.dcd-dark-mode .ranch-plugin select:focus,
body.dcd-dark-mode .ranch-plugin textarea:focus {
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 1px var(--dark-accent) !important;
}

/* --- Buttons --- */
body.dcd-dark-mode .ranch-plugin .button-primary,
body.dcd-dark-mode .ranch-plugin .ranch-btn-primary {
    background: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
    color: #ffffff !important;
}

body.dcd-dark-mode .ranch-plugin .button-primary:hover {
    background: var(--dark-accent-dim) !important;
    border-color: var(--dark-accent-dim) !important;
}

body.dcd-dark-mode .ranch-plugin .button-secondary,
body.dcd-dark-mode .ranch-plugin .ranch-btn-secondary {
    background: transparent !important;
    border-color: var(--dark-input-border) !important;
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .ranch-plugin .button-secondary:hover {
    border-color: var(--dark-accent) !important;
    color: var(--dark-text) !important;
}

/* --- Results header --- */
body.dcd-dark-mode .results-header {
    color: var(--dark-text);
    border-bottom-color: var(--dark-border);
}

body.dcd-dark-mode .results-count,
body.dcd-dark-mode .results-count strong {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .results-sort label {
    color: var(--dark-text-muted);
}

body.dcd-dark-mode .results-sort select {
    background: var(--dark-input-bg);
    border-color: var(--dark-input-border);
    color: var(--dark-text);
}

/* --- View toggle buttons --- */
body.dcd-dark-mode .view-toggle {
    border-color: var(--dark-input-border);
}
body.dcd-dark-mode .ranch-plugin .view-btn {
    background: transparent;
    border-color: var(--dark-input-border);
    color: var(--dark-text-muted);
}

body.dcd-dark-mode .ranch-plugin .view-btn.active,
body.dcd-dark-mode .ranch-plugin .view-btn:hover {
    background: var(--dark-accent);
    border-color: var(--dark-accent);
    color: #ffffff;
}

/* --- Property cards (archive, featured, shortcode grids) --- */
body.dcd-dark-mode .ranch-card,
body.dcd-dark-mode .featured-grid-item {
    background: var(--dark-surface);
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-card:hover,
body.dcd-dark-mode .featured-grid-item:hover {
    background: var(--dark-card-hover);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

body.dcd-dark-mode .ranch-card.is-map-selected {
    outline-color: var(--dark-accent);
    box-shadow: 0 0 0 4px rgba(122, 155, 198, 0.25);
}

body.dcd-dark-mode .ranch-card-title a,
body.dcd-dark-mode .featured-grid-title {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .ranch-card-title a:hover {
    color: var(--dark-accent) !important;
}

body.dcd-dark-mode .ranch-card-county {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .ranch-card-location,
body.dcd-dark-mode .ranch-card-excerpt {
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .ranch-card-meta {
    border-top-color: transparent;
}

body.dcd-dark-mode .ranch-card-meta .meta-item {
    color: var(--dark-text-muted);
}

body.dcd-dark-mode .ranch-card-meta .meta-item.price strong,
body.dcd-dark-mode .ranch-card-meta .meta-value {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .ranch-card-meta .meta-label {
    color: var(--dark-text-muted);
}


body.dcd-dark-mode .ranch-card-view-details {
    color: var(--dark-accent) !important;
    border-top-color: transparent;
    background-color: var(--dark-input-bg);
}

/* Property type badges — dark mode */
body.dcd-dark-mode .listing-badge--type {
    background: var(--dark-card) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .listing-badge--type:hover {
    background: var(--dark-card-hover) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-text) !important;
}

/* Feature tags — dark mode */
body.dcd-dark-mode .property-feature-tag a,
body.dcd-dark-mode .property-feature-tag span {
    background: var(--dark-card) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .property-feature-tag a:hover {
    background: var(--dark-card-hover) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-text) !important;
}

/* --- Single property template overrides --- */
body.dcd-dark-mode .ranch-content-wrapper,
body.dcd-dark-mode .ranch-tab-panels {
    background: var(--dark-bg);
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-tab-nav {
    border-color: var(--dark-border);
    background: var(--dark-surface);
}

body.dcd-dark-mode .ranch-plugin .ranch-tab {
    color: var(--dark-text-muted);
    border-color: transparent;
}

body.dcd-dark-mode .ranch-plugin .ranch-tab.active,
body.dcd-dark-mode .ranch-plugin .ranch-tab:hover {
    color: var(--dark-text);
    background: var(--dark-card);
    border-color: var(--dark-accent);
}

body.dcd-dark-mode .facts-list strong,
body.dcd-dark-mode .quick-facts-box h3,
body.dcd-dark-mode .property-map-box h3 {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .ranch-overview-layout,
body.dcd-dark-mode .ranch-highlights-panel,
body.dcd-dark-mode .ranch-broker-panel {
    border-color: var(--dark-border);
}

/* --- No-results / notices --- */
body.dcd-dark-mode .no-results {
    color: var(--dark-text);
}

body.dcd-dark-mode .no-results a {
    color: var(--dark-accent);
}

body.dcd-dark-mode .no-map-data,
body.dcd-dark-mode .map-notice p {
    color: var(--dark-text-muted);
}

/* --- Pagination --- */
body.dcd-dark-mode .ranch-plugin .ranch-pagination a,
body.dcd-dark-mode .ranch-plugin .ranch-pagination span.current {
    color: var(--dark-text) !important;
    border-color: var(--dark-border);
    background: var(--dark-card);
}

body.dcd-dark-mode .ranch-plugin .ranch-pagination a:hover {
    background: var(--dark-accent);
    color: #ffffff !important;
    border-color: var(--dark-accent);
}

body.dcd-dark-mode .ranch-plugin .ranch-pagination span {
    background: none;
    color: #ffffff !important;
    border-color: none;
}

/* --- General headings & text inside all plugin components --- */
body.dcd-dark-mode .ranch-plugin h1,
body.dcd-dark-mode .ranch-plugin h2,
body.dcd-dark-mode .ranch-plugin h3,
body.dcd-dark-mode .ranch-plugin h4,
body.dcd-dark-mode .ranch-plugin h5,
body.dcd-dark-mode .ranch-plugin h6 {
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-plugin p,
body.dcd-dark-mode .ranch-plugin li,
body.dcd-dark-mode .ranch-plugin td,
body.dcd-dark-mode .ranch-plugin th {
    color: var(--dark-text);
}

/* ==========================================================================
   Dark theme — Single Property Mag Layout (.ranch-single--mag)
   The two-column template outputs an inline <style> that defines --mag-*
   CSS variables (specificity 10) and some hardcoded #fff/#2a2a2a values.
   Overriding the variables here (specificity 20) causes every var(--mag-*)
   reference in the inline style to resolve to dark values automatically.
   Hardcoded background/color values need explicit !important rules.
   ========================================================================== */

body.dcd-dark-mode .ranch-single--mag {
    --mag-fg:      var(--dark-text);
    --mag-muted:   var(--dark-text-muted);
    --mag-rule:    var(--dark-border);
    --mag-accent:  var(--dark-accent);
    --mag-bg-soft: var(--dark-surface);
    color: var(--mag-fg);
    background-color: var(--dark-bg);
}

/* Sticky stat bar — hardcoded background: #fff */
body.dcd-dark-mode .ranch-single--mag .mag-stats {
    background: var(--dark-surface) !important;
    border-bottom-color: var(--dark-border) !important;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.35) !important;
}

/* Two-column content area — hardcoded background: #fff */
body.dcd-dark-mode .ranch-single--mag .mag-layout {
    background: var(--dark-bg) !important;
}

/* Prose / highlights / detail body — hardcoded color: #2a2a2a */
body.dcd-dark-mode .ranch-single--mag .mag-prose,
body.dcd-dark-mode .ranch-single--mag .mag-prose p,
body.dcd-dark-mode .ranch-single--mag .mag-highlights li,
body.dcd-dark-mode .ranch-single--mag .mag-detail__body,
body.dcd-dark-mode .ranch-single--mag .mag-detail__body p {
    color: var(--mag-fg) !important;
}

/* Mobile sticky CTA — hardcoded rgba white background */
body.dcd-dark-mode .ranch-single--mag .mag-mobile-cta {
    background: rgba(11, 22, 38, 0.98) !important;
    border-top-color: var(--dark-border) !important;
}

/* Sidebar panels */
body.dcd-dark-mode .ranch-single--mag .mag-sidebar__panel {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

/* Dark / outline buttons in hero that reference --mag-fg */
body.dcd-dark-mode .ranch-single--mag .mag-btn--dark {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}
body.dcd-dark-mode .ranch-single--mag .mag-btn--dark:hover {
    background: var(--dark-accent);
    border-color: var(--dark-accent);
}
body.dcd-dark-mode .ranch-single--mag .mag-btn--outline {
    color: var(--mag-fg);
    border-color: var(--dark-border);
}
body.dcd-dark-mode .ranch-single--mag .mag-btn--outline:hover {
    background: var(--dark-surface);
}

/* Lede / short description */
body.dcd-dark-mode .ranch-single--mag .mag-lede {
    color: var(--mag-muted);
    border-bottom-color: var(--dark-border);
}

/* ==========================================================================
   Dark theme — Google Maps InfoWindow
   .gm-style-iw-c  = the bubble frame rendered by Maps JS
   .gm-style-iw-tc = the arrow / pointer below the bubble
   .gm-style-iw-d  = the scrollable content wrapper inside the bubble
   .map-info-window = our content div injected as the InfoWindow content
   ========================================================================== */

/* Strip Google's default padding so the image can go full-bleed */
.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style .gm-style-iw-c {
    padding: 0 !important;
}

/* Dark mode bubble frame */
body.dcd-dark-mode .gm-style .gm-style-iw-c {
    background-color: var(--dark-card) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55) !important;
    border: 1px solid var(--dark-border) !important;
}

body.dcd-dark-mode .gm-style .gm-style-iw-tc::after {
    background: var(--dark-card) !important;
}

/* Our content */
body.dcd-dark-mode .map-info-window {
    background: var(--dark-card);
    color: var(--dark-text);
}

body.dcd-dark-mode .map-info-window__title {
    color: var(--dark-text) !important;
    word-break: break-word;
}

body.dcd-dark-mode .map-info-window__title a {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .map-info-window__location,
body.dcd-dark-mode .map-info-window__acres {
    color: var(--dark-text-muted) !important;
}

body.dcd-dark-mode .map-info-window__price {
    color: var(--dark-text) !important;
}

body.dcd-dark-mode .map-info-window__cta {
    color: var(--dark-accent) !important;
}

body.dcd-dark-mode .map-info-window__cta:hover {
    color: var(--dark-text) !important;
}

/* Close button — make it legible over the photo */
.gm-style .gm-ui-hover-effect {
    opacity: 1 !important;
}

body.dcd-dark-mode .gm-style .gm-ui-hover-effect > span {
    background-color: #ffffff !important;
}

/* ==========================================================================
   Dark theme — Loading skeleton cards
   Replace the light-grey shimmer with a dark-navy shimmer that sits
   naturally on the dark card background.
   ========================================================================== */

body.dcd-dark-mode .ranch-card-skeleton {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

body.dcd-dark-mode .skeleton-slab,
body.dcd-dark-mode .ranch-card-skeleton .skeleton-line {
    background: linear-gradient(
        90deg,
        var(--dark-card, #1e2535) 25%,
        var(--dark-surface, #252d40) 50%,
        var(--dark-card, #1e2535) 75%
    ) !important;
    background-size: 200% 100% !important;
}

/* ==========================================================================
   Dark Mode — Overlay Drawers
   ========================================================================== */

body.dcd-dark-mode .ranch-overlay-drawer {
    background-color: var(--dark-surface);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}

body.dcd-dark-mode .ranch-overlay-header {
    background-color: var(--dark-surface);
    border-bottom-color: var(--dark-border);
}

body.dcd-dark-mode .ranch-overlay-header h2 {
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-overlay-body {
    background-color: var(--dark-surface);
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-overlay-body p,
body.dcd-dark-mode .ranch-overlay-body li,
body.dcd-dark-mode .ranch-overlay-body td,
body.dcd-dark-mode .ranch-overlay-body th {
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-overlay-body a {
    color: var(--dark-text-muted);
}

body.dcd-dark-mode .ranch-overlay-body a:hover {
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-overlay-close {
    color: var(--dark-text-muted);
}

body.dcd-dark-mode .ranch-overlay-close:hover {
    color: var(--dark-text);
}

body.dcd-dark-mode .ranch-overlay-close:focus-visible {
    outline-color: var(--dark-border);
}

/* --- Drawer form inputs (Gravity Forms + native) --- */
body.dcd-dark-mode .ranch-overlay-body input[type="text"],
body.dcd-dark-mode .ranch-overlay-body input[type="email"],
body.dcd-dark-mode .ranch-overlay-body input[type="tel"],
body.dcd-dark-mode .ranch-overlay-body input[type="number"],
body.dcd-dark-mode .ranch-overlay-body input[type="url"],
body.dcd-dark-mode .ranch-overlay-body select,
body.dcd-dark-mode .ranch-overlay-body textarea,
body.dcd-dark-mode .ranch-overlay-body .gfield input,
body.dcd-dark-mode .ranch-overlay-body .gfield select,
body.dcd-dark-mode .ranch-overlay-body .gfield textarea {
    background-color: var(--dark-bg) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 6px !important;
    color: var(--dark-text) !important;
    padding: 10px 14px !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-shadow: none !important;
}

body.dcd-dark-mode .ranch-overlay-body input[type="text"]:focus,
body.dcd-dark-mode .ranch-overlay-body input[type="email"]:focus,
body.dcd-dark-mode .ranch-overlay-body input[type="tel"]:focus,
body.dcd-dark-mode .ranch-overlay-body input[type="number"]:focus,
body.dcd-dark-mode .ranch-overlay-body input[type="url"]:focus,
body.dcd-dark-mode .ranch-overlay-body select:focus,
body.dcd-dark-mode .ranch-overlay-body textarea:focus,
body.dcd-dark-mode .ranch-overlay-body .gfield input:focus,
body.dcd-dark-mode .ranch-overlay-body .gfield select:focus,
body.dcd-dark-mode .ranch-overlay-body .gfield textarea:focus {
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 3px rgba(122, 155, 198, 0.2) !important;
    outline: none !important;
}

body.dcd-dark-mode .ranch-overlay-body input::placeholder,
body.dcd-dark-mode .ranch-overlay-body textarea::placeholder,
body.dcd-dark-mode .ranch-overlay-body .gfield input::placeholder,
body.dcd-dark-mode .ranch-overlay-body .gfield textarea::placeholder {
    color: var(--dark-text) !important;
    opacity: 0.45 !important;
}

body.dcd-dark-mode .ranch-overlay-body .gfield_label,
body.dcd-dark-mode .ranch-overlay-body label {
    color: var(--dark-text-muted) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

/* --- Gravity Forms submit button in drawer --- */
body.dcd-dark-mode .ranch-overlay-body .gform_button,
body.dcd-dark-mode .ranch-overlay-body input[type="submit"],
body.dcd-dark-mode .ranch-overlay-body button[type="submit"] {
    background-color: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
    color: var(--dark-bg) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 11px 24px !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
}

body.dcd-dark-mode .ranch-overlay-body .gform_button:hover,
body.dcd-dark-mode .ranch-overlay-body input[type="submit"]:hover,
body.dcd-dark-mode .ranch-overlay-body button[type="submit"]:hover {
    background-color: var(--dark-text) !important;
    border-color: var(--dark-text) !important;
    color: var(--dark-bg) !important;
}

/* ===================================================================
   Property Features — pill tag list (single listing templates)
   =================================================================== */
.property-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.property-feature-tag {
    display: inline-block;
}
.property-feature-tag a,
.property-feature-tag span {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    background: rgba(36, 61, 106, 0.06);
    color: var(--color-text, #333);
    border: 1px solid rgba(36, 61, 106, 0.16);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.6;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.property-feature-tag a:hover {
    background: rgba(36, 61, 106, 0.13);
    border-color: rgba(36, 61, 106, 0.3);
    color: var(--color-text, #333);
    text-decoration: none;
}

/* Features section pinned just below the details bar */
.ranch-features-section--top {
    padding: clamp(12px, 2vw, 20px) clamp(16px, 4vw, 40px);
    background: transparent;
    border-bottom: 1px solid var(--color-border-weak, rgba(0,0,0,.08));
}
.ranch-features-section--top .property-features-list {
    gap: 6px;
}

/* ===== Custom gallery viewer ============================= */
.dcd-gallery {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}
.dcd-gallery-stage {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 0;
}
.dcd-gallery-main-wrap {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #000;
    border-radius: 6px;
}
.dcd-gallery-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.dcd-gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font: 500 12px/1 Inter, sans-serif;
    padding: 4px 9px;
    border-radius: 20px;
    pointer-events: none;
}
.dcd-gal-arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.dcd-gal-arrow:hover { background: rgba(0,0,0,.55); }
.dcd-gal-arrow svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dcd-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 6px;
    flex-shrink: 0;
    scrollbar-width: thin;
}
.dcd-gal-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 58px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: #111;
    transition: border-color .15s;
}
.dcd-gal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .65;
    transition: opacity .15s;
}
.dcd-gal-thumb:hover img,
.dcd-gal-thumb.is-active img { opacity: 1; }
.dcd-gal-thumb.is-active { border-color: #fff; }

/* ===================================================================
   Brochure unlock / download-ready state (single listing templates)
   =================================================================== */
.brochure-unlock-ready {
    text-align: center;
    padding: clamp(24px, 4vw, 40px) 16px;
}
.brochure-unlock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    margin: 0 auto 16px;
}
.brochure-unlock-message {
    font-size: 16px;
    font-weight: 500;
    color: #1a2010;
    margin: 0 0 20px;
}
.brochure-download-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: #16a34a;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}
.brochure-download-cta:hover {
    background: #15803d;
    color: #fff;
}
.brochure-download-cta::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ===================================================================
   Embed fill helper — replaces inline styles in overlay iframes/maps
   =================================================================== */
.ranch-embed-fill {
    position: relative;
    width: 100%;
    min-height: 70vh;
}
.ranch-embed-fill iframe,
.ranch-embed-fill .ranch-idland-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.ranch-embed-fill .ranch-map-hero {
    position: absolute;
    inset: 0;
}

/* ===================================================================
   Magazine long-scroll layout (two-column / RR template)
   Scoped to .ranch-single--mag. Mobile-first.
   =================================================================== */
.ranch-single--mag {
    --mag-max:          1080px;
    --mag-gutter:       clamp(16px, 4vw, 32px);
    --mag-fg:           #1a1a1a;
    --mag-muted:        #6b6b6b;
    --mag-rule:         #e5e0d8;
    --mag-accent:       #7a6a4f;
    --mag-bg-soft:      #faf8f4;
    --mag-radius:       2px;
    --mag-break:        1024px;
    --mag-sidebar-width: 320px;
    --mag-sidebar-gap:  clamp(24px, 3vw, 48px);
    --font-family:      inherit;
    color: var(--mag-fg);
    font-family: Inter, 'Times New Roman', serif;
}
.ranch-single--mag a { color: var(--mag-accent); }

/* Badge links sit on top of images — must stay white regardless of mag accent */
.ranch-single--mag .ranch-card-badges .listing-badge,
.ranch-single--mag .ranch-card-badges .listing-badge a {
    color: #ffffff;
}
.ranch-single--mag h1,
.ranch-single--mag h2,
.ranch-single--mag h3,
.ranch-single--mag h4 {
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--mag-fg);
}

/* Font family cascade — let theme control font via Site Editor */
.ranch-single--mag,
.ranch-single--mag p,
.ranch-single--mag a,
.ranch-single--mag li,
.ranch-single--mag dt,
.ranch-single--mag dd,
.ranch-single--mag span,
.ranch-single--mag div,
.ranch-single--mag button,
.ranch-single--mag input,
.ranch-single--mag textarea,
.ranch-single--mag select {
    font-family: inherit !important;
}

/* Hero ---------------------------------------------------- */
.ranch-single--mag .mag-hero {
    position: relative;
    width: 100%;
    min-height: min(78vh, 760px);
    background: #111 center/cover no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}
.ranch-single--mag .mag-hero::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,.75) 100%);
    pointer-events: none;
}
.ranch-single--mag .mag-hero__back {
    position: absolute;
    top: clamp(16px, 3vw, 28px);
    left: clamp(16px, 3vw, 28px);
    z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: rgba(0,0,0,.35);
    color: #fff;
    text-decoration: none;
    font: 500 13px/1 Inter, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--mag-radius);
    backdrop-filter: blur(4px);
    transition: background .2s ease;
}
.ranch-single--mag .mag-hero__back:hover { background: rgba(0,0,0,.6); color: #fff; }
.ranch-single--mag .mag-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--mag-max);
    margin: 0 auto;
    padding: clamp(24px, 6vw, 56px) var(--mag-gutter) clamp(48px, 8vw, 96px);
}
.ranch-single--mag .mag-hero__eyebrow {
    font: 600 12px/1 Inter, sans-serif;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255,255,255,.92);
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--mag-radius);
}
.ranch-single--mag .mag-hero__title {
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.05;
    margin: 0 0 12px;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
    font-weight: 400;
}
.ranch-single--mag .mag-hero__location {
    font: 400 clamp(16px, 2vw, 20px)/1.3 Inter, sans-serif;
    color: rgba(255,255,255,.9);
    margin: 0 0 24px;
    letter-spacing: .02em;
}
.ranch-single--mag .mag-hero__acres {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 24px;
    font: 400 clamp(15px, 1.8vw, 19px)/1.3 Inter, sans-serif;
    color: rgba(255,255,255,.9);
    letter-spacing: .02em;
}
.ranch-single--mag .mag-hero__acres-label {
    font-size: .8em;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .75;
    margin-right: 4px;
}
.ranch-single--mag .mag-hero__acres-sep {
    opacity: .5;
    font-size: .9em;
}
.ranch-single--mag .mag-hero__buttons {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.ranch-single--mag .mag-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font: 500 13px/1 Inter, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--mag-radius);
    cursor: pointer;
    transition: all .2s ease;
    border: 1px solid transparent;
}
.ranch-single--mag .mag-btn--primary {
    background: var(--mag-accent);
    color: #fff;
    border-color: var(--mag-accent);
}
.ranch-single--mag .mag-btn--primary:hover { background: #5f5340; border-color: #5f5340; color: #fff; }
.ranch-single--mag .mag-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.ranch-single--mag .mag-btn--ghost:hover { background: rgba(255,255,255,.15); color: #fff; }
.ranch-single--mag .mag-btn--dark {
    background: var(--mag-fg);
    color: #fff;
    border-color: var(--mag-fg);
}
.ranch-single--mag .mag-btn--dark:hover { background: var(--mag-accent); border-color: var(--mag-accent); color: #fff; }
.ranch-single--mag .mag-btn--outline {
    background: transparent;
    color: var(--mag-fg);
    border-color: var(--mag-fg);
}
.ranch-single--mag .mag-btn--outline:hover { background: var(--mag-fg); color: #fff; }
.ranch-single--mag .mag-btn svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ranch-single--mag .mag-btn svg .icon-fill {
    fill: currentColor;
    stroke: none;
}

/* Sticky stat bar ----------------------------------------- */
.ranch-single--mag .mag-stats {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid var(--mag-rule);
    box-shadow: 0 1px 12px rgba(0,0,0,.04);
}
.ranch-single--mag .mag-stats__inner {
    max-width: var(--mag-max);
    margin: 0 auto;
    padding: 16px var(--mag-gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
}
.ranch-single--mag .mag-stat {
    display: flex; flex-direction: column; gap: 2px;
}
.ranch-single--mag .mag-stat__label {
    font: 500 10px/1 Inter, sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mag-muted);
}
.ranch-single--mag .mag-stat__value {
    font: 400 clamp(18px, 2.4vw, 26px)/1.1 'Cormorant Garamond', serif;
    color: var(--mag-fg);
}
.ranch-single--mag .mag-stat__value .price-original {
    text-decoration: line-through;
    color: var(--mag-muted);
    font-size: .7em;
    margin-right: 8px;
}
.ranch-single--mag .mag-stats__cta {
    margin-left: auto;
    display: flex; gap: 8px;
}

/* Two-column layout --------------------------------------- */
.ranch-single--mag .mag-layout {
    max-width: var(--mag-max);
    margin: 0 auto;
    padding: clamp(40px, 7vw, 88px) var(--mag-gutter) clamp(48px, 8vw, 96px);
    /* background: #fff; */
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mag-sidebar-gap);
    align-items: start;
}
@media (min-width: 1024px) {
    .ranch-single--mag .mag-layout {
        grid-template-columns: minmax(0, 1fr) var(--mag-sidebar-width);
    }
}

/* Main content ------------------------------------------- */
.ranch-single--mag .mag-main {
    min-width: 0;
}
.ranch-single--mag .mag-section {
    max-width: 720px;
    margin: 0 auto clamp(40px, 6vw, 72px);
}
.ranch-single--mag .mag-section--wide {
    max-width: none;
}
.ranch-single--mag .mag-section__eyebrow {
    font: 500 11px/1 Inter, sans-serif;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--mag-accent);
    margin: 0 0 16px;
}
.ranch-single--mag .mag-section__title {
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.15;
    margin: 0 0 24px;
    font-weight: 400;
}
.ranch-single--mag .mag-prose {
    font: 400 17px/1.7 Inter, serif;
    color: #2a2a2a;
}

.ranch-single--mag .mag-short-descr.mag-prose {
    margin-bottom: 2em;
}
.ranch-single--mag .mag-prose > *:first-child { margin-top: 0; }
.ranch-single--mag .mag-prose > *:last-child  { margin-bottom: 0; }
.ranch-single--mag .mag-prose p { margin: 0 0 1.2em; }
.ranch-single--mag .mag-prose h3 {
    font-size: 22px;
    margin: 2em 0 .6em;
}
.ranch-single--mag .mag-prose h4 {
    font: 500 13px/1 Inter, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mag-accent);
    margin: 1.8em 0 .5em;
}
.ranch-single--mag .mag-prose ul,
.ranch-single--mag .mag-prose ol { margin: 0 0 1.2em 1.25em; padding: 0; }
.ranch-single--mag .mag-prose li { margin: 0 0 .4em; }
.ranch-single--mag .mag-lede {
    font-size: clamp(19px, 2vw, 22px);
    line-height: 1.55;
    color: var(--mag-muted);
    font-style: italic;
    margin: 0 0 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid var(--mag-rule);
}
.ranch-single--mag .mag-rule {
    max-width: 720px;
    margin: 0 auto clamp(40px, 6vw, 72px);
    border: 0;
    border-top: 1px solid var(--mag-rule);
}

/* Highlights list ---------------------------------------- */
.ranch-single--mag .mag-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 32px;
}
@media (min-width: 640px) {
    .ranch-single--mag .mag-highlights {
        grid-template-columns: 1fr 1fr;
    }
}
.ranch-single--mag .mag-highlights li {
    position: relative;
    padding-left: 22px;
    font: 400 16px/1.5 Inter, sans-serif;
    color: #2a2a2a;
}
.ranch-single--mag .mag-highlights li::before {
    content: '';
    position: absolute;
    left: 0; top: .6em;
    width: 8px; height: 8px;
    background: var(--mag-accent);
    border-radius: 50%;
}

/* Detail blocks ------------------------------------------ */
.ranch-single--mag .mag-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(24px, 3vw, 40px);
}
@media (min-width: 720px) {
    .ranch-single--mag .mag-details {
        grid-template-columns: 1fr 1fr;
    }
}
.ranch-single--mag .mag-detail__label {
    font: 500 11px/1 Inter, sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mag-accent);
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mag-rule);
}
.ranch-single--mag .mag-detail__body {
    font: 400 16px/1.65 Inter, sans-serif;
    color: #2a2a2a;
}
.ranch-single--mag .mag-detail__body > *:first-child { margin-top: 0; }
.ranch-single--mag .mag-detail__body > *:last-child  { margin-bottom: 0; }
.ranch-single--mag .mag-detail__body p { margin: 0 0 1em; }

/* Facts grid --------------------------------------------- */
.ranch-single--mag .mag-facts {
    background: var(--mag-bg-soft);
    padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 40px);
    border-radius: var(--mag-radius);
}
.ranch-single--mag .mag-facts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: clamp(16px, 3vw, 32px);
    margin: 0;
}
.ranch-single--mag .mag-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ranch-single--mag .mag-fact dt {
    font: 500 10px/1 Inter, sans-serif;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--mag-muted);
}
.ranch-single--mag .mag-fact dd {
    font: 400 22px/1.1 Inter, sans-serif;
    color: var(--mag-fg);
    margin: 0;
}
.ranch-single--mag .mag-fact dd .price-original {
    text-decoration: line-through;
    color: var(--mag-muted);
    font-size: .7em;
    display: block;
    margin-bottom: 2px;
}

/* Floating contacts sidebar ------------------------------- */
.ranch-single--mag .mag-sidebar {
    position: relative;
}
@media (min-width: 1024px) {
    .ranch-single--mag .mag-sidebar {
        position: sticky;
        top: clamp(20px, 4vh, 40px);
        align-self: start;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        padding-right: 4px;
    }
}
.ranch-single--mag .mag-sidebar__panel {
    background: var(--mag-bg-soft);
    border: 1px solid var(--mag-rule);
    border-radius: var(--mag-radius);
    padding: clamp(20px, 2vw, 28px);
}
.ranch-single--mag .mag-sidebar__eyebrow {
    font: 500 11px/1 Inter, sans-serif;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--mag-accent);
    margin: 0 0 6px;
}
.ranch-single--mag .mag-sidebar__title {
    font-size: 20px;
    line-height: 1.2;
    margin: 0 0 20px;
    color: var(--mag-fg);
    font-weight: 400;
}
.ranch-single--mag .mag-sidebar__cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ranch-single--mag .mag-sidebar__card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mag-rule);
}
.ranch-single--mag .mag-sidebar__card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.ranch-single--mag .mag-sidebar__photo {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--mag-radius);
    overflow: hidden;
    background: rgba(0,0,0,.06);
    margin-bottom: 12px;
}
.ranch-single--mag .mag-sidebar__photo img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block;
}
.ranch-single--mag .mag-sidebar__photo--placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--mag-muted);
    font: 500 24px/1 Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.ranch-single--mag .mag-sidebar__body { min-width: 0; }
.ranch-single--mag .mag-sidebar__name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    margin: 0 0 2px;
    color: var(--mag-fg);
}
.ranch-single--mag .mag-sidebar__name a {
    color: inherit; text-decoration: none;
}
.ranch-single--mag .mag-sidebar__name a:hover { color: var(--mag-accent); }
.ranch-single--mag .mag-sidebar__role {
    font: 500 10px/1 Inter, sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mag-muted);
    margin: 0 0 10px;
}
.ranch-single--mag .mag-sidebar__detail {
    font: 400 13px/1.4 Inter, sans-serif;
    margin: 0 0 2px;
    word-break: break-word;
}
.ranch-single--mag .mag-sidebar__detail a {
    color: var(--mag-fg); text-decoration: none;
    border-bottom: 1px solid transparent;
}
.ranch-single--mag .mag-sidebar__detail a:hover {
    color: var(--mag-accent); border-bottom-color: var(--mag-accent);
}
.ranch-single--mag .mag-sidebar__cta {
    margin-top: 20px;
    display: flex; flex-direction: column; gap: 8px;
}
.ranch-single--mag .mag-sidebar__cta .mag-btn {
    width: 100%;
    justify-content: center;
}
.ranch-single--mag .mag-sidebar__fallback {
    font: 400 14px/1.55 Inter, sans-serif;
    color: var(--mag-fg);
    margin-bottom: 16px;
}
.ranch-single--mag .mag-sidebar__fallback a { color: var(--mag-accent); }

/* Mobile sticky CTA -------------------------------------- */
.ranch-single--mag .mag-mobile-cta {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
    background: rgba(255,255,255,.98);
    border-top: 1px solid var(--mag-rule);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    gap: 8px;
}
.ranch-single--mag .mag-mobile-cta .mag-btn { flex: 1; justify-content: center; padding: 14px 16px; }
@media (max-width: 768px) {
    .ranch-single--mag .mag-mobile-cta { display: flex; }
    .ranch-single--mag .mag-main { padding-bottom: 96px; }
    .ranch-single--mag .mag-stats__cta { display: none; }
    .ranch-single--mag .mag-stats__inner { gap: 20px; }
    .ranch-single--mag .mag-stat__value { font-size: 17px; }
}

/* Overlay drawer sizing ---------------------------------- */
.ranch-single--two-col .ranch-overlay-drawer-gallery,
.ranch-single--two-col .ranch-overlay-drawer-map {
    width: min(96vw, 1200px);
    max-width: 96vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.ranch-single--two-col .ranch-overlay-drawer-gallery .ranch-overlay-body,
.ranch-single--two-col .ranch-overlay-drawer-map .ranch-overlay-body {
    flex: 1;
    overflow: auto;
    padding: 16px;
}
/* Black background for gallery lightbox */
.ranch-single--two-col .ranch-overlay-drawer-gallery .ranch-overlay-body {
    background: #000;
    padding: 12px;
}
.ranch-single--two-col .ranch-overlay-drawer-map .ranch-overlay-body {
    overflow: hidden;
    padding: 0;
}

/* Gallery strip (NGG fallback) --------------------------- */
.ranch-single--mag .mag-gallery-strip {
    width: 100%;
    line-height: 0;
    overflow: hidden;
}
.ranch-single--mag .mag-gallery-strip > * {
    width: 100%;
}

/* Property meta (type badges + feature tags) ------------- */
.ranch-single--mag .mag-property-meta {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 20px);
    max-width: 720px;
    margin: 0 auto clamp(20px, 3vw, 32px);
}
.ranch-single--mag .mag-property-meta__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ranch-single--mag .mag-property-meta__label {
    margin: 0;
    font: 600 11px/1 Inter, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mag-muted, #6b6b6b);
}
.ranch-single--mag .mag-property-meta__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ranch-single--mag .mag-property-meta .listing-badge--type {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: #fff;
    color: var(--color-text, #243d6a);
    border: 1px solid rgba(36, 61, 106, 0.22);
    box-shadow: 0 1px 0 rgba(36, 61, 106, 0.04);
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.ranch-single--mag .mag-property-meta .listing-badge--type:hover {
    background: rgba(36, 61, 106, 0.06);
    border-color: rgba(36, 61, 106, 0.4);
    transform: translateY(-1px);
}

/* Accordion ---------------------------------------------- */
.ranch-single--mag .mag-accordion {
    max-width: 720px;
    margin: 0 auto clamp(40px, 6vw, 72px);
}
.ranch-single--mag .mag-accordion__item {
    border-bottom: 1px solid var(--mag-rule);
}
.ranch-single--mag .mag-accordion__item:first-child {
    border-top: 1px solid var(--mag-rule);
}
.ranch-single--mag .mag-accordion__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 18px 0;
    cursor: pointer;
    list-style: none;
    color: var(--mag-fg);
    background: none;
    border: none;
    text-align: left;
    transition: color .15s ease;
}
.ranch-single--mag .mag-accordion__trigger::-webkit-details-marker { display: none; }
.ranch-single--mag .mag-accordion__trigger::marker { display: none; }
.ranch-single--mag details[open] > .mag-accordion__trigger,
.ranch-single--mag .mag-accordion__trigger:hover { color: var(--mag-accent); }
.ranch-single--mag .mag-accordion__label {
    font: 500 12px/1 inherit;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.ranch-single--mag .mag-accordion__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
    color: var(--mag-muted);
}
.ranch-single--mag .mag-accordion__icon::before,
.ranch-single--mag .mag-accordion__icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 1px;
    transition: transform .25s ease, opacity .25s ease;
}
.ranch-single--mag .mag-accordion__icon::before {
    width: 12px; height: 1.5px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.ranch-single--mag .mag-accordion__icon::after {
    width: 1.5px; height: 12px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.ranch-single--mag details[open] .mag-accordion__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}
.ranch-single--mag .mag-accordion__body {
    padding: 4px 0 clamp(28px, 4vw, 44px);
}
