/**
 * Resource Cards Styling - Version 4.0.0
 * Improved layout: 2 columns on desktop, 1 on mobile
 * Uses LawCentralAlberta.ca color scheme
 */
/* Grid Layout for resource-cards-grid - 1 column on mobile, 2 on desktop */
.resource-cards-grid {
    display: grid !important;
    grid-template-columns: 1fr !important; /* Mobile first: 1 column */
    gap: 2rem !important;
    padding: 0 !important;
    margin: 2rem 0 4rem 0 !important; /* Combined margin */
    list-style: none !important;
}

/* 2 columns on tablet and up */
@media (min-width: 768px) {
    .resource-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem !important;
    }
}
/* Grid Layout - 2 columns on desktop, 1 on mobile */
.wp-block-query .wp-block-post-template {
    display: grid !important;
    grid-template-columns: 1fr !important; /* Mobile first: 1 column */
    gap: 2rem !important;
    padding: 0 !important;
    margin: 2rem 0 !important;
    list-style: none !important;
}

/* 2 columns on tablet and up */
@media (min-width: 768px) {
    .wp-block-query .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem !important;
    }
}

/* Individual Resource Card */
.wp-block-post {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 2rem 2rem 1rem 2rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.wp-block-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
    border-color: #006483 !important;
}

/* Card Title */
h2.wp-block-post-title {
    font-size: 1.375rem !important; /* 22px */
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 0 1rem 0 !important;
    color: #1a1a1a !important;
}

h2.wp-block-post-title a {
    color: #006483 !important; /* LawCentral blue */
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

h2.wp-block-post-title a:hover {
    color: #02779b !important; /* Darker blue on hover */
    text-decoration: underline !important;
}

/* Resource Blurb/Description */
.resource-blurb,
.wp-block-post-excerpt,
.entry-content {
    font-size: 0.9375rem !important; /* 15px */
    line-height: 1.6 !important;
    color: #4a5568 !important;
    margin: 0 0 1.5rem 0 !important;
    flex-grow: 1 !important; /* Push button to bottom */
}

.resource-blurb p,
.wp-block-post-excerpt p {
    margin: 0 0 0.75rem 0 !important;
}

.resource-blurb p:last-child,
.wp-block-post-excerpt p:last-child {
    margin-bottom: 0 !important;
}

/* Taxonomy Terms (Jurisdictions, Subject Terms) */
.wp-block-post-terms {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    margin: 0 0 1rem 0 !important;
    font-size: 0.8125rem !important; /* 13px */
}

.wp-block-post-terms a {
    display: inline-block !important;
    padding: 0.375rem 0.75rem !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.wp-block-post-terms a:hover {
    background: #006483 !important;
    color: #ffffff !important;
}

/* Jurisdiction terms - distinct color */
.taxonomy-resource_jurisdiction .wp-block-post-terms a {
    background: #d0eaf1 !important;
    color: #006483 !important;
}

.taxonomy-resource_jurisdiction .wp-block-post-terms a:hover {
    background: #02779b !important;
    color: #ffffff !important;
}

/* View Resource Button */
a.resource-button,
.wp-block-button__link {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.75rem 1.5rem !important;
    background: #006483 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s ease !important;
    margin-top: auto !important; /* Stick to bottom of card */
    align-self: flex-start !important;
}

a.resource-button:hover,
.wp-block-button__link:hover {
    background: #02779b !important;
    transform: translateX(4px) !important;
}

/* Arrow icon for button */
a.resource-button::after,
.wp-block-button__link::after {
    content: "→" !important;
    margin-left: 0.5rem !important;
    transition: transform 0.2s ease !important;
}

a.resource-button:hover::after,
.wp-block-button__link:hover::after {
    transform: translateX(4px) !important;
}

/* Taxonomy Description Section */
.taxonomy-description {
    background: #f9fafb !important;
    border-left: 4px solid #006483 !important;
    padding: 1.5rem 2rem !important;
    margin: 0 0 3rem 0 !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    line-height: 1.7 !important;
    color: #374151 !important;
}

.taxonomy-description p {
    margin: 0 0 1rem 0 !important;
}

.taxonomy-description p:last-child {
    margin-bottom: 0 !important;
}
.term-description {
    background: #f9fafb;
    border-left: 4px solid #006483;
    padding: 1.5rem 2rem;
    margin: 0 0 3rem 0; /* Increase bottom margin */
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}
/* No Results Message */
.wp-block-query .wp-block-query-no-results {
    padding: 3rem 2rem !important;
    text-align: center !important;
    background: #f9fafb !important;
    border-radius: 8px !important;
    color: #6b7280 !important;
}

/* Pagination */
.wp-block-query-pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin: 3rem 0 !important;
    flex-wrap: wrap !important;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
    padding: 0.5rem 1rem !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
    color: #006483 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.wp-block-query-pagination a:hover {
    background: #006483 !important;
    color: #ffffff !important;
    border-color: #006483 !important;
}

.wp-block-query-pagination .current {
    background: #006483 !important;
    color: #ffffff !important;
    border-color: #006483 !important;
}
/* Related Topics */
.resource-related-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.resource-related-topics strong {
    color: #006483;
    margin-right: 0.5rem;
}

.related-topic-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e1e8f0;
    color: #006483;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    margin:2px;
}

.related-topic-tag:hover {
    background: #006483;
    color: #FFF;
}

