/**
 * Location, Category (property type), and Collection page templates.
 * Pulled from the Figma "02 - Public Website" file: Location (34:1851,
 * "Ikoyi" example), Category (34:2087, "Penthouses" example), Collection
 * (34:2404, "Waterfront" example). One reusable PHP template per type
 * (location.php / category.php / collection.php), not hand-coded per
 * instance - this stylesheet is shared across all three since they share
 * the same hero/section/card visual language, with page-specific rules
 * grouped under their own headers below.
 *
 * "Category" = property type, not the separate `categories` table - see
 * public/category.php's own file comment for why.
 *
 * Corrected stale/inconsistent Figma example content, per explicit
 * instruction (same pattern as every earlier correction in this build):
 * - Location's "Ikoyi at a Glance" stats card had its labels and values
 *   mismatched (an "Area" row showing a price, a "Properties Available"
 *   row showing "Ikoyi, Lagos") - rebuilt with real, computed values.
 * - "Nearby Areas" listed "Banana Island", not one of the 6 confirmed
 *   locations - replaced with the other 5 real locations.
 * - Collection's "Other Collections" showed fabricated counts
 *   ("14/28/9 Properties Available") - replaced with real, live counts.
 * - Property card badges across all three frames (Off-Market, Waterfront,
 *   Oceanfront, New Release, etc.) aren't real property attributes in
 *   this schema - the reused property-card component's own existing tag
 *   logic (Featured / New Listing) is used instead of inventing new ones.
 */

/* ---------------------------------------------------------------------
 * Shared: large hero (720px, all three templates)
 * --------------------------------------------------------------------- */

.tpl-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 20px;
    width: 100%;
    height: 720px;
    padding: 0 80px 80px;
    box-sizing: border-box;
    overflow: hidden;
}

.tpl-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.tpl-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(153.43deg, rgba(6, 34, 23, 0) 25%, rgba(6, 34, 23, 0.8) 52.5%, rgba(6, 34, 23, 0.949) 75%);
}

.tpl-hero__kicker {
    position: relative;
    z-index: 2;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--color-champagne-gold);
    text-transform: uppercase;
    margin: 0;
}

.tpl-hero__title {
    position: relative;
    z-index: 2;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 56px;
    line-height: 1.15;
    color: var(--color-white);
    max-width: 800px;
    margin: 0;
}

.tpl-hero__subtitle {
    position: relative;
    z-index: 2;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-white);
    opacity: 0.9;
    max-width: 720px;
    margin: 0;
}

/* ---------------------------------------------------------------------
 * Shared: overview/intro section (kicker + heading + body copy)
 * --------------------------------------------------------------------- */

.tpl-intro {
    display: flex;
    align-items: center;
    gap: 96px;
    width: 100%;
    padding: 120px 80px;
    box-sizing: border-box;
}

.tpl-intro--compact {
    padding: 120px 80px 80px;
}

.tpl-intro__text {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tpl-intro__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpl-intro__kicker {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--color-champagne-gold);
    text-transform: uppercase;
    margin: 0;
}

.tpl-intro__heading {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 42px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-intro__text p.tpl-intro__body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.9;
    color: var(--color-charcoal);
    margin: 0;
}

/* ---------------------------------------------------------------------
 * Location-only: "X at a Glance" stats card
 * --------------------------------------------------------------------- */

.tpl-stats-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 440px;
    flex-shrink: 0;
    padding: 40px;
    background-color: var(--color-white);
    border: 1px solid var(--color-stone);
    border-radius: 16px;
    box-shadow: 0px 12px 16px 0px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.tpl-stats-card__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 24px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-stats-card__divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-stone);
    border: none;
    margin: 0;
}

.tpl-stats-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.tpl-stats-card__label {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: #717171;
}

.tpl-stats-card__value {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    color: var(--color-primary-green);
    text-align: right;
}

/* ---------------------------------------------------------------------
 * Shared: listings section (reuses .property-card--grid + .listing-*
 * from properties.css)
 * --------------------------------------------------------------------- */

.tpl-listings-section {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    padding: 80px 80px 120px;
    box-sizing: border-box;
}

.tpl-listings-section--tight {
    padding: 40px 80px 120px;
}

.tpl-listings-section__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpl-listings-section__kicker {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--color-champagne-gold);
    text-transform: uppercase;
    margin: 0;
}

.tpl-listings-section__heading {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 42px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-listings-section__desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #717171;
    margin: 0;
}

.tpl-view-all-wrap {
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

.tpl-view-all-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border: 1.5px solid var(--color-primary-green);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-primary-green);
    text-decoration: none;
}

