/* ==========================================================================
   TERRITORIO VUE APP GRID LAYOUT
   ========================================================================== */

#territorio-vue-app {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Loader state --- */
.vue-loader {
    text-align: center;
    padding: 60px 0;
    font-size: 1.1rem;
    color: #666;
}

/* --- Top Counters Bar --- */
.territorio-counters-row {
    margin-bottom: 40px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
}

.counter-item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.counter-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #cc5a43; /* Terracotta accents */
    line-height: 1;
}

.counter-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666666;
    font-weight: 600;
}

/* --- Subcategory Block & Heading --- */
.territorio-subcat-block {
    margin-bottom: 60px;
}

.territorio-subcat-title {
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    font-size: var(--e-global-typography-primary-font-size);
    font-weight: var(--e-global-typography-primary-font-weight);
    letter-spacing: 0.5px;
    color: #1E1E1E;
    margin-bottom: 24px;
    line-height: 1.2;
}

/* ==========================================================================
   THE 4-COLUMN RESPONSIVE GRID
   ========================================================================== */
.aggregation-grid {
    display: grid;
    /* Clean 4-column layout tracks */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0 !important; /* Resets default bootstrap row margin rules */
    padding: 0;
}

/* --- Grid Items / Cards (poi-card-v2) --- */
.poi-card-v2 {
    width: 100%;
    box-sizing: border-box;
}

/* Card Hover effect */
.poi-card-link-wrapper {
    display: block;
    text-decoration: none !important;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.poi-card-link-wrapper:hover {
    transform: translateY(-5px);
}

/* Main Card Container */
.poi-card-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3; /* Matches the taller, elegant portrait ratio in your screenshot */
    border: 1px solid #eaeaea; /* Very subtle light outer border */
    background-color: #f7f7f7;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}

/* Background Cover Image */
.poi-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.poi-image-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.poi-card-link-wrapper:hover .poi-image-bg img {
    transform: scale(1.05); /* Soft, premium zoom on hover */
}

/* Placeholder Icon Box (if no image is uploaded) */
.poi-placeholder-icon-wrapper {
    width: 100%;
    height: 100%;
    background-color: #f5f3ef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poi-svg-icon {
    width: 48px;
    height: 48px;
    color: #bca05c;
}

/* Readability Gradient Overlay */
.poi-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Soft top-to-bottom darkness curve to keep text readable */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.4) 70%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

/* Card Content Area */
.poi-card-content-v2 {
    position: relative;
    z-index: 3;
    padding: 24px; /* Spacious, elegant padding */
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left-aligns badge and text */
    gap: 8px;
}

/* Post Title */
.poi-title-v2 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.85rem; /* Clean and bold */
    font-weight: 700;
    color: #ffffff !important;
    margin: 0 0 4px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Metadata Text Block */
.poi-location-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 12px;
}

.poi-address-v2,
.poi-place-v2 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff !important;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Custom Ochre Pill Badge (Ristorante) */
.poi-badge-v2 {
    display: inline-block;
    background-color: #9a8353; /* Ochre/Gold tint from the screenshot */
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize; /* "Ristorante" instead of all-caps */
    padding: 6px 20px;
    border-radius: 20px; /* Perfectly round pill layout */
    border: none;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}


/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */

/* Laptops and Small Desktops (Up to 1200px) */
@media (max-width: 1200px) {
    .aggregation-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 Columns */
        gap: 20px;
    }
}

/* Tablets (Up to 991px) */
@media (max-width: 991px) {
    .aggregation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 Columns */
        gap: 20px;
    }

    .territorio-subcat-title {
        font-size: 1.5rem;
    }
}

/* Mobile Devices (Up to 600px) */
@media (max-width: 600px) {
    .aggregation-grid {
        grid-template-columns: 1fr; /* 1 Column */
        gap: 16px;
    }

    .poi-card-container {
        aspect-ratio: 16 / 11; /* Wider aspect ratio looks much cleaner on single column mobile */
    }

    .territorio-subcat-title {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
}