/* Public post and profile pages /p/<code> and /u/<code> (ticket 314), in the app's look (ticket 344): the post page is
   the app's post screen, the profile its profile header. Builds on landing.css; colours and sizes only from theme.css. */
.public-main {
    flex: 1;
    width: 100%;
    max-width: 600px;
    padding: 24px 0 48px;
}

/* The post: on the page itself, like the app's post screen (no box around it). */
.post-card {
    color: var(--on-surface);
}

/* Author pill: avatar and name on a surface pill floating over the post, as in the app. */
.author-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 6px 18px 6px 6px;
    border-radius: 999px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    color: var(--on-surface);
    text-decoration: none;
}

.author-pill:hover .author-name {
    text-decoration: underline;
}

.post-avatar,
.comment-avatar,
.profile-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.post-avatar {
    width: var(--avatar-post);
    height: var(--avatar-post);
}

.comment-avatar {
    width: var(--avatar-comment);
    height: var(--avatar-comment);
}

.profile-avatar {
    width: var(--avatar-profile);
    height: var(--avatar-profile);
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--avatar-fallback);
    color: var(--on-avatar-fallback);
    font-family: var(--font);
    font-weight: 400;
}

.post-avatar.avatar-fallback { font-size: 1.25rem; }
.comment-avatar.avatar-fallback { font-size: 0.95rem; }
.profile-avatar.avatar-fallback { font-size: 2rem; }

.author-name {
    overflow: hidden;
    color: var(--on-surface);
    font: var(--title-medium);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.author-name:hover {
    text-decoration: underline;
}

.post-meta {
    font: var(--label-medium);
    letter-spacing: var(--tracking-label);
    color: var(--on-surface-variant);
}

.post-card > .post-meta {
    margin-top: 14px;
}

.post-photo {
    display: block;
    width: 100%;
    max-height: 80vh;
    margin: 12px 0 0;
    border-radius: var(--radius-card);
    object-fit: cover;
    background: var(--surface-container);
}

.post-photo + .post-photo {
    margin-top: 6px;
}

/* An event's page (ticket 1005): its title as the heading, then when, where, price, category, Tickets and source. */
.event-title {
    margin: 16px 0 0;
    font: var(--headline-small);
    color: var(--on-surface);
    overflow-wrap: anywhere;
}

.event-facts {
    margin-top: 8px;
    font: var(--body-large);
    color: var(--on-surface);
}

.event-facts p {
    margin: 4px 0 0;
}

.event-when {
    font-weight: 600;
}

.event-venue {
    font-weight: 600;
}

/* Ticket 1424: the venue and the category link their pages; the venue reads as a link, the chip stays a chip. */
a.event-venue {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--outline);
}

a.event-venue:hover {
    text-decoration-color: currentColor;
}

/* Ticket 1424: the breadcrumb above an event's or a venue's heading: the town's events › the venue › the page. */
.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font: var(--body-medium);
    color: var(--on-surface-variant);
}

.crumbs li {
    min-width: 0;
    overflow-wrap: anywhere;
}

.crumbs li + li::before {
    content: "›";
    padding: 0 8px;
}

.crumbs a {
    color: var(--primary);
    text-decoration: none;
}

.crumbs a:hover {
    text-decoration: underline;
}

.crumbs a:focus-visible,
a.event-venue:focus-visible,
.event-category a:focus-visible,
.event-around a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.crumbs + .event-title,
.crumbs + .event-list-title {
    margin-top: 8px;
}

.event-cancelled {
    color: var(--error);
    font: var(--title-medium);
    font-weight: 700;
}

/* Ticket 1121: postponed or rescheduled; the old date struck through. */
.event-status {
    color: var(--on-surface);
    font: var(--title-medium);
    font-weight: 700;
}

/* Ticket 1546: reported or no longer listed; the app's quiet muted line, never alarming. */
.event-status.event-maybe-cancelled {
    color: var(--on-surface-variant);
    font: var(--body-large);
    font-weight: 400;
}

.event-status .event-was {
    color: var(--on-surface-variant);
    font-weight: 400;
    text-decoration: line-through;
}

.event-price,
.event-source {
    color: var(--on-surface-variant);
}

/* Ticket 1786: a race's distances, one per line with its fee, and when its entries close. */
.event-distances {
    margin-top: 8px;
}

.event-distances-label {
    margin: 0;
    color: var(--on-surface-variant);
    font: var(--label-large);
    letter-spacing: var(--tracking-label);
}

