/* Current home controls using Vecindar's original shared theme.
   Colours, typography, cards and buttons come from html.css/theme.css/screen.css. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-shell {
    padding-top: 69px;
}

.home-hero {
    position: relative;
    padding: 18px 12px;
    isolation: isolate;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 345px;
    z-index: -1;
    background: url('/images/vecindar.webp') center / cover no-repeat;
}

.home-hero__copy {
    margin: 0 auto;
    max-width: 1120px;
    padding: 24px;
}

.home-hero__message > .vecindar,
.home-hero__message > .home-kicker,
.home-hero h1,
.home-hero__intro,
.home-hero__links {
    text-align: center;
}

.home-hero__message,
.home-hero__discovery {
    min-width: 0;
}

.home-hero__links a {
    display: inline-block;
    padding: 10px 0;
}

.home-kicker {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: .9em;
}

.home-hero h1 {
    line-height: 1.3;
}

.home-hero h1 em,
.home-neighborhood-card h3 em {
    color: var(--brand);
    font-style: normal;
}

.home-hero__intro {
    margin: 12px 0;
}

.home-hero__links {
    margin: 0 0 12px;
}

.home-search-row,
.home-search-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-search-input {
    flex: 1;
    min-width: 0;
}

.home-search-input > i {
    color: var(--brand);
}

.home-search-input input {
    min-width: 0;
    box-sizing: border-box;
}

.home-search-button {
    flex-shrink: 0;
}

.home-distance-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: 12px;
    font-size: .9em;
}

.home-distance-row i,
.home-location i {
    margin-right: 6px;
    color: var(--brand);
}

.home-distance-row output {
    white-space: nowrap;
}

.home-distance {
    width: 100%;
}

.home-location-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted var(--border);
}

.home-location {
    flex-basis: 100%;
    font-size: .9em;
}

.home-location-picker summary {
    width: fit-content;
    cursor: pointer;
    margin: 12px 0;
    color: var(--brand);
}

.home-location-picker form {
    display: grid;
    gap: 6px;
}

/* The legacy search field uses content-box; keep this full-width field inside its card. */
.home-location-picker input[type="search"] {
    box-sizing: border-box;
    min-width: 0;
}

.home-location-picker button {
    min-height: 44px;
    height: auto;
    line-height: 1.4;
    padding: 6px 12px;
    white-space: normal;
}

#home-location-options {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

#home-location-status,
#home-search-status {
    font-size: .9em;
    overflow-wrap: anywhere;
}

#home-location-status {
    flex-basis: 100%;
}

#home-location-status:empty {
    display: none;
}

.home-location-picker details[open] {
    flex-basis: 100%;
}

.home-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 12px;
}

.home-section-heading,
.home-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.home-section-count,
.home-live {
    font-size: .9em;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    color: var(--color);
    outline: 1px solid transparent;
}

.home-action:hover {
    color: var(--color);
    outline-color: var(--brand);
}

.home-action__icon {
    color: var(--brand);
    font-size: 26px;
    margin-bottom: 12px;
}

.home-action__number {
    color: var(--color);
    font-family: monospace;
    font-size: .9em;
}

.home-action h3 {
    margin: 6px 0 12px;
    line-height: 1.3;
}

.home-action__link {
    margin-top: auto;
    padding-top: 12px;
    color: var(--brand);
}

.home-feed-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.home-outline-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.home-outline-button:hover {
    border-color: var(--brand);
}

.home-feed-results {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-feed-results > h3 {
    grid-column: 1 / -1;
}

.home-feed-results > .result {
    grid-column: 1 / -1;
}

.home-feed-results > .card {
    max-width: none !important;
}

.home-feed-results > .card h3 {
    line-height: 1.3;
    margin-bottom: 12px;
}

/* Preserve the shared publication grid and its original card/title styles. */
.home-feed-results .result > .column {
    min-width: 0;
}

.home-feed-results .card {
    overflow-wrap: anywhere;
}

.home-neighborhood-card {
    max-width: 630px;
    margin: 24px auto 0;
}

.home-neighborhood-card__top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--brand);
}

.home-neighborhood-card h3 {
    margin-bottom: 12px;
    line-height: 1.3;
}

.home-neighborhood-card__footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted var(--border);
    font-size: .9em;
}

.home-shell [hidden] {
    display: none !important;
}

.home-shell :focus-visible {
    outline: 2px solid var(--brand) !important;
    outline-offset: 3px;
}

@media only screen and (min-width: 900px) {
    .home-hero__copy {
        display: grid;
        grid-template-columns: .95fr 1.05fr;
        gap: 32px;
        align-items: center;
    }

    .home-hero__message > .vecindar,
    .home-hero__message > .home-kicker,
    .home-hero h1,
    .home-hero__intro,
    .home-hero__links {
        text-align: left;
    }
}

@media only screen and (max-width: 640px) {
    .home-hero__copy {
        padding: 18px 12px;
    }

    .home-action-grid,
    .home-feed-results {
        grid-template-columns: 1fr;
    }

    .home-section-heading,
    .home-feed-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-feed-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media only screen and (max-width: 420px) {
    .home-search-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-shell .card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
