/* ==========================================================================
   Neighborhood Pages Styles
   Based on Style Guide specifications
   ========================================================================== */

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.neighborhood-content {
    padding: clamp(40px, 5vw, 64px) 0;
    background: var(--warm-white);
}

/* Single-column editorial layout. Sidebar je uklonjen — sav content
   teče u .container > .section-card stack-u. Compare widget + Korisni
   saveti + Spotlight koji su bili u sidebar-u sad su inline sekcije. */
.neighborhood-content > .container {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3vw, 36px);
}

/* Old .content-layout / .content-main / .content-sidebar klase obrisane
   — template više ne koristi. */

/* --------------------------------------------------------------------------
   Section Cards
   -------------------------------------------------------------------------- */
.section-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

/* .section-title now from components/section.css. Page-context override
   below adds the badge child styling that lives only here. */

.section-title .badge {
    background: var(--secondary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

/* --------------------------------------------------------------------------
   SEO Content Styling
   -------------------------------------------------------------------------- */
.seo-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.seo-content p {
    margin-bottom: 1.25rem;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

.seo-content strong {
    color: var(--primary);
    font-weight: 600;
}

.seo-content ul,
.seo-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.seo-content li {
    margin-bottom: 8px;
}

.seo-content h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 24px 0 16px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Neighborhood Photo Gallery
   -------------------------------------------------------------------------- */
.neighborhood-gallery-section {
    padding-bottom: 24px;
}

/*
 * Grid: 3 columns (2fr + 1fr + 1fr), 2 rows of 200px
 * First item (featured) spans both rows in column 1.
 * Items 2-5 fill the 2x2 grid on the right.
 */
.ngallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 6px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ngallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--bg-light);
    text-decoration: none;
}

/* Featured: first image spans both rows */
.ngallery-item:first-child {
    grid-row: 1 / 3;
    grid-column: 1;
}

.ngallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ngallery-item:hover img {
    transform: scale(1.06);
}

.ngallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    color: white;
    font-size: 1.4rem;
    opacity: 0;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.ngallery-item:hover .ngallery-overlay {
    background: rgba(0, 0, 0, 0.35);
    opacity: 1;
}

/* Last visible item with "+N više" — always show the overlay */
.ngallery-item:has(.ngallery-more) .ngallery-overlay {
    background: rgba(0, 0, 0, 0.48);
    opacity: 1;
}

.ngallery-item:has(.ngallery-more):hover .ngallery-overlay {
    background: rgba(0, 0, 0, 0.62);
}

.ngallery-more {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    letter-spacing: -0.5px;
}

/* Hidden links registered in GLightbox group but not rendered as thumbnails */
.ngallery-hidden {
    display: none;
}

.ngallery-hint {
    margin-top: 12px;
    font-size: 0.83rem;
    color: var(--text-light);
    text-align: center;
}

.ngallery-hint i {
    margin-right: 5px;
    color: var(--secondary);
}

/* Tablet: collapse to 2-column layout */
@media (max-width: 768px) {
    .ngallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 180px 130px 130px;
    }

    /* Featured spans full width on first row */
    .ngallery-item:first-child {
        grid-column: 1 / 3;
        grid-row: 1;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .ngallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 160px 110px 110px;
    }
}

/* --------------------------------------------------------------------------
   Ads Grid Section
   -------------------------------------------------------------------------- */
.ads-section {
    margin-top: 8px;
}

/* .ads-grid now from components/ads-grid.css */

.ad-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary);
}

.ad-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.ad-placeholder {
    width: 100%;
    height: 180px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border-color);
}

.ad-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.ad-area,
.ad-rooms {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ad-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.ad-card .btn {
    padding: 6px 16px;
    font-size: 0.85rem;
}

/* .empty-state → canonical u components/empty-state.css (deli se kroz
   articles, faq, neighborhoods, search no-results). */

/* --------------------------------------------------------------------------
   FAQ Section
   -------------------------------------------------------------------------- */
.faq-section {
    margin-top: 8px;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 18px 20px;
    background: white;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--primary);
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-answer {
    border-top: 1px solid var(--border-color);
}

.faq-answer-content {
    padding: 18px 20px;
    color: var(--text-light);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Sidebar Components
   -------------------------------------------------------------------------- */
/* .sidebar-card now from components/sidebar-card.css */

.sidebar-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
}

/* Stats Card */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Articles Card */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.article-item a {
    text-decoration: none;
    color: inherit;
}

.article-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    transition: color 0.2s;
}