.event-distances ul {
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    color: var(--on-surface);
}

.event-distances li {
    padding: 2px 0;
}

.event-entries {
    color: var(--on-surface);
    font-weight: 600;
}

.event-category span,
.event-category a {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 12px;
    border-radius: var(--radius-chip);
    background: var(--tonal);
    font: var(--label-medium);
    letter-spacing: var(--tracking-label);
}

/* Ticket 1786: a race's sign-up button is the Tickets button; its results after the race the outlined one. */
.event-tickets,
.event-signup,
.event-results {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--button-height);
    margin-top: 12px;
    padding: 10px 28px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font: var(--label-large);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-decoration: none;
}

.event-results {
    border: 1px solid var(--outline);
    background: transparent;
    color: var(--primary);
}

.event-tickets:hover,
.event-signup:hover,
.event-results:hover {
    opacity: 0.88;
}

.event-tickets:focus-visible,
.event-signup:focus-visible,
.event-results:focus-visible,
.event-source a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.event-source {
    font: var(--body-small);
}

.event-facts .event-source {
    margin-top: 10px;
}

.event-source a {
    color: inherit;
}

/* A past event (ticket 1013): the line where Tickets was, then the next events at the venue. */
.event-over {
    color: var(--on-surface-variant);
    font: var(--title-medium);
    font-weight: 700;
}

.event-facts .event-over {
    margin-top: 12px;
}

.event-next {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--outline-variant);
    font: var(--body-large);
    color: var(--on-surface);
}

.event-next h2 {
    margin: 0 0 4px;
    font: var(--title-medium);
}

.event-next ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-next li {
    padding: 6px 0;
    overflow-wrap: anywhere;
}

.event-next li time {
    color: var(--on-surface-variant);
}

.event-next a {
    color: var(--primary);
    font-weight: 600;
}

.event-next a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Same day nearby (ticket 1425): the venue after the title, quieter than the link. */
.event-same-day-venue {
    color: var(--on-surface-variant);
}

/* A series' other dates (ticket 1338): date chips that wrap, each a link to that date's page. */
.event-series ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.event-series li {
    padding: 0;
}

.event-series a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--outline-variant);
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}

.event-series a:hover {
    background: var(--surface-container);
}

.event-series li time {
    color: inherit;
}

.post-text {
    margin: 6px 0 0;
    font: var(--body-large);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Reaction row: the app's pills under the photo. */
.post-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.reactions {
    display: inline-flex;
    gap: 8px;
}

.reaction,
.comment-count {
    display: inline-flex;
    align-items: center;
    min-height: var(--button-height);
    padding: 8px 16px;
    border-radius: var(--radius-chip);
    background: var(--tonal);
    color: var(--on-surface);
    font: var(--label-large);
    letter-spacing: var(--tracking-label);
}

/* Comments: the app's comment cards. */
.comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.comment {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-card);
    background: var(--surface-container-low);
    box-shadow: var(--shadow);
}

.comment-body {
    min-width: 0;
}

.comment-author {
    font: var(--title-small);
}

.comment-body p {
    margin: 2px 0 0;
    font: var(--body-medium);
    letter-spacing: var(--tracking-body);
    color: var(--on-surface);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* The app's buttons: a filled pill in primary and the tonal pill, side by side like the profile's action row. */
.cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    text-align: center;
}

.cta a {
    display: inline-flex;
    flex: 1 1 140px;
    align-items: center;
    justify-content: center;
    min-height: var(--button-height);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font: var(--label-large);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.cta-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.cta-primary:hover {
    opacity: 0.88;
}

.cta-secondary {
    background: var(--tonal);
    color: var(--on-surface);
}

.cta-secondary:hover {
    background: var(--tonal-hover);
}

.cta a:focus-visible,
.author-pill:focus-visible,
.post-thumb:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.cta .note {
    flex-basis: 100%;
    margin-top: 2px;
}

/* Profile: the app's header, avatar beside the name. */
.profile-head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 16px;
}

.profile-head h1 {
    margin: 0;
    font: var(--headline-small);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.profile-bio {
    grid-column: 1 / -1;
    margin-top: 16px;
    font: var(--body-large);
    color: var(--on-surface);
    white-space: pre-line;
}

.public-main > .cta {
    margin-top: 20px;
}

.profile-posts h2 {
    margin: 32px 0 12px;
    font: var(--title-medium);
    font-weight: 600;
    color: var(--on-surface);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.post-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-thumb);
    background: var(--surface-container);
    color: var(--on-surface);
    text-decoration: none;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    height: 100%;
    padding: 10px;
    font: var(--body-small);
    overflow-wrap: anywhere;
    background: var(--surface-container-high);
}

