/*
 * Balô master stylesheet.
 * Keep brand tokens, layout primitives, components and page styles here to avoid drift.
 *
 * Sections:
 * 1. Font assets
 * 2. Design tokens
 * 3. Base elements
 * 4. Layout primitives
 * 5. Site chrome
 * 6. Brand marks and navigation
 * 7. Page structure
 * 8. Home hero
 * 9. Typography
 * 10. Controls, forms and card shells
 * 11. Home content and badges
 * 12. Property cards
 * 13. Footer
 * 14. Responsive rules
 */

/* 1. Font Assets */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter/inter-400.ttf") format("truetype");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/inter/inter-700.ttf") format("truetype");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/inter/inter-800.ttf") format("truetype");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("../fonts/inter/inter-900.ttf") format("truetype");
}

/* 2. Design Tokens */
:root {
    --balo-blue: #06356f;
    --balo-blue-2: #0057d8;
    --balo-green: #058747;
    --balo-yellow: #fdbb00;
    --balo-cream: #fff9eb;
    --balo-white: #ffffff;
    --balo-ink: #14213d;
    --balo-muted: #64748b;
    --balo-soft: #f5f7fa;
    --balo-line: #dde5ef;
    --balo-success: #13a267;
    --balo-warning: #f59e0b;
    --balo-danger: #d64545;
    --shadow-sm: 0 8px 22px rgba(6, 53, 111, 0.08);
    --shadow-md: 0 18px 50px rgba(6, 53, 111, 0.14);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --font-head: "Inter", "Aptos Display", "Montserrat", system-ui, sans-serif;
    --font-body: "Inter", "Aptos", "Segoe UI", system-ui, sans-serif;
    --property-home: url("../media/properties/property-home.jpg");
    --property-apartment: url("../media/properties/property-apartment.jpg");
    --property-investment: url("../media/properties/property-investment.jpg");
}

/* 3. Base Elements */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--balo-ink);
    background: var(--balo-white);
    line-height: 1.55;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

/* 4. Layout Primitives */
.shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

/* 5. Site Chrome */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--balo-line);
    backdrop-filter: blur(16px);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

/* 6. Brand Marks And Navigation */
.brand {
    --brand-logo: url("../media/brand/balo-logo-primary-clean.png");
    display: inline-block;
    width: 136px;
    aspect-ratio: 1137 / 456;
    overflow: hidden;
    background: var(--brand-logo) center / contain no-repeat;
    line-height: 0;
    text-indent: 120%;
    white-space: nowrap;
}

.brand--on-light,
.surface-light .brand {
    --brand-logo: url("../media/brand/balo-logo-primary-clean.png");
}

.brand--on-dark,
.surface-dark .brand,
.site-footer .brand {
    --brand-logo: url("../media/brand/balo-logo-on-dark.png");
}

.brand--on-blue,
.surface-blue .brand {
    --brand-logo: url("../media/brand/balo-logo-on-blue.png");
}

.brand--on-green,
.surface-green .brand {
    --brand-logo: url("../media/brand/balo-logo-on-green.png");
}

.brand--on-yellow,
.surface-yellow .brand {
    --brand-logo: url("../media/brand/balo-logo-on-yellow.png");
}

.brand--mono-light {
    --brand-logo: url("../media/brand/balo-logo-mono-light.png");
}

.brand--mono-dark {
    --brand-logo: url("../media/brand/balo-logo-mono-dark.png");
}

.nav-toggle {
    display: none;
    border: 1px solid var(--balo-line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    background: var(--balo-white);
    color: var(--balo-blue);
    font-weight: 800;
    cursor: pointer;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--balo-muted);
    font-size: 0.94rem;
    font-weight: 700;
}

.site-nav a.is-active,
.site-nav a:hover {
    background: #eef6ff;
    color: var(--balo-blue);
}

/* 7. Page Structure */
main {
    min-height: calc(100vh - 154px);
}

.page {
    display: grid;
    gap: 34px;
}

.page-section {
    padding: 54px 0;
}

/* 8. Home Hero */
.hero {
    position: relative;
    display: grid;
    gap: 24px;
    overflow: hidden;
    min-height: 610px;
    margin-inline: calc((100vw - min(1240px, calc(100vw - 32px))) / -2);
    padding: 72px max(16px, calc((100vw - 1240px) / 2));
    background:
        radial-gradient(circle at 82% 18%, rgba(253, 187, 0, 0.22), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, var(--balo-cream) 100%);
    border-bottom: 1px solid var(--balo-line);
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: auto 0 0 auto;
    z-index: 0;
    width: min(46vw, 640px);
    height: 100%;
    pointer-events: none;
    opacity: 0.32;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.03) contrast(1.04);
}

.hero-media-fade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.44)),
        linear-gradient(180deg, rgba(255, 249, 235, 0.10), rgba(255, 249, 235, 0.84));
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
    align-items: center;
    gap: 44px;
}

.hero-copy {
    display: grid;
    gap: 24px;
    max-width: 690px;
}

/* 9. Typography */
.eyebrow {
    display: inline-flex;
    width: fit-content;
    color: var(--balo-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-head);
    color: var(--balo-blue);
    line-height: 1.06;
    font-weight: 700;
}

h1 {
    max-width: 760px;
    font-size: clamp(44px, 7vw, 86px);
    letter-spacing: 0;
    line-height: 0.95;
}

h2 {
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: 0;
}