/* ---------------------------------------------------------------------
 * Category-only: filter bar (real, functional - not the confirmed
 * frame's static "Location: All / Price Range: Any" example text)
 * --------------------------------------------------------------------- */

.tpl-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px;
    background-color: var(--color-white);
    border: 1px solid var(--color-stone);
    border-radius: 8px;
    box-sizing: border-box;
}

.tpl-filter-bar__label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-primary-green);
    white-space: nowrap;
}

.tpl-filter-bar__divider {
    width: 1px;
    height: 24px;
    background-color: var(--color-border-light);
    flex-shrink: 0;
}

.tpl-filter-select {
    height: 36px;
    padding: 0 28px 0 10px;
    background-color: var(--color-white);
    background-image: url('/assets/images/icons/icon-form-chevron-down.svg');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    border: none;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: var(--color-charcoal);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.tpl-filter-bar__sort {
    margin-left: auto;
}

/* ---------------------------------------------------------------------
 * Category-only: featured type showcase
 * --------------------------------------------------------------------- */

.tpl-showcase-card {
    display: flex;
    width: 100%;
    height: 520px;
    background-color: var(--color-white);
    border: 1px solid var(--color-stone);
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

.tpl-showcase-card__image {
    width: 780px;
    flex-shrink: 0;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpl-showcase-card__body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 0 0;
    min-width: 0;
    padding: 48px;
    box-sizing: border-box;
}

.tpl-showcase-card__top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tpl-showcase-card__badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 12px;
    background-color: var(--color-champagne-gold);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 10px;
    color: var(--color-primary-green);
    text-transform: uppercase;
}

/* Same charcoal/white "Sold" treatment as .badge-status--sold /
   .property-card__tag--sold - only reachable here in the edge case
   where every listing of this type is sold (public/category.php's own
   $featuredProperty selection comment explains why that one case still
   falls through to this showcase). */
.tpl-showcase-card__badge--sold {
    background-color: var(--color-charcoal);
    color: var(--color-white);
}

.tpl-showcase-card__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 32px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-showcase-card__desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #717171;
    margin: 0;
}

.tpl-showcase-card__bottom {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tpl-showcase-card__price {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 28px;
    color: var(--color-primary-green);
}

.tpl-showcase-card__cta {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    padding: 14px 32px;
    background-color: var(--color-primary-green);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-white);
    text-decoration: none;
}

/* ---------------------------------------------------------------------
 * Shared: 3-column icon/image benefit cards (Location's Neighbourhood
 * Guide + Category's Type Benefits - same grid shape, different card
 * chrome per the confirmed frames)
 * --------------------------------------------------------------------- */

.tpl-benefits-section {
    display: flex;
    flex-direction: column;
    gap: 64px;
    width: 100%;
    padding: 120px 80px;
    background-color: var(--color-white);
    box-sizing: border-box;
}

.tpl-benefits-grid {
    display: flex;
    gap: 32px;
    width: 100%;
}

/* Location's Neighbourhood Guide cards - image + bordered card body */
.tpl-guide-card {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--color-ivory);
    border: 1px solid var(--color-stone);
    border-radius: 12px;
    overflow: hidden;
}

.tpl-guide-card__image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.tpl-guide-card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.tpl-guide-card__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 20px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-guide-card__desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #717171;
    margin: 0;
}

.tpl-guide-card__venues {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-champagne-gold);
    margin: 0;
}

/* Category's Type Benefits cards - icon square, no card chrome, 40px gap */
.tpl-benefits-grid--icons {
    gap: 40px;
}

.tpl-benefit-item {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tpl-benefit-item__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: var(--color-ivory);
    border: 1px solid var(--color-champagne-gold);
    border-radius: 12px;
}

.tpl-benefit-item__icon {
    width: 24px;
    height: 24px;
}

.tpl-benefit-item__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 22px;
    color: var(--color-primary-green);
    margin: 0;
}

.tpl-benefit-item__desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #717171;
    margin: 0;
}

/* ---------------------------------------------------------------------
 * Location-only: map section
 * --------------------------------------------------------------------- */

.tpl-map-section {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    padding: 120px 80px;
    box-sizing: border-box;
}

.tpl-map-section__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpl-mock-map {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid var(--color-stone);
    border-radius: 12px;
    overflow: hidden;
}

.tpl-mock-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpl-mock-map__pin {
    position: absolute;
    top: 44%;
    left: 46%;
    padding: 8px 16px;
    background-color: var(--color-primary-green);
    border: 1px solid var(--color-champagne-gold);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--color-white);
    text-transform: uppercase;
    white-space: nowrap;
}

.tpl-nearby-row {
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}

.tpl-nearby-row__label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-charcoal);
    margin: 0;
}