.pager {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
}

.pager a {
    color: var(--mention);
    font: var(--label-large);
    text-decoration: none;
}

.pager a[rel="next"] {
    margin-left: auto;
}

/* The events list pages (ticket 1007): a heading, one sentence, the map link and chips, then the event cards. */
.event-list-page {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 0 48px;
}

.event-list-title {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
}

.event-list-address {
    margin: 6px 0 0;
    font: var(--body-large);
    color: var(--on-surface-variant);
}

.event-list-intro {
    margin-top: 8px;
}

.event-list-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.event-list-map,
.event-list-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font: var(--label-large);
    letter-spacing: var(--tracking-label);
    text-decoration: none;
}

.event-list-map {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
}

.event-list-chip {
    background: var(--tonal);
    color: var(--on-surface);
}

.event-list-map:hover,
.event-list-chip:hover {
    opacity: 0.88;
}

/* Ticket 1429: a venue's or a town's calendar feed, under its coming events. */
.event-calendar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
}

.event-calendar-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 560px;
    font: var(--body-medium);
    color: var(--on-surface-variant);
}

.event-calendar-url {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    background: var(--surface-container-low);
    color: var(--on-surface);
    font: var(--body-medium);
}

.event-calendar-url:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.event-list-section {
    margin: 32px 0 0;
    font: var(--title-large);
    color: var(--on-surface);
}

/* Ticket 1423: a season's programme, one heading per day, and the official programme's credit. */
.event-list-day {
    margin: 24px 0 0;
    font: var(--title-medium);
    font-weight: 700;
    color: var(--on-surface-variant);
}

.event-list-credit {
    margin: 32px 0 0;
    font: var(--body-small);
    color: var(--on-surface-variant);
}

.event-list-credit a {
    color: inherit;
}

/* The line to the town's season: on its events pages and under each of its events. Ticket 1424: an event's line to
   its town's weekend or events looks the same. */
.event-season,
.event-around {
    margin: 16px 0 0;
    font: var(--body-large);
}

.event-category a {
    color: var(--on-surface);
    text-decoration: none;
}

.event-season a,
.event-around a {
    color: var(--primary);
    font-weight: 600;
}

.event-season a:focus-visible,
.event-list-credit a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.event-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.event-card {
    padding: 14px 16px;
    border-radius: var(--radius-card);
    background: var(--surface-container);
    color: var(--on-surface);
}

.event-card-title {
    font: var(--title-medium);
    font-weight: 700;
    color: var(--on-surface);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.event-card-title:hover {
    text-decoration: underline;
}

.event-card p {
    margin: 4px 0 0;
    font: var(--body-medium);
}

.event-card-when {
    font-weight: 600;
}

.event-card-venue a {
    color: var(--on-surface-variant);
    text-decoration: none;
}

.event-card-venue a:hover {
    text-decoration: underline;
}

.event-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Ticket 1121: postponed or rescheduled, as strong as the event page's line. */
.event-card-status {
    padding: 2px 12px;
    border-radius: var(--radius-chip);
    background: var(--tonal);
    color: var(--on-surface);
    font: var(--label-medium);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
}

.event-card-category {
    padding: 2px 12px;
    border-radius: var(--radius-chip);
    background: var(--tonal);
    font: var(--label-medium);
    letter-spacing: var(--tracking-label);
}

.event-card-tickets {
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font: var(--label-medium);
    font-weight: 600;
    text-decoration: none;
}

.event-list-map:focus-visible,
.event-list-chip:focus-visible,
.event-card a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}


/* On a phone the photo runs edge to edge, as on the app's post screen. */
@media (max-width: 640px) {
    .post-photo {
        width: calc(100% + 40px);
        max-width: none;
        margin-left: -20px;
        border-radius: 0;
    }
}

@media (max-width: 420px) {
    .post-photo {
        width: calc(100% + 24px);
        margin-left: -12px;
    }

    .landing {
        padding-left: 12px;
        padding-right: 12px;
    }

    .nav-links {
        gap: 14px;
    }
}

/* ===== Ticket 1557: the profile and the post look exactly like the app (Poster 973 gallery wall, 1017/1394 lightbox).
   Numbers are the app's (ProfileWideLayout.kt, PublicProfile.kt, PostLightbox.kt): change them together with the app, or
   scripts/server-page-parity.sh fails. ===== */
