/* ============================================
   COMMUNITY PAGE STYLES
   ============================================ */

/* Title Section */
.community-title-section {
    margin-top: 140px;
    padding: 40px 0 30px;
    text-align: center;
}

.community-title-section h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    /* Reduced from 48px */
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--dark-color);
    margin: 0;
    font-weight: normal;
    /* Unbold */
}

/* Full Width Image Section */
.community-image-section {
    max-width: 1348px;
    margin: 0 auto;
    padding: 0 50px;
}

.community-image-section.full-width {
    max-width: 100%;
    padding: 0 60px;
}

.community-full-img {
    width: 100%;
    height: 600px;
    /* Fixed height to enable object-position to work */
    object-fit: cover;
    object-position: top center;
    /* Show the top portion */
    display: block;
}

.community-content-img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    object-position: bottom center;
    border-radius: 4px;
    display: block;
}

/* Special positioning for lounge hero image */
.hero-lounge {
    object-position: bottom center;
}

.img-bottom-view {
    object-position: bottom center !important;
}

/* Make image fit fully within container */
.img-contain {
    object-fit: contain !important;
    height: auto !important;
    max-height: 600px;
    width: auto !important;
    max-width: 100%;
    margin: 0 auto;
}

/* Welcome Section */
.community-welcome h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    /* Reduced from 36px */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: normal;
    /* Unbold */
}

.welcome-subtitle {
    font-size: 14px;
    /* Reduced from 18px */
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 30px !important;
}

