/* ============================================
   YPSPH Property Cards v1.5.3
   CSS Grid layout — resistant to GeneratePress
   theme overrides
   ============================================ */

/* ─────────────────────────────────────────
   1st container: white bg, relative
───────────────────────────────────────── */
.ypsph-section {
    background: #ffffff;
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    box-sizing: border-box;
}

/* ─────────────────────────────────────────
   2nd container: max-width 1200px, centered
   padding: 80px top, 40px left/right
   text-align: center
───────────────────────────────────────── */
.ypsph-section__inner {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 80px 40px 60px;
    text-align: center;
    box-sizing: border-box;
}

/* H3: 29px, weight 600, line-height 1.2em */
.ypsph-section__title {
    font-size: 29px;
    font-weight: 600;
    line-height: 1.2em;
    margin: 0 0 12px;
    color: #1a1a1a;
}

/* Paragraph: 16px */
.ypsph-section__subtitle {
    font-size: 16px;
    margin: 0 0 40px;
    color: #555;
    line-height: 1.6;
}

/* ─────────────────────────────────────────
   3rd container: no formatting (passthrough)
───────────────────────────────────────── */
.ypsph-section__wrap {
    width: 100%;
}

/* ─────────────────────────────────────────
   4th container:
   display: flex, justify-content: center
   grid-template-columns: repeat(2, minmax(0,1fr)) → grows to 3
   column-gap: 20px, row-gap: 20px
   flex-wrap: wrap
───────────────────────────────────────── */
.ypsph-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 0;
    margin: 0 auto;
    list-style: none;
    width: 100%;
    max-width: 1200px;
}

/* ─────────────────────────────────────────
   5th container (card outer):
   display: flex, justify-content: space-between
   flex-direction: column, height: 100%
   max-width: 360px, text-align: left
   background: #f7f7f7
   border: 1px solid #7a7a7a (all sides)
   border-radius: 8px (all corners)
───────────────────────────────────────── */
.ypsph-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    max-width: 100%;
    text-align: left;
    background-color: #f7f7f7;
    border: 1px solid #7a7a7a;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    text-decoration: none !important;
    color: inherit !important;
}

.ypsph-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-decoration: none !important;
    color: inherit !important;
}

/* ─────────────────────────────────────────
   Image:
   width: 100%, height: 200px, max-width: 100%
   border: #7a7a7a (top sides only via image-wrap)
   border-radius top-right: 8px, top-left: 8px
   object-fit: cover
───────────────────────────────────────── */
.ypsph-card__image-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
    background: #dde3ea;
}

.ypsph-card__image {
    width: 100%;
    height: 200px;
    max-width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
    border-color: #7a7a7a;
    transition: transform 0.4s ease;
}

.ypsph-card:hover .ypsph-card__image {
    transform: scale(1.03);
}

.ypsph-card__image--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d0d8e2, #bbc5d1);
    border-radius: 8px 8px 0 0;
}

/* Badge */
.ypsph-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1.5;
}

/* ─────────────────────────────────────────
   6th container (card body):
   display: flex, justify-content: space-between
   flex-direction: column, height: 100%
   padding: 20px top, 20px left, 20px right
   border-radius bottom-left: 10px, bottom-right: 10px
   position: relative
───────────────────────────────────────── */
.ypsph-card__body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 20px 20px 20px;
    border-radius: 0 0 10px 10px;
    position: relative;
    flex: 1;
}

.ypsph-card__body-top {
    flex: 1;
}

/* H2 title: margin 8px, font-size 20px, weight 600, line-height 120% */
.ypsph-card__title {
    margin: 8px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 120%;
    color: #1a1a1a;
}

/* H2 location: flex, align-center, col-gap 0.5em, mb 20px,
   font-size 14px, weight 500, line-height 100% */
.ypsph-card__location {
    display: flex;
    align-items: center;
    column-gap: 0.5em;
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 100%;
    color: #555;
}