.app-page {
    margin: 0;
    min-height: 100vh;
    background: var(--surface);
    color: var(--on-surface);
    font: var(--body-large);
    letter-spacing: var(--tracking-body);
    overflow-x: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.app-page .icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-page .glass-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    color: var(--on-surface);
    text-decoration: none;
}

/* The round home button in the top left, 16 from the top (PROFILE_BAR_BUTTON_TOP); on the wide wall at the content's edge. */
.home-button {
    position: absolute;
    z-index: 3;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
}

/* The site's own links live under the page: the app has nothing on top. */
.site-chrome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px 32px;
}

.site-chrome .landing-nav {
    max-width: 1116px;
}

/* ----- Profile: the phone's column (below 840, the app's EXPANDED_WIDTH) ----- */
.profile-wall {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin: 0 auto;
}

.profile-head {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
}

/* The map on top, 176 high (PROFILE_MAP_HEIGHT), the avatar 36 over its bottom (PROFILE_AVATAR_OVERLAP). */
.profile-map-card {
    position: relative;
    display: block;
    height: 176px;
    background: var(--map-placeholder);
    color: var(--on-surface);
    text-decoration: none;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent);
    mask-image: linear-gradient(to bottom, black 60%, transparent);
}

/* Ticket 1563: the still map of the person's places over the placeholder; each width and theme has its own image. */
.profile-map-image,
.profile-map-image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.profile-map-image img {
    object-fit: cover;
    object-position: center;
}

/* The tiles' credit (ODbL), small on a plate: top right on the phone, where the fade and the avatar are not. */
.map-credit {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--surface-glass);
    color: var(--on-surface-variant);
    font-size: 10px;
    line-height: 14px;
    white-space: nowrap;
}

.map-explore.map-explore-wide {
    display: none;
}

.map-explore {
    position: absolute;
    right: 16px;
    bottom: 56px;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    font: var(--label-large);
}

.profile-identity {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 24px;
    margin-top: -24px;
    padding: 0 16px;
}

/* On the phone the name line's parts sit in the column's grid: avatar and name, stats, Follow the whole width, bio. */
.profile-name-line {
    display: contents;
}

.app-page .profile-avatar {
    width: 70px;
    height: 70px;
    margin-left: 12px;
}

.profile-names {
    display: flex;
    flex-direction: column;
    align-self: center;
    min-width: 0;
}

.profile-names h1 {
    margin: 0;
    overflow: hidden;
    font: 400 1.75rem/2.25rem var(--font);
    /* The app's Skia lays Nunito about 4 % tighter than the browser: measured on the 1280 wall, so Follow lands where the app's does. */
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-handle {
    font: var(--body-medium);
    letter-spacing: var(--tracking-body);
    color: var(--on-surface-variant);
}

.follow-button,
.store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 120px;
    height: 40px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font: 700 0.875rem/1.25rem var(--font);
    text-decoration: none;
}

.profile-identity .follow-button {
    grid-row: 3;
    grid-column: 1 / -1;
    margin-top: 8px;
}

.profile-identity .profile-stats,
.profile-identity .profile-bio {
    grid-column: 1 / -1;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin: 21px 0 0;
    padding: 8px 0;
    font: 400 1rem/1.5rem var(--font);
    color: var(--on-surface-variant);
}

.profile-stats b {
    color: var(--on-surface);
    font-weight: 700;
}

.stat-sparks {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.app-page .spark {
    width: 16px;
    height: 16px;
    fill: var(--spark);
    stroke: none;
}

.profile-bio {
    margin: 12px 0 0;
    font: var(--body-large);
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.town-chips {
    display: flex;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0 8px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    height: 32px;
    padding: 0 13px;
    border: 1px solid var(--outline-variant);
    border-radius: 999px;
    color: var(--on-surface);
    font: var(--label-large);
    text-decoration: none;
    white-space: nowrap;
}

.chip-count {
    font: var(--label-small);
    color: var(--on-surface-variant);
}

.profile-page .profile-posts {
    margin: 0;
    padding: 0 8px;
}

/* Three square tiles in a row, 2 apart (SQUARE_COLUMNS, SquareCellGap). */
.profile-page .post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin: 0;
}

.profile-page .post-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0;
    background: var(--surface-container);
}