.article-item a:hover h4 {
    color: var(--primary);
}

.article-excerpt {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* CTA Card — legacy navy gradient panel, page-scope-ovano da ne kolidira sa
   canonical components/cta.css. Briše se kada neighborhoods dođe na editorial
   migration sprint i template pređe na canonical .cta-section. */
.neighborhoods-page .cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, #2a4d7a 100%);
    color: white;
}

.neighborhoods-page .cta-card .sidebar-title {
    color: white;
    border-bottom-color: var(--secondary);
}

.neighborhoods-page .cta-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 20px;
}

.neighborhoods-page .cta-card .btn {
    width: 100%;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Footer CTA Section
   -------------------------------------------------------------------------- */
.cta-footer-section {
    background: var(--primary);
    padding: 48px 0;
    color: white;
    text-align: center;
}

.cta-footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-footer-content .seo-content {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 32px;
}

.cta-footer-content .seo-content strong {
    color: white;
}

.cta-footer-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 24px;
}

.mt-3 {
    margin-top: 16px;
}

.w-100 {
    width: 100%;
}

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

.btn-outline-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

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

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

/* --------------------------------------------------------------------------
   Responsive - Tablet (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-card {
        padding: 24px;
    }
}

/* --------------------------------------------------------------------------
   Responsive - Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .neighborhood-content {
        padding: 24px 0;
    }

    .section-card {
        padding: 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .ads-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ad-image,
    .ad-placeholder {
        height: 200px;
    }

    .sidebar-card {
        padding: 20px;
    }

    .cta-footer-section {
        padding: 32px 0;
    }

    .cta-footer-actions {
        flex-direction: column;
    }

    .cta-footer-actions .btn {
        width: 100%;
    }

    .empty-state {
        padding: 32px 16px;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    .faq-question {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .faq-answer-content {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive - Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ad-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .ad-footer .btn {
        width: 100%;
    }

    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .breadcrumb-section,
    .content-sidebar,
    .cta-footer-section {
        display: none;
    }

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

    .section-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   NEIGHBORHOODS INDEX PAGE STYLES
   ========================================================================== */

/* --------------------------------------------------------------------------
   Intro Section
   -------------------------------------------------------------------------- */
.neighborhoods-intro-section {
    background: var(--bg-light);
    padding: 48px 0;
}

/* intro prose fills container — editorial override below */

/* --------------------------------------------------------------------------
   Neighborhoods Grid Section
   -------------------------------------------------------------------------- */
.neighborhoods-grid-section {
    background: white;
    padding: 56px 0;
}

.section-title-center {
    text-align: center;
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-title-center i {
    color: var(--secondary);
}

/* Neighborhoods list cards → canonical .place-card iz components/place-card.css.
   Sve klase (.neighborhoods-index-grid, .neighborhood-card-index, .neighborhood-image-*,
   .neighborhood-card-content/title/meta/action, .ads-count, .btn-link) su uklonjene
   jer ih template više ne koristi. Ne duplikujemo CSS ovde. */

/* --------------------------------------------------------------------------
   Description Section
   -------------------------------------------------------------------------- */
.neighborhoods-description-section {
    background: var(--bg-light);
    padding: 48px 0;
}

.neighborhoods-description-section .seo-content {
    max-width: 900px;
    margin: 0 auto;
}

.neighborhoods-description-section h2 {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.neighborhoods-description-section ul {
    max-width: 800px;
    margin: 24px auto;
}

.neighborhoods-description-section li {
    margin-bottom: 16px;
    padding-left: 8px;
}

/* CTA section koristi canonical .cta-section komponentu iz components/cta.css */

/* --------------------------------------------------------------------------
   Responsive - Tablet (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .neighborhoods-index-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .section-title-center {
        font-size: 1.7rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive - Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .neighborhoods-intro-section,
    .neighborhoods-grid-section,
    .neighborhoods-description-section {
        padding: 32px 0;
    }

    .section-title-center {
        font-size: 1.5rem;
        margin-bottom: 32px;
    }

    .neighborhoods-index-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .neighborhood-image-wrapper {
        height: 200px;
    }

}

/* --------------------------------------------------------------------------
   Responsive - Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .section-title-center {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 8px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .neighborhood-card-title {
        font-size: 1.1rem;
    }

    .neighborhoods-description-section h2 {
        font-size: 1.5rem;
    }

}

/* ==========================================================================
   EDITORIAL OVERRIDES (Sprint 2 Phase 9) — last in cascade, takes priority
   ========================================================================== */

/* ----- Neighborhood show: compare inline section (no sidebar) ---------- */
.neighborhood-compare-section .neighborhood-compare-hint {
    margin: 0 0 18px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--taupe);
    max-width: 56ch;
}

.neighborhood-compare-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    max-width: 560px;
}

