/* ==========================================================================
   association.css - "Association" page
   All colors come from colors.css (load that first).
   ========================================================================== */

/* ========== Theme fix ========== */
/* GeneratePress wraps every group in an inner container with 40px padding.
   Nested groups stack that padding (that's what squeezed the timeline), so
   let the children of our own groups sit directly in the group instead. */

.entry-content {
    margin-top: 0!important;
}

.ass-section > .wp-block-group__inner-container,
.ass-timeline > .wp-block-group__inner-container,
.tl-item > .wp-block-group__inner-container,
.tl-body > .wp-block-group__inner-container {
    display: contents;
}

/* ========== Shared section shell ========== */
.entry-content > .ass-section {
    max-width: 1100px;
    margin: clamp(28px, 4vw, 44px) auto 0 !important;
    padding-inline: clamp(16px, 5vw, 48px);
    box-sizing: border-box;
}

/* small uppercase label above a title */
.section-eyebrow {
    margin: 0 0 6px !important;
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* section titles with the short red bar under them */
.section-title {
    margin: 0 !important;
    text-align: center;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 3px;
    background: var(--color-primary);
}

.section-title.is-left {
    text-align: left;
}

.section-title.is-left::after {
    margin-left: 0;
}

.section-lead {
    max-width: 58ch;
    margin: 14px auto clamp(22px, 3vw, 30px) !important;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: clamp(1rem, 1.9vw, 1.08rem);
    line-height: 1.7;
}

/* ========== Buttons (hero + join) ========== */
.entry-content .wp-block-buttons {
    gap: 12px;
}

.entry-content .wp-block-button.is-primary .wp-block-button__link,
.entry-content .wp-block-button.is-ghost .wp-block-button__link {
    padding: 11px 24px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.entry-content .wp-block-button.is-primary .wp-block-button__link {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border: 2px solid var(--color-primary);
}

.entry-content .wp-block-button.is-primary .wp-block-button__link:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.entry-content .wp-block-button.is-ghost .wp-block-button__link {
    background: transparent;
    color: var(--color-white);
    border: 2px solid color-mix(in srgb, var(--color-white) 70%, transparent);
}

.entry-content .wp-block-button.is-ghost .wp-block-button__link:hover {
    background: color-mix(in srgb, var(--color-white) 15%, transparent);
    border-color: var(--color-white);
}

/* ========== Hero ========== */
.entry-content > .wp-block-cover:first-child {
    min-height: clamp(300px, 46vh, 460px) !important;
    /* same left inset as the homepage hero - keep these two in sync */
    padding-inline: clamp(20px, 8vw, 96px) !important;
}

/* dark fade from the left so the white text stays readable */
.entry-content > .wp-block-cover:first-child .wp-block-cover__background {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-text-primary) 62%, transparent) 0%,
        color-mix(in srgb, var(--color-text-primary) 25%, transparent) 60%,
        transparent 100%
    ) !important;
    opacity: 1 !important;
}

.entry-content > .wp-block-cover:first-child .wp-block-cover__inner-container {
    max-width: 560px;
    margin: 0 !important;
}

.entry-content > .wp-block-cover:first-child .wp-block-cover__inner-container > * {
    max-width: none;
    margin-left: 0 !important;
}

.hero-eyebrow {
    display: inline-block;
    margin: 0 0 14px !important;
    padding: 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-white) 18%, transparent);
    color: var(--color-white);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 10px !important;
    font-size: clamp(2.2rem, 6.5vw, 3.4rem) !important;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: var(--color-white);
}

.hero-sub {
    max-width: 40ch;
    margin: 0 0 24px !important;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    line-height: 1.6;
    color: var(--color-white);
    opacity: 0.92;
}

/* ========== Who we are ========== */
.ass-intro-cols {
    gap: clamp(28px, 6vw, 64px) !important;
    align-items: center !important;
    margin: 0 !important;
}

.ass-intro-text .section-title {
    margin-bottom: 22px !important;
}

.ass-intro-text p:not(.section-eyebrow) {
    margin: 0 0 14px;
    color: var(--color-text-secondary);
    font-size: clamp(0.98rem, 1.8vw, 1.04rem);
    line-height: 1.8;
}

.ass-intro-text p a {
    color: var(--color-primary) !important;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--color-primary-border);
    transition: border-color 0.15s ease;
}

.ass-intro-text p a:hover {
    border-bottom-color: var(--color-primary);
}

.ass-intro-media {
    position: relative;
}

.intro-photo {
    margin: 0 !important;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card-hover);
    background: linear-gradient(145deg, var(--color-avatar-bg-start), var(--color-avatar-bg-end));
    transform: rotate(1.5deg);
}

.intro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 25%;
}

/* little floating note on the photo */
.intro-note {
    position: absolute;
    left: -14px;
    bottom: 22px;
    margin: 0 !important;
    padding: 12px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--color-text-secondary);
    font-size: 0.88rem;
    transform: rotate(-2deg);
}

.intro-note strong {
    display: block;
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* ========== What we do ========== */
.entry-content > .ass-activities {
    max-width: none;
    padding-block: clamp(32px, 5vw, 48px);
    padding-inline: max(clamp(16px, 5vw, 48px), calc((100% - 1100px) / 2 + 48px));
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--color-surface-secondary) 22%,
        var(--color-surface-secondary) 78%,
        transparent 100%
    );
}

