/* ==========================================================================
   The account's home page (/@handle/home; views/home/layout, pages/home/).
   One column on warm paper, off-white cards, and the two colours the account
   chose for this page: main.css turns them into --color-primary... and
   --color-second... on <body> (App\Classes\Brand::Style()). Everything here
   is .hp-*: nothing of the other public pages is restyled.
   ========================================================================== */

.hp-body {
    --hp-bg: #F4F2EC;
    --hp-surface: #FFFEFA;
    --hp-ink: #252B27;
    --hp-muted: #687168;
    --hp-line: #DCDED4;
    --hp-soft: #EFF0E6;
    --hp-radius: 1.5rem;

    /* Without a second colour the accents take a tint of the main one. */
    --hp-accent: var(--brand-2, var(--color-primary-light));
    --hp-on-accent: var(--brand-2-on, var(--hp-ink));

    background-color: var(--hp-bg);
    background-image: radial-gradient(rgba(var(--color-primary-rgb), 0.07) 0.7px, transparent 0.7px);
    background-size: 16px 16px;
    color: var(--hp-ink);
    line-height: 1.5;
}

.hp-shell {
    width: min(100%, 36.5rem);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 1.75rem;
    display: grid;
    gap: 1.125rem;
}
.hp-shell > * { min-width: 0; }

.hp-body a { color: inherit; text-decoration: none; }
.hp-body a:focus-visible, .hp-body button:focus-visible { outline: 3px solid var(--color-link); outline-offset: 3px; }

.hp-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.625rem;
    font-weight: 800;
    color: var(--hp-muted);
}
.hp-arrow { font-size: 1.1em; line-height: 1; }
.hp-copy { display: block; margin: 0.75rem 0; font-size: 0.8125rem; color: var(--hp-muted); }
.hp-copy--ruled { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--hp-line); }
.hp-fine { margin: 0.625rem 0 0; font-size: 0.6875rem; color: var(--hp-muted); text-align: center; }
.hp-fine--left { text-align: left; margin-top: 0.25rem; }
.hp-empty { margin: 0; text-align: center; color: var(--hp-muted); font-size: 0.875rem; }

/* --- Buttons and links --------------------------------------------------- */

.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    padding: 0.5rem 1.125rem;
    border: 1px solid var(--color-primary);
    border-radius: 0.75rem;
    background: var(--color-primary);
    color: var(--color-on-primary) !important;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
.hp-btn:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.hp-btn--ghost { background: var(--hp-surface); border-color: var(--hp-line); color: var(--hp-ink) !important; }
.hp-btn--ghost:hover { background: var(--hp-soft); border-color: var(--hp-line); }
.hp-btn--block { display: flex; width: 100%; margin-top: 0.875rem; }

.hp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.25rem;
    font-size: 0.8125rem;
    font-weight: 750;
    color: var(--color-link) !important;
}
.hp-link:hover { text-decoration: underline; }

/* --- Hero ---------------------------------------------------------------- */

.hp-hero { text-align: center; padding: 0 0.5rem 0.5rem; }
.hp-hero__logo {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 0.625rem;
    border-radius: 1.375rem;
    border: 5px solid var(--hp-surface);
    box-shadow: 0 0 0 1px var(--hp-line);
    background: var(--hp-surface);
    overflow: hidden;
}
.hp-hero__logo img { width: 100%; height: 100%; object-fit: contain; }
/* No square logo: the account's own, whatever its shape, in a frame that follows it. */
.hp-hero__logo--wide { width: auto; max-width: min(100%, 15rem); height: auto; padding: 0.625rem 0.875rem; }
.hp-hero__logo--wide img { width: auto; max-width: 100%; height: auto; max-height: 4.5rem; }
.hp-hero__logo--mark { background: var(--color-primary); color: var(--color-on-primary); }
.hp-hero__logo--mark svg { width: 2.75rem; height: 2.75rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hp-hero__handle { margin: 0 0 0.875rem; font-size: 0.8125rem; font-weight: 650; color: var(--color-link); }
.hp-hero__headline { margin: 0.625rem 0; font-size: 2.3125rem; line-height: 1.08; letter-spacing: -0.045em; font-weight: 700; overflow-wrap: anywhere; }
.hp-hero__intro { max-width: 24rem; margin: 0.75rem auto 0; font-size: 0.875rem; color: var(--hp-muted); }

.hp-socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.125rem; }
.hp-social {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--hp-line);
    background: var(--hp-surface);
}
.hp-social:hover { background: var(--hp-soft); }
.hp-social .icon { width: 1.3125rem; height: 1.3125rem; stroke-width: 1.6; }

