/* Minimal custom styles for Home Page Topics Block */
/* Most styles are handled by Tailwind CSS */

/* Break out of container to make full-width */
.home-page-topics-block {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    box-sizing: border-box;
}

/* Override Elementor container max-width when block is inside */
.e-con-inner:has(.home-page-topics-block),
.elementor-container:has(.home-page-topics-block),
main:has(.home-page-topics-block) {
    max-width: none !important;
    overflow-x: visible !important;
}

/* Fallback for browsers without :has() support */
.home-page-topics-block {
    max-width: 100vw !important;
}

/* Topics section h2 - match resources-headline responsiveness */
.home-page-topics-section__headline {
    font-size: 20px !important;
}

@media (min-width: 768px) {
    .home-page-topics-section__headline {
        font-size: 24px !important;
    }
}

@media (min-width: 1024px) {
    .home-page-topics-section__headline {
        font-size: 30px !important;
    }
}

/* Filter buttons - consistent sizing to prevent layout shift */
.topic-filter-btn {
    color: #000000 !important;
    background: transparent !important;
    border: 2px solid transparent !important;
    border-radius: 9999px !important;
    padding: 0.5rem !important; /* Same padding for both states */
    cursor: pointer;
    min-height: 2.75rem; /* Fixed height to prevent shifting */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease !important;
    box-sizing: border-box;
    font-size: 13px !important; /* Below 1160px */
}

/* Font size 16px at 1160px and above */
@media (min-width: 1160px) {
    .topic-filter-btn {
        font-size: 15px !important;
    }
}

.topic-filter-btn:hover {
    color: #000000 !important;
    background: transparent !important;
}

/* Active state for filter buttons - pill with black background */
.topic-filter-btn.active {
    background-color: black !important;
    color: #ffffff !important;
    border: 2px solid black !important;
}

.topic-filter-btn.active:hover {
    background-color: #1f2937 !important;
    border-color: #1f2937 !important;
    color: #ffffff !important;
}

/* Flex layout - all buttons on one line */
.topic-filter-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0; /* 0 gap between 1024-1280px */
}

/* Above 1280px: 1rem gap */
@media (min-width: 1280px) {
    .topic-filter-grid {
        gap: 1rem;
    }
}

/* Topic filter button styling */
.topic-filter-btn {
    letter-spacing: 0 !important;
    font-weight: 500 !important;
    color: #64707D !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

@media (min-width: 1280px) {
    .topic-filter-btn {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}

/* Topic card hover effects - scale only, no shadow */
.topic-card {
    transition: transform 0.3s ease;
}

.topic-card:hover {
    transform: scale(1.05);
}

/* Mobile: Center thumbnails with max-width */
@media (max-width: 767px) {
    .topics-grid {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Hide buttons below 1024px when dropdown is visible */
@media (max-width: 1023px) {
    .topic-filter-grid {
        display: none !important;
    }
}

/* CTA button - match btn-filled-on-dark: gradient text, gradient bg on hover; keep padding/font from class */
.topic-cta-btn {
    background-color: #ffffff !important;
    border: none !important;
    text-decoration: none !important;
    transition: background 0.3s ease-in-out 0s !important;
}

.topic-cta-btn .topic-cta-btn__text {
    display: inline-block;
    background: linear-gradient(90deg, #7400B2 13.48%, #5511BC 56.52%, #D500C3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: color 0.3s ease-in-out, -webkit-text-fill-color 0.3s ease-in-out, background 0.3s ease-in-out !important;
}

.topic-cta-btn:hover {
    background: linear-gradient(90deg, rgba(248, 38, 255, 0.67) 13.48%, rgba(144, 0, 255, 0.67) 60.07%, rgba(51, 0, 255, 0.67) 100%), rgba(255, 255, 255, 0.46) !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
    border: none !important;
}

.topic-cta-btn:hover .topic-cta-btn__text,
.topic-cta-btn:hover .inline-block {
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
}

/* Mobile select dropdown styling */
.topic-filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.topic-filter-select:focus {
    outline: none;
    border-color: #000000;
}

/* Smooth transition for grid visibility */
.topics-grid {
    transition: opacity 0.3s ease;
}

.topics-grid.hidden {
    display: none;
}
