/**
 * AC Faculty Blog — Listing Page Styles
 *
 * Visual design matched to Figma reference with accessibility adjustments:
 *   - Minimum font sizes increased from Figma's 11px to 13px+
 *   - Responsive typography with clamp()
 *   - Sufficient contrast ratios on overlays
 *   - All selectors scoped to .acfb-* prefix
 *
 * @package AC_Faculty_Blog
 */


/* ============================================================
   DESIGN TOKENS
   ============================================================ */

.acfb-wrapper,
#acfb-local-menu {
    --acfb-max-width:    min(1600px, calc(100% - 64px));
    --acfb-green:        #006341;
    --acfb-green-dark:   #004e33;
    --acfb-green-light:  #e6f0eb;
    --acfb-text:         #1a1a1a;
    --acfb-text-light:   #555555;
    --acfb-text-muted:   #888888;
    --acfb-date-color:   #717182;
    --acfb-border:       #e0e0e0;
    --acfb-bg-light:     #f7f7f7;
    --acfb-white:        #ffffff;
    --acfb-radius-card:  24px;
    --acfb-radius-hero:  32px;
    --acfb-radius-thumb: 8px;
    --acfb-radius-pill:  999px;
    --acfb-font:         'Metropolis', Arial, Helvetica, sans-serif;
}


/* ============================================================
   BASE
   ============================================================ */

.acfb-wrapper {
    font-family: var(--acfb-font);
    line-height: 1.6;
    color: var(--acfb-text);
    width: var(--acfb-max-width, min(1600px, calc(100% - 64px)));
    max-width: 1600px;
    margin-inline: auto;
}

@media (max-width: 768px) {
    .acfb-wrapper {
        width: calc(100% - 32px);
    }
}

.acfb-wrapper *,
.acfb-wrapper *::before,
.acfb-wrapper *::after {
    box-sizing: border-box;
}

.acfb-wrapper a {
    text-decoration: none;
    color: inherit;
}

.acfb-wrapper a:focus-visible {
    outline: 2px solid var(--acfb-green);
    outline-offset: 2px;
}



/* ============================================================
   HIDE PAGE TITLE
   Scoped to pages that contain the .acfb-wrapper shortcode output.
   Uses the Landing 2019 template's #landing-main-title and
   the main > .container structure.
   ============================================================ */

/* Faculty Blog Full Width Page Template */
.acfb-fullwidth-page-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.acfb-fullwidth-main {
    width: 100%;
    max-width: none;
    float: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.acfb-fullwidth-container {
    width: var(--acfb-max-width, min(1600px, calc(100% - 64px)));
    max-width: 1600px;
    margin-inline: auto;
    padding: 0;
}

@media (max-width: 768px) {
    .acfb-fullwidth-container {
        width: calc(100% - 32px);
    }
}

/* Landing 2019 & Full-Width page title when blog shortcode is present */
main:has(.acfb-wrapper) .container.landing-section-container h2#landing-main-title,
.acfb-fullwidth-main:has(.acfb-wrapper) .acfb-page-title,
.acfb-fullwidth-main:has(.acfb-wrapper) h1.entry-title {
    display: none !important;
}

/* Collapse the container gap around the hidden title */
main:has(.acfb-wrapper) > .container.landing-section-container,
.acfb-fullwidth-main:has(.acfb-wrapper) .acfb-fullwidth-container {
    max-width: 1600px !important;
    width: var(--acfb-max-width, min(1600px, calc(100% - 64px))) !important;
    margin-inline: auto !important;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 768px) {
    main:has(.acfb-wrapper) > .container.landing-section-container {
        width: calc(100% - 32px) !important;
    }
}

main:has(.acfb-wrapper) > .container.landing-section-container .col,
main:has(.acfb-wrapper) > .container.landing-section-container .col-md-8 {
    margin-bottom: 0;
    padding-left: 0;
    padding-right: 0;
}


/* ============================================================
   SECTION HEADER ROW  (title left, control right, divider below)
   ============================================================ */

.acfb-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
}

.acfb-header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.acfb-sort-wrapper {
    display: flex;
    align-items: center;
}

