.club-directory {
    color: #f3f5f4;
}

.club-directory .container {
    max-width: 940px;
    border-radius: 8px;
    background-color: rgba(20, 24, 23, 0.94);
}

.club-directory:not(.club-index):not(.club-detail) .char-en {
    letter-spacing: 0;
}

.club-directory :is(main, footer) a {
    color: #b3e0e4;
    text-underline-offset: 4px;
}

.club-directory :is(main, footer) a:hover {
    color: #fff;
}

.club-directory :is(main, footer) a:focus-visible {
    outline: 2px solid #b3e0e4;
    outline-offset: 5px;
}

.club-breadcrumb, .club-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
}

.club-breadcrumb {
    margin: 24px 0;
    color: #bdc3c4;
}

.club-heading {
    padding: 8px 0 28px;
}

.club-heading h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin: 10px 0 16px;
    overflow-wrap: anywhere;
}

.club-location {
    color: #e5d291;
    font-size: 0.95rem;
    margin: 0 0 8px;
}

.club-summary, .club-section p, .club-listing > p {
    color: #e0e4e3;
    line-height: 1.8;
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.club-summary {
    max-width: 720px;
    font-size: 1.08rem;
}

.club-original-name, .club-updated {
    color: #bdc3c4;
    line-height: 1.6;
}

.club-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 28px;
    border-top: 1px solid #535958;
}

.club-section {
    padding: 24px 0;
}

.club-section h2, .club-listing h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin: 0 0 12px;
}

.club-schedule p + p {
    border-top: 1px solid #414846;
    padding-top: 8px;
}

.club-join {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #759c92;
    background: #23433a;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.club-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.club-reference {
    background: transparent;
}

.club-listings {
    display: grid;
    gap: 16px;
}

.club-listing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
    gap: 24px;
    padding: 22px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.club-directory main a.club-listing {
    color: #222;
    text-decoration: none;
}

.club-directory main a.club-listing:hover {
    color: #222;
    border-color: #427a70;
}

.club-directory main a.club-listing:focus-visible {
    outline: 3px solid #00a6bd;
    outline-offset: 4px;
}

.club-listing .club-card-meta,
.club-listing .club-card-summary {
    color: #4b5563;
}

.club-listing .club-type {
    border-color: #a3b9b2;
    color: #285348;
}

.club-listing[data-type="class"] .club-type {
    border-color: #c1b08d;
    color: #70531b;
}

.club-listing .club-term,
.club-listing .club-inactive-marker {
    color: #62605a;
}

.club-listing .club-listing-schedule {
    margin: 0;
    color: #70531b;
    font-size: 0.95rem;
}

.club-index-heading {
    padding-bottom: 32px;
    text-align: center;
}

.club-index-heading .club-summary {
    margin-inline: auto;
}

/* Use the homepage shell spacing and colors around the shared top controls. */
:is(.club-index, .club-detail) .container {
    border-radius: 12px;
    background-color: rgba(26, 26, 26, 0.9);
}

.club-eyebrow {
    color: #bdc3c4;
    font-size: 0.9rem;
    margin: 0;
}

.club-submit {
    margin-top: 16px;
}

.club-group {
    border-top: 1px solid #535958;
    padding: 24px 0 8px;
}

.club-group > h2, .club-empty h2 {
    color: #e0e4e3;
    font-size: 1.1rem;
    margin: 0 0 16px;
}

.club-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    font-size: 0.85rem;
    color: #bdc3c4;
    margin: 0 0 10px;
}

.club-type {
    padding: 3px 7px;
    border: 1px solid #71877f;
    border-radius: 4px;
    color: #d0e8db;
    line-height: 1.4;
}

[data-type="class"] .club-type {
    border-color: #9e8c62;
    color: #e5d291;
}

