@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ============================================================
   Avada Page Title Override — targets the theme-rendered h1
   on taxonomy archive and resource archive pages
   ============================================================ */
body.tax-subject-area h1,
body.tax-subject-area .page-title,
body.tax-subject-area .fusion-page-title-bar h1,
body.tax-program-level h1,
body.tax-program-level .page-title,
body.tax-program-level .fusion-page-title-bar h1,
body.tax-material-type h1,
body.tax-material-type .page-title,
body.tax-material-type .fusion-page-title-bar h1,
body.post-type-archive-rsc_resources h1,
body.post-type-archive-rsc_resources .page-title,
body.post-type-archive-rsc_resources .fusion-page-title-bar h1 {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif !important;
    font-size: 40px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    border-bottom: 3px solid #005480 !important;
    padding-bottom: 16px !important;
    margin-bottom: 24px !important;
}

@media ( max-width: 640px ) {
    body.tax-subject-area h1,
    body.tax-program-level h1,
    body.tax-material-type h1,
    body.post-type-archive-rsc_resources h1 {
        font-size: 28px !important;
    }
}



/* Outer wrapper */
#coabe-resource-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.coabe-archive-inner {
    background: #fff;
    padding: 10px 0;
}

/* ============================================================
   Page Header
   ============================================================ */
.coabe-archive-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.coabe-archive-label {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coabe-archive-title {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 40px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    border-bottom: 3px solid #005480;
    padding-bottom: 16px;
}

/* ============================================================
   Resource List
   ============================================================ */
.coabe-resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Individual Resource Item
   ============================================================ */
.coabe-resource-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    gap: 20px;
}

.coabe-resource-item:last-child {
    border-bottom: none;
}

/* ============================================================
   Thumbnail
   ============================================================ */
.coabe-item-image {
    flex-shrink: 0;
    width: 225px;
}

.coabe-item-image img {
    display: block;
    width: 225px;
    height: 225px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.coabe-item-image a:hover img {
    opacity: 0.88;
    transition: opacity 0.2s ease;
}

/* ============================================================
   Content (right of image)
   ============================================================ */
.coabe-item-content {
    flex: 1;
    min-width: 0;
}

/* Title */
.coabe-item-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: #222;
}

.coabe-item-title a {
    color: #2a7ae2;
    text-decoration: none;
}

.coabe-item-title a:hover {
    text-decoration: underline;
    color: #1a5fbf;
}

/* Excerpt */
.coabe-item-excerpt {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 17px;
    color: #000;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

/* ============================================================
   Metadata rows
   ============================================================ */
.coabe-item-meta {
    margin-bottom: 12px;
}

.coabe-item-meta-row {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 17px;
    color: #000;
    padding: 2px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.coabe-item-meta-label {
    font-weight: 700;
    color: #000;
    min-width: 120px;
    flex-shrink: 0;
}

.coabe-item-meta-value {
    color: #000;
    flex: 1;
}

/* ============================================================
   Download Link
   ============================================================ */
.coabe-item-download {
    margin-top: 10px;
}

.coabe-item-download-link {
    display: inline-block;
    background-color: #005480;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    padding: 10px 22px;
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.coabe-item-download-link:hover {
    background-color: #15BFF1;
    color: #E2E0DF !important;
    text-decoration: none;
}

/* ============================================================
   No Results
   ============================================================ */
.coabe-no-results {
    padding: 30px 0;
    font-size: 16px;
    color: #666;
    text-align: center;
}

/* ============================================================
   Pagination
   ============================================================ */
.coabe-archive-pagination {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.coabe-archive-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    color: #2a7ae2;
    text-decoration: none;
    background: #fff;
    transition: background-color 0.2s ease;
}

.coabe-archive-pagination .page-numbers:hover,
.coabe-archive-pagination .page-numbers.current {
    background-color: #2a7ae2;
    color: #fff;
    border-color: #2a7ae2;
}

.coabe-archive-pagination .page-numbers.dots {
    border: none;
    background: none;
    color: #666;
}

/* ============================================================
   Post Card Grid Card  — .coabe-pc-card
   Used by the [coabe_resource_card] shortcode inside Avada
   Post Cards. Vertical layout designed to fill the column
   Avada provides; Avada handles all grid/spacing/columns.
   ============================================================ */

.coabe-pc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Source Serif 4', Georgia, serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.coabe-pc-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Image */
.coabe-pc-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f4f7;
    flex-shrink: 0;
}

.coabe-pc-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.coabe-pc-card:hover .coabe-pc-img {
    transform: scale(1.04);
}

/* Body */
.coabe-pc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
    gap: 6px;
}

/* Material type badge */
.coabe-pc-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #005480;
    background: #e8f4fb;
    border-radius: 3px;
    padding: 3px 8px;
    align-self: flex-start;
}

