/* ==========================================================
   MA-CO Real Estate — design tokens
   Palette:  ink #2E2C2C · parchment #F7F6F6 · red #C00000
             gray #767171 · clay-line #DDD9D9 · white #FFFFFF
   Colors sampled directly from the MA-CO logo (red #C00000, gray #767171).
   Type:     display "Fraunces" · body/data "Inter"
   Signature: the "key groove" divider + red listing plaques
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ink: #2E2C2C;
    --ink-soft: #767171;
    --parchment: #F7F6F6;
    --parchment-dim: #ECEAEA;
    --brass: #C00000;
    --brass-dark: #970000;
    --sage: #3F7D42;
    --clay-line: #DDD9D9;
    --white: #FFFFFF;
    --danger: #970000;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    --radius: 3px;
    --shadow: 0 12px 30px -18px rgba(46, 44, 44, 0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    margin: 0 0 0.4em;
    line-height: 1.15;
    color: var(--ink);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- key-groove divider (signature element) ---------- */
.key-groove {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2.2rem 0;
    user-select: none;
}
.key-groove::before,
.key-groove::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--clay-line);
}
.key-groove .bit {
    width: 9px;
    height: 9px;
    background: var(--brass);
    transform: rotate(45deg);
    flex: none;
}
.key-groove.left::before { flex: 0 0 0; }

/* ---------- header ---------- */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--brass);
    padding: 14px 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
}
.brand img {
    height: 92px;
    width: auto;
    display: block;
}
.site-nav a {
    color: var(--ink);
    font-size: 0.92rem;
    margin-left: 28px;
    font-weight: 600;
    transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--brass); }

.lang-switch {
    margin-left: 28px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.lang-switch a {
    margin-left: 0;
    color: var(--ink-soft);
    opacity: 0.75;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a.active { color: var(--brass); opacity: 1; }
.lang-switch .lang-divider {
    color: var(--ink-soft);
    opacity: 0.5;
    margin: 0 4px;
}

/* ---------- hero ---------- */
.hero {
    background: var(--ink);
    color: var(--parchment);
    padding: 40px 0 60px;
    position: relative;
}
.hero .container { max-width: 860px; }
.hero .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 {
    color: var(--white);
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    font-style: italic;
    font-weight: 500;
}
.hero p {
    color: var(--parchment-dim);
    font-size: 1.05rem;
    max-width: 46ch;
    margin: 18px 0 0;
}

/* ---------- section heading ---------- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 56px;
}
.section-head h2 { font-size: 1.7rem; font-style: italic; }
.section-head .count {
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 500;
}

/* ---------- listing grid & plaque cards ---------- */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin: 28px 0 70px;
}

.plaque {
    background: var(--white);
    border: 1px solid var(--clay-line);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
}
.plaque:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.plaque .photo {
    aspect-ratio: 4 / 3;
    background: var(--parchment-dim) center/cover no-repeat;
    position: relative;
}
.plaque .tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--ink);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 2px;
}
.plaque .status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 2px;
    background: var(--sage);
    color: var(--white);
}
.plaque .status.pending { background: var(--brass); }
.plaque .status.rented { background: var(--ink-soft); }

.plaque .body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.plaque .price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--brass-dark);
    font-weight: 600;
}
.plaque .price span { font-size: 0.85rem; color: var(--ink-soft); font-family: var(--font-body); font-weight: 500; }
.plaque h3 { font-size: 1.08rem; margin: 8px 0 2px; }
.plaque .addr { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 12px; }
.plaque .specs {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    border-top: 1px solid var(--clay-line);
    padding-top: 12px;
    margin-top: auto;
}
.plaque .specs strong { color: var(--ink); }
.plaque .view-btn {
    display: block;
    text-align: center;
    margin-top: 14px;
    padding: 10px;
    background: var(--ink);
    color: var(--parchment);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 2px;
    transition: background 0.15s ease;
}
.plaque .view-btn:hover { background: var(--brass-dark); }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--ink-soft);
    border: 1px dashed var(--clay-line);
    border-radius: var(--radius);
}