/* --- Avisos -------------------------------------------------------------- */

.hp-alerts { display: grid; gap: 0.625rem; }
.hp-alert {
    --alert-bg: #E8EEF9;
    --alert-line: #CBD8F0;
    --alert-fg: #2B4470;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 0.75rem;
    padding: 1rem;
    border: 1px solid var(--alert-line);
    border-radius: 1rem;
    background: var(--alert-bg);
    color: var(--alert-fg);
}
.hp-alert--success { --alert-bg: #E3F1E4; --alert-line: #C5DFC8; --alert-fg: #25572F; }
.hp-alert--warning { --alert-bg: #F5EACB; --alert-line: #E6D7AF; --alert-fg: #604A24; }
.hp-alert--urgent  { --alert-bg: #FBE3E0; --alert-line: #F0BDB7; --alert-fg: #84261C; }
.hp-alert__icon { width: 1.3125rem; height: 1.3125rem; margin-top: 0.125rem; }
.hp-alert__slides { display: grid; gap: 0.75rem; }
.hp-alert__slide { display: flex; align-items: flex-start; gap: 0.5rem; }
.hp-alert__slide[hidden] { display: none; }
.hp-alert__text { flex: 1; min-width: 0; font-size: 0.8125rem; }
.hp-alert__title { display: block; }
.hp-alert__body p { margin: 0.25rem 0 0; }
.hp-alert__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: -0.375rem -0.375rem 0 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.hp-alert__close:hover { background: rgba(0, 0, 0, 0.07); }
.hp-alert__dots { grid-column: 2; display: flex; gap: 0.125rem; margin-top: 0.375rem; }
.hp-alert__dots:empty { display: none; }
/* A dot is small; what is pressed is the 24px around it. */
.hp-alert__dot { width: 1.5rem; height: 1.5rem; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.hp-alert__dot::after { content: ''; position: absolute; inset: 0; margin: auto; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; opacity: 0.3; }
.hp-alert__dot.is-current::after { opacity: 1; }

/* --- Members ------------------------------------------------------------- */

.hp-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.875rem 1rem 0.875rem 1.25rem;
    border: 1px solid var(--hp-line);
    border-radius: 1.1875rem;
    background: var(--hp-surface);
}
.hp-member__text { flex: 1 1 12rem; margin: 0; font-size: 0.8125rem; font-weight: 600; }
.hp-member__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hp-member__actions form { margin: 0; }

/* --- Tiles --------------------------------------------------------------- */

.hp-group { display: grid; gap: 0.625rem; }
.hp-group__title { margin: 0.375rem 0.125rem 0; }
.hp-tiles { display: grid; gap: 0.6875rem; }
.hp-tile {
    display: grid;
    grid-template-columns: 2.875rem minmax(0, 1fr) auto;
    gap: 0.875rem;
    align-items: center;
    padding: 1.125rem;
    border: 1px solid var(--hp-line);
    border-radius: 1.1875rem;
    background: var(--hp-surface);
    transition: transform 0.18s;
}
.hp-tile:hover { transform: translateY(-2px); }
.hp-tile__icon { display: grid; place-items: center; width: 2.875rem; height: 2.875rem; border-radius: 0.8125rem; background: var(--hp-soft); color: var(--color-link); }
.hp-tile__icon .icon { width: 1.3125rem; height: 1.3125rem; stroke-width: 1.6; }
.hp-tile__text strong { display: block; font-size: 0.875rem; letter-spacing: -0.02em; }
.hp-tile__text small { display: block; margin-top: 0.1875rem; font-size: 0.6875rem; color: var(--hp-muted); }
.hp-tile .hp-arrow { font-size: 1.4375rem; }

.hp-tile--featured { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary) !important; }
.hp-tile--featured .hp-tile__icon { background: var(--hp-accent); color: var(--hp-on-accent); transform: rotate(-5deg); }
.hp-tile--featured .hp-tile__text small { color: inherit; opacity: 0.85; }

/* --- Cards --------------------------------------------------------------- */

.hp-card { padding: 1.375rem; border: 1px solid var(--hp-line); border-radius: var(--hp-radius); background: var(--hp-surface); }
/* A card's heading: its section's drawing, as on the tile it stands in for, then the title. */
.hp-card__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.125rem; }
.hp-card__icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.6875rem; background: var(--hp-soft); color: var(--color-link); }
.hp-card__icon .icon { width: 1.125rem; height: 1.125rem; stroke-width: 1.6; }
.hp-card__title { min-width: 0; margin: 0; font-size: 1.0625rem; letter-spacing: -0.035em; font-weight: 700; }