.profile-page .post-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The app's text tile: a soft tint by the post, the text centred, five lines at most (textTileTint, TEXT_TILE_LINES). */
.profile-page .thumb-text {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 8px;
    background: var(--tile-tint-0);
    color: var(--on-surface);
    font: var(--body-medium);
    text-align: center;
}

.profile-page .thumb-text > span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.thumb-text.tint-1 { background: var(--tile-tint-1); }
.thumb-text.tint-2 { background: var(--tile-tint-2); }
.thumb-text.tint-3 { background: var(--tile-tint-3); }

}

/* The card after the open posts (Poster 981). */
.store-card {
    max-width: 560px;
    margin: 32px auto 0;
    padding: 24px;
    border-radius: 24px;
    background: var(--surface-container-low);
    text-align: center;
}

.store-card h2 {
    margin: 0;
    font: var(--title-large);
}

.store-card p {
    margin: 8px 0 16px;
    color: var(--on-surface-variant);
}

.profile-page .pager {
    justify-content: center;
}

/* ----- Profile: the gallery wall (840 and wider, ProfileWideLayout) ----- */
@media (min-width: 840px) {
    .profile-wall {
        width: min(100% - 64px, 1116px);
        padding-top: 64px;
    }

    .profile-page .home-button {
        left: max(32px, (100% - 1116px) / 2);
    }

    .profile-head {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
        min-height: 280px;
    }

    .profile-identity {
        display: block;
        flex: 1;
        min-width: 0;
        margin: 0;
        padding: 17px 0 0;
    }

    /* The name and Follow sit 16 and 24 below the avatar's top, as the app lays them (not centred on it). */
    .profile-name-line {
        display: flex;
        align-items: flex-start;
        column-gap: 16px;
    }

    .app-page .profile-avatar {
        width: 104px;
        height: 104px;
        margin: 0;
    }

    .profile-names {
        flex: 0 1 auto;
        align-self: flex-start;
        margin: 16px 8px 0 0;
    }

    .profile-identity .follow-button {
        flex-shrink: 0;
        margin: 24px 0 0;
    }

    .profile-stats {
        margin-top: 12px;
    }

    .map-explore.map-explore-wide {
        display: inline-flex;
    }

    .map-explore.map-explore-narrow {
        display: none;
    }

    .profile-map-card {
        flex: 0 0 clamp(320px, 100% - 516px, 600px);
        height: 264px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: var(--shadow);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .map-credit {
        top: auto;
        bottom: 8px;
    }

    .map-explore {
        top: 12px;
        right: 12px;
        bottom: auto;
        height: 44px;
        padding: 0 12px;
        background: var(--primary);
        color: var(--on-primary);
        font: 700 0.875rem/1.25rem var(--font);
    }

    .town-chips {
        margin-top: 7px;
        padding: 0 0 12px;
        border-bottom: 1px solid var(--outline-variant);
    }

    .chip {
        height: 34px;
    }

    .profile-page .profile-posts {
        padding: 13px 0 0;
    }

    .profile-page .post-grid {
        gap: 6px;
    }
}

@media (min-width: 1024px) {
    .profile-page .post-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
    .profile-page .post-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ----- Post: the phone's post screen (below 1000, PostLightbox.MinWidth) ----- */
.lb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-position: center;
    background-size: cover;
    filter: blur(48px);
    transform: scale(1.3);
    opacity: 0.55;
}

.lightbox {
    position: relative;
    z-index: 1;
    container-type: inline-size;
}

.lb-photo-col {
    position: relative;
    padding-top: 112px;
}

.post-page .author-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
    padding: 8px 18px 8px 8px;
    border-radius: 999px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    color: var(--on-surface);
    text-decoration: none;
}

.author-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-page .author-name {
    font: 500 0.9375rem/1.25rem var(--font);
}

.author-handle {
    font: var(--body-small);
    color: var(--on-surface-variant);
}

.lb-photo-pill {
    margin: 0 0 8px 16px;
}

