/**
 * Practice Library (Archive) Styles
 *
 * @package Inspire_Resources
 */

/* ==========================================================================
   Practice Library (Archive)
   ========================================================================== */

.practice-library {
    background: #fff;
}

/* Archive Hero - Left aligned */
.resource-hero--archive {
    text-align: left;
    min-height: 450px;
    padding-bottom: 120px !important;
}

.container.resource-container {
    width: 80% !important;
    max-width: 1475px !important;
    margin: 0 auto;
    padding: 0 !important;
}

.resource-hero--archive .resource-hero__title {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.resource-hero--archive .resource-hero__content {
    max-width: 550px;
}

.resource-hero--archive .resource-hero__description {
    color: #fff;
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.resource-hero--archive .resource-hero__description p {
    margin: 0 0 1em;
}

.resource-hero--archive .resource-hero__description p:last-child {
    margin-bottom: 0;
}

.resource-hero--archive .resource-hero__description a {
    color: var(--link-color);
    text-decoration: underline;
}

.resource-hero--archive .resource-hero__description a:hover {
    opacity: 0.85;
}

/* Ordered list in hero description */
.resource-hero--archive .resource-hero__description ol {
    list-style: none;
    counter-reset: hero-counter;
    margin: 1em 0;
    padding-left: 0;
}

.resource-hero--archive .resource-hero__description ol li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 0.75em;
    counter-increment: hero-counter;
}

.resource-hero--archive .resource-hero__description ol li:last-child {
    margin-bottom: 0;
}

.resource-hero--archive .resource-hero__description ol li::before {
    content: counter(hero-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Unordered list in hero description */
.resource-hero--archive .resource-hero__description ul {
    list-style: none;
    margin: 1em 0;
    padding-left: 0;
}

.resource-hero--archive .resource-hero__description ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.75em;
}

.resource-hero--archive .resource-hero__description ul li:last-child {
    margin-bottom: 0;
}

.resource-hero--archive .resource-hero__description ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.resource-hero--archive .resource-hero__link-text {
    color: #fff;
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.7;
}

.resource-hero--archive .resource-hero__link-text a {
    color: #fff;
    text-decoration: underline;
}

/* Category Filters Card */
.category-filters {
    position: relative;
    z-index: 10;
    margin-top: -100px;
}

.category-filters .container.resource-container {
    padding: 0;
}

.category-filters__card {
    background: #fff url('/wp-content/uploads/2025/12/library-filters-background-e1767124437860.png') no-repeat;
    background-position: calc(100% - 11%) top;
    background-size: 300px auto;
    border-radius: var(--border-radius);
    padding: 35px 40px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

.category-filters__title {
    color: #57499e;
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #57499e;
    display: inline-block;
}

/* Filter Buttons - 4 per row */
.category-filter-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Search Bar in Category Filters */
.category-filters__search {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(87, 73, 158, 0.15);
}

.category-filters__search-wrapper {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
}

.category-filters__search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-family: var(--font-primary);
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
}

.category-filters__search-input:focus {
    outline: none;
    border-color: #57499e;
}

.category-filters__search-input::placeholder {
    color: #999;
}

.category-filters__search-btn {
    background: #57499e;
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-filters__search-btn:hover {
    background: #453a7d;
}

.category-filters__search-btn svg {
    width: 20px;
    height: 20px;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6rem 2rem;
    border-radius: var(--border-radius);
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #57499e;
    min-height: 140px;
    background-position: bottom right;
}

/* Hide icons */
.filter-btn__icon {
    display: none;
}

.filter-btn__text {
    font-family: var(--font-primary);
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.4;
    color: #57499e;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* Arrow at bottom of button */
.filter-btn::after {
    display: none;
}

.filter-btn:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    background-image: url(/wp-content/uploads/2025/12/practice-library-filter-image.png);
    background-size: initial;
    background-position: bottom right 20px;
    background-repeat: no-repeat;
}

.filter-btn:hover::after {
    transform: translateY(3px);
}

.filter-btn.active {
    background-color: #57499e;
    color: #fff;
    box-shadow: 0 4px 20px rgba(87, 73, 158, 0.3);
    background-image: url(/wp-content/uploads/2025/12/practice-library-filter-image.png);
    background-size: initial;
    background-position: bottom right 20px;
    background-repeat: no-repeat;
}

.filter-btn.active .filter-btn__text {
    color: #fff;
}

.filter-btn.active::after {
    color: #fff;
}

/* Filter Button Wrapper */
.filter-btn-wrapper {
    position: relative;
    height: 100%;
    display: flex;
}

.filter-btn__info {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: rgba(87, 73, 158, 0.1);
    border-radius: 50%;
    cursor: pointer;
    color: #57499e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-btn__info:hover {
    background: #57499e;
    color: #fff;
    transform: scale(1.1);
}

/* Info button on active card */
.filter-btn-wrapper:has(.filter-btn.active) .filter-btn__info {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.filter-btn-wrapper:has(.filter-btn.active) .filter-btn__info:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.filter-btn__info svg {
    width: 16px;
    height: 16px;
}

/* Tooltip */
.filter-btn__info::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 8px 12px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.filter-btn__info:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Category Modal */
.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.category-modal[hidden] {
    display: none;
}

.category-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.category-modal__content {
    position: relative;
    background: #fff;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.category-modal__close:hover {
    background: #57499e;
    color: #fff;
}

.category-modal__item[hidden] {
    display: none;
}

.category-modal__title {
    font-family: var(--font-primary);
    font-size: var(--step-2, 1.75rem);
    font-weight: 700;
    color: #57499e;
    margin: 0 0 20px;
    padding-right: 40px;
    line-height: 1.2em;
}

.category-modal__body {
    font-family: var(--font-primary);
    font-size: var(--step-0, 1rem);
    line-height: 1.7;
    color: #444;
}

.category-modal__body p {
    margin: 0 0 1em;
}

.category-modal__body p:last-child {
    margin-bottom: 0;
}

/* Lists in modal */
.category-modal__body ul,
.category-modal__body ol {
    margin: 0 0 1.5em;
    padding-left: 0;
}

.category-modal__body ul:last-child,
.category-modal__body ol:last-child {
    margin-bottom: 0;
}

/* Unordered list - teal dot bullets */
.category-modal__body ul {
    list-style: none;
}

.category-modal__body ul li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 0.75em;
    line-height: 1.6;
}

.category-modal__body ul li:last-child {
    margin-bottom: 0;
}

.category-modal__body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 10px;
    height: 10px;
    background-color: #00ac90;
    border-radius: 50%;
}

/* Ordered list */
.category-modal__body ol {
    list-style: none;
    counter-reset: modal-counter;
}

.category-modal__body ol li {
    padding-left: 32px;
    position: relative;
    margin-bottom: 0.75em;
    line-height: 1.6;
    counter-increment: modal-counter;
}

.category-modal__body ol li:last-child {
    margin-bottom: 0;
}

.category-modal__body ol li::before {
    content: counter(modal-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: #00ac90;
}

/* Links in modal */
.category-modal__body a {
    color: #00ac90;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.category-modal__body a:hover {
    color: #57499e;
}

/* Strong and emphasis */
.category-modal__body strong,
.category-modal__body b {
    font-weight: 700;
    color: #333;
}

.category-modal__body em,
.category-modal__body i {
    font-style: italic;
}

/* Hide old category descriptions */
.category-descriptions {
    display: none;
}

.category-description {
    background: linear-gradient(135deg, #f8fcfb 0%, #e8f5f2 100%);
    border-left: 4px solid #00ac90;
    border-radius: 0 8px 8px 0;
    padding: 30px 35px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-description[hidden] {
    display: none;
}

.category-description__title {
    font-family: var(--font-primary);
    font-size: 22px;
    font-weight: var(--font-weight-black);
    color: #57499e;
    margin: 0 0 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(87, 73, 158, 0.2);
}

.category-description__content {
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.category-description__content p {
    margin: 0 0 15px;
}

.category-description__content p:last-child {
    margin-bottom: 0;
}

.category-description__content a {
    color: #00ac90;
    text-decoration: underline;
}

.category-description__content a:hover {
    color: #57499e;
}

/* Category Description Lists */
.category-description__content ul,
.category-description__content ol {
    margin: 0 0 15px;
    padding-left: 0;
}

.category-description__content ul:last-child,
.category-description__content ol:last-child {
    margin-bottom: 0;
}

.category-description__content ul {
    list-style: none;
}

.category-description__content ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.category-description__content ul li:last-child {
    margin-bottom: 0;
}

.category-description__content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 10px;
    height: 10px;
    background-color: #00ac90;
    border-radius: 50%;
}

.category-description__content ol {
    list-style: none;
    counter-reset: item;
}

.category-description__content ol li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    counter-increment: item;
}

.category-description__content ol li:last-child {
    margin-bottom: 0;
}

.category-description__content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background-color: #57499e;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Archive Resources Section */
.archive-resources {
    padding: 40px 0 80px;
    background-image: url('/wp-content/uploads/2025/12/form-background-overlay.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.archive-resources .container.resource-container {
    padding: 0;
}

/* Resource Grid - 3 columns */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Resource Card */
.resource-card {
    background: #d7ede8;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Featured Image */
.resource-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

.resource-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Content area */
.resource-card__content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Cards without images get padding on the card itself */
.resource-card:not(:has(.resource-card__image)) {
    padding: 30px 25px;
}

.resource-card:not(:has(.resource-card__image)) .resource-card__content {
    padding: 0;
}

.resource-card__title {
    font-family: var(--font-primary);
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
    color: #57499e;
}

.resource-card__title a {
    color: inherit;
    text-decoration: none;
}

/* Make entire card clickable */
.resource-card__title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.resource-card:hover .resource-card__title a {
    color: #009494;
}

.resource-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
    border: none;
}

.resource-card__tag {
    font-family: var(--font-primary);
    font-size: var(--step--1);
    color: #57499e;
}

/* Hidden state for filtering */
.resource-card.hidden {
    display: none;
}

/* No resources message */
.no-resources {
    grid-column: 1 / -1;
    text-align: center;
    font-family: var(--font-primary);
    font-size: 16px;
    color: #666;
    padding: 60px 20px;
}

/* ==========================================================================
   Archive Responsive
   ========================================================================== */

@media screen and (max-width: 1080px) {
    .category-filter-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 980px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .resource-hero--archive {
        min-height: auto;
        padding-bottom: 120px;
    }

    .container.resource-container {
        width: 90%;
    }

    .category-filter-buttons {
        grid-template-columns: 1fr;
    }

    .category-filters {
        margin-top: -60px;
    }

    .category-filters__card {
        padding: 25px 20px;
    }

    .category-filters__search-wrapper {
        max-width: 100%;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .filter-btn {
        padding: 15px 10px;
        font-size: 0.8rem;
    }
}
