/* ── Public pages: event listing, event page, homepage demo widgets ──────────
   Pages a signed-out visitor can load. They render as static HTML (no Blazor
   circuit), so nothing here relies on component interactivity: filters are
   plain GET forms, and the homepage demos are driven by /js/home-demos.js.

   Built on the site tokens in site.css (--pastel-*, --color-*) rather than
   new colours, and deliberately calm: no glow, no looping animation. Motion
   that does exist is short, triggered by the visitor, and switched off under
   prefers-reduced-motion. */

.pub-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.pub-section {
    padding: 3rem 0;
}

.pub-section--tint {
    background: var(--color-surface-elevated);
}

.pub-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary-strong);
    margin-bottom: 0.5rem;
}

.pub-h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text-strong);
    margin: 0 0 1rem;
}

.pub-h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-strong);
    margin: 0 0 0.75rem;
}

.pub-h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-strong);
    margin: 0 0 0.4rem;
}

.pub-lead {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text-subtle);
    max-width: 40rem;
}

.pub-muted {
    color: var(--color-muted);
}

.pub-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(35, 22, 37, 0.04);
}

.pub-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.pub-link {
    color: var(--color-primary-strong);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Status pills ── */
.pub-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pub-pill--open      { background: #E3F8EF; color: #11684A; border-color: #B6EAD3; }
.pub-pill--closed    { background: #FFF1EC; color: #9A3B1F; border-color: #FFD5C8; }
.pub-pill--finished  { background: #F1EEF4; color: #5B4A68; border-color: #E2DAEA; }
.pub-pill--external  { background: #EAF4FF; color: #1D5E9E; border-color: #C7E1FF; }
.pub-pill--kind      { background: var(--color-surface-elevated); color: var(--color-text-subtle); border-color: var(--color-border); }
.pub-pill--sample    { background: #FFF6DB; color: #7A5800; border-color: #F5E2A6; }
.pub-pill--show      { background: #FFF0F8; color: #8A2A62; border-color: #F8CFE6; }

/* ── Event cards (listing + homepage) ── */
.pub-event-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-event-card:hover,
.pub-event-card:focus-visible {
    border-color: var(--color-border-strong);
    box-shadow: 0 6px 18px rgba(35, 22, 37, 0.08);
}

.pub-event-card:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.pub-event-card__top {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.pub-date {
    flex-shrink: 0;
    width: 3.4rem;
    text-align: center;
    border-radius: 0.75rem;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    padding: 0.35rem 0;
    line-height: 1.1;
}

.pub-date__month { display: block; font-size: 0.7rem; font-weight: 700; color: var(--color-primary-strong); text-transform: uppercase; letter-spacing: 0.06em; }
.pub-date__day   { display: block; font-size: 1.5rem; font-weight: 800; color: var(--color-text-strong); }
.pub-date__dow   { display: block; font-size: 0.68rem; font-weight: 600; color: var(--color-muted); }

.pub-event-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text-strong);
    margin: 0 0 0.35rem;
}

.pub-event-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

.pub-event-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.pub-event-card__meta .material-icons {
    font-size: 1rem;
    color: var(--color-muted);
}

.pub-event-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

/* ── Filters ── */
.pub-filters {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    align-items: end;
}

@media (min-width: 768px) {
    .pub-filters {
        grid-template-columns: 2fr 1fr 1fr auto;
    }
}

.pub-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-subtle);
    margin-bottom: 0.3rem;
}

.pub-field input,
.pub-field select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 0.6rem;
    background: #fff;
    color: var(--color-text);
    font: inherit;
}

.pub-field input:focus,
.pub-field select:focus {
    outline: 3px solid var(--color-primary-soft);
    border-color: var(--color-primary);
}

.pub-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.pub-quick a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-strong);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-subtle);
    text-decoration: none;
}

.pub-quick a[aria-current="true"] {
    background: var(--color-primary-strong);
    border-color: var(--color-primary-strong);
    color: #fff;
}

.pub-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.pub-pager {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* ── Event page ── */
.pub-event-hero {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .pub-event-hero {
        grid-template-columns: minmax(0, 1fr) 22rem;
        align-items: start;
    }
}

.pub-facts {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pub-facts li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    color: var(--color-text);
}

.pub-facts .material-icons {
    font-size: 1.2rem;
    color: var(--color-primary-strong);
    margin-top: 0.1rem;
}

.pub-price-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pub-price-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
}