/* Title */
.coabe-pc-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0 0;
    color: #1a1a1a;
}

.coabe-pc-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.coabe-pc-title a:hover {
    color: #005480;
    text-decoration: underline;
}

/* Author */
.coabe-pc-author {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

/* Subject area tag */
.coabe-pc-subject {
    display: inline-block;
    font-size: 12px;
    color: #555;
    background: #f5f5f5;
    border-radius: 3px;
    padding: 3px 8px;
    align-self: flex-start;
}

/* Footer / button — pushed to bottom */
.coabe-pc-footer {
    margin-top: auto;
    padding-top: 12px;
}

.coabe-pc-btn {
    display: inline-block;
    background-color: #005480;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.coabe-pc-btn:hover {
    background-color: #15BFF1;
    color: #fff !important;
}

.coabe-pc-btn--login {
    background-color: #888;
}

.coabe-pc-btn--login:hover {
    background-color: #555;
}

/* ============================================================
   Responsive
   ============================================================ */
@media ( max-width: 640px ) {

    .coabe-resource-item {
        flex-direction: column;
        gap: 12px;
    }

    .coabe-item-image {
        width: 100%;
    }

    .coabe-item-image img {
        width: 100%;
        height: auto;
        max-width: 225px;
    }

    .coabe-item-title {
        font-size: 16px;
    }

    .coabe-item-meta-row {
        flex-direction: column;
        gap: 0;
    }

    .coabe-item-meta-label {
        min-width: auto;
    }
}

/* ============================================================
   [coabe_resources_grid] — self-contained resource grid
   ============================================================ */

.coabe-grid {
    display: grid;
    gap: 28px;
    width: 100%;
}

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

/* Card */
.coabe-grid-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.coabe-grid-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* Image */
.coabe-grid-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f4f7;
    flex-shrink: 0;
}

.coabe-grid-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.coabe-grid-card:hover .coabe-grid-img {
    transform: scale(1.04);
}

/* Body */
.coabe-grid-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
    gap: 6px;
}

/* Title */
.coabe-grid-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 2px;
    color: #1a1a1a;
}

.coabe-grid-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.coabe-grid-title a:hover {
    color: #005480;
    text-decoration: underline;
}

/* Author */
.coabe-grid-author {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

/* Subject area tag */
.coabe-grid-subject {
    display: inline-block;
    font-size: 12px;
    color: #005480;
    background: #e8f4fb;
    border-radius: 3px;
    padding: 3px 8px;
    align-self: flex-start;
    font-weight: 600;
}

/* Footer / button */
.coabe-grid-footer {
    margin-top: auto;
    padding-top: 14px;
}

.coabe-grid-btn {
    display: inline-block;
    background-color: #005480;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    padding: 9px 18px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.coabe-grid-btn:hover {
    background-color: #15BFF1;
    color: #fff !important;
}

.coabe-grid-btn--login {
    background-color: #888;
}

.coabe-grid-btn--login:hover {
    background-color: #555;
}

/* Empty state */
.coabe-grid-empty {
    color: #888;
    font-size: 15px;
    padding: 20px 0;
}

/* Responsive */
@media ( max-width: 900px ) {
    .coabe-grid--cols-3,
    .coabe-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 580px ) {
    .coabe-grid--cols-2,
    .coabe-grid--cols-3,
    .coabe-grid--cols-4 { grid-template-columns: 1fr; }
}

/* Force title size — overrides Avada global h3 styles */
.coabe-grid .coabe-grid-card .coabe-grid-body .coabe-grid-title,
.coabe-grid .coabe-grid-card .coabe-grid-body h3.coabe-grid-title {
    font-size: 24px !important;
    line-height: 1.4 !important;
    margin: 0 0 2px !important;
}
