/**
 * Conditions Grid Styles
 */

.conditions-grid-wrapper {
    width: 100%;
    padding: 20px 0;
}

.conditions-grid {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.conditions-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Stagger the right column */
.conditions-column.right-column {
    margin-top: 30px;
}

/* Condition Card */
.condition-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #CFB46B;
    /* Taller portrait aspect ratio */
    aspect-ratio: 3/4;
    width: 100%;
	height: 340px;
    isolation: isolate;
}
.condition-card::after {
	content: "";
	position: absolute;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 28%, #000000 100%);
	width: 100%;
	height: 100%;
	bottom: 0;
	left: 0;
	right: 0;
	top: 0;
	z-index: 2;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	border-radius: inherit;
}
.condition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.condition-card:hover::after {
	opacity: 0;
	visibility: hidden;
}
.condition-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    border-radius: 20px;
    cursor: pointer;
}

.condition-card-no-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    border-radius: 20px;
    cursor: default;
}

/* Card Image */
/* Card Image */
.condition-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: inherit;
}

/* Img tag is removed in PHP, so this rule is largely redundant but harmless to keep if needed for placeholders */
.condition-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.condition-card:hover .condition-card-image img {
    transform: scale(1.05);
}

/* Placeholder for no image */
.condition-card-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* Card Content (Title at bottom) */
.condition-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 35px 15px 25px;
    background: transparent;
    z-index: 3;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.condition-card:hover .condition-card-content {
    opacity: 0;
    visibility: hidden;
}

.condition-card-title {
    margin: 0;
font-style: normal;
font-weight: 600;
font-size: 22px;
line-height: 30px;
text-align: center;
color: #CFB46B;

}

/* Overlay */
.condition-card-overlay {
    position: absolute;
    top: -8px;
    left: -5px;
    right: -5px;
    bottom: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    background: #CFB46B;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 10;
    padding: 40px 20px 30px;
    border-radius: 28px;
}

.condition-card:hover .condition-card-overlay {
    opacity: 1;
    visibility: visible;
}

.condition-overlay-content {
    text-align: left;
    color: #000;
    position: relative;
    width: 100%;
    height: auto;
    padding-bottom: 50px;
}

.condition-overlay-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #000;
    line-height: 1.3;
}

.condition-overlay-excerpt {
    font-size: 17px;
    line-height: 28px;
	font-weight: 400;
    margin: 0;
    color: #000;
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* Limit to 7 rows with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.condition-overlay-arrow {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    color: #000;
    box-shadow: none;
    padding: 10px 20px 20px 10px;
}

.condition-overlay-arrow svg {
    width: 22px;
    height: 22px;
    transform: rotate(-45deg);
    stroke-width: 2.5;
}

.condition-overlay-arrow img {
    width: 24px;
    height: 24px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .conditions-grid {
        flex-direction: column;
        padding: 0px;
    }

    .conditions-column.right-column {
        margin-top: 0;
    }

    /* Remove stagger on mobile */
    .conditions-grid .condition-card:nth-child(even) {
        margin-top: 0;
    }

    /* Keep the same aspect ratio and height as desktop */
    .condition-card {
        aspect-ratio: 3/4;
        height: 340px;
    }

    .condition-card-title {
        font-size: 22px;
    }

    .condition-overlay-title {
        font-size: 22px;
    }

    /* Keep the same content padding as desktop */
    .condition-card-content {
        padding: 35px 15px 25px;
    }

    /* Keep the same overlay padding as desktop */
    .condition-card-overlay {
        padding: 40px 20px 30px;
    }

    .condition-overlay-arrow {
        bottom: 10px;
        right: 10px;
        width: auto;
        height: auto;
        padding: 10px 20px 20px 10px;
    }

    .condition-overlay-arrow svg {
        width: 22px;
        height: 22px;
    }

    .condition-overlay-arrow img {
        width: 24px;
        height: 24px;
    }

    /* Increase bottom padding to prevent arrow overlap */
    .condition-overlay-content {
        padding-bottom: 60px;
    }

    /* Ensure line-clamping works in mobile */
    .condition-overlay-excerpt {
        font-size: 17px;
        line-height: 28px;
        display: -webkit-box !important;
        -webkit-line-clamp: 7 !important;
        line-clamp: 7 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-height: calc(28px * 7); /* 7 lines * line-height */
        padding-right: 10px; /* Add right padding to prevent overlap with arrow */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .conditions-grid {
        column-gap: 18px;
    }

    .condition-card-title {
        font-size: 19px;
    }

    .condition-overlay-title {
        font-size: 22px;
    }
}

/* Additional hover effects */
.condition-card-link:focus {
    outline: none;
}

.condition-card-link:focus:not(:focus-visible) {
    outline: none;
}