/* Threads-style social layout; keeps iamnotu's white, black and muted gold palette. */
.community-page {
    --thread-ink: #191919;
    --thread-muted: #77756f;
    --thread-line: #e8e6e0;
    --thread-gold: #a58a5d;
    min-height: 100vh;
    background: #fff;
    color: var(--thread-ink);
    font-family: var(--sans, Arial, sans-serif);
}

.community-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 62px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--thread-line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.community-brand {
    justify-self: start;
    color: var(--thread-ink);
    font: 700 20px/1 var(--serif, Georgia, serif);
    letter-spacing: -.055em;
    text-decoration: none;
}
.community-brand > span > span,
.community-footer > a > span { color: var(--thread-gold); }
.community-nav { display: flex; justify-content: center; gap: 6px; height: 62px; }
.community-nav a,
.community-nav > span {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 15px;
    color: var(--thread-muted);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.community-nav a.is-active { color: var(--thread-ink); font-weight: 650; }
.community-nav a.is-active::after { position: absolute; right: 14px; bottom: 0; left: 14px; height: 2px; background: var(--thread-gold); content: ""; }
.community-nav .is-disabled { opacity: .48; }
.community-header__actions { display: flex; justify-self: end; align-items: center; gap: 10px; min-width: 0; }
.community-language-toggle,
.community-logout button {
    border: 0;
    background: transparent;
    color: var(--thread-muted);
    font: 600 11px/1 var(--sans, Arial, sans-serif);
    cursor: pointer;
}
.community-language-toggle { padding: 8px 3px; }
.community-user-chip { max-width: 190px; min-height: 38px; padding: 4px 10px 4px 5px; border: 1px solid var(--thread-line); border-radius: 999px; background: #fff; color: var(--thread-ink); }
.community-user-chip > span:not(.community-avatar) { max-width: 105px; overflow: hidden; color: var(--thread-ink); font-size: 11px; text-overflow: ellipsis; }
.community-logout button { width: 34px; height: 34px; border: 1px solid var(--thread-line); border-radius: 50%; color: var(--thread-ink); }
.community-login { padding: 10px 14px; border: 1px solid var(--thread-ink); border-radius: 999px; background: var(--thread-ink); color: #fff; font-size: 11px; font-weight: 650; }

.community-shell { width: min(100% - 36px, 660px); margin: 0 auto; padding: 25px 0 96px; }
.community-intro { margin: 0 0 20px; padding: 0 0 19px; border-bottom: 1px solid var(--thread-line); }
.community-kicker { margin: 0 0 8px; color: var(--thread-gold); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.community-intro h1 { margin: 0; color: var(--thread-ink); font: 500 clamp(24px, 4vw, 31px)/1.15 var(--serif, Georgia, serif); letter-spacing: -.035em; }
.community-intro__sub { margin: 7px 0 0; color: var(--thread-muted); font-size: 12px; line-height: 1.5; }

.community-account-gate { display: flex; align-items: center; gap: 18px; margin: 14px 0 22px; padding: 15px 0; border-top: 1px solid var(--thread-line); border-bottom: 1px solid var(--thread-line); background: transparent; }
.community-account-gate__spark { display: none; }
.community-account-gate h2 { margin: 0 0 4px; font: 550 16px/1.3 var(--serif, Georgia, serif); }
.community-account-gate p:not(.community-kicker) { margin: 0; color: var(--thread-muted); font-size: 11px; line-height: 1.5; }
.community-account-gate .community-primary-button { flex: 0 0 auto; min-height: 36px; padding: 0 13px; border-radius: 999px; font-size: 10px; }
.community-account-gate--setup { margin-top: 10px; }

.community-feed-head { display: flex; align-items: end; justify-content: space-between; margin: 0; padding: 16px 0 12px; border-bottom: 1px solid var(--thread-line); }
.community-feed-head .community-kicker { margin-bottom: 5px; }
.community-feed-head h2 { margin: 0; color: var(--thread-ink); font: 500 19px/1.25 var(--serif, Georgia, serif); letter-spacing: -.02em; }
.community-feed-head p:not(.community-kicker) { margin: 4px 0 0; color: var(--thread-muted); font-size: 11px; }
.community-feed-head--profile { scroll-margin-top: 78px; }

.community-compose-entry {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 74px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--thread-line);
    background: #fff;
    color: var(--thread-ink);
    text-align: left;
    cursor: pointer;
}
.community-compose-entry > span:not(.community-avatar) { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.community-compose-entry strong { font-size: 12px; font-weight: 600; }
.community-compose-entry small { color: var(--thread-muted); font-size: 10px; }
.community-compose-entry > b { display: grid; min-width: 60px; height: 31px; place-items: center; padding: 0 12px; border-radius: 999px; background: var(--thread-ink); color: #fff; font-size: 10px; font-weight: 650; }
.community-compose-entry--guest { grid-template-columns: minmax(0, 1fr) auto; padding-left: 8px; }
.community-compose-entry__placeholder { color: var(--thread-muted); font-size: 12px; }
.community-avatar--small { width: 40px; height: 40px; border: 0; background: #f0eee9; color: #524834; font-size: 12px; }
.community-avatar img { object-fit: cover; }

.community-grid { display: block; margin: 0; border-top: 0; }
.community-card.thread-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    padding: 17px 0 15px;
    border: 0;
    border-bottom: 1px solid var(--thread-line);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}
.thread-card__avatar { position: relative; display: block; width: 42px; height: 42px; text-decoration: none; }
.thread-card__avatar::after { position: absolute; top: 47px; bottom: -30px; left: 20px; width: 1px; background: var(--thread-line); content: ""; }
.thread-card:last-child .thread-card__avatar::after { display: none; }
.thread-card__avatar .community-avatar { width: 42px; height: 42px; }
.thread-card__main { min-width: 0; }
.thread-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 24px; }
.thread-card__author { display: inline-flex; min-width: 0; align-items: baseline; gap: 6px; color: var(--thread-ink); text-decoration: none; }
.thread-card__author strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.thread-card__author > span { overflow: hidden; color: var(--thread-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.thread-card__head time { flex: 0 0 auto; color: #96938d; font-size: 10px; }
.thread-card__text { display: block; margin: 2px 0 10px; color: var(--thread-ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; text-decoration: none; }
.thread-card__image { display: block; overflow: hidden; max-height: 540px; margin: 0 0 9px; border: 1px solid var(--thread-line); border-radius: 15px; background: #f7f6f3; }
.thread-card__image img { display: block; width: 100%; max-height: 540px; object-fit: cover; }
.thread-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; max-width: 455px; margin: 3px 0 0 -8px; }
.thread-card__actions form { display: contents; }
.thread-action { display: inline-flex; min-width: 52px; min-height: 32px; align-items: center; justify-content: flex-start; gap: 5px; padding: 4px 8px; border: 0; border-radius: 999px; background: transparent; color: #68665f; font: 500 11px/1 var(--sans, Arial, sans-serif); text-decoration: none; cursor: pointer; }
.thread-action > span { font-size: 17px; line-height: 1; }
.thread-action > b { font-size: 10px; font-weight: 550; }
.thread-action:hover { background: #f6f4f0; color: var(--thread-ink); }
.thread-action.is-active { color: #9a3738; }
.thread-action[aria-pressed="true"] > span { color: #9a3738; }
.thread-action:focus-visible,.community-compose-entry:focus-visible,.community-follow-button:focus-visible { outline: 2px solid var(--thread-gold); outline-offset: 3px; }
.thread-card .verified-badge { width: 14px; height: 14px; font-size: 9px; }

.community-profile-hero { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; margin: 8px 0 18px; padding: 18px 0; border-top: 1px solid var(--thread-line); border-bottom: 1px solid var(--thread-line); border-radius: 0; background: transparent; box-shadow: none; }
.community-profile-hero__flare { display: none; }
.community-profile-hero > .community-avatar--large { grid-row: span 2; width: 72px; height: 72px; border: 1px solid var(--thread-line); background: #f3f1ec; font-size: 21px; }
.community-profile-hero__identity { position: static; min-width: 0; }
.community-profile-hero__identity h2 { margin: 3px 0; color: var(--thread-ink); font: 550 22px/1.2 var(--serif, Georgia, serif); }
.community-profile-hero__handle { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--thread-muted); font-size: 11px; }
.community-profile-bio { margin-top: 4px; color: #4f4d48; font-size: 11px; line-height: 1.5; }
.community-profile-url { margin-top: 5px; color: var(--thread-gold); font-size: 10px; }
.community-profile-stats { grid-column: 2 / 3; justify-content: flex-start; gap: 22px; margin: 0; padding: 0; border: 0; }
.community-profile-stats a { display: flex; align-items: baseline; gap: 4px; color: var(--thread-muted); text-decoration: none; }
.community-profile-stats strong { color: var(--thread-ink); font-size: 12px; }
.community-profile-stats span { font-size: 10px; }
.community-follow-form,.community-profile-edit { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.community-follow-button { min-width: 100px; min-height: 34px; padding: 0 14px; border: 1px solid var(--thread-ink); border-radius: 999px; background: var(--thread-ink); color: #fff; font-size: 10px; font-weight: 650; }
.community-follow-button[aria-pressed="true"],.community-profile-edit { background: #fff; color: var(--thread-ink); }

.community-detail-card { display: block; overflow: hidden; margin: 0; border: 0; border-bottom: 1px solid var(--thread-line); border-radius: 0; background: #fff; box-shadow: none; }
.community-detail-photo { overflow: hidden; margin: 0 0 16px; border: 1px solid var(--thread-line); border-radius: 16px; }
.community-detail-photo img { display: block; width: 100%; max-height: 660px; object-fit: contain; background: #f7f6f3; }
.community-detail-copy { padding: 0 0 18px; }
.community-detail-title { margin: 14px 0; color: var(--thread-ink); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.community-detail-copy > time { color: var(--thread-muted); font-size: 10px; }
.community-actions { justify-content: flex-start; gap: 12px; margin: 12px 0; padding: 9px 0; border-top: 1px solid var(--thread-line); border-bottom: 1px solid var(--thread-line); }
.community-action { border: 0; background: transparent; color: var(--thread-muted); }
.community-action:hover { color: var(--thread-ink); }
.community-comments { margin-top: 18px; }

.community-empty { margin: 0; padding: 40px 8px; border: 0; border-bottom: 1px solid var(--thread-line); border-radius: 0; background: #fff; box-shadow: none; text-align: center; }
.community-empty__orbit { display: none; }
.community-empty h2 { margin: 0 0 7px; color: var(--thread-ink); font: 500 19px/1.3 var(--serif, Georgia, serif); }
.community-empty p:not(.community-kicker) { max-width: 380px; margin: 0 auto; color: var(--thread-muted); font-size: 11px; line-height: 1.55; }
.community-empty .community-primary-button { margin-top: 15px; border-radius: 999px; }
.community-pagination { padding: 16px 0; border: 0; }
.community-pagination a { color: var(--thread-ink); text-decoration-color: var(--thread-gold); }
.community-footer { display: flex; justify-content: center; gap: 18px; padding: 20px; border-top: 1px solid var(--thread-line); color: var(--thread-muted); font-size: 10px; }
.community-footer > a { color: inherit; }
.community-post-fab { min-height: 48px; padding: 0 7px 0 15px; border-color: #c8b58f; border-radius: 999px; background: var(--thread-ink); box-shadow: 0 6px 18px rgba(25, 25, 25, .15); font-size: 10px; }
.community-post-fab:hover { background: #30302d; box-shadow: 0 8px 22px rgba(25, 25, 25, .19); }
.community-post-fab > b { width: 34px; height: 34px; border: 0; background: #eee7da; color: #3d3425; font-size: 23px; }
.community-post-dialog { width: min(100% - 28px, 520px); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--thread-line); border-radius: 18px; background: #fff; box-shadow: 0 20px 70px rgba(0,0,0,.22); }
.community-dialog-close { border-color: var(--thread-line); background: #fff; color: var(--thread-ink); }

/* Compact, uncropped photo galleries for image threads. */
.community-gallery { position: relative; width: 100%; max-width: 100%; overflow: hidden; margin: 0 0 9px; border: 1px solid var(--thread-line); border-radius: 13px; background: #f7f6f3; }
.community-gallery__track { display: flex; width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x pan-y; }
.community-gallery__track::-webkit-scrollbar { display: none; }
.community-gallery__slide { display: grid; flex: 0 0 100%; width: 100%; height: clamp(220px, 43vh, 340px); overflow: hidden; place-items: center; background: #f7f6f3; scroll-snap-align: start; text-decoration: none; }
.community-gallery__slide img { display: block; width: 100%; max-width: 100%; height: 100%; object-fit: contain; }
.community-gallery__count { position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 4px 7px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; background: rgba(25,25,25,.66); color: #fff; font-size: 9px; line-height: 1; pointer-events: none; }
.community-gallery--detail { margin-bottom: 16px; border-radius: 16px; }
.community-gallery--detail .community-gallery__slide { height: clamp(300px, 65vh, 660px); }
.community-upload-preview { display: flex; width: min(100%, 190px); min-height: 0; aspect-ratio: auto; gap: 7px; overflow-x: auto; border: 0; background: transparent; }
.community-upload-preview img { display: block; flex: 0 0 100%; width: 100%; height: auto; max-height: 190px; aspect-ratio: 4 / 5; border: 1px solid var(--thread-line); border-radius: 8px; object-fit: cover; }
.community-upload-preview--multiple { width: 100%; }
.community-upload-preview--multiple img { flex: 0 0 82px; width: 82px; height: 103px; max-height: 103px; aspect-ratio: auto; }

@media (max-width: 680px) {
    .community-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; min-height: 56px; padding: 0 14px; }
    .community-brand { font-size: 18px; }
    .community-nav { height: 56px; gap: 0; overflow-x: auto; scrollbar-width: none; }
    .community-nav::-webkit-scrollbar { display: none; }
    .community-nav a,.community-nav > span { padding: 0 9px; font-size: 11px; }
    .community-nav a.is-active::after { right: 8px; left: 8px; }
    .community-header__actions { gap: 5px; }
    .community-language-toggle { font-size: 9px; }
    .community-user-chip { min-height: 34px; padding-right: 5px; }
    .community-user-chip > span:not(.community-avatar) { display: none; }
    .community-login { padding: 8px 10px; font-size: 9px; white-space: nowrap; }
    .community-logout button { width: 30px; height: 30px; }
    .community-shell { width: min(100% - 28px, 660px); padding-top: 18px; }
    .community-account-gate { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
    .community-account-gate > div { flex: 1 1 100%; }
    .community-account-gate .community-primary-button { margin-left: auto; }
    .community-feed-head { padding: 13px 0 10px; }
    .community-compose-entry { min-height: 68px; grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; }
    .community-compose-entry .community-avatar--small { width: 36px; height: 36px; }
    .community-compose-entry > b { min-width: 52px; height: 29px; }
    .community-card.thread-card { grid-template-columns: 38px minmax(0,1fr); gap: 9px; padding: 15px 0 13px; }
    .thread-card__avatar,.thread-card__avatar .community-avatar { width: 38px; height: 38px; }
    .thread-card__avatar::after { top: 43px; left: 18px; }
    .thread-card__head { gap: 6px; }
    .thread-card__author { gap: 4px; }
    .thread-card__author strong { max-width: 120px; font-size: 11px; }
    .thread-card__author > span { font-size: 10px; }
    .thread-card__head time { font-size: 9px; }
    .thread-card__text { font-size: 12px; }
    .thread-card__image { border-radius: 13px; }
    .community-gallery { border-radius: 12px; }
    .community-gallery__slide { height: clamp(200px, 38vh, 290px); }
    .community-gallery--detail .community-gallery__slide { height: clamp(260px, 50vh, 500px); }
    .thread-card__actions { margin-left: -6px; }
    .thread-action { min-width: 42px; padding: 4px 6px; }
    .thread-action > b { font-size: 9px; }
    .community-profile-hero { grid-template-columns: 58px minmax(0,1fr); gap: 12px; padding: 15px 0; }
    .community-profile-hero > .community-avatar--large { grid-row: 1 / 3; width: 56px; height: 56px; }
    .community-profile-hero__identity h2 { font-size: 19px; }
    .community-profile-stats { grid-column: 1 / -1; gap: 18px; }
    .community-follow-form,.community-profile-edit { grid-column: 2; grid-row: 3; justify-self: start; }
    .community-profile-edit { margin-left: 0; }
    .community-footer { flex-wrap: wrap; gap: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .community-page *, .community-page *::before, .community-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