.pub-price-list li:last-child {
    border-bottom: 0;
}

.pub-price {
    font-weight: 700;
    color: var(--color-text-strong);
    white-space: nowrap;
}

.pub-prose {
    color: var(--color-text);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.pub-prose p { margin: 0 0 0.9rem; }
.pub-prose ul, .pub-prose ol { margin: 0 0 0.9rem 1.25rem; list-style: revert; }
.pub-prose a { color: var(--color-primary-strong); text-decoration: underline; }
.pub-prose h1, .pub-prose h2, .pub-prose h3 { font-weight: 700; margin: 1.2rem 0 0.5rem; color: var(--color-text-strong); }

.pub-notice {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: #FFF6DB;
    border: 1px solid #F5E2A6;
    color: #5C4300;
    font-size: 0.925rem;
}

.pub-signin-note {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--color-text-subtle);
}

/* ── Public event page: hero band ── */
.pub-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(160deg, #F4EBFF 0%, #FFF0F8 60%, #EFF8FF 100%);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 1.5rem 0 2.25rem;
}

.pub-band__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.pub-band__glow span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.pub-band__glow span:nth-child(1) { width: 26rem; height: 26rem; background: #B98CFF; top: -14rem; left: -8rem; }
.pub-band__glow span:nth-child(2) { width: 22rem; height: 22rem; background: #FF7CCB; bottom: -15rem; right: 5%; opacity: 0.3; }

.pub-band__crumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-text-subtle);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.pub-band__crumb a:hover { color: var(--color-primary-strong); }
.pub-band__crumb .material-icons { font-size: 1rem; }

.pub-band__row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-top: 1.25rem;
}

.pub-band__date {
    flex-shrink: 0;
    width: 4.5rem;
    text-align: center;
    border-radius: 1rem;
    padding: 0.5rem 0;
    background: var(--color-hot-gradient);
    color: var(--color-hot-text);
    box-shadow: 0 12px 30px -12px rgba(255, 122, 89, 0.6);
    line-height: 1.1;
}
.pub-band__date span { display: block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.pub-band__date strong { display: block; font-size: 2rem; font-weight: 800; }

.pub-band__title {
    font-size: clamp(1.7rem, 4.2vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin: 0 0 0.5rem;
}

.pub-band__where {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    color: var(--color-text-subtle);
}
.pub-band__where .material-icons { font-size: 1.1rem; color: var(--color-primary); }

.pub-band .pub-band__kind { background: #fff; color: var(--color-text-subtle); border-color: var(--color-border-strong); }

/* The collie pictures (HomeArt components) are styled in dog-art.css. */

/* ── Demo widgets ── */
.demo {
    position: relative;
}

.demo__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.demo__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-strong);
}

.demo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.demo-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 0.7rem;
    background: #fff;
    transition: transform 0.25s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.demo-row[draggable="true"] {
    cursor: grab;
}

.demo-row.is-dragging {
    opacity: 0.5;
}

.demo-row.is-moved,
.demo-row.is-updated {
    background: #F1FBF6;
    border-color: #9FDDBF;
}

.demo-row.has-clash {
    background: #FFF6F2;
    border-color: #FFC9B7;
}

.demo-pos {
    font-weight: 800;
    color: var(--color-primary-strong);
    text-align: center;
}

.demo-name {
    min-width: 0;
}

.demo-name strong {
    display: block;
    color: var(--color-text-strong);
    font-size: 0.95rem;
}

.demo-name small {
    display: block;
    color: var(--color-muted);
    font-size: 0.78rem;
}

.demo-moves {
    display: flex;
    gap: 0.25rem;
}

.demo-moves button,
.demo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-strong);
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}

.demo-btn {
    padding: 0.35rem 0.8rem;
}

.demo-moves button:disabled {
    opacity: 0.35;
    cursor: default;
}

.demo-moves button:focus-visible,
.demo-btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 1px;
}

.demo-moves .material-icons {
    font-size: 1.1rem;
}

.demo-status {
    min-height: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-subtle);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.demo-clash {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    background: #FFF1EC;
    border: 1px solid #FFD5C8;
    color: #7A2E16;
    font-size: 0.85rem;
}

.demo-score {
    font-weight: 800;
    color: var(--color-text-strong);
    font-variant-numeric: tabular-nums;
}

.demo-score--pending {
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
    .demo-row,
    .pub-event-card {
        transition: none;
    }
}
