/* =========================================================
   Suburb Profile Detail Page – Comprehensive Layout
   ========================================================= */

.sp-page {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 24px 56px;
    width: 100%;
}

.page-suburb-detail .sp-page {
    padding-top: var(--content-pad-after-hero);
}

.sp-page-title {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Two-column layout ── */
.sp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.sp-col-left,
.sp-col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.sp-col-left > :last-child,
.sp-col-right > :last-child {
    flex: 1;
}

/* ── Hero Image ── */
.sp-hero-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 260px;
    background: #d5dce3;
}

.sp-hero-images {
    display: flex;
    gap: 8px;
    height: 100%;
}

.sp-hero-img-wrap {
    flex: 1;
    min-width: 0;
}

.sp-hero-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-hero-image.sp-hero-no-images {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-hero-no-images-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c7a89;
    padding: 24px;
}

.sp-hero-no-images-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.sp-hero-no-images-hint {
    font-size: 0.9rem;
    opacity: 0.85;
}

.sp-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px 24px;
}

.sp-hero-overlay span {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Module Panels ── */
.sp-module {
    background: #fff;
    border: 1px solid #e4e8ec;
    border-radius: 12px;
    padding: 22px 24px;
}

.sp-module h2 {
    text-transform: none;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--estate-hair);
}

.sp-module h2 strong {
    font-weight: inherit;
    color: inherit;
}

.sp-module-tag {
    font-weight: 400;
    color: #999;
    font-style: italic;
}

.sp-module-dark {
    background: #2e3a46;
    border-color: #2e3a46;
    color: #ddd;
}

.sp-module-dark h2 {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.sp-module-dark h2 strong {
    color: inherit;
}

/* ── Module 1: Vibe ── */
.sp-vibe-content p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.7;
}

/* ── Module 2: Key Insights ── */
.sp-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.sp-insight-chart {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
}

.sp-insight-chart h4 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.sp-insight-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.sp-insight-chart canvas {
    width: 100%;
    height: 80px;
}

/* Data table */
.sp-data-table-wrap {
    margin-top: 8px;
    overflow-x: auto;
}

.sp-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.sp-data-table th,
.sp-data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sp-data-table th {
    font-weight: 700;
    color: #555;
    background: #f8f9fa;
}

.sp-data-table td:first-child {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* ── Module 3: Demographics ── */
.sp-demo-rings {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sp-demo-ring-item {
    text-align: center;
}

.sp-donut-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 8px;
}

.sp-donut-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.sp-demo-ring-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ccc;
}

.sp-demo-age-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #4a6274;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 8px;
}

.sp-demo-age-circle span {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

.sp-demo-list {
    padding-left: 18px;
    font-size: 0.85rem;
    color: #bbb;
    line-height: 1.7;
}

/* Housing types */
.sp-housing-dist {
    margin-top: 16px;
}

.sp-housing-dist h4 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 12px;
}

.sp-housing-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-housing-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-housing-bar-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ccc;
    min-width: 100px;
}

.sp-housing-bar-track {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.sp-housing-bar-fill {
    height: 100%;
    background: #209EBB;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.sp-housing-bar-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ddd;
    min-width: 40px;
    text-align: right;
}

/* Amenities */
.sp-amenity-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.sp-amenity-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
}

.sp-module:not(.sp-module-dark) .sp-amenity-card {
    background: #f5f8fa;
    border-color: #e0e5ea;
}

.sp-amenity-card strong {
    font-size: 0.82rem;
    color: inherit;
}

.sp-amenity-card small {
    color: #999;
}

/* ── Module 4: News & Community (full width) ── */
.sp-module-news-full {
    margin-bottom: 32px;
}

.sp-news-community {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.sp-news-col h4 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
}

.sp-news-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
}

