/**
 * MOM Participatory Budget - Project Cards & Detail Page Styles
 * Based on existing design system
 */

/* === CSS VARIABLES === */
:root {
    --mom-font-family: "Inter Tight", sans-serif;
    --mom-color-primary: #8B2332;
    --mom-color-secondary: #848ACE;
    --mom-color-text: #212121;
    --mom-color-text-muted: #393A44;
    --mom-color-bg-light: #f3f3fa;
    --mom-color-white: #ffffff;
    --mom-border-radius: 12px;
    --mom-border-radius-sm: 10px;
    --mom-transition: 0.3s ease;
}

/* === FILTERS === */
.mom-projects-wrapper {
    width: 100%;
}

.mom-projects-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.mom-projects-filters__field {
    min-width: 0;
    position: relative;
}

.mom-projects-filters__field::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cg opacity='0.5'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23393A44' stroke-width='1.33333' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 20px 20px;
    pointer-events: none;
}

.mom-projects-filters__select {
    width: 100%;
    min-height: 52px;
    padding: 16px 44px 16px 16px;
    box-sizing: border-box;
    border: 1px solid rgba(57, 58, 68, 0.2);
    border-radius: 8px;
    background-color: #fff;
    color: #212121;
    font-family: var(--mom-font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.1504px;
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    transition: border-color var(--mom-transition), box-shadow var(--mom-transition);
}

.mom-projects-filters__select::-ms-expand {
    display: none;
}

.mom-projects-filters__select:focus {
    outline: none;
    border-color: #848ace;
    box-shadow: 0 0 0 3px rgba(132, 138, 206, 0.2);
}

.mom-projects-filters__submit {
    margin-top: 12px;
    height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background-color: var(--mom-color-primary);
    color: #fff;
    font-family: var(--mom-font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.mom-projects-empty {
    margin: 0;
    padding: 24px;
    border: 1px solid #d8d8de;
    border-radius: var(--mom-border-radius);
    font-family: var(--mom-font-family);
    font-size: 18px;
    color: var(--mom-color-text-muted);
}

/* === PROJECTS GRID === */
.mom-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.mom-projects-grid--2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.mom-projects-grid--3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.mom-projects-grid--4-cols {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .mom-projects-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mom-projects-filters__select {
        min-height: 52px;
        font-size: 16px;
    }

    .mom-projects-grid,
    .mom-projects-grid--2-cols,
    .mom-projects-grid--3-cols,
    .mom-projects-grid--4-cols {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .mom-projects-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mom-projects-grid--3-cols,
    .mom-projects-grid--4-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === PROJECT CARD === */
.project-card {
    background-color: var(--mom-color-white);
    border-radius: var(--mom-border-radius);
    overflow: hidden;
    font-family: var(--mom-font-family);
}

/* Card Image */
.project-card__image {
    position: relative;
    overflow: hidden;
    border-radius: var(--mom-border-radius-sm);
}

.project-card__image a {
    display: block;
}

.project-card__image img {
    width: 100%;
    height: auto;
    aspect-ratio: 750 / 450;
    object-fit: cover;
    border-radius: var(--mom-border-radius-sm);
    display: block;
    -webkit-transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out !important;
    -moz-transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out !important;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out !important;
    -webkit-transform: scale(1);
    transform: scale(1);
    will-change: transform, opacity;
}

.project-card__image a:hover img,
.project-card__image a:focus img {
    opacity: 0.9;
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

.project-card__image-placeholder {
    width: 100%;
    aspect-ratio: 750 / 450;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    border-radius: var(--mom-border-radius-sm);
}

/* Card Content */
.project-card__content {
    padding: 35px 24px 25px;
    position: relative;
}

/* Category Badge */
.project-card__category {
    position: absolute;
    top: -20px;
    left: 24px;
}

.project-card__category-badge {
    display: inline-block;
    background-color: var(--mom-color-secondary);
    color: var(--mom-color-white);
    font-family: var(--mom-font-family);
    font-size: 15px;
    font-weight: 500;
    line-height: 15px;
    letter-spacing: 0.3px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color var(--mom-transition);
}

/* Card Title */
.project-card__title {
    font-family: var(--mom-font-family);
    font-size: 24px;
    font-weight: 600;
    line-height: 33.6px;
    margin: 0 0 14px 0;
}

.project-card__title a {
    color: var(--mom-color-text);
    text-decoration: none;
    transition: color var(--mom-transition);
}

.project-card__title a:hover {
    color: var(--mom-color-primary);
}

/* Card Excerpt */
.project-card__excerpt {
    font-family: var(--mom-font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    color: var(--mom-color-text);
    margin: 0 0 16px 0;
}

.project-card__excerpt p {
    margin: 0;
}

/* Read More Link */
.project-card__read-more a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mom-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 28px;
    color: var(--mom-color-text-muted);
    text-decoration: none;
    transition: color var(--mom-transition);
}

.project-card__read-more a:hover {
    color: var(--mom-color-primary);
}

/* Arrow Icon */
.project-card__read-more a::after {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M16.4227 16.059C16.3527 15.9897 16.2972 15.907 16.2596 15.8159C16.222 15.7249 16.2029 15.6272 16.2035 15.5287L16.2035 7.79292H8.46774C8.27353 7.78607 8.08956 7.7041 7.9546 7.56428C7.81963 7.42447 7.7442 7.23772 7.7442 7.04339C7.7442 6.84906 7.81963 6.66231 7.9546 6.5225C8.08956 6.38268 8.27353 6.30071 8.46774 6.29386L16.953 6.29386C17.1518 6.29398 17.3423 6.37299 17.4829 6.51353C17.6234 6.65406 17.7024 6.84464 17.7026 7.04339L17.7026 15.5287C17.7024 15.7274 17.6234 15.918 17.4829 16.0585C17.3423 16.1991 17.1518 16.2781 16.953 16.2782C16.8545 16.2788 16.7568 16.2597 16.6657 16.2221C16.5747 16.1845 16.492 16.129 16.4227 16.059Z' fill='%23848ACE'/%3E%3Cpath d='M6.52232 17.4749C6.38407 17.3329 6.3067 17.1427 6.3067 16.9445C6.3067 16.7464 6.38407 16.5561 6.52232 16.4142L16.4218 6.51471C16.5625 6.37405 16.7532 6.29504 16.9521 6.29504C17.1511 6.29504 17.3418 6.37405 17.4825 6.51471C17.6231 6.65536 17.7021 6.84612 17.7021 7.04503C17.7021 7.24395 17.6231 7.43471 17.4825 7.57537L7.58298 17.4749C7.44107 17.6131 7.25078 17.6905 7.05265 17.6905C6.85453 17.6905 6.66424 17.6131 6.52232 17.4749Z' fill='%23848ACE'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform var(--mom-transition);
}

.project-card__read-more a:hover::after {
    transform: translate(2px, -2px);
}

/* === PROJECT DETAIL PAGE === */
.mom-project-detail {
    font-family: var(--mom-font-family);
    max-width: 770px;
    margin: 0 auto;
}

/* Detail Header */
.mom-project-detail__header {
    margin-bottom: 24px;
}

.mom-project-detail__title {
    font-family: var(--mom-font-family);
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    color: #393a44;
    margin: 0 0 20px 0;
}

@media (max-width: 768px) {
    .mom-project-detail__title {
        font-size: 28px;
    }
}

/* Detail Status Badge */
.mom-project-detail__status {
    margin-bottom: 30px;
}

.mom-project-detail__status-badge {
    display: inline-block;
    background-color: var(--mom-color-primary);
    color: var(--mom-color-white);
    font-family: var(--mom-font-family);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    padding: 12px 24px;
    border-radius: 999px;
}

/* Detail Meta Info */
.mom-project-detail__meta {
    margin-bottom: 40px;
}

.mom-project-detail__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 28px;
}

.mom-project-detail__meta-label {
    color: #000;
    font-weight: 400;
}

.mom-project-detail__meta-value {
    color: #000;
    font-weight: 500;
}

.mom-project-detail__meta-value--bold {
    font-weight: 500;
}

/* Detail Image */
.mom-project-detail__image {
    margin-bottom: 50px;
}

.mom-project-detail__image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* Q&A Sections */
.mom-project-detail__qa-sections {
    margin-bottom: 60px;
}

.mom-project-detail__qa {
    margin-bottom: 40px;
}

.mom-project-detail__qa:last-child {
    margin-bottom: 0;
}

.mom-project-detail__qa-question {
    font-family: var(--mom-font-family);
    font-size: 24px;
    font-weight: 700;
    line-height: 36px;
    color: #122428;
    margin: 0 0 10px 0;
}

.mom-project-detail__qa-answer {
    font-family: var(--mom-font-family);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    color: #000;
    text-align: justify;
}

.mom-project-detail__qa-answer p {
    margin: 0 0 20px 0;
}

.mom-project-detail__qa-answer p:last-child {
    margin-bottom: 0;
}

/* Response Section - Full Width */
.mom-project-detail__response-wrapper {
    /* Break out of the 770px container to full viewport width */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: #f3f3fa;
}

.mom-project-detail__response {
    max-width: 770px;
    margin: 0 auto;
    padding: 90px 0 250px;
}

.mom-project-detail__response-title {
    font-family: var(--mom-font-family);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #122428;
    margin: 0 0 40px 0;
}

.mom-project-detail__response-by {
    margin-bottom: 30px;
    font-size: 18px;
    line-height: 28px;
}

.mom-project-detail__response-by-label {
    font-weight: 600;
    color: #000;
}

.mom-project-detail__response-by-value {
    font-weight: 600;
    color: #000;
}

.mom-project-detail__response-content {
    font-family: var(--mom-font-family);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    color: #000;
    text-align: justify;
}

.mom-project-detail__response-content p {
    margin: 0 0 20px 0;
}

.mom-project-detail__response-content p:last-child {
    margin-bottom: 0;
}

/* Mobile responsive styles for detail page */
@media (max-width: 768px) {
    .mom-project-detail {
        padding: 0 20px;
    }

    .mom-project-detail__meta-row {
        flex-direction: column;
        gap: 5px;
    }

    .mom-project-detail__qa-question {
        font-size: 20px;
        line-height: 30px;
    }

    .mom-project-detail__qa-answer,
    .mom-project-detail__response-content {
        font-size: 16px;
        line-height: 26px;
    }

    .mom-project-detail__response {
        padding: 60px 20px 180px;
    }
}

/* CTA Banner overlap - fix overflow and pull footer up */
body.mom-project-detail-view .elementor-top-section:has(.elementor-widget-mom_projects) {
    padding-bottom: 0 !important;
    overflow: visible !important;
    background: transparent !important;
}

body.mom-project-detail-view .elementor-location-footer > .e-con.e-parent:first-child {
    margin-top: -180px;
    position: relative;
    z-index: 10;
}

/* === LOADING & ERROR STATES === */
.mom-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    font-family: var(--mom-font-family);
    font-size: 16px;
    color: var(--mom-color-text-muted);
}

.mom-error {
    padding: 24px;
    background-color: #fff5f5;
    border-radius: var(--mom-border-radius);
    color: var(--mom-color-primary);
    font-family: var(--mom-font-family);
    font-size: 16px;
    text-align: center;
}
