/* ==========================================================================
   Resources page — sections, rows, tabs, sidebar, and the search/filter UI.

   Brand colors are hardcoded here (not the Tailwind `primary-*`/`secondary-*`
   utility classes) because only a handful of `primary-*` shades are actually
   overridden to green in header.php's inline <style> block — any other
   `primary-*` class silently falls back to tailwind.config.js's real
   "primary" color, which is blue. Using the exact hexes here avoids that
   trap entirely. Green = Publications/downloads, purple = Gallery, per spec.
   ========================================================================== */

.resources-page {
    --ry-green-50: #f7fee7;
    --ry-green-100: #ecfccb;
    --ry-green-200: #d9f99d;
    --ry-green-600: #65a30d;
    --ry-green-700: #4d7c0f;
    --ry-green-800: #3f6212;
    --ry-purple-50: #faf5ff;
    --ry-purple-100: #f3e8ff;
    --ry-purple-600: #9333ea;
    --ry-purple-700: #7e22ce;
    --ry-ink: #1f2937;
    --ry-body: #374151;
    --ry-muted: #6b7280;
    --ry-hairline: #e5e7eb;
}

.resources-page .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.resources-page :focus-visible {
    outline: 2px solid var(--ry-green-600);
    outline-offset: 2px;
}

/* ---------- Header row: title/subtitle + search ---------- */
.resources-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.resources-search {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.resources-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ry-muted);
    font-size: .85rem;
    pointer-events: none;
}

.resources-search__input {
    width: 100%;
    min-height: 44px;
    padding: .6rem .9rem .6rem 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    font: inherit;
    color: var(--ry-ink);
}

.resources-search__input:focus {
    outline: none;
    border-color: var(--ry-green-600);
    box-shadow: 0 0 0 2px var(--ry-green-100);
}

/* ---------- Filter tabs ---------- */
.resource-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    border-bottom: 1px solid var(--ry-hairline);
    margin-bottom: 2.5rem;
    overflow-x: auto;
}

.resource-tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    color: var(--ry-muted);
    padding: .75rem .1rem;
    min-height: 44px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s ease, border-color .2s ease;
}

.resource-tab:hover {
    color: var(--ry-ink);
}

.resource-tab.is-active {
    color: var(--ry-green-700);
    border-bottom-color: var(--ry-green-600);
}

.resource-tab__count {
    font-variant-numeric: tabular-nums;
}

/* ---------- Main layout ---------- */
.resources-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .resources-layout {
        grid-template-columns: 2fr 1fr;
        gap: 3.5rem;
    }
}

.resources-main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* ---------- Sections ---------- */
.resource-section__head {
    margin-bottom: .35rem;
}

.resource-section__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ry-ink);
}

.resource-section__count {
    font-weight: 500;
    color: var(--ry-muted);
    font-variant-numeric: tabular-nums;
}

.resource-section__desc {
    color: var(--ry-muted);
    font-size: .95rem;
    margin-bottom: .5rem;
}

.resource-section__note {
    font-size: .85rem;
    color: var(--ry-green-700);
    font-style: italic;
    margin-bottom: 1rem;
}

.resource-section__notice {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: #f9fafb;
    border: 1px solid var(--ry-hairline);
    border-radius: .5rem;
    padding: .85rem 1rem;
    margin: .75rem 0 1.25rem;
    font-size: .85rem;
    color: var(--ry-body);
    line-height: 1.5;
}

.resource-section__notice i {
    color: var(--ry-green-600);
    margin-top: .15rem;
}

.resource-section__notice p {
    margin: 0;
}

/* ---------- Resource rows ---------- */
.resource-section__empty {
    color: var(--ry-muted);
    font-size: .875rem;
    font-style: italic;
    padding: .75rem 0;
    border-top: 1px solid var(--ry-hairline);
}

.resource-list {
    border-top: 1px solid var(--ry-hairline);
}

.resource-list:empty {
    border-top: none;
}

.resource-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem .5rem;
    border-bottom: 1px solid var(--ry-hairline);
    transition: background-color .2s ease;
}

.resource-row:hover {
    background: #fafbf7;
}