.ypsph-card__location svg {
    flex-shrink: 0;
    color: #888;
}

/* Paragraph: 14px */
.ypsph-card__desc {
    font-size: 14px;
    line-height: 1.55;
    color: #444;
    margin: 0 0 16px;
}

/* Meta rows */
.ypsph-card__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.ypsph-card__meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.ypsph-card__meta-label {
    color: #888;
    font-weight: 400;
    flex-shrink: 0;
    white-space: nowrap;
}

.ypsph-card__meta-value {
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
}

.ypsph-card__meta-value--price {
    color: #c05c1a;
    font-weight: 700;
}

.ypsph-card__meta-value--dev {
    color: #1a2d55;
    font-weight: 700;
}

/* CTA Button — pushed to bottom by flex space-between */
.ypsph-card__cta {
    display: block;
    width: 100%;
    padding: 11px 0;
    background: #1a2d55;
    color: #fff !important;
    text-align: center;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: background 0.18s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ypsph-card:hover .ypsph-card__cta,
.ypsph-card__cta:hover {
    background: #2c4a8a;
    text-decoration: none !important;
    color: #fff !important;
}

/* ─────────────────────────────────────────
   View More link
───────────────────────────────────────── */
.ypsph-viewmore {
    text-align: center;
    margin-top: 32px;
}

.ypsph-viewmore a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8a7355;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: gap 0.18s ease, color 0.18s ease;
}

.ypsph-viewmore a:hover {
    color: #6b5640;
    gap: 10px;
    text-decoration: none;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 1024px) {
    .ypsph-section__inner {
        padding: 50px 24px 40px;
    }
    .ypsph-grid,
    .entry-content .ypsph-grid,
    .inside-article .ypsph-grid,
    .gb-container .ypsph-grid,
    .site-content .ypsph-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ypsph-section__inner {
        padding: 40px 16px 32px;
    }
    .ypsph-grid,
    .entry-content .ypsph-grid,
    .inside-article .ypsph-grid,
    .gb-container .ypsph-grid,
    .site-content .ypsph-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ─────────────────────────────────────────
   Grouped layout (Properties listing page)
   .ypsph-section__inner--grouped removes
   top padding since category headings
   already provide separation
───────────────────────────────────────── */
.ypsph-section__inner--grouped {
    text-align: left;
}

.ypsph-category-group {
    margin-bottom: 56px;
}

.ypsph-category-group:last-child {
    margin-bottom: 0;
}

/* Category heading: matches your site's H2 style */
.ypsph-category-group__title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    line-height: 1.2;
}

/* ─────────────────────────────────────────
   GeneratePress / GenerateBlocks overrides
   Prevents GP's content container from
   forcing single-column layout on cards
───────────────────────────────────────── */
.entry-content .ypsph-card,
.site-content .ypsph-card,
.inside-article .ypsph-card,
.gb-container .ypsph-card {
    max-width: 100% !important;
    width: 100% !important;
}

.entry-content .ypsph-section,
.site-content .ypsph-section,
.inside-article .ypsph-section,
.gb-container .ypsph-section {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
}

/* ─────────────────────────────────────────
   Filter Bars
───────────────────────────────────────── */
.ypsph-filters {
    max-width: 1200px;
    margin: 0 auto 32px;
    text-align: left;
}

.ypsph-filter-group {
    margin-bottom: 20px;
}

.ypsph-filter-group__title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.ypsph-filter-group__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ypsph-filter-btn {
    padding: 7px 18px;
    border: 1.5px solid #c0c0c0;
    border-radius: 50px;
    background: #fff;
    color: #1a2d55;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.ypsph-filter-btn:hover {
    border-color: #1a2d55;
    color: #1a2d55;
}

.ypsph-filter-btn--active {
    background: #1a2d55;
    border-color: #1a2d55;
    color: #fff;
}

/* Card hide/show animation */
.ypsph-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.3s ease;
}

.ypsph-card--hidden {
    display: none !important;
}