/* ---------- property detail page ---------- */
.detail-hero {
    background: var(--parchment-dim);
    padding: 40px 0;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

.carousel {
    position: relative;
}
.carousel:focus { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: var(--radius); }
.carousel-main {
    aspect-ratio: 4 / 3;
    background: var(--white) center/cover no-repeat;
    border-radius: var(--radius);
    border: 1px solid var(--clay-line);
    position: relative;
    touch-action: pan-y;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(46, 44, 44, 0.55);
    color: var(--white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.carousel-arrow:hover { background: var(--brass); }
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(46, 44, 44, 0.7);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.thumb-strip {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.thumb {
    width: 68px;
    height: 52px;
    background: var(--parchment-dim) center/cover no-repeat;
    border-radius: 2px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.thumb:hover { opacity: 1; }
.thumb.active { opacity: 1; border-color: var(--brass); }

.location-block { margin: 0 0 60px; }
.location-heading { font-size: 1.4rem; font-style: italic; margin-bottom: 16px; }
.map-frame {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--clay-line);
    line-height: 0;
}
.map-directions { margin-top: 16px; }

.detail-info .ref { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-dark); font-weight: 600; }
.detail-info h1 { font-size: 2rem; font-style: italic; margin-top: 6px; }
.detail-info .addr { color: var(--ink-soft); margin-bottom: 18px; }
.detail-info .price-row { font-family: var(--font-display); font-size: 2rem; color: var(--brass-dark); font-weight: 600; margin-bottom: 18px; }
.detail-info .price-row span { font-size: 0.95rem; color: var(--ink-soft); font-family: var(--font-body); font-weight: 500; }

.spec-strip {
    display: flex;
    gap: 26px;
    padding: 16px 0;
    border-top: 1px solid var(--clay-line);
    border-bottom: 1px solid var(--clay-line);
    margin-bottom: 22px;
}
.spec-strip div strong { display: block; font-size: 1.15rem; font-family: var(--font-display); }
.spec-strip div span { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.detail-info .description { color: var(--ink-soft); margin-bottom: 26px; }

.btn {
    display: inline-block;
    padding: 13px 28px;
    background: var(--brass);
    color: var(--white);
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn:hover { background: var(--brass-dark); }
.btn.secondary { background: var(--clay-line); color: var(--ink); border: 1px solid var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--parchment); }
.btn:disabled { background: var(--clay-line); color: var(--ink-soft); cursor: not-allowed; }

/* ---------- forms ---------- */
.form-card {
    background: var(--white);
    border: 1px solid var(--clay-line);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 640px;
    margin: 40px auto 80px;
}
.form-card h1 { font-size: 1.6rem; font-style: italic; }
.form-card .sub { color: var(--ink-soft); margin-bottom: 26px; font-size: 0.92rem; }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--clay-line);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--parchment);
    color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--brass);
    outline-offset: 1px;
}
.field-hint {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 6px;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.alert {
    padding: 14px 16px;
    border-radius: 2px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.alert.success { background: #EAF0E8; color: var(--sage); border: 1px solid var(--sage); }
.alert.error { background: #F5E9E7; color: var(--danger); border: 1px solid var(--danger); }

.gallery-manage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--clay-line);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    background: rgba(24, 42, 46, 0.85);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 600;
}
.gallery-item .remove-photo:hover { background: var(--danger); }

/* ---------- admin ---------- */
.admin-bar {
    background: var(--ink);
    color: var(--parchment);
    padding: 14px 0;
    font-size: 0.85rem;
}
.admin-bar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: var(--white); font-weight: 600; margin-left: 18px; }

.data-table { width: 100%; border-collapse: collapse; margin: 24px 0 60px; background: var(--white); }
.data-table th, .data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--clay-line);
    font-size: 0.9rem;
}
.data-table th { background: var(--parchment-dim); font-weight: 600; }
.data-table tr:hover td { background: var(--parchment-dim); }
.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--clay-line);
}
.pill.available, .pill.new { background: #EAF0E8; color: var(--sage); }
.pill.pending, .pill.reviewed { background: #F3E7D6; color: var(--brass-dark); }
.pill.rented, .pill.approved { background: #E4EEEC; color: var(--ink-soft); }
.pill.denied { background: #F5E9E7; color: var(--danger); }

.login-card {
    max-width: 380px;
    margin: 90px auto;
    background: var(--white);
    border: 1px solid var(--clay-line);
    padding: 34px;
    border-radius: var(--radius);
}

/* ---------- footer ---------- */
.site-footer {
    background: var(--ink);
    color: var(--parchment-dim);
    padding: 34px 0;
    font-size: 0.85rem;
    margin-top: 60px;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 640px) {
    .site-header .container { flex-direction: column; gap: 12px; }
    .site-nav a { margin: 0 10px; }
}