.resource-row.is-hidden {
    display: none;
}

.resource-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid #d1d5db;
    border-radius: .35rem;
    padding: .25rem .5rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--ry-muted);
    margin-top: .15rem;
}

.resource-row__body {
    flex: 1 1 auto;
    min-width: 0;
}

.resource-row__title {
    font-weight: 700;
    color: var(--ry-ink);
    margin: 0 0 .2rem;
}

.resource-row__desc {
    font-size: .875rem;
    color: var(--ry-body);
    margin: 0 0 .3rem;
}

.resource-row__meta {
    font-size: .75rem;
    color: var(--ry-muted);
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.resource-row__dataset {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    color: var(--ry-green-700);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: .35rem;
}

.resource-row__action {
    flex: 0 0 auto;
    padding-top: .1rem;
}

/* ---------- Buttons + chips ---------- */
.btn-resource {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 44px;
    padding: .5rem 1.1rem;
    border-radius: .5rem;
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
}

.btn-resource:active {
    transform: translateY(1px);
}

.btn-resource--download {
    background: var(--ry-green-600);
    color: #fff;
}

.btn-resource--download:hover {
    background: var(--ry-green-700);
}

.btn-resource__size {
    font-weight: 500;
    opacity: .85;
}

.btn-resource--apply {
    background: #fff;
    color: var(--ry-green-700);
    border-color: var(--ry-green-600);
}

.btn-resource--apply:hover {
    background: var(--ry-green-50);
}

.btn-resource--gallery {
    width: 100%;
    background: var(--ry-purple-600);
    color: #fff;
}

.btn-resource--gallery:hover {
    background: var(--ry-purple-700);
}

.chip-coming-soon {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem .9rem;
    border-radius: .5rem;
    background: #f3f4f6;
    color: #4b5563; /* gray-600 on gray-100: ~7.6:1 contrast, well past 4.5:1 */
    font-size: .8rem;
    font-weight: 600;
}

/* ---------- Sidebar ---------- */
.resources-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    border: 1px solid var(--ry-hairline);
    border-radius: .75rem;
    padding: 1.5rem;
    background: #fff;
}

.sidebar-card--gallery {
    background: var(--ry-purple-50);
    border-color: var(--ry-purple-100);
    text-align: center;
}

.sidebar-card__icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto .75rem;
    border-radius: 999px;
    background: var(--ry-purple-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.sidebar-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ry-ink);
    margin-bottom: .5rem;
}

.sidebar-card__text {
    font-size: .85rem;
    color: var(--ry-body);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.sidebar-card__meta {
    font-size: .8rem;
    color: var(--ry-muted);
    margin-top: .75rem;
    text-align: center;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.newsletter-form__input {
    min-height: 44px;
    padding: .5rem .8rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    font: inherit;
}

.newsletter-form__input:focus {
    outline: none;
    border-color: var(--ry-green-600);
    box-shadow: 0 0 0 2px var(--ry-green-100);
}

.deadline-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.deadline-list__item {
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--ry-hairline);
}

.deadline-list__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.deadline-list__title {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ry-ink);
    margin-bottom: .15rem;
}

.deadline-list__meta {
    display: block;
    font-size: .75rem;
    color: var(--ry-green-700);
    font-variant-numeric: tabular-nums;
}

/* ---------- Empty state ---------- */
.resources-empty {
    text-align: center;
    color: var(--ry-muted);
    font-size: .95rem;
    padding: 2rem 0;
}

.resources-empty.is-hidden {
    display: none;
}

.resource-section.is-hidden {
    display: none;
}

/* ---------- Fade-up on load (JS-gated so content never hides without JS) --- */
.has-js .reveal-up {
    opacity: 0;
    transform: translateY(16px);
}

.has-js .reveal-up.is-in {
    opacity: 1;
    transform: none;
    transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1);
}

@media (max-width: 640px) {
    .resources-search {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .has-js .reveal-up {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .btn-resource,
    .resource-tab,
    .resource-row {
        transition: none !important;
    }
    .btn-resource:active {
        transform: none !important;
    }
}