.club-card-summary, .club-source, .club-listing-schedule {
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.club-card-summary {
    margin: 4px 0 0;
    color: #e0e4e3;
}

.club-listing-aside {
    align-self: center;
    min-width: 0;
}

.club-listing .club-actions {
    gap: 8px;
    margin-top: 12px;
}

.club-listing .club-join {
    padding: 8px 12px;
    gap: 8px;
}

.club-detail-link {
    display: inline-block;
    padding: 12px 0 0;
    font-size: 0.9rem;
}

.club-source {
    font-size: 0.8rem;
    color: #bdc3c4;
    margin: 16px 0 0;
}

.club-inactive-marker, .club-term {
    color: #c8c6bb;
    font-size: 0.8rem;
    font-weight: 400;
}

.club-term {
    margin: 8px 0 0;
    line-height: 1.6;
}

.club-inactive-group {
    border-top-style: dashed;
}

.club-empty {
    border-top: 1px solid #535958;
    padding: 24px 0;
    line-height: 1.7;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.club-updated {
    margin: 12px 0 24px;
    font-size: 0.85rem;
}

.club-profile-heading { display: flex; gap: 24px; align-items: center; padding: 28px 0; }
.club-profile-heading > div { min-width: 0; }
.club-cover { background: #101719; margin-top: 12px; }
.club-cover img { display: block; width: 100%; aspect-ratio: 16/9; max-height: 460px; object-fit: contain; }
.club-logo { width: 100px; height: 100px; object-fit: contain; flex-shrink: 0; }
.club-member-actions { display: flex; gap: 24px; flex-wrap: wrap; font-size: .85rem; margin-top: 20px; }
.club-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.club-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #101719; border-radius: 6px; }
.club-people { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.club-person { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #46504e; align-items: start; }
.club-person > div { min-width: 0; }
.club-person h3 { margin: 0; font-size: 1.1rem; }
.club-person p { line-height: 1.6; overflow-wrap: anywhere; }
.club-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; }
.club-finish { color: #a9cfc7; font-size: .85rem; }
.club-card-photo { width: 100%; max-height: 180px; object-fit: contain; margin-bottom: 16px; }
.club-section + .club-section { border-top: 1px solid #414846; }
.club-edit-grid, .club-edit-languages { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
[data-club-manage] { color: #eff4f2; }
[data-club-manage] h1 { font-size: 1.8rem; overflow-wrap: anywhere; }
[data-club-manage] label { display: grid; gap: 7px; margin: 14px 0; font-size: .95rem; }
[data-club-manage] input, [data-club-manage] textarea, [data-club-manage] select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #687571; background: #101719; color: #f3f5f4; border-radius: 6px; padding: 10px; font: inherit; }
[data-club-manage] textarea { resize: vertical; }
[data-club-manage] fieldset { min-width: 0; border: 0; padding: 0; margin: 16px 0; }
[data-club-manage] legend { color: #a9cfc7; font-weight: 700; }
[data-club-manage] summary { cursor: pointer; min-height: 44px; padding: 12px 0; }
[data-club-manage] button { color: #e3f4ef; font: inherit; cursor: pointer; }
[data-club-manage] button:disabled { opacity: .5; cursor: wait; }
[data-club-manage] .club-check { display: flex; align-items: start; gap: 10px; line-height: 1.6; }
[data-club-manage] .club-check input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; margin-top: 3px; }
.club-health { padding-left: 0; list-style: none; line-height: 1.9; color: #bfdbce; }
.club-onboarding { font-size: .9rem; line-height: 1.7; color: #c7d2cd; }
.club-alert { border-left: 3px solid #d9ba75; padding: 14px; background: #302c24; }
.club-save-status { position: sticky; bottom: 0; background: #182521; padding: 12px; }
.club-save-status:empty { display: none; }
.club-manager-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; }
[data-invite-result] { overflow-wrap: anywhere; }
.club-group:not(:has(.club-listing)) { display: none; }

.club-footer {
    justify-content: space-between;
    border-top: 1px solid #535958;
    padding: 20px 0 0;
    margin-top: 24px;
}

@media (max-width: 600px) {
    .club-edit-grid, .club-edit-languages, .club-people { grid-template-columns: minmax(0,1fr); }
    .club-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .club-profile-heading { align-items: start; gap: 14px; }
    .club-logo { width: 60px; height: 60px; }
    .club-directory:not(.club-index):not(.club-detail) {
        padding: 12px;
    }
    .club-directory:not(.club-index):not(.club-detail) .container {
        padding: 1px 18px 20px;
    }
    .club-heading h1 {
        font-size: 1.65rem;
    }
    .club-details {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .club-listing {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 18px;
    }
    .club-section + .club-section {
        border-top: 1px solid #414846;
    }
}

@media (max-width: 420px) {
    .club-directory:not(.club-index):not(.club-detail) header {
        padding-top: 34px;
    }
    .club-directory:not(.club-index):not(.club-detail) .header-actions {
        top: 8px;
    }
    body.calendar-shell.club-directory:not(.club-index):not(.club-detail) header > .logo-link {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    :is(.club-index, .club-detail) .container {
        background-color: transparent;
    }
    .club-index main {
        padding: 1px 18px 20px;
        border-radius: 8px;
        background-color: rgba(20, 24, 23, 0.94);
    }
}

/* Section editors use the same permissions and revision checks as My clubs. */
.club-inline-edit { margin-left: 10px; padding: 6px 12px; border: 1px solid #79b9b0; border-radius: 7px; color: #d8fbff; background: #183d38; font: 600 0.9rem system-ui; cursor: pointer; vertical-align: middle; }
.club-profile [hidden] { display: none !important; }
.club-editor-notice { padding: 16px; margin-bottom: 20px; border: 1px solid #79b9b0; border-radius: 8px; background: #183d38; }
.club-editor-dialog { width: min(620px, calc(100vw - 40px)); max-height: 85vh; box-sizing: border-box; border: 1px solid #a7c5c0; border-radius: 12px; padding: 24px; color: #172b28; background: #fff; overflow-y: auto; }
.club-editor-dialog::backdrop { background: rgba(0,0,0,.65); }
.club-editor-dialog h2 { margin-top: 0; }
.club-editor-dialog label { display: grid; gap: 6px; margin: 12px 0; font-weight: 600; }
.club-editor-dialog input:not([type=checkbox]), .club-editor-dialog textarea, .club-editor-dialog select { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border: 1px solid #6c847e; border-radius: 6px; color: #172b28; background: #fff; }
.club-editor-dialog fieldset { border: 1px solid #b7c9c5; border-radius: 6px; min-width: 0; }
.club-editor-dialog button { min-height: 44px; padding: 8px 16px; cursor: pointer; }
.club-editor-dialog .club-join { background: #174c43; color: #fff; }
.club-editor-dialog .club-check { display: flex; align-items: flex-start; gap: 8px; }
.club-editor-dialog .club-check input { flex: 0 0 auto; margin-top: 6px; }
.club-editor-dialog [role=status] { color: #9a2c16; }
.club-editor-dialog .club-gallery img { max-height: 160px; object-fit: cover; }
.club-editor-dialog :focus-visible, .club-inline-edit:focus-visible { outline: 3px solid #009caf; outline-offset: 3px; }

/* Public details share the homepage header and opaque cards used by race listings. */
.club-profile { display: grid; gap: 16px; }
.club-profile-heading, .club-profile .club-section, .club-profile-meta {
    padding: 24px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #222;
    box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.1);
}
.club-profile .club-details { gap: 16px; border: 0; }
.club-profile :is(.club-summary, .club-section p, .club-location, .club-original-name, .club-source, .club-updated) { color: #4b5563; }
.club-profile :is(.club-type, .club-joining-policy) { color: #285348; border-color: #a3b9b2; }
.club-directory .club-profile a { color: #17665d; }
.club-directory .club-profile a:hover { color: #0d403a; }
.club-directory .club-profile a:focus-visible { outline-color: #00889a; }
.club-directory .club-profile a.club-join { color: #fff; background: #234f44; }
.club-directory .club-profile a.club-join:hover { background: #173a32; }
.club-profile .club-schedule p, .club-profile .club-person {
    background: #f3f6f5;
    border: 1px solid #dce5e2;
    border-radius: 6px;
    padding: 12px;
}
.club-profile .club-schedule p { margin: 0 0 10px; }
.club-profile .club-schedule p:last-child { margin-bottom: 0; }
.club-profile .club-cover { margin: 0; border-radius: 8px; overflow: hidden; background: #fff; }
.club-profile .club-gallery img { background: #f3f6f5; }
.club-profile-meta :is(.club-source, .club-updated) { margin: 0; }
.club-profile-meta .club-source + .club-updated { margin-top: 8px; }
.club-profile > :is(.club-term, .club-inactive-marker) { margin: 0; padding: 12px 24px; border-radius: 8px; background: #fff4d6; color: #70531b; }
@media (max-width: 600px) {
    .club-profile-heading, .club-profile .club-section, .club-profile-meta { padding: 18px; }
}

/* Owners can add or replace the cover directly where it appears. */
.club-cover-controls { padding: 16px 20px; background: #f3f6f5; color: #285348; }
.club-cover-empty .club-cover-controls { padding: 28px 24px; text-align: center; border: 2px dashed #7ca99d; border-radius: 8px; }
.club-cover-controls p { margin: 12px auto 0; max-width: 540px; line-height: 1.6; }
.club-cover-edit { min-height: 44px; padding: 10px 18px; border: 1px solid #234f44; border-radius: 6px; background: #234f44; color: #fff; font: 600 1rem system-ui; cursor: pointer; }
.club-cover-edit:hover { background: #173a32; }
.club-cover-edit:focus-visible { outline: 3px solid #009caf; outline-offset: 3px; }