.neighborhood-compare-form select {
    flex: 1;
    min-width: 200px;
}

/* ----- Index sections -------------------------------------------------- */
.neighborhoods-intro-section,
.neighborhoods-grid-section,
.neighborhoods-description-section {
    padding: clamp(48px, 6vw, 80px) 0;
}

.neighborhoods-intro-section { background: var(--warm-white); border-bottom: 1px solid var(--hairline); }
.neighborhoods-grid-section  { background: var(--cream); border-bottom: 1px solid var(--hairline); }
.neighborhoods-description-section { background: var(--warm-white); border-bottom: 1px solid var(--hairline); }

.neighborhoods-intro-section .seo-content,
.neighborhoods-description-section .seo-content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
}

.section-title-center {
    margin: 0 0 32px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    line-height: 1.1;
    color: var(--ink);
    text-align: left;
}

.section-title-center i {
    color: var(--terracotta);
    margin-right: 12px;
    font-size: 0.7em;
}

/* Index neighborhood cards → canonical .place-card iz components/place-card.css. */

/* ==========================================================================
   Compare form — slim editorial za /naselja/poredi (oba state-a:
   "promenite poređenje" i "odaberi naselja"). Tabela sama je canonical
   .comparison-table iz components/comparison-table.css.
   ========================================================================== */
.compare-form {
    background: var(--warm-white);
    border: 1px solid var(--hairline);
    padding: clamp(18px, 2.4vw, 24px);
    margin: 0 0 clamp(28px, 4vw, 40px);
}

.compare-form__label {
    margin: 0 0 14px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--taupe);
}

.compare-form__row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.compare-form__row .form-control {
    flex: 1 1 220px;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--cream);
    font-size: 0.95rem;
}

.compare-form__vs {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--taupe);
    padding: 0 4px;
}

.compare-form__row .btn {
    padding: 10px 24px;
    font-size: 0.78rem;
}

/* Intro paragraph blok ispod comparison-table */
.compare-intro {
    max-width: 72ch;
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--ink);
}

.compare-intro p {
    margin: 0 0 1rem;
}

.compare-intro p:last-child {
    margin-bottom: 0;
}

.compare-intro strong {
    font-weight: 600;
    color: var(--ink);
}

@media (max-width: 640px) {
    .compare-form__row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .compare-form__vs {
        text-align: center;
        padding: 4px 0;
    }

    .compare-form__row .form-control,
    .compare-form__row .btn {
        width: 100%;
    }
}


/* ----- Show page (neighborhood detail) --------------------------------- */
.neighborhood-content {
    background: var(--warm-white);
}

.neighborhood-content .section-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: clamp(40px, 5vw, 64px) 0;
    border-bottom: 1px solid var(--hairline);
}

.neighborhood-content .section-title {
    margin: 0 0 24px;
    padding: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
    line-height: 1.15;
    color: var(--ink);
    background: transparent;
    border: none;
    text-align: left;
}

.neighborhood-content .section-title .badge {
    background: var(--terracotta);
    color: var(--warm-white);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 2px;
    margin-left: 12px;
    vertical-align: middle;
}

.neighborhood-content .stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--hairline);
}

.neighborhood-content .stats-list .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
}

.neighborhood-content .stats-list .stat-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--taupe);
}

.neighborhood-content .stats-list .stat-value {
    font-family: var(--font-display);
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    color: var(--ink);
}

.neighborhood-content .ad-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.neighborhood-content .ad-card:hover {
    transform: translateY(-3px);
    box-shadow: none;
}

/* ----- Mobile fine-tuning --------------------------------------------- */
@media (max-width: 720px) {
    .neighborhoods-index-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .neighborhoods-stats-section .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .neighborhoods-stats-section .stat-box + .stat-box:nth-child(odd) {
        border-left: 1px solid var(--hairline);
    }
    .neighborhoods-stats-section .stat-box:nth-child(2n+1) {
        border-left: none;
    }
    .neighborhood-content .stats-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .neighborhoods-index-grid {
        grid-template-columns: 1fr;
    }
}