.tpl-nearby-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.tpl-nearby-links a {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: var(--color-primary-green);
    text-decoration: underline;
}

/* ---------------------------------------------------------------------
 * Collection-only: lifestyle banner
 * --------------------------------------------------------------------- */

.tpl-lifestyle-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    height: 520px;
    padding: 120px;
    box-sizing: border-box;
    overflow: hidden;
}

.tpl-lifestyle-section__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.tpl-lifestyle-section__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(12, 59, 42, 0.6);
}

.tpl-lifestyle-section__title {
    position: relative;
    z-index: 2;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 48px;
    color: var(--color-white);
    text-align: center;
    max-width: 800px;
    margin: 0;
}

.tpl-lifestyle-section__body {
    position: relative;
    z-index: 2;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-white);
    text-align: center;
    max-width: 720px;
    margin: 0;
}

/* ---------------------------------------------------------------------
 * Collection-only: other collections
 * --------------------------------------------------------------------- */

.tpl-other-collections {
    display: flex;
    flex-direction: column;
    gap: 64px;
    width: 100%;
    padding: 120px 80px;
    background-color: var(--color-white);
    box-sizing: border-box;
}

.tpl-collections-grid {
    display: flex;
    gap: 32px;
    width: 100%;
}

.tpl-collection-card {
    position: relative;
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 360px;
    padding: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
    text-decoration: none;
}

.tpl-collection-card__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    border-radius: 12px;
}

.tpl-collection-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 12px;
    background: linear-gradient(221.61deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.902) 75%);
}

.tpl-collection-card__title {
    position: relative;
    z-index: 2;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 24px;
    color: var(--color-white);
    margin: 0 0 6px;
}

.tpl-collection-card__count {
    position: relative;
    z-index: 2;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 13px;
    color: var(--color-champagne-gold);
}

/* ---------------------------------------------------------------------
 * Shared: bottom CTA banner
 * --------------------------------------------------------------------- */

.tpl-cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding: 120px 80px;
    background-color: var(--color-primary-green);
    box-sizing: border-box;
}

.tpl-cta-section__heading {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 40px;
    color: var(--color-white);
    text-align: center;
    max-width: 800px;
    margin: 0;
}

.tpl-cta-section__body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    color: var(--color-white);
    opacity: 0.8;
    text-align: center;
    max-width: 600px;
    margin: 0;
}

.tpl-cta-section__actions {
    display: flex;
    gap: 16px;
    padding-top: 16px;
}

.tpl-cta-btn-gold {
    display: inline-flex;
    align-items: center;
    padding: 16px 36px;
    background-color: var(--color-champagne-gold);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-primary-green);
    text-decoration: none;
}

.tpl-cta-btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 16px 36px;
    border: 1.5px solid var(--color-white);
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-white);
    text-decoration: none;
}

/* ---------------------------------------------------------------------
 * Mobile / tablet
 * --------------------------------------------------------------------- */

@media (max-width: 1023px) {
    .tpl-hero,
    .tpl-intro,
    .tpl-listings-section,
    .tpl-benefits-section,
    .tpl-map-section,
    .tpl-other-collections,
    .tpl-cta-section {
        padding-left: 24px;
        padding-right: 24px;
    }

    .tpl-hero {
        height: auto;
        min-height: 480px;
        padding-top: 120px;
        padding-bottom: 48px;
    }

    .tpl-hero__title {
        font-size: 34px;
    }

    .tpl-intro,
    .tpl-benefits-grid,
    .tpl-collections-grid,
    .tpl-showcase-card {
        flex-direction: column;
    }

    /* .tpl-collection-card's desktop rule sets flex: 1 0 0 so 3 cards
       share equal WIDTH in the row layout above - but flex-basis applies
       along the flex container's main axis, and .tpl-collections-grid
       switches to flex-direction: column here, so that same flex-basis:0
       started collapsing each card's HEIGHT instead, overriding its
       explicit height: 360px and squashing every "Other Collections"
       card down to a sliver with its title clipped off (only the
       "X Properties Available" line stayed visible). Resetting flex
       sizing here restores the intended fixed-height stacked card. */
    .tpl-collection-card {
        flex: none;
        height: 360px;
    }

    .tpl-stats-card {
        width: 100%;
    }

    .tpl-showcase-card {
        height: auto;
    }

    .tpl-showcase-card__image {
        width: 100%;
        height: 280px;
    }

    .tpl-filter-bar__sort {
        margin-left: 0;
    }

    .tpl-cta-section__actions {
        flex-direction: column;
        width: 100%;
    }

    .tpl-cta-btn-gold,
    .tpl-cta-btn-outline {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}