.ass-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: clamp(14px, 2.5vw, 20px) !important;
    margin: 0 !important;
}

.ass-card {
    margin: 0 !important;
    padding: 22px 22px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ass-card::before {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin-bottom: 14px;
    border-radius: 3px;
    background: var(--color-primary);
    opacity: 0.75;
}

.ass-card .card-title {
    margin: 0 0 8px !important;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.ass-card p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* ========== History timeline ========== */
.ass-timeline {
    position: relative;
    display: grid;
    gap: clamp(18px, 3vw, 26px);
    margin: 0 !important;
    padding-left: 34px;
}

/* the vertical line */
.ass-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--color-primary-border), var(--color-border));
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(200px, 320px) 1fr;
    gap: clamp(16px, 3vw, 26px);
    align-items: center;
    margin: 0 !important;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tl-item .tl-photo,
.tl-body p,
.tl-body h3 {
    margin: 0 !important;
}

/* dot on the line */
.tl-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 26px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 3px solid var(--color-primary);
    box-sizing: border-box;
}

.tl-photo {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--color-avatar-bg-start), var(--color-avatar-bg-end));
}

.tl-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tl-body {
    padding: 6px 14px 6px 0;
}

.tl-year {
    display: inline-block;
    margin-bottom: 8px !important;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.tl-title {
    margin-bottom: 6px !important;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.tl-body p:not(.tl-year) {
    color: var(--color-text-secondary);
    font-size: 0.96rem;
    line-height: 1.7;
}

/* ========== Board ========== */
.ass-cols {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: clamp(14px, 3vw, 22px) !important;
    margin: 0 !important;
}

.board-member-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 !important;
    padding: 28px 20px 24px;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* faded red line at the bottom on hover (same as member-directory cards) */
.board-member-col::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.board-photo {
    width: 104px;
    height: 104px;
    margin: 0 0 16px !important;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-surface);
    box-shadow: var(--shadow-avatar);
    background: linear-gradient(145deg, var(--color-avatar-bg-start), var(--color-avatar-bg-end));
}

.board-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-name {
    margin: 0 0 8px !important;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}

/* role as a badge (same as .badge on the lesson list) */
.board-role {
    display: inline-block;
    margin: 0 0 12px !important;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.6;
}

.board-bio {
    margin: 0 !important;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========== Join ========== */
.entry-content > .ass-join {
    max-width: none;
    margin-bottom: 0 !important;
    padding-block: clamp(36px, 6vw, 56px);
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, var(--color-primary-soft) 100%);
}

.join-title {
    margin: 0 0 12px !important;
    font-size: clamp(1.5rem, 3.6vw, 2rem);
    font-weight: 600;
    color: var(--color-text-primary);
}

.join-text {
    max-width: 52ch;
    margin: 0 auto 24px !important;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.join-buttons {
    justify-content: center;
}

/* ========== Hover (pointer devices only) ========== */
@media (hover: hover) {
    .ass-card:hover,
    .tl-item:hover,
    .board-member-col:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-card-hover);
    }

    .tl-item:hover .tl-photo img {
        transform: scale(1.04);
    }

    .board-member-col:hover::after {
        opacity: 0.6;
    }
}

/* ========== Responsive ========== */
@media (max-width: 781px) {
    /* WP stacks the "Who we are" columns here: photo first, smaller */
    .ass-intro-media {
        order: -1;
        max-width: 420px;
        margin-inline: auto;
    }

    .intro-photo {
        aspect-ratio: 4 / 3;
    }

    .intro-note {
        left: 12px;
    }
}

@media (max-width: 600px) {
    .ass-timeline {
        padding-left: 26px;
    }

    .ass-timeline::before {
        left: 6px;
    }

    .tl-item {
        grid-template-columns: 1fr;
    }

    .tl-item::before {
        left: -27px;
    }

    .tl-body {
        padding: 0 6px 6px;
    }

}

@media (max-width: 480px) {
    /* hero buttons stay side by side, just a little more compact
       (same as the homepage) */
    .entry-content > .wp-block-cover:first-child .wp-block-buttons {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .entry-content > .wp-block-cover:first-child .wp-block-button__link {
        padding: 10px 18px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* two board cards per row on phones */
    .ass-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-member-col {
        padding: 22px 10px 18px;
    }

    .board-photo {
        width: 80px;
        height: 80px;
    }

    .board-bio {
        font-size: 0.84rem;
    }
}

/* very narrow phones (320px): a bit tighter still so both buttons fit */
@media (max-width: 360px) {
    .entry-content > .wp-block-cover:first-child .wp-block-buttons {
        gap: 8px;
    }

    .entry-content > .wp-block-cover:first-child .wp-block-button__link {
        padding: 9px 12px !important;
        font-size: 0.8rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ass-card,
    .tl-item,
    .tl-photo img,
    .board-member-col,
    .entry-content .wp-block-button__link {
        transition: none;
    }

    .intro-photo,
    .intro-note {
        transform: none;
    }
}