/* ==========================================================================
   ViewItOnline — brand palette sampled from the client's yard-sign artwork
   ========================================================================== */
:root {
    --color-charcoal: #26282b;
    --color-charcoal-light: #3a3d41;
    --color-red: #9c3a3d;
    --color-red-dark: #7e2e30;
    --color-lime: #8dc63f;
    --color-lime-dark: #6ea52e;
    --color-bg: #f5f5f3;
    --color-white: #ffffff;
    --color-text: #24262b;
    --color-text-muted: #6b6f73;
    --color-border: #e2e2df;

    --radius: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
    --max-width: 1180px;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset / base ---- */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.55;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-red);
    text-decoration: none;
}

a:hover {
    color: var(--color-red-dark);
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 0.6em;
}

p {
    margin: 0 0 1em;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 3px solid var(--color-lime);
    outline-offset: 2px;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- Buttons & badges ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.7em 1.4em;
    border-radius: var(--radius);
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
    background: var(--color-red);
    color: var(--color-white);
}

.btn--primary:hover {
    background: var(--color-red-dark);
    color: var(--color-white);
}

.btn--ghost {
    background: transparent;
    border-color: var(--color-charcoal);
    color: var(--color-charcoal);
}

.btn--ghost:hover {
    background: var(--color-charcoal);
    color: var(--color-white);
}

.btn--danger {
    background: var(--color-white);
    border-color: var(--color-red);
    color: var(--color-red);
}

.btn--danger:hover {
    background: var(--color-red);
    color: var(--color-white);
}

