/* JR Realty Theme - Main CSS */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8fafc;
    color: #0f172a;
    margin: 0;
}

.font-serif { font-family: 'Playfair Display', serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Number input */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Property Card ──────────────────────────────────────────────────────── */
.jr-property-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
}

.jr-property-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.jr-property-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e2e8f0;
    overflow: hidden;
}

.jr-property-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.jr-property-card:hover .jr-property-card__image img {
    transform: scale(1.05);
}

.jr-property-card__image-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #cbd5e1, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jr-property-card__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.jr-property-card__save {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    padding: 0.5rem;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jr-property-card__save:hover { color: #e11d48; }

.jr-property-card__body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.jr-property-card__price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.jr-property-card__address {
    font-size: 0.8125rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.jr-property-card__stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #475569;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

.jr-property-card__stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.jr-property-card__divider {
    width: 1px;
    height: 1rem;
    background: #e2e8f0;
}

/* ── Search Form ─────────────────────────────────────────────────────────── */
.jr-search-form {
    display: flex;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .jr-search-form { flex-direction: column; }
}

.jr-search-form__field {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: border-color 0.2s;
    min-width: 0;
}

.jr-search-form__field:focus-within {
    border-color: #fecaca;
}

.jr-search-form__field input,
.jr-search-form__field select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: #0f172a;
    outline: none;
    cursor: pointer;
}

.jr-search-form__field input::placeholder { color: #94a3b8; }

.jr-search-form__submit {
    padding: 0.875rem 2rem;
    background: #7f1d1d;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.jr-search-form__submit:hover { background: #6b1818; }

/* ── Single Listing Page ─────────────────────────────────────────────────── */
.jr-listing-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.5rem;
    border-radius: 1rem;
    overflow: hidden;
    height: 420px;
}

.jr-listing-gallery__main {
    grid-row: 1 / 3;
    overflow: hidden;
}

.jr-listing-gallery__main img,
.jr-listing-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.jr-listing-gallery__main:hover img,
.jr-listing-gallery__thumb:hover img {
    transform: scale(1.04);
}

.jr-listing-gallery__thumb { overflow: hidden; background: #e2e8f0; }

.jr-listing-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .jr-listing-details { grid-template-columns: repeat(4, 1fr); }
}

.jr-listing-detail {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.jr-listing-detail__value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.jr-listing-detail__label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Loading & States ────────────────────────────────────────────────────── */
.jr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.jr-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #7f1d1d;
    border-radius: 50%;
    animation: jr-spin 0.6s linear infinite;
    margin-right: 0.75rem;
}

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

.jr-no-listings {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-style: italic;
}

/* ── CREA Attribution ────────────────────────────────────────────────────── */
.jr-crea-attribution {
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* ── Custom city autocomplete (replaces native <datalist> dark UI) ─────── */
.jr-ac-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.25);
    max-height: 320px;
    overflow-y: auto;
    z-index: 60;
    padding: 6px;
}
.jr-ac-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    font-family: inherit;
}
.jr-ac-item + .jr-ac-item { margin-top: 2px; }
.jr-ac-item:hover,
.jr-ac-item.is-active {
    background: #fff1f2;
    color: #881337;
    outline: none;
}
.jr-ac-item .jr-ac-count {
    float: right;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}
.jr-ac-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: #94a3b8;
}

/* ── Blog Article Typography (.jr-prose) ─────────────────────────────────── */
/* Styles every common element WordPress can output inside post content so the
   blog matches the site palette (slate + #7f1d1d rose) and fonts
   (Playfair Display headings / Inter body). Replaces Tailwind Typography,
   which is not loaded on this theme. */

.jr-prose {
    font-family: 'Inter', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #334155;
}

.jr-prose > *:first-child { margin-top: 0; }
.jr-prose > *:last-child  { margin-bottom: 0; }