h3 {
    font-size: 22px;
    letter-spacing: 0;
}

p {
    color: #34445f;
    line-height: 1.7;
}

.hero-copy p {
    max-width: 650px;
    font-size: 1.18rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 10. Controls, Forms And Card Shells */
.button,
.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    background: var(--balo-yellow);
    color: var(--balo-blue);
    font-weight: 800;
    cursor: pointer;
}

.button.is-secondary {
    background: var(--balo-blue);
    color: var(--balo-white);
}

.search-card,
.card,
.panel,
.cta-card,
.module-grid article,
.card-grid article {
    background: var(--balo-white);
    border: 1px solid var(--balo-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.panel,
.cta-card {
    padding: 28px;
}

.search-card {
    display: grid;
    gap: 18px;
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.search-card h2 {
    font-size: clamp(1.9rem, 3vw, 2.45rem);
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--balo-line);
    border-radius: 14px;
    padding: 13px 15px;
    background: var(--balo-white);
    color: var(--balo-muted);
}

.search-button {
    grid-column: 1 / -1;
    background: var(--balo-blue);
    color: var(--balo-white);
}

/* 11. Home Content And Badges */
.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 8px 12px;
    background: #eef6ff;
    color: var(--balo-blue);
    font-size: 0.82rem;
    font-weight: 700;
}

.badge.green {
    background: #eaf8f1;
    color: var(--balo-green);
}

.badge.yellow {
    background: #fff4c8;
    color: #8a6100;
}

.section-title {
    display: grid;
    gap: 8px;
    max-width: 720px;
    margin-bottom: 24px;
}

.card-grid,
.module-grid,
.property-grid {
    display: grid;
    gap: 22px;
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid article,
.module-grid article {
    padding: 24px;
}

.property-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.property-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 22px;
}

.admin-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.admin-table-wrap {
    overflow-x: auto;
    padding: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--balo-line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--balo-blue);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-form {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label,
.form-grid label span {
    display: grid;
    gap: 6px;
}

.form-grid label span {
    color: var(--balo-blue);
    font-size: 0.82rem;
    font-weight: 800;
}

.span-2 {
    grid-column: 1 / -1;
}

.check-row {
    align-content: end;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.notice {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-weight: 700;
}

.notice.success {
    background: #eaf8f1;
    color: var(--balo-green);
}

.notice.error {
    background: #fff1f1;
    color: var(--balo-danger);
}

.media-list {
    display: grid;
    gap: 10px;
}

.media-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--balo-line);
    border-radius: var(--radius-sm);
}

.auth-page {
    max-width: 720px;
}

.auth-form {
    max-width: 520px;
}

/* 12. Property Cards */
.property-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    gap: 24px;
    align-items: stretch;
    margin-inline: calc((100vw - min(1240px, calc(100vw - 32px))) / -2);
    padding: 54px max(16px, calc((100vw - 1240px) / 2));
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 52%, var(--balo-cream) 100%);
    border-bottom: 1px solid var(--balo-line);
}

.property-detail-media {
    min-height: 520px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(6, 53, 111, 0.08), rgba(5, 135, 71, 0.16)),
        var(--property-image-url);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
}

.property-summary {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: 32px;
}

.property-card {
    --property-image-url: var(--property-home);
    overflow: hidden;
    padding: 0;
}

.property-image {
    height: 210px;
    background:
        linear-gradient(135deg, rgba(6, 53, 111, 0.08), rgba(5, 135, 71, 0.16)),
        var(--property-image-url);
    background-size: cover;
    background-position: center;
}

.property-card:nth-child(2) {
    --property-image-url: var(--property-apartment);
}

.property-card:nth-child(3) {
    --property-image-url: var(--property-investment);
}

.property-body {
    display: grid;
    gap: 10px;
    padding: 20px;
}

.property-link {
    color: var(--balo-blue-2);
    font-weight: 800;
}

.price {
    color: var(--balo-blue);
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    border-radius: 999px;
    padding: 6px 9px;
    background: #edf7f2;
    color: var(--balo-green);
    font-size: 0.75rem;
    font-weight: 700;
}

/* 13. Footer */
.site-footer {
    margin-top: 56px;
    padding: 34px 0 42px;
    background: #071a38;
    color: #dbeafe;
}

.site-footer .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.site-footer .badge {
    background: rgba(255, 255, 255, 0.10);
    color: var(--balo-white);
}

/* 14. Responsive Rules */
@media (max-width: 980px) {
    .hero {
        min-height: auto;
        padding-block: 56px;
    }

    .hero-media {
        width: 100%;
        opacity: 0.18;
    }

    .hero-grid,
    .card-grid,
    .module-grid,
    .property-grid,
    .property-detail-hero,
    .property-detail-grid,
    .form-grid,
    .search-fields {
        grid-template-columns: 1fr;
    }

    .property-detail-media {
        min-height: 360px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        width: 100%;
        padding-bottom: 16px;
    }

    .site-nav.is-open {
        display: flex;
    }

    .header-row {
        flex-wrap: wrap;
        padding: 14px 0;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 24px, 1240px);
    }

    .hero {
        margin-inline: -12px;
        padding-inline: 12px;
    }

    .search-card,
    .card-grid article,
    .module-grid article,
    .property-summary {
        padding: 20px;
    }

    .property-detail-hero {
        margin-inline: -12px;
        padding-inline: 12px;
    }
}
