/* ==========================================================================
   Minimalist editorial style - no card boxes, hairline dividers,
   restrained type, quiet accents. Uses the site's brand vars with fallbacks.
   ========================================================================== */

.ac-grid {
    display: grid;
    gap: 40px 32px;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 0 1em;
}
.ac-columns-1 { grid-template-columns: 1fr; }
.ac-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ac-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ac-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .ac-grid:not(.ac-columns-1) { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
    .ac-grid { grid-template-columns: 1fr !important; }
}

/* Labeled sections when publications are grouped by category (e.g.
   Journals, Articles, Newsletters) - matches the same quiet editorial
   style as the rest of this plugin, just a hairline rule under each
   section's name rather than a heavy heading treatment. */
.ac-pub-section { margin-bottom: 56px; }
.ac-pub-section:last-child { margin-bottom: 0; }
.ac-pub-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--assoc-text, #1c1c1a);
    margin: 0 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--assoc-primary, #008751);
}

.ac-card {
    background: none;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.ac-card-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

.ac-card-cta {
    margin-top: 14px;
    align-self: flex-start;
}

.ac-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background: var(--assoc-primary, #008751);
    margin-bottom: 18px;
}
.ac-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ac-card:hover .ac-card-image img { transform: scale(1.03); }

.ac-pub-icon { display: flex; align-items: center; justify-content: center; background: var(--assoc-paper-deep, #f2f3ef); }
.ac-pub-icon span {
    color: var(--assoc-primary, #008751);
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    border: 1.5px solid var(--assoc-primary, #008751);
    border-radius: 3px;
    padding: 4px 10px;
}

.ac-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Quiet dot-marker label instead of a filled pill */
.ac-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
    margin-bottom: 10px;
    align-self: flex-start;
    background: none;
    padding: 0;
    color: var(--assoc-text-muted, #6e7573);
}
.ac-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.ac-badge-event { color: var(--assoc-primary, #008751); }
.ac-badge-event::before { background: var(--assoc-accent, #C6D62E); }
.ac-badge-news::before { background: var(--assoc-text-muted, #6e7573); }

.ac-card-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--assoc-text, #1c1c1a);
    transition: color 0.15s ease;
}
.ac-card:hover .ac-card-title { color: var(--assoc-primary, #008751); }

.ac-meta {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: var(--assoc-text-muted, #6e7573);
    letter-spacing: 0.01em;
}

.ac-excerpt {
    margin: 0 0 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--assoc-text-muted, #6e7573);
    flex-grow: 1;
}

/* Understated text-link style instead of a solid button */
.ac-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 0 0 2px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1.5px solid currentColor;
}
.ac-btn-primary {
    background: none;
    color: var(--assoc-primary, #008751);
}
.ac-btn-primary:hover { color: var(--assoc-text, #1c1c1a); }

.ac-btn-secondary {
    background: none;
    color: var(--assoc-text-muted, #6e7573);
}
.ac-btn-secondary:hover { color: var(--assoc-text, #1c1c1a); }

.ac-pub-actions { display: flex; gap: 18px; flex-wrap: wrap; }

.ac-empty {
    color: var(--assoc-text-muted, #6e7573);
    text-align: center;
    font-size: 0.95rem;
    padding: 20px 0;
}

/* ---------------- Media wall ---------------- */
.ac-media-wall {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, 1fr);
}
.ac-media-wall.ac-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ac-media-wall.ac-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ac-media-wall.ac-columns-4 { grid-template-columns: repeat(4, 1fr); }
.ac-media-wall.ac-columns-5 { grid-template-columns: repeat(5, 1fr); }
.ac-media-wall.ac-columns-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 700px) {
    .ac-media-wall { grid-template-columns: repeat(2, 1fr) !important; }
}

.ac-media-item {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 2px;
}
.ac-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.15s ease;
}
.ac-media-item:hover img { transform: scale(1.04); opacity: 0.92; }

/* ---------------- Lightbox (created dynamically by JS) ---------------- */
.ac-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20,20,18,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    padding: 24px;
}
.ac-lightbox.is-open { display: flex; }
.ac-lightbox img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 2px; }
.ac-lightbox-caption { color: rgba(255,255,255,0.75); margin-top: 16px; font-size: 0.9rem; letter-spacing: 0.01em; }
.ac-lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}
.ac-lightbox-close:hover { color: #ffffff; }

/* ---------------- Carousel layout (News & Events, when layout="carousel") ---------------- */
.ac-carousel { position: relative; }
.ac-carousel-track {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ac-carousel-track::-webkit-scrollbar { display: none; }

.ac-carousel-item {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

.ac-carousel-arrow {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--assoc-primary, #008751);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.ac-carousel-arrow:hover { background: var(--assoc-primary, #008751); color: #fff; }
.ac-carousel-prev { left: -6px; }
.ac-carousel-next { right: -6px; }

@media (max-width: 600px) {
    .ac-carousel-item { width: 240px; }
    .ac-carousel-arrow { width: 32px; height: 32px; font-size: 1.1rem; }
}

/* ---------------- Event registration + payment panel (single event page) ---------------- */
.ac-event-register-panel {
    background: var(--assoc-paper-deep, #f2f3ef);
    border-radius: 8px;
    padding: 28px 32px;
    margin: 32px 0;
}
.ac-event-register-panel h3 { margin: 0 0 6px; color: var(--assoc-text, #1c1c1a); }
.ac-event-form p { margin: 0 0 14px; }
.ac-event-form label { display: block; font-weight: 600; font-size: 0.88rem; color: var(--assoc-text, #1c1c1a); margin-bottom: 4px; }
.ac-event-form input[type="text"],
.ac-event-form input[type="email"] {
    width: 100%;
    max-width: 360px;
    padding: 10px 12px;
    border: 1px solid var(--assoc-line, #dcdfd9);
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.ac-event-form-message { margin-top: 10px; font-size: 0.88rem; }
.ac-event-form-message.ac-form-error { color: #9c2b2b; }

@media (max-width: 500px) {
    .ac-event-register-panel { padding: 22px 20px; }
}

/* ---------------- Simple alert banners (used on the single event page) ---------------- */
.ac-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 0.92rem;
}
.ac-alert-success { background: #e6f4ea; color: #1a5d3a; border: 1px solid #b7dfc4; }
.ac-alert-error { background: #fdecec; color: #9c2b2b; border: 1px solid #f3c1c1; }

/* ---------------- Timeline layout (date left, body middle, image far right) ---------------- */
.ac-timeline { display: flex; flex-direction: column; }

.ac-timeline-month-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--assoc-text, #1c1c1a);
    margin: 36px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--assoc-primary, #008751);
}
.ac-timeline > .ac-timeline-month-heading:first-child { margin-top: 0; }

.ac-timeline-row {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 28px 0;
    border-bottom: 1px solid var(--assoc-line, #e4e6e2);

    /* Ease-in scroll reveal - starts hidden/offset, animates in via .is-visible */
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.ac-timeline-row.is-visible { opacity: 1; transform: translateY(0); }
.ac-timeline-row:last-child { border-bottom: none; }

.ac-timeline-date {
    flex: 0 0 64px;
    text-align: center;
    padding-top: 2px;
}
.ac-timeline-mon {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--assoc-primary, #008751);
}
.ac-timeline-day {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--assoc-text, #1c1c1a);
    line-height: 1.1;
}

.ac-timeline-body { flex: 1 1 auto; min-width: 0; }
.ac-timeline-title { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.35; }
.ac-timeline-title a { color: var(--assoc-text, #1c1c1a); }
.ac-timeline-title a:hover { color: var(--assoc-primary, #008751); }
.ac-timeline-excerpt { margin: 8px 0; font-size: 0.92rem; color: var(--assoc-text-muted, #6e7573); }
.ac-timeline-link { color: var(--assoc-primary, #008751); font-weight: 600; font-size: 0.9rem; }
.ac-timeline-link:hover { color: var(--assoc-text, #1c1c1a); }

/* Featured image sits at the far right of the row, fixed width */
.ac-timeline-image {
    flex: 0 0 220px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    display: block;
}
.ac-timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.ac-timeline-image:hover img { transform: scale(1.04); }

@media (max-width: 780px) {
    .ac-timeline-row { flex-wrap: wrap; gap: 16px; }
    .ac-timeline-date { flex: 0 0 auto; text-align: left; display: flex; align-items: baseline; gap: 8px; }
    .ac-timeline-body { flex: 1 1 100%; order: 2; }
    .ac-timeline-image { flex: 0 0 100%; order: 1; aspect-ratio: 16/9; }
}

/* Bank transfer section inside the event registration form (the account /
   panel styling itself comes from the Member Portal's stylesheet). */
.ac-pay-block { margin: 18px 0 20px; padding-top: 16px; border-top: 1px solid var(--assoc-line, #e4e6e2); }
.ac-pay-heading { margin: 0 0 12px; font-size: 1rem; }