/* Paragraphs & inline */
.jr-prose p { margin: 0 0 1.35em; }
.jr-prose p.has-drop-cap:first-letter,
.jr-prose .jr-lead:first-letter { }
.jr-prose .jr-lead,
.jr-prose > p:first-of-type {
    font-size: 1.1875rem;
    line-height: 1.7;
    color: #1e293b;
}
.jr-prose strong, .jr-prose b { font-weight: 600; color: #0f172a; }
.jr-prose em, .jr-prose i { font-style: italic; }
.jr-prose small { font-size: 0.8125rem; color: #64748b; }
.jr-prose mark {
    background: #fef2f2;
    color: #7f1d1d;
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
}
.jr-prose abbr[title] { text-decoration: underline dotted #cbd5e1; cursor: help; }
.jr-prose sub, .jr-prose sup { font-size: 0.72em; }

/* Headings */
.jr-prose h1, .jr-prose h2, .jr-prose h3,
.jr-prose h4, .jr-prose h5, .jr-prose h6 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
    scroll-margin-top: 7rem;
}
.jr-prose h1 { font-size: 2.25rem; line-height: 1.2;  margin: 2.4em 0 0.7em; }
.jr-prose h2 {
    font-size: 1.875rem;
    line-height: 1.25;
    margin: 2.1em 0 0.7em;
    padding-bottom: 0.45em;
    border-bottom: 1px solid #f1f5f9;
}
.jr-prose h3 { font-size: 1.4375rem; line-height: 1.3; margin: 1.9em 0 0.6em; }
.jr-prose h4 { font-size: 1.1875rem; line-height: 1.4; margin: 1.7em 0 0.5em; }
.jr-prose h5,
.jr-prose h6 {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7f1d1d;
    margin: 1.8em 0 0.5em;
}
.jr-prose h6 { color: #64748b; }

/* Links */
.jr-prose a {
    color: #7f1d1d;
    text-decoration: underline;
    text-decoration-color: #fecaca;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.jr-prose a:hover { color: #991b1b; text-decoration-color: #7f1d1d; }

/* Lists */
.jr-prose ul, .jr-prose ol { margin: 0 0 1.35em; padding-left: 1.35rem; }
.jr-prose ul { list-style: none; padding-left: 1.5rem; }
.jr-prose ul > li { position: relative; }
.jr-prose ul > li::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7f1d1d;
}
.jr-prose ol { list-style: decimal; }
.jr-prose ol > li::marker { color: #7f1d1d; font-weight: 600; }
.jr-prose li { margin: 0.4em 0; padding-left: 0.15rem; }
.jr-prose li > ul, .jr-prose li > ol { margin: 0.45em 0 0.45em; }
.jr-prose ul ul > li::before { background: #cbd5e1; }
.jr-prose dl { margin: 0 0 1.35em; }
.jr-prose dt { font-weight: 600; color: #0f172a; margin-top: 1em; }
.jr-prose dd { margin: 0.25em 0 0 1rem; color: #475569; }

/* Blockquote */
.jr-prose blockquote,
.jr-prose .wp-block-quote {
    margin: 2em 0;
    padding: 1.5rem 1.75rem;
    background: #f8fafc;
    border-left: 3px solid #7f1d1d;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
    color: #1e293b;
}
.jr-prose blockquote p:last-child { margin-bottom: 0; }
.jr-prose blockquote cite,
.jr-prose .wp-block-quote cite {
    display: block;
    margin-top: 0.85rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 500;
    color: #64748b;
}
.jr-prose .wp-block-pullquote {
    margin: 2.25em 0;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-style: italic;
    color: #0f172a;
}

/* Tables */
.jr-prose .jr-table-scroll {
    margin: 2em 0;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,0.05);
    -webkit-overflow-scrolling: touch;
}
.jr-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: 0;
}
.jr-prose .jr-table-scroll > table { min-width: 34rem; }
.jr-prose thead { background: #0f172a; }
.jr-prose thead th {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    text-align: left;
    padding: 0.9rem 1.1rem;
    white-space: nowrap;
}
.jr-prose tbody tr { border-top: 1px solid #f1f5f9; }
.jr-prose tbody tr:nth-child(2n) { background: #f8fafc; }
.jr-prose tbody tr:hover { background: #fef2f2; }
.jr-prose tbody th {
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    padding: 0.85rem 1.1rem;
}
.jr-prose td { padding: 0.85rem 1.1rem; color: #334155; vertical-align: top; }
.jr-prose tfoot { background: #f1f5f9; font-weight: 600; color: #0f172a; }
.jr-prose tfoot td { border-top: 2px solid #e2e8f0; }
.jr-prose table caption,
.jr-prose .wp-block-table figcaption {
    caption-side: bottom;
    padding: 0.75rem 1.1rem 0.85rem;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: left;
}
.jr-prose .wp-block-table { margin: 2em 0; }

/* Code */
.jr-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    background: #f1f5f9;
    color: #7f1d1d;
    padding: 0.15em 0.4em;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}
.jr-prose pre {
    margin: 2em 0;
    padding: 1.25rem 1.4rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.7;
}
.jr-prose pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.jr-prose kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8em;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    border-radius: 0.375rem;
    padding: 0.1em 0.4em;
    color: #0f172a;
}

/* Media */
.jr-prose img,
.jr-prose video,
.jr-prose iframe { max-width: 100%; height: auto; border-radius: 1rem; }
.jr-prose img { display: block; margin: 2em auto; }
.jr-prose figure { margin: 2em 0; }
.jr-prose figure img { margin: 0; }
.jr-prose figcaption,
.jr-prose .wp-caption-text {
    margin-top: 0.7rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}
.jr-prose .alignleft  { float: left;  margin: 0.5em 1.75em 1.25em 0; }
.jr-prose .alignright { float: right; margin: 0.5em 0 1.25em 1.75em; }
.jr-prose .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.jr-prose .wp-block-embed iframe,
.jr-prose .wp-block-embed__wrapper iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.jr-prose .wp-block-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin: 2em 0; }
.jr-prose .wp-block-gallery figure { margin: 0; }

/* Rules & separators */
.jr-prose hr,
.jr-prose .wp-block-separator {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 3em 0;
}

/* Buttons inside content */
.jr-prose .wp-block-button__link,
.jr-prose .jr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #7f1d1d;
    color: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.2s;
}
.jr-prose .wp-block-button__link:hover,
.jr-prose .jr-btn:hover { background: #991b1b; }

/* Callout / key takeaways box */
.jr-prose .jr-callout {
    margin: 2em 0;
    padding: 1.4rem 1.6rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 1rem;
    color: #1e293b;
}
.jr-prose .jr-callout > *:last-child { margin-bottom: 0; }
.jr-prose .jr-callout strong { color: #7f1d1d; }

/* Details / FAQ accordion */
.jr-prose details {
    margin: 0.75em 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
}
.jr-prose details summary {
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
    list-style: none;
}
.jr-prose details summary::-webkit-details-marker { display: none; }
.jr-prose details summary::after { content: "+"; float: right; color: #7f1d1d; font-weight: 500; }
.jr-prose details[open] summary::after { content: "−"; }
.jr-prose details[open] summary { margin-bottom: 0.75rem; }

/* Footnotes */
.jr-prose .wp-block-footnotes { font-size: 0.875rem; color: #64748b; }

@media (max-width: 640px) {
    .jr-prose { font-size: 1rem; }
    .jr-prose h1 { font-size: 1.875rem; }
    .jr-prose h2 { font-size: 1.5rem; }
    .jr-prose h3 { font-size: 1.25rem; }
    .jr-prose blockquote { font-size: 1.125rem; padding: 1.15rem 1.25rem; }
    .jr-prose .wp-block-gallery { grid-template-columns: 1fr; }
}


/* ── Blog pages: flat (no rounded corners) + Georgia headings ───────────── */
.jr-blog-flat [class*="rounded"],
.jr-blog-flat img,
.jr-blog-flat table,
.jr-blog-flat input,
.jr-blog-flat textarea,
.jr-blog-flat select,
.jr-blog-flat button,
.jr-blog-flat .jr-prose *,
.jr-blog-flat .jr-prose {
    border-radius: 0 !important;
}
.jr-blog-flat .font-serif,
.jr-blog-flat h1, .jr-blog-flat h2, .jr-blog-flat h3 {
    font-family: Georgia, 'Times New Roman', serif;
}

/* Blog list thumbnail: show the full image, never crop it */
.jr-blog-card__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: #0f172a;
    overflow: hidden;
}
.jr-blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

/* FAQ accordion (built from content headings) */
.jr-faq { margin: 2em 0; border-top: 1px solid #e2e8f0; }
.jr-faq__item { border-bottom: 1px solid #e2e8f0; }
.jr-faq__q {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    background: none;
    border: 0;
    padding: 1.05rem 0;
    cursor: pointer;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
}
.jr-faq__q:hover { color: #7f1d1d; }
.jr-faq__q .jr-faq__icon {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    position: relative;
    margin-top: 0.2rem;
}
.jr-faq__q .jr-faq__icon::before,
.jr-faq__q .jr-faq__icon::after {
    content: "";
    position: absolute;
    background: #7f1d1d;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.jr-faq__q .jr-faq__icon::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.jr-faq__q .jr-faq__icon::after  { left: 50%; top: 0; height: 100%; width: 2px; transform: translateX(-50%); }
.jr-faq__item.is-open .jr-faq__icon::after { opacity: 0; transform: translateX(-50%) scaleY(0); }
.jr-faq__a { display: none; padding: 0 0 1.15rem; }
.jr-faq__item.is-open .jr-faq__a { display: block; }
.jr-faq__a > *:last-child { margin-bottom: 0; }