.community-welcome p {
    font-size: 13px;
    /* Reduced from 16px */
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* What to Love Grid */
.love-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.love-item {
    padding: 25px;
    background: var(--white);
    border-left: 3px solid var(--primary-color);
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.love-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.love-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    /* Prevent shrinking */
    stroke: var(--primary-color);
    color: var(--primary-color);
    /* Ensure currentColor works */
}

/* Schools Grid */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.school-card {
    background: var(--white);
    padding: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.school-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.school-rating {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.school-info h3 {
    font-size: 14px;
    margin: 0 0 5px 0;
    color: var(--dark-color);
}

.school-info p {
    font-size: 11px !important;
    margin: 0;
    opacity: 0.7;
}

/* Community Stats */
.community-stats {
    text-align: center;
}

.stats-intro {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stats-subnav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    font-family: var(--font-heading);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark-color);
}

.stats-subnav span {
    cursor: pointer;
    padding-bottom: 5px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    border-bottom: 2px solid transparent;
}

.stats-subnav span.active,
.stats-subnav span:hover {
    opacity: 1;
    border-bottom-color: var(--primary-color);
}

.stats-grid-community {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.stat-box {
    flex: 1;
    min-width: 240px;
    max-width: 280px;
    padding: 30px 20px;
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-number-large {
    font-family: var(--font-heading);
    font-size: 36px;
    color: var(--primary-color);
    margin-top: 10px;
    font-weight: 700;
}

.stat-label-large {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

.stat-sublabel {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 5px;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    text-align: left;
}

.chart-box {
    background: var(--white);
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.chart-box h3 {
    font-size: 14px;
    margin-bottom: 30px;
    color: var(--dark-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
}

/* Age Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bar-item {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.bar-label {
    width: 60px;
    flex-shrink: 0;
    font-weight: 500;
}

.bar-track {
    flex-grow: 1;
    height: 4px;
    background: #f5f5f5;
    border-radius: 2px;
    margin: 0 15px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 1s ease-out;
}

.bar-value {
    width: 35px;
    text-align: right;
    font-weight: 600;
    color: var(--dark-color);
}

/* Education List */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edu-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edu-label {
    font-size: 13px;
    font-weight: 500;
}

.edu-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.edu-bar {
    height: 8px;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 1s ease-out;
}

.edu-value {
    font-size: 13px;
    font-weight: 600;
    min-width: 35px;
}

/* Tab Functionality */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pie Chart Styles */
.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: center;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

/* Walk Score Grid */
.walk-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.walk-score-item {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Progress Ring */
.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
}

.progress-ring__circle {
    transition: stroke-dashoffset 1s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.walk-score-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.walk-score-sublabel {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

/* CTA Section */
.community-cta {
    text-align: center;
    padding: 80px 0;
}

.community-cta h2 {
    font-family: var(--font-heading);
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.community-cta p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Global Section Styles for Community Page - Scoped to avoid parallax sections */
.section:not(.work-with-luci-parallax) {
    padding: 50px 0;
}

.section:not(.work-with-luci-parallax)+.section:not(.work-with-luci-parallax) {
    padding-top: 0;
}

.section:not(.work-with-luci-parallax) h2 {
    font-size: 24px !important;
    font-weight: normal !important;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.section:not(.work-with-luci-parallax) p {
    font-size: 13px !important;
    line-height: 1.8;
    margin-bottom: 15px;
}

.section:not(.work-with-luci-parallax) p:last-child {
    margin-bottom: 0;
}

/* Specific Element Reductions */
.love-item {
    font-size: 12px;
    padding: 20px;
}

.schools-list li {
    font-size: 12px;
}

.stats-intro {
    font-size: 12px;
}

.community-cta p {
    font-size: 12px;
}

.community-cta h2 {
    font-size: 24px;
    font-weight: normal;
}

/* Community Map */
.community-map-section {
    padding: 0;
    line-height: 0;
}

.map-container {
    width: 100%;
    height: 700px;
    background: #eee;
    overflow: hidden;
    position: relative;
}

.map-container iframe {
    width: 100%;
    height: 850px;
    /* Taller than container to allow cropping */
    border: 0;
    margin-top: -150px;
    /* Crop the top UI */
}

/* Points of Interest Section */
.poi-section {
    background: #fcfcfc;
    padding: 100px 0;
}

.poi-header {
    margin-bottom: 40px;
}

.poi-header h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.poi-header p {
    font-size: 14px;
    color: #666;
    max-width: 600px;
}

.poi-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.poi-filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: var(--white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.poi-filter-btn:hover,
.poi-filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.poi-table-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    border: 1px solid #eee;
}

.poi-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.poi-table th {
    background: #f8f8f8;
    padding: 15px 25px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.poi-table td {
    padding: 20px 25px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.poi-row {
    transition: background 0.3s ease;
}

.poi-row:hover {
    background: #fafafa;
}

.poi-name-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.poi-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
}

.poi-info h4 {
    font-size: 15px;
    margin: 0 0 5px 0;
    color: var(--dark-color);
}

.poi-links {
    display: flex;
    gap: 15px;
    font-size: 11px;
}

.poi-links a {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.8;
}

.poi-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.poi-cat-tag {
    font-size: 12px;
    color: #888;
}

.poi-dist {
    font-size: 13px;
    color: #666;
}

.poi-rating-cell {
    min-width: 120px;
}

.yelp-stars {
    color: #ff3b30;
    /* Yelp Red */
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.yelp-reviews {
    font-size: 11px;
    color: #999;
}

.yelp-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #999;
    margin-top: 10px;
    justify-content: flex-end;
    padding-right: 25px;
}

.yelp-logo-sm {
    height: 12px;
}

/* Hide rows based on filter or limit */
.poi-row.hidden,
.poi-row.hidden-limit {
    display: none;
}

.poi-load-more-container {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}

.btn-load-more {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Responsive */
@media (max-width: 992px) {
    .community-hero-content h1 {
        font-size: 36px;
    }

    .stats-grid-community {
        gap: 20px;
    }

    .walk-score-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

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

@media (max-width: 768px) {
    .community-hero {
        height: 50vh;
        min-height: 400px;
    }

    .community-hero-content h1 {
        font-size: 28px;
    }

    .community-hero-subtitle {
        font-size: 12px;
    }

    .stats-grid-community {
        flex-direction: column;
        gap: 15px;
    }

    .stat-box {
        max-width: 100%;
        min-width: 0;
    }

    .community-image-section {
        padding: 0 20px;
    }

    .community-image-section.full-width {
        padding: 0 20px;
    }

    /* Stack grids on mobile */
    .charts-grid,
    .walk-score-grid,
    .schools-grid,
    .love-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Allow table to scroll horizontally */
    .poi-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .poi-table {
        min-width: 600px;
        /* Ensure table maintains width and scrolls */
    }

    /* Adjust pie chart container */
    .pie-chart-container {
        flex-direction: column;
        gap: 20px;
    }
}