.btn--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.badge {
    display: inline-block;
    padding: 0.3em 0.8em;
    border-radius: 999px;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--sold,
.badge--under_offer {
    background: var(--color-charcoal);
}

.badge--let {
    background: var(--color-lime-dark);
}

/* ==========================================================================
   Site chrome
   ========================================================================== */
.site-header {
    background: var(--color-charcoal);
    padding: 1.1rem 0;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.site-header__contact {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.site-header__phone {
    color: var(--color-lime);
}

.site-header__phone:hover {
    color: var(--color-white);
}

.site-header__email {
    color: var(--color-white);
    font-weight: 600;
}

.site-header__email:hover {
    color: var(--color-lime);
}

@media (max-width: 480px) {
    .site-header__email {
        display: none;
    }
}

.brand {
    display: inline-block;
}

.brand__mark {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--color-white);
}

.brand__accent {
    color: var(--color-lime);
}

.site-footer {
    background: var(--color-charcoal);
    color: #c9cbce;
    margin-top: 4rem;
    padding: 2.5rem 0;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: flex-start;
}

.site-footer p {
    margin: 0 0 0.35em;
}

.site-footer a {
    color: #c9cbce;
}

.site-footer a:hover {
    color: var(--color-lime);
}

.site-footer__contact {
    text-align: right;
}

.site-footer__admin {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==========================================================================
   Homepage — property listing grid
   ========================================================================== */
.page-hero {
    padding: 2.5rem 0 1rem;
}

.narrow-wrap {
    max-width: 420px;
}

.page-hero h1 {
    font-size: 1.9rem;
}

.page-hero p {
    color: var(--color-text-muted);
    max-width: 46em;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1.5rem 0 3rem;
}

.property-card {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

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

.property-card__link {
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.property-card__link:hover {
    color: inherit;
}

.property-card__image {
    aspect-ratio: 4 / 3;
    background: var(--color-charcoal-light);
    position: relative;
    overflow: hidden;
}

.property-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-card__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
}

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

.property-card__price {
    color: var(--color-red);
    font-weight: 700;
    margin-bottom: 0.15em;
}

.property-card__title {
    font-size: 1.15rem;
    margin-bottom: 0.3em;
}

.property-card__summary {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Property detail page
   ========================================================================== */
.property-header {
    padding: 2rem 0 1rem;
}

.property-header__top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.property-header h1 {
    font-size: 2rem;
    margin-bottom: 0.15em;
}

.property-header__address {
    color: var(--color-text-muted);
    margin-bottom: 0.4em;
}

.property-header__price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-red);
}

/* Gallery scroller */
.gallery-scroller {
    position: relative;
    background: var(--color-charcoal);
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-scroller__frame {
    position: relative;
    aspect-ratio: 16 / 10;
}

.gallery-scroller__track {
    display: flex;
    height: 100%;
    transition: transform 0.35s ease;
}

.gallery-scroller__slide {
    flex: 0 0 100%;
    height: 100%;
}

.gallery-scroller__slide a {
    display: block;
    height: 100%;
}

.gallery-scroller__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.gallery-scroller__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(38, 40, 43, 0.65);
    color: var(--color-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.gallery-scroller__btn:hover {
    background: var(--color-red);
}

.gallery-scroller__btn--prev {
    left: 0.75rem;
}

.gallery-scroller__btn--next {
    right: 0.75rem;
}

.gallery-scroller__count {
    position: absolute;
    bottom: 0.75rem;
    right: 0.9rem;
    background: rgba(38, 40, 43, 0.7);
    color: var(--color-white);
    padding: 0.25em 0.7em;
    border-radius: 999px;
    font-size: 0.85rem;
}

.gallery-scroller__viewall {
    display: inline-flex;
    margin-top: 0.9rem;
    color: var(--color-charcoal);
    font-weight: 600;
    align-items: center;
    gap: 0.4em;
}

.gallery-scroller__viewall:hover {
    color: var(--color-red);
}

/* Two-column layout: write-up + sidebar */
.property-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2rem 0 4rem;
}

.property-main h2 {
    font-size: 1.4rem;
    margin-top: 2rem;
}

.property-main h2:first-child {
    margin-top: 0;
}

.property-description {
    white-space: pre-line;
    color: var(--color-text);
}

.room-group {
    margin-bottom: 1.75rem;
}

.room-group h3 {
    font-size: 1.05rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.85rem;
    margin-bottom: 0.75em;
}

.room-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.room-card__top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.3em;
}

.room-card__name {
    font-weight: 700;
}

.room-card__dimensions {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.room-card__description {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.floorplan-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    max-width: 480px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    background: var(--color-bg);
    font-size: 0.95rem;
}

.property-sidebar {
    align-self: start;
}

.fact-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.fact-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

.fact-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5em 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.fact-list .fact-key {
    flex: 0 0 auto;
}

.fact-list li > span:last-child {
    text-align: right;
}

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

.fact-list dt,
.fact-list .fact-key {
    color: var(--color-text-muted);
}

@media (min-width: 900px) {
    .property-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .property-sidebar {
        position: sticky;
        top: 1.5rem;
    }
}

/* ==========================================================================
   Full gallery page + lightbox
   ========================================================================== */
.gallery-page-header {
    padding: 2rem 0 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem 0 4rem;
}

.gallery-grid__item {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-charcoal-light);
}

.gallery-grid--floorplans {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    max-width: 560px;
    padding: 0 0 0.5rem;
}

.gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

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

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 21, 23, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.lightbox.is-open {
    display: flex;
}

.lightbox__image {
    max-width: min(90vw, 1100px);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
}

.lightbox__btn:hover {
    background: var(--color-red);
}

.lightbox__btn--prev {
    left: 1rem;
}

.lightbox__btn--next {
    right: 1rem;
}

.lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    color: var(--color-white);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox__count {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: #d7d8da;
    font-size: 0.9rem;
}

/* ==========================================================================
   Forms (shared by admin)
   ========================================================================== */
.field {
    margin-bottom: 1.1rem;
}

.field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35em;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    padding: 0.65em 0.8em;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-white);
}

.field textarea {
    min-height: 7em;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--color-lime);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.3em;
}

/* Spam-trap field: hidden from sighted users but still present in the DOM
   (unlike display:none/type=hidden, which some bots skip) and out of the
   tab order so it never confuses screen reader users either. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: 0.9em 1.1em;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.alert--error {
    background: #fbe9e9;
    color: var(--color-red-dark);
    border: 1px solid #f0c4c4;
}

.alert--success {
    background: #eef7e1;
    color: var(--color-lime-dark);
    border: 1px solid #cde8a6;
}