.acfb-screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.acfb-sort-select {
    min-width: 160px;
    min-height: 40px;
    padding: 10px 32px 10px 0;
    border: 0;
    border-bottom: 2px solid var(--acfb-border);
    border-radius: 0;
    background-color: transparent;
    color: var(--acfb-text);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23505050' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.acfb-sort-select:focus,
.acfb-sort-select:hover {
    border-bottom-color: var(--acfb-green);
    outline: none;
}

.acfb-sort-select:focus-visible {
    outline: 2px solid var(--acfb-green);
    outline-offset: 2px;
}

.acfb-section-title {
    flex: 0 1 auto;
    font-size: clamp(1.25rem, 2.5vw, 1.875rem);
    font-weight: 500;
    color: var(--acfb-green);
    margin: 0;
    line-height: 1.2;
}

/* Toggle filters button matching Featured Funds style */
.acfb-toggle-filters {
    display: none; /* Hidden on desktop by default */
    font-family: var(--acfb-font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--acfb-green);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.acfb-toggle-filters:hover,
.acfb-toggle-filters:focus {
    background-color: rgba(0, 99, 65, 0.08);
    outline: none;
}

@media (max-width: 768px) {
    .acfb-section-header-row {
        flex-wrap: wrap;
    }

    .acfb-header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .acfb-toggle-filters {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .acfb-sort-select {
        min-width: 140px;
    }

    .acfb-filter-chips.acfb-filters-hidden {
        display: none !important;
    }
}

.acfb-section-divider {
    margin-top: 10px;
}

.acfb-section-divider::after {
    content: '';
    display: block;
    height: 1px;
    background-color: var(--acfb-border);
}


/* ============================================================
   HERO SECTION
   ============================================================ */

.acfb-hero {
    margin-top: 24px;
}

.acfb-hero-card {
    position: relative;
    width: 100%;
    min-height: 500px;
    border-radius: var(--acfb-radius-hero);
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.acfb-hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

@media (max-width: 768px) {
    .acfb-hero-card {
        min-height: 492px;
    }
}

.acfb-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.78) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.08) 100%
    );
    border-radius: inherit;
}

.acfb-hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: 44px 40px;
}

.acfb-hero-category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
}

.acfb-hero-read {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-left: 6px;
    margin-bottom: 10px;
}

.acfb-hero-title {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
}

.acfb-hero-title a {
    color: var(--acfb-white);
}

.acfb-hero-title a:hover,
.acfb-hero-title a:focus {
    color: var(--acfb-white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.acfb-hero-excerpt {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 16px;
}

/* ── Hero arrow button ────────────────────────────────────────── */

.acfb-hero-arrow {
    position: absolute;
    bottom: 28px;
    right: 28px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--acfb-radius-pill);
    background-color: var(--acfb-green);
    color: var(--acfb-white);
    font-size: 0;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.acfb-hero-arrow::before {
    content: "\2192";
    font-size: 1.125rem;
    line-height: 1;
    color: var(--acfb-white) !important;
}

/* Force white color on the inner span/SVG in case of template changes or global overrides */
.acfb-hero-arrow span,
.acfb-hero-arrow svg,
.acfb-hero-arrow svg path,
.acfb-hero-arrow svg line,
.acfb-hero-arrow svg polyline {
    color: #FFFFFF !important;
    fill: #FFFFFF;
    stroke: #FFFFFF;
}

.acfb-hero-card:hover .acfb-hero-arrow,
.acfb-hero-arrow:hover {
    background-color: var(--acfb-green-dark);
    transform: translateX(2px);
}

.acfb-hero-arrow:focus-visible {
    background-color: var(--acfb-green-dark);
    outline: 2px solid var(--acfb-white);
    outline-offset: 3px;
    transform: translateX(2px);
}


/* ============================================================
   FILTER CHIPS — Horizontal button bar (matches Featured Funds)
   ============================================================ */

.acfb-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.acfb-chip {
    display: inline-flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #c2c2c2;
    color: #222222;
    padding: 11px 18px 11px 15px;
    border-radius: var(--acfb-radius-pill);
    font-size: 15.2px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: var(--acfb-font);
    line-height: 1;
    white-space: nowrap;
}

.acfb-chip:hover {
    background-color: #f8f8f8;
    border-color: #c2c2c2;
}

.acfb-chip:focus-visible {
    outline: 2px solid var(--acfb-green);
    outline-offset: 2px;
}

/* Active / selected chip */
.acfb-chip-active,
.acfb-chip-active:hover {
    background-color: #DAE5DF; /* Light muted green/grey */
    border-color: #DAE5DF;
    color: #222222;
}

/* The 'x' icon for active chips (matches Featured Funds) */
.acfb-chip-active::before {
    content: "\2715";
    font-size: 0.75rem;
    color: #717182;
    font-weight: bold;
    margin-right: 6px;
}


/* ============================================================
   ALL POSTS SECTION
   ============================================================ */

.acfb-allposts-section {
    padding: 36px 0 60px;
}

.acfb-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 28px;
    row-gap: 64px;
    margin-top: 20px;
}

.acfb-loadmore-wrap {
    text-align: center;
    margin-top: 48px;
}


/* ============================================================
   POST CARD — All Posts Grid
   ============================================================ */

.acfb-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--acfb-radius-card);
    overflow: hidden;
}

