/**
 * PropertyCMS Pro - Public Frontend Styles
 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --success: #22c55e;
    --radius: 0.5rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Property Grid */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.property-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.1);
}

.property-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.property-card-body {
    padding: 1.25rem;
}

.property-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.property-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.property-card h3 a:hover {
    color: var(--primary);
}

.property-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.property-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.property-location {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Page Header */
.page-header {
    background: var(--bg-alt);
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Filters */
.filters {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filters .form-group {
    flex: 1;
    min-width: 150px;
}

.filters label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.filters input,
.filters select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* Property Detail */
.property-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.property-gallery img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}

.property-gallery .main-image {
    grid-row: span 2;
    height: 400px;
}

.property-gallery .thumb {
    height: 195px;
}

.property-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.property-details h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.property-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-item strong {
    color: var(--text);
}

.feature-item span {
    color: var(--text-muted);
}

/* Contact Form */
.contact-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.contact-card h3 {
    margin-bottom: 1rem;
}

.contact-card .form-group {
    margin-bottom: 1rem;
}

.contact-card input,
.contact-card textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
}

.contact-card textarea {
    resize: vertical;
    min-height: 100px;
}

/* Footer */
.site-footer {
    background: #1e293b;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-grid h3,
.footer-grid h4 {
    margin-bottom: 1rem;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid ul li {
    margin-bottom: 0.5rem;
}

.footer-grid a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-grid a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-body {
    padding: 1.5rem;
}

.blog-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.blog-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: var(--primary);
}

.blog-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ============================================
   CONTENT BLOCKS - Public Frontend
   ============================================ */

/* Single Property Block */
.content-property {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.content-property--full {
    flex-direction: column;
}

.content-property--compact {
    gap: 1rem;
    padding: 1rem;
}

.content-property__image {
    flex-shrink: 0;
}

.content-property__image img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
}

.content-property--full .content-property__image img {
    width: 100%;
    height: 300px;
}

.content-property--compact .content-property__image img {
    width: 120px;
    height: 90px;
}

.content-property__info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.content-property__info h3 a {
    color: var(--text);
    text-decoration: none;
}

.content-property__info h3 a:hover {
    color: var(--primary);
}

.content-property__location {
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.content-property__price {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.content-property__details {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Property List Block */
.content-propertylist {
    margin: 2rem 0;
}

.content-propertylist__filters {
    margin-bottom: 1.5rem;
}

.content-propertylist__form {
    display: flex;
    gap: 1rem;
}

.content-propertylist__form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.content-propertylist__form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.content-propertylist__grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 1.5rem;
}

.content-propertylist__item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-propertylist__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.1);
}

.content-propertylist__thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.content-propertylist__info {
    padding: 1rem;
}

.content-propertylist__info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.content-propertylist__info h4 a {
    color: var(--text);
    text-decoration: none;
}

.content-propertylist__info h4 a:hover {
    color: var(--primary);
}

.content-propertylist__info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.content-propertylist__price {
    display: block;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

/* Gallery Block */
.content-gallery {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.content-gallery--masonry {
    /* Could add masonry layout with JS */
}

.content-gallery--carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
}

.content-gallery--carousel .content-gallery__item {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

.content-gallery__item {
    margin: 0;
}

.content-gallery__item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
}

.content-gallery__item figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* Button Block */
.content-button {
    margin: 1.5rem 0;
    text-align: center;
}

.content-button .btn-secondary {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.content-button .btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.content-button .btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.content-button .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Spacer Block */
.content-spacer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-spacer--divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--border);
}

/* Video Block */
.content-video {
    position: relative;
    aspect-ratio: 16/9;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.content-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Testimonial Block */
.content-testimonial {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: none;
    text-align: center;
}

.content-testimonial__photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.content-testimonial__quote {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.content-testimonial__author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.content-testimonial__author strong {
    color: var(--text);
    font-style: normal;
}

.content-testimonial__author span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* CTA Block */
.content-cta {
    margin: 2rem 0;
    padding: 3rem 2rem;
    border-radius: var(--radius);
    text-align: center;
}

.content-cta h2 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
}

.content-cta p {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .property-gallery {
        grid-template-columns: 1fr;
    }

    .property-info {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        display: none;
    }

    .content-property {
        flex-direction: column;
    }

    .content-property__image img {
        width: 100%;
        height: 200px;
    }

    .content-propertylist__grid {
        grid-template-columns: 1fr;
    }

    .content-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-cta {
        padding: 2rem 1rem;
    }

    .content-cta h2 {
        font-size: 1.5rem;
    }
}