.lb-photos {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.post-page .post-photo {
    flex: 0 0 100%;
    width: 100%;
    max-height: none;
    aspect-ratio: var(--aspect);
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    scroll-snap-align: start;
}

.post-page .post-photo + .post-photo {
    margin: 0;
}

.lb-text-card {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    aspect-ratio: var(--aspect);
    padding: 32px;
    background: var(--surface-container-low);
    font: var(--title-large);
    text-align: center;
    overflow-wrap: anywhere;
}

.post-counts {
    display: flex;
    gap: 8px;
}

.lb-photo-actions {
    position: absolute;
    left: 16px;
    bottom: 16px;
}

.lb-text .lb-photo-actions {
    position: static;
    margin: 12px 16px 0;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    height: 40px;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    color: var(--on-surface);
    font: var(--label-large);
}

.action-pill .reaction {
    min-height: 0;
    padding: 0;
    background: none;
    font: var(--label-large);
}

.lb-column {
    position: relative;
    padding: 0 16px 24px;
}

.lb-card .lb-card-author,
.lb-card .lb-card-actions {
    display: none;
}

.lb-card .post-meta {
    margin: 12px 4px 0;
}

.post-page .post-text {
    margin: 8px 4px 0;
    font: var(--body-large);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.post-page .comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.post-page .comment {
    display: flex;
    gap: 7px;
    margin: 0;
    padding: 8px 12px 8px 8px;
    border-radius: 16px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
}

.post-page .comment-avatar {
    width: 28px;
    height: 28px;
}

/* The header line is the app's labelMedium line (16 px), not the taller line of the body font (ticket 1718). */
.post-page .comment-body {
    font: var(--label-medium);
}

.post-page .comment-author {
    font: var(--label-medium);
    font-weight: 600;
}

/* The app's comment header (ticket 1718): the full name in semibold, the @handle after it in the secondary colour. */
.comment-handle {
    font: var(--label-medium);
    font-weight: 400;
    color: var(--on-surface-variant);
}

.comment-date {
    font: var(--label-small);
    color: var(--on-surface-variant);
}

.post-page .comment-body p {
    margin: 0;
    font: var(--body-medium);
}

.lb-open-app {
    display: inline-block;
    margin-top: 16px;
    color: var(--on-surface);
    font: var(--label-large);
}

.post-page .lb-arrow,
.post-page .lb-close {
    display: none;
}

/* ----- Post: the lightbox (1000 and wider): photo card left, the 420 glass column right, ‹ › in the side margins ----- */
@media (min-width: 1000px) {
    .post-page {
        --side: 80px;
        --margin: clamp(12px, 8vh, 44px);
    }

    .lightbox {
        --photo-w: min(100cqw - var(--side) * 2 - 436px, (100vh - var(--margin) * 2) * var(--aspect));
        --photo-h: calc(var(--photo-w) / var(--aspect));
        height: 100vh;
    }

    .lb-stage {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 16px;
        padding-top: calc((100vh - var(--photo-h)) / 2);
    }

    .lb-photo-col {
        flex: 0 0 auto;
        width: var(--photo-w);
        height: var(--photo-h);
        padding: 0;
    }

    /* Wide: the author is in the card only, as in the app's lightbox (Poster ticket 1577, ticket 1714). */
    .post-page .lb-photo-pill {
        display: none;
    }

    .lb-photos,
    .lb-text-card {
        width: 100%;
        height: 100%;
        border-radius: 24px;
        box-shadow: var(--shadow-raised);
    }

    .post-page .post-photo {
        height: 100%;
        aspect-ratio: auto;
    }

    .lb-photo-actions {
        display: none;
    }

    .lb-column {
        flex: 0 0 420px;
        max-height: calc(100vh - var(--margin));
        padding: 0;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .lb-card {
        padding: 14px;
        border-radius: 24px;
        background: var(--surface-glass);
        box-shadow: var(--shadow);
    }

    .lb-card .lb-card-author {
        display: flex;
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .lb-card .lb-card-actions {
        display: flex;
        /* 8 px as in the app's card: with 12 the comments under it sat 4 px low (ticket 1718's parity box). */
        margin-top: 8px;
    }

    .lb-card .action-pill {
        background: none;
        box-shadow: none;
        border: 1px solid var(--outline-variant);
    }

    .lb-card .post-meta {
        margin: 8px 0 0;
    }

    .post-page .lb-arrow {
        position: fixed;
        top: calc(50vh - 26px);
        display: inline-flex;
        width: 52px;
        height: 52px;
    }

    .lb-arrow-none {
        visibility: hidden;
    }

    .lb-prev {
        left: calc(var(--side) / 2 - 26px);
    }

    .lb-next {
        right: calc(var(--side) / 2 - 26px);
    }

    .post-page .lb-close {
        position: fixed;
        z-index: 2;
        top: 24px;
        right: 24px;
        display: inline-flex;
        width: 48px;
        height: 48px;
    }

    .post-page .home-button {
        display: none;
    }
}

@media (min-width: 1400px) {
    .post-page {
        --side: 112px;
        --margin: clamp(12px, 8vh, 56px);
    }
}
