/* ============================================
   Shared Card Component Styles
   ============================================
   All card variants: content, profile, service,
   listing, and sidebar cards.

   Grid layout:     .gallery-grid
   Content cards:   .card, .card.dev-card
   Profile cards:   .profile-card
   Service cards:   .puja-card
   Listing cards:   .listing-card
   ============================================ */


/* ============================================
   1. Gallery Grid (shared card layout)
   ============================================ */

.gallery-grid {
    display: grid;
    margin-top: 60px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: 44px;
    row-gap: 33px;
    width: 100%;
    max-width: 1220px;
}


/* ============================================
   2. Content Card (temple, event, festival, god)
   ============================================ */

.card {
    width: 100%;
    max-width: 100%;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    border: var(--card-border);
    background: var(--card-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.card-image {
    width: 100%;
    aspect-ratio: var(--card-img-ratio);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    background-color: var(--card-img-bg);
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    display: block;
    transition: transform 0.3s ease;
}

.card-image:hover img {
    transform: scale(1.05);
    cursor: pointer;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    overflow: hidden;
}

.card-title {
    font-size: 24px;
    font-weight: 400;
    margin-top: 13px;
    margin-left: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title a {
    text-decoration: none;
    color: inherit;
}

.card-description {
    font-size: 20px;
    line-height: 165%;
    font-weight: 400;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
    padding: 0 10px;
}

.card-description a {
    text-decoration: none;
    color: inherit;
}


/* --- Card Stats (like / save / share row) --- */

.card-stats {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
    color: var(--text-light);
    align-items: center;
    margin-top: auto;
    padding: 8px 0;
    gap: 20px;
}

.stat {
    width: 75px;
    height: 31px;
    padding: 0 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.card-stats .stat {
    gap: 0;
}

.stat-icon {
    width: var(--stat-icon-size);
    height: var(--stat-icon-size);
}

.like_png {
    width: 24px;
    height: 24px;
}

.bookmarks_png {
    width: 24px;
    height: 24px;
    padding: 2px;
    object-fit: contain;
    vertical-align: middle;
}

.share_png {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

.count-show {
    color: var(--text-link);
    margin-left: 5px;
    font-family: var(--font-primary);
    font-size: 22px;
    font-style: normal;
    font-weight: 400;
    min-width: 3ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    vertical-align: middle;
}


/* --- Dev Card modifier (god/goddess — compact, no description) --- */

.card.dev-card .card-title {
    text-align: center;
    margin-top: 18px;
    margin-left: 0;
}

.card.dev-card .card-stats {
    margin-top: 0;
}


/* --- Event Section (date/time row inside event cards) --- */

.event-section {
    padding: 10px;
    display: flex;
    gap: 10px;
}

.event-section .event-image {
    width: 22px;
    height: 22px;
    margin-top: 0.9%;
}

.event-time-icon {
    width: 22px;
    height: 22px;
    margin-top: 0.9%;
    margin-left: 14px;
}

.event-date,
.event-time {
    font-size: 18px;
    color: var(--text-tertiary);
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
}


/* ============================================
   3. Profile Card (community / person)
   ============================================ */

.card-container {
    width: 100%;
}

.profile-card {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 44.436px 44.436px 0 0;
    border: var(--card-border);
    background: var(--card-bg);
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    height: 120px;
    background: rgba(128, 128, 128, 0.62);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header.background-image {
    height: 128px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: absolute;
    bottom: -40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.avatar-img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    padding: 50px 20px 10px 20px;
    text-align: center;
}

.profile-name {
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    height: 34px;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-location {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-location:empty {
    margin-bottom: 28px;
}

.profile-location-inline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.location-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-bottom: 33px;
}

.request {
    text-align: center;
}

.request:not(:last-child) {
    border-right: 1px solid rgba(172, 169, 169, 0.50);
}

.stat-number {
    display: block;
    font-weight: 400;
    color: var(--text-link);
    font-family: var(--font-primary);
    font-size: 22px;
    font-style: normal;
}

.stat-label {
    margin-top: 2px;
    color: var(--text-link);
    font-family: var(--font-primary);
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
}

.action-button {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--card-bg);
    border-radius: 5px 5px 0 0;
    border-top: var(--card-stats-border);
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--brand-dark);
    color: white;
}


/* ============================================
   4. Service Card (puja / service)
   ============================================ */

.puja-card {
    min-height: 439px;
    max-width: 377px;
    border-radius: 10.778px 10.778px 0 0;
    border: 0.849px solid var(--border-secondary);
    background: var(--card-bg);
    min-width: 100px;
}

.puja-card-image {
    width: 100%;
    aspect-ratio: var(--card-img-ratio);
    height: 269px;
    border-radius: 10.778px 10.778px 0 0;
    background-color: var(--card-img-bg);
    position: relative;
}

.puja-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10.778px 10.778px 0 0;
    display: block;
}

.puja-card .card-title {
    margin-left: 16px;
    height: 34px;
}

.puja-price {
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 20px;
    font-style: normal;
    margin-bottom: 30px;
    padding: 0 16px;
}

.select-sections {
    display: flex;
    flex-wrap: wrap;
    padding: 0 26px 20px 16px;
}

.share-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    padding: 7px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.share-icon img {
    width: 20px;
    height: 26px;
    object-fit: contain;
}

.share-icon:hover {
    transform: scale(1.1);
}

.star-rating {
    color: var(--brand-secondary);
    font-size: 20px;
    letter-spacing: 2px;
    margin-left: 50px;
}


/* ============================================
   5. Listing Card (DDEFP / generic list)
   ============================================ */

.listing-card {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.listing-card:hover {
    box-shadow: var(--shadow-sm);
}

.listing-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.listing-card-body {
    padding: 14px;
}

.listing-card-title {
    font-size: var(--text-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-family: var(--font-primary);
    margin-bottom: 6px;
}

.listing-card-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card-stats {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    border-top: 1px solid var(--bg-tertiary);
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-primary);
}


/* ============================================
   6. Responsive Breakpoints
   ============================================ */

@media (max-width: 1590px) {
    .gallery-grid {
        max-width: 1000px;
        justify-content: center;
    }
    .select-sections {
        padding: 0 10px 20px 16px;
    }
    .star-rating {
        margin-left: 10px;
    }
}

@media (max-width: 1315px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 750px;
    }
    .star-rating {
        margin-left: 50px;
    }
}

@media (max-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 550px;
    }
    .event-time-icon {
        margin-left: 5px;
    }
    .event-date,
    .event-time {
        font-size: 16px;
    }
    .select-sections {
        padding: 0 0 20px 16px;
    }
    .star-rating {
        font-size: 16px;
        margin-left: 0;
    }
}

@media (max-width: 750px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        max-width: 100%;
        width: 100%;
    }
    .star-rating {
        margin-left: auto;
        margin-right: 10px;
    }
}

@media (max-width: 614px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        min-width: 345px;
        width: 100%;
        margin-top: 0;
    }

    .card {
        border-radius: var(--card-radius-sm) var(--card-radius-sm) 0 0;
    }

    .card-image {
        border-radius: var(--card-radius-sm) var(--card-radius-sm) 0 0;
    }

    .card-image img {
        border-radius: var(--card-radius-sm) var(--card-radius-sm) 0 0;
    }

    .card-title {
        font-size: 16px;
    }

    .card-description {
        font-size: 14px;
    }

    .card-stats {
        margin-top: 0;
    }

    .count-show {
        font-size: 14px;
    }

    .like_png {
        height: 20px;
        width: 20px;
    }

    .puja-card {
        min-height: 360px;
    }

    .puja-card-image {
        height: 220px;
    }

    .puja-price {
        font-size: 16px;
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .puja-card .card-title {
        margin-left: 10px;
    }

    .select-sections {
        padding: 0 0 10px 10px;
    }

    .star-rating {
        margin-top: 5px;
    }
}

@media (max-width: 505px) {
    .listing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    .card-header.background-image {
        height: 122px;
    }
    .profile-avatar {
        width: 72px;
        height: 73px;
    }
    .profile-name {
        font-size: 18px;
        height: 25px;
    }
    .profile-location {
        font-size: 16px;
    }
    .location-icon {
        width: 17px;
        height: 17px;
    }
    .stat-number {
        font-size: 14px;
    }
    .stat-label {
        font-size: 14px;
    }
    .action-button {
        font-size: 14px;
    }
    .profile-stats {
        margin-bottom: 32px;
    }
}

@media (max-width: 375px) {
    .gallery-grid {
        padding: 0 15px 0 0;
    }
}