.hp-feature + .hp-feature { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--hp-line); }
.hp-feature__image { display: block; width: 100%; max-height: 15rem; margin-bottom: 0.875rem; border-radius: 1.125rem; object-fit: cover; background: var(--hp-soft); }
.hp-feature__title { display: block; margin: 0; font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.035em; font-weight: 700; }
.hp-feature__links { display: flex; flex-wrap: wrap; gap: 0 1.125rem; margin: 0; }

/* Calendar */
.hp-month__label { margin: 0 0 0.625rem; font-size: 0.75rem; font-weight: 700; text-transform: capitalize; }
.hp-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; text-align: center; }
.hp-month span { display: grid; place-items: center; min-height: 2.1875rem; font-size: 0.6875rem; position: relative; border-radius: 0.625rem; }
.hp-month .hp-month__weekday { min-height: 1.5625rem; font-size: 0.5625rem; color: var(--hp-muted); }
.hp-month .is-today { background: var(--color-primary); color: var(--color-on-primary); font-weight: 800; }
.hp-month .has-event::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--color-link); }
.hp-month .is-today.has-event::after { background: currentColor; }

.hp-events { margin: 0; padding: 0; list-style: none; }
.hp-events li { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hp-line); }
.hp-events--alone li:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hp-event { display: flex; align-items: center; gap: 0.8125rem; }
.hp-event__date { display: grid; place-items: center; min-width: 2.8125rem; padding: 0.3125rem; border-radius: 0.6875rem; background: var(--hp-soft); color: var(--color-link); font-size: 0.5625rem; font-weight: 700; }
.hp-event__date b { font-size: 1.1875rem; line-height: 1.2; }
.hp-event__text { min-width: 0; }
.hp-event__text strong { display: block; font-size: 0.8125rem; }
.hp-event__text small { display: block; margin-top: 0.1875rem; font-size: 0.6875rem; color: var(--hp-muted); }
.hp-event:hover strong { text-decoration: underline; }

/* Store: as the store's item page -- the picture on the left, what it is on
   the right; one under the other where there is no room for both. */
.hp-item { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: 1.125rem; align-items: stretch; }
.hp-item__media { position: relative; display: block; min-width: 0; min-height: 15rem; border-radius: 1.0625rem; background: var(--hp-soft); overflow: hidden; }
/* The picture fills its space -- as tall as the text beside it, and never
   short -- and what does not fit of it is cut off at the edges. */