.acfb-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Card image with overlay ──────────────────────────────────── */

.acfb-card-image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--acfb-radius-card);
}

.acfb-card-image {
    width: 100%;
    height: 0;
    padding-bottom: 68%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #e1e1e1;
}

.acfb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Overlay: covers bottom of image with gradient */
.acfb-card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 12px 16px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.45) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

/* Left-side text group: stacked vertically (read time on top, category below) */
.acfb-card-overlay-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: calc(100% - 44px); /* leave room for arrow circle */
}

.acfb-card-overlay-read {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.acfb-card-overlay-cat {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
}

/* ── Arrow pill button on card image (matches Featured Funds CTA) ─ */

.acfb-card-arrow {
    position: absolute;
    bottom: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--acfb-radius-pill);
    background: var(--acfb-green);
    color: var(--acfb-white);
    font-size: 0;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.acfb-card-arrow::before {
    content: "\2192";
    font-size: 1.125rem;
    line-height: 1;
}

.acfb-card:hover .acfb-card-arrow {
    background: var(--acfb-green-dark);
    transform: translateX(2px);
}

.acfb-card-arrow:focus-visible {
    background: var(--acfb-green-dark);
    outline: 2px solid var(--acfb-white);
    outline-offset: 2px;
    transform: translateX(2px);
}

/* ── Card body ────────────────────────────────────────────────── */

.acfb-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 4px 4px;
}

/* Post date */
.acfb-card-date {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--acfb-date-color);
    line-height: 1.4;
    margin-bottom: 4px;
}

.acfb-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--acfb-text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.acfb-card-excerpt {
    font-size: 0.875rem;
    color: var(--acfb-text-light);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.acfb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 11px 32px;
    border-radius: 28px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
}

.acfb-btn:active {
    transform: scale(0.97);
}

.acfb-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.acfb-btn:focus-visible {
    outline: 2px solid var(--acfb-green);
    outline-offset: 2px;
}

/* Green outlined pill */
.acfb-btn-outline {
    background-color: transparent;
    color: var(--acfb-green);
    border: 2px solid var(--acfb-green);
}

.acfb-btn-outline:hover,
.acfb-btn-outline:focus {
    background-color: var(--acfb-green);
    color: var(--acfb-white);
}


/* ============================================================
   NO POSTS MESSAGE
   ============================================================ */

.acfb-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--acfb-text-muted);
    font-size: 1rem;
    font-style: italic;
}


/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */

@media (max-width: 1024px) {
    .acfb-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 48px;
    }

    .acfb-hero-card {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .acfb-hero-card {
        min-height: 340px;
    }

    .acfb-hero-content {
        padding: 28px 24px;
    }

    .acfb-hero-title {
        font-size: 1.35rem;
    }

    .acfb-hero-arrow {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    .acfb-filter-chips {
        gap: 8px;
    }

    .acfb-chip {
        font-size: 0.875rem;
        padding: 7px 12px;
        min-height: 32px;
    }
}


/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 600px) {

    .acfb-posts-grid {
        grid-template-columns: 1fr;
        row-gap: 36px;
    }

    .acfb-section-header-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .acfb-hero-card {
        min-height: 492px;
        border-radius: var(--acfb-radius-card);
    }

    .acfb-hero-content {
        padding: 20px 18px;
    }

    .acfb-hero-excerpt {
        font-size: 0.875rem;
    }

    .acfb-hero-arrow {
        width: 36px;
        height: 36px;
        bottom: 16px;
        right: 16px;
        font-size: 1rem;
    }

    .acfb-filter-chips {
        gap: 6px;
    }

    .acfb-chip {
        font-size: 0.8125rem;
        padding: 6px 10px;
    }
}