.sp-news-thumb {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.sp-news-item strong {
    font-size: 0.82rem;
    color: #333;
}

.sp-news-item small {
    color: #999;
}

/* Community stats */
.sp-community-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.sp-cs-item {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.sp-cs-item span {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 4px;
}

.sp-cs-item strong {
    display: block;
    font-size: 0.78rem;
    color: #555;
    margin-bottom: 4px;
}

.sp-cs-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
}

.sp-cs-big {
    font-size: 1.6rem;
    font-weight: 700;
    color: #209EBB;
}

.sp-community-events {
    font-size: 0.82rem;
    color: #555;
}

.sp-community-events strong {
    display: block;
    margin-bottom: 6px;
    color: #333;
}

.sp-community-events ul {
    padding-left: 16px;
    margin: 0;
}

.sp-community-events li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.sp-community-events small {
    color: #999;
}

.sp-placeholder-text {
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
}

/* ── Module 5: Comparison ── */
.sp-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.sp-comp-table th,
.sp-comp-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sp-comp-table th {
    font-weight: 700;
    color: #888;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f8f9fa;
}

.sp-comp-table td strong {
    color: #333;
}

/* ── Inline table gate (blurred rows + signup) ── */
.sp-table-gate {
    position: relative;
    margin-top: -60px;
    z-index: 5;
}

.sp-table-gate-fade {
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 60%, #fff 100%);
    pointer-events: none;
}

.sp-table-gate .content-gate-body {
    background: #fff;
    text-align: center;
    padding: 8px 24px 28px;
}

/* ── Enquiry Section ── */
.sp-enquiry-section {
    background: #f8f9fb;
    border: 1px solid #e4e8ec;
    border-radius: 12px;
    padding: 40px 0;
    margin-top: 8px;
}

.sp-enquiry-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
}

.sp-enquiry-header {
    text-align: center;
    margin-bottom: 28px;
}

.sp-enquiry-header h2 {
    margin: 0 0 8px;
}

.sp-enquiry-header p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.sp-enquiry-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sp-enquiry-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sp-enquiry-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.sp-enquiry-field label .req {
    color: #e74c3c;
}

.sp-enquiry-field label .optional {
    font-weight: 400;
    color: #999;
}

.sp-enquiry-field input,
.sp-enquiry-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.88rem;
    font-family: inherit;
    border: 1px solid #d0d5db;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sp-enquiry-field input::placeholder,
.sp-enquiry-field textarea::placeholder {
    color: #b0b6bf;
}

.sp-enquiry-field input:focus,
.sp-enquiry-field textarea:focus {
    outline: none;
    border-color: #209EBB;
    box-shadow: 0 0 0 3px rgba(32, 158, 187, 0.1);
}

.sp-enquiry-field textarea {
    resize: vertical;
    min-height: 80px;
}

.sp-enquiry-btn {
    align-self: center;
    padding: 13px 48px;
    background: #2e3a46;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.sp-enquiry-btn:hover {
    background: #1d2830;
    transform: translateY(-1px);
}

.sp-enquiry-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .sp-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sp-page { padding: 16px 16px 40px; }
    .page-suburb-detail .sp-page {
        padding-top: var(--content-pad-after-hero);
    }
    .sp-hero-image { height: 200px; }
    .sp-insights-grid { grid-template-columns: 1fr; }
    .sp-news-community { grid-template-columns: 1fr; }
    .sp-demo-rings { gap: 16px; }
    .sp-community-stats { flex-direction: column; }
    .sp-amenity-card { flex: 1 1 100%; }
    .sp-enquiry-fields { grid-template-columns: 1fr; }
    .sp-enquiry-section { padding: 28px 0; }
    .sp-enquiry-inner { padding: 0 20px; }
}

@media (max-width: 600px) {
    .sp-hero-image { height: 160px; }
    .sp-module { padding: 16px 18px; }
    .sp-enquiry-field input,
    .sp-enquiry-field textarea { font-size: 16px; }
    .sp-enquiry-btn { width: 100%; min-height: 48px; }
}