.hp-item__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.hp-item__badge { position: absolute; left: 0.75rem; top: 0.75rem; padding: 0.3125rem 0.5625rem; border-radius: 1.875rem; background: var(--hp-accent); color: var(--hp-on-accent); font-size: 0.6875rem; font-weight: 800; }
.hp-item__info { min-width: 0; }
.hp-item__price { margin: 0.375rem 0 0; font-size: 1.5rem; font-weight: 750; letter-spacing: -0.04em; }
.hp-item__price s { margin-left: 0.375rem; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; color: var(--hp-muted); }
.hp-item__line { margin: 0.375rem 0 0; font-size: 0.75rem; color: var(--hp-muted); }
.hp-item__info .hp-btn--ghost { margin-top: 0.5rem; }

/* Organization: its own colours (--k1, --k2, --k-on from Brand::CardStyle()) */
.hp-org { display: block; }
.hp-org__banner { display: block; height: 5.5rem; border-radius: 1.0625rem; background: linear-gradient(135deg, var(--k1), var(--k2)) center / cover no-repeat; }
.hp-org__logo {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin: -2rem 0 0.75rem 1rem;
    position: relative;
    border-radius: 1rem;
    border: 4px solid var(--hp-surface);
    background: var(--k1);
    color: var(--k-on);
    font-weight: 800;
    overflow: hidden;
}
.hp-org__logo img { width: 100%; height: 100%; object-fit: cover; background: var(--hp-surface); }
.hp-org:hover .hp-link { text-decoration: underline; }

/* Poll */
.hp-question { margin: 0; font-size: 0.9375rem; font-weight: 650; line-height: 1.5; }

/* Figures */
.hp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.hp-stat { padding: 1.25rem; border: 1px solid var(--hp-line); border-radius: 1.3125rem; background: var(--hp-surface); }
.hp-stat:first-child { background: var(--hp-accent); border-color: transparent; color: var(--hp-on-accent); }
.hp-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.hp-stat .hp-eyebrow { font-size: 0.5625rem; color: inherit; }
.hp-stat b { display: block; margin-top: 0.625rem; font-size: 2.4375rem; line-height: 1.2; letter-spacing: -0.06em; }
.hp-stat small { display: block; margin-top: 0.25rem; font-size: 0.6875rem; }

/* --- Contact, footer ----------------------------------------------------- */

.hp-contact { text-align: center; padding: 0.75rem 1.25rem; }
.hp-contact__heading { margin: 0; font-size: 1.1875rem; letter-spacing: -0.035em; }
.hp-contact__text { margin: 0.5rem 0 0.875rem; font-size: 0.8125rem; color: var(--hp-muted); }
.hp-contact .hp-btn { border-radius: 1.875rem; }

.hp-footer { width: min(100%, 36.5rem); margin: 0 auto; padding: 0.875rem 1.25rem 2rem; border-top: 1px solid var(--hp-line); font-size: 0.6875rem; color: var(--hp-muted); }
.hp-footer p { margin: 0.25rem 0; }

/* --- The admin's preview bar --------------------------------------------- */

.hp-preview {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
    padding: 0.625rem 1rem;
    background: #1F2937;
    color: #FFFFFF;
    font-size: 0.8125rem;
}
.hp-preview a { color: #FFFFFF; text-decoration: underline; }
.hp-preview__as { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.hp-preview__link.is-current { text-decoration: none; font-weight: 700; }
.hp-preview__back { font-weight: 700; }

@media (max-width: 380px) {
    .hp-shell { padding: 1.75rem 0.875rem; }
    .hp-card { padding: 1.0625rem; }
    .hp-tile { padding: 0.9375rem; gap: 0.625rem; grid-template-columns: 2.625rem minmax(0, 1fr) auto; }
    .hp-tile__icon { width: 2.625rem; height: 2.625rem; }
    .hp-hero__headline { font-size: 2rem; }
    .hp-stat { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-tile { transition: none; }
}