/* Pagination */
.resource-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.resource-pagination ul {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.resource-pagination li {
    margin: 0;
}

.resource-pagination a,
.resource-pagination .current {
    display: block;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #006483;
    text-decoration: none;
    transition: all 0.2s ease;
}

.resource-pagination a:hover {
    background: #006483;
    color: #ffffff;
    border-color: #006483;
}

.resource-pagination .current {
    background: #006483;
    color: #ffffff;
    border-color: #006483;
    font-weight: 600;
}

/* Jurisdiction Filter Buttons */
.jurisdiction-filters {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.jurisdiction-filter {
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jurisdiction-filter:hover {
    border-color: #006483;
    color: #006483;
}

.jurisdiction-filter.active {
    background: #006483;
    border-color: #006483;
    color: #ffffff;
}
/* Hide filtered cards */
.resource-card.hidden-card {
    display: none !important;
}
/* Hide jurisdiction display in cards (still needed for filtering) */
.resource-jurisdiction {
    display: none !important;
}
/* Add space after resources, before footer */

/* Add border after the last row of resource cards */
.resource-cards-grid::after {
    content: '';
    grid-column: 1 / -1; /* Span all columns */
    border-bottom: 2px solid #e5e7eb;
    margin-top: 2rem;
    margin-bottom: 3rem;
}
/* Header flex layout fix: justify-content:space-between is normally set via
 * per-block CSS generated during FSE's two-pass render. In the PHP template
 * (taxonomy-resource_topic.php), block_template_part() runs after wp_head(),
 * so that per-block CSS never makes it to the page. */
header.wp-block-template-part > .wp-block-group > .wp-block-group.is-layout-flex {
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

/* Browse Topics page (/browse-topics/) — view toggle */
.browse-view-toggle {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
    flex-wrap: wrap;
}

.browse-view-btn {
    padding: 0.625rem 1.25rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browse-view-btn:hover {
    border-color: #006483;
    color: #006483;
}

.browse-view-btn.active {
    background: #006483;
    border-color: #006483;
    color: #ffffff;
}

/* Category view — two-column grid of sections */
.topic-categories-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 3rem;
    align-items: start;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .topic-categories-columns {
        grid-template-columns: 1fr;
    }
}

.topic-category-group {
    break-inside: avoid;
}

.topic-category-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid var(--wp--preset--color--primary, #BCC78F);
}

.topic-category-description {
    color: #4a5568;
    margin: 0.25rem 0 0.75rem;
    font-size: 0.875rem;
}

/* Compact topic list inside each category section */
.topic-category-topics {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.topic-category-topics li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.topic-category-topics li:last-child {
    border-bottom: none;
}

.topic-category-topics a {
    color: #006483;
    text-decoration: none;
    font-size: 0.9375rem;
}

.topic-category-topics a:hover {
    text-decoration: underline;
}

/* Browse Topics page (/browse-topics/) */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 4rem;
}

.topic-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #006483;
}

.topic-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.75rem;
}

.topic-card h2 a {
    color: #006483;
    text-decoration: none;
}

.topic-card h2 a:hover {
    text-decoration: underline;
}

.topic-card-description {
    font-size: 0.9375rem;
    color: #4a5568;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0 0 1rem;
}

.topic-card-count {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
}

/* Recommended CPLEA Resources section */
.cplea-recommended {
    background: #f9fafb;
    border-left: 4px solid #006483;
    border-radius: 4px;
    padding: 1.5rem 2rem;
    margin-bottom: 0;
}

/* Remove excess bottom space from the grid inside the CPLEA section */
.cplea-recommended .resource-cards-grid {
    margin-bottom: 0 !important;
}

.cplea-recommended .resource-cards-grid::after {
    display: none !important;
}

.cplea-recommended__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.25rem;
}

.cplea-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* Not Sure Where to Start shortcode — homepage */
.not-sure-section {
    margin: 2rem 0;
}

.not-sure-section__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.25rem;
}

.not-sure-section__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .not-sure-section__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.not-sure-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.not-sure-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #006483;
}

.not-sure-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.75rem;
}

.not-sure-card__desc {
    font-size: 0.9375rem;
    color: #4a5568;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0 0 1.25rem;
}

.not-sure-card__cta {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #006483;
}

/* Popular Resource Topics shortcode — homepage */
.popular-topics {
    margin: 2rem 0;
}

.popular-topics__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.25rem;
}

.popular-topics__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .popular-topics__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.popular-topic-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.popular-topic-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #006483;
}

.popular-topic-card__title a {
    color: #006483;
    text-decoration: none;
}

.popular-topic-card__title a:hover {
    color: #02779b;
    text-decoration: underline;
}

.popular-topic-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #006483;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.popular-topic-card__desc {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0 0 1rem;
}

.popular-topic-card__count {
    font-size: 1rem;
    color: #006483;
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
}

.popular-topic-card__count:hover {
    color: #02779b;
    text-decoration: underline;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.breadcrumb li + li::before {
    content: "›";
    margin-right: 0.25rem;
    color: #9ca3af;
}

.breadcrumb a {
    color: #006483;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: #6b7280;
}

/* Single resource page — card-style layout */
.single-resource-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.single-resource-card h1.wp-block-post-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1.25rem 0;
    color: #1a1a1a;
}

.single-resource-card h1.wp-block-post-title a {
    color: #006483;
    text-decoration: none;
}

.single-resource-card h1.wp-block-post-title a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 640px) {
    .wp-block-post {
        padding: 1.5rem !important;
    }
    
    h2.wp-block-post-title {
        font-size: 1.25rem !important; /* 20px on mobile */
    }
    
    .taxonomy-description {
        padding: 1rem 1.5rem !important;
    }
}
