/* Home page layout and look. Loaded after role-index.css and overrides its .hp-* rules, so the shared
   role/list pages keep their styles. Motion lives in home-effects.css / home-effects.js. */

.role-page.hp {
    --fsm-night: #003a49;
    --fsm-teal: #006580;
    --fsm-teal-ink: #004f63;
    --fsm-red: #ef3038;
    --fsm-red-text: #b91c23;
    --fsm-gilt: #d4b26a;
    --ink: #1b2a30;
    --muted: #5b6670;
    --line: #dfe3e8;
    --paper: #f4f5fa;
    --ring: 0 0 0 3px #fff, 0 0 0 5px var(--fsm-teal);
    /* Shared .rp-* components follow the page tokens (fixes the 4.4:1 subtitle contrast). */
    --rp-muted: var(--muted);
    --rp-border: var(--line);
    --rp-text: var(--ink);
}

/* ---------------------------------------------------------------- Hero */
.role-page.hp .hp-hero {
    display: block;
    padding: 56px 48px 52px;
    margin-bottom: 8px;
    border-radius: 20px;
    text-align: left;
    background: var(--fsm-night);
    box-shadow: none;
}
.role-page.hp .hp-hero::after { height: 4px; background: var(--fsm-red); }
.role-page.hp .hp-hero-copy { position: relative; z-index: 1; max-width: 600px; }

.role-page.hp .hp-hero-art {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 58%;
    z-index: 0;
    pointer-events: none;
    /* Keep the copy on solid ground: the lattice only appears towards the right edge. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .35) 30%, #000 70%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .35) 30%, #000 70%);
}
.role-page.hp .hp-girih { position: absolute; inset: 0; display: block; }
.role-page.hp .hp-girih-line {
    fill: none;
    stroke: var(--fsm-gilt);
    stroke-width: 1;
    stroke-linejoin: round;
    stroke-opacity: .42;
}

.role-page.hp .hp-title {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(1.875rem, 1.2rem + 2.6vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.015em;
}
.role-page.hp .hp-lead {
    max-width: 46ch;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, .86);
    font-size: 1rem;
    line-height: 1.55;
}
.role-page.hp .hp-search { max-width: 600px; margin: 0; }
.role-page.hp .hp-search input { border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(0, 20, 28, .6); }
.role-page.hp .hp-search input:focus { box-shadow: 0 12px 32px -12px rgba(0, 20, 28, .6); }
.role-page.hp .hp-search input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (hover: none) {
    .role-page.hp .rp-kbd { display: none; }
}

/* ------------------------------------------------------------- Toolbar */
/* The layout's .app-content has overflow-x:hidden, which makes it a scroll container and stops
   position:sticky from following the page. clip hides overflow the same way without that side effect. */
body:has(.role-page.hp) .app-content { overflow-x: clip; overflow-y: visible; }

.role-page.hp .hp-toolbar {
    position: sticky;
    top: var(--hp-header-h, 70px); /* below the sticky site header; home-effects.js measures it */
    z-index: 20;
    margin: 0 -12px 16px;
    padding: 16px 12px 14px;
    background: rgba(244, 245, 250, .9);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.role-page.hp .hp-toolbar.is-stuck { border-bottom-color: var(--line); box-shadow: 0 10px 20px -18px rgba(0, 40, 50, .5); }
.role-page.hp .rp-subtitle { color: var(--muted); font-size: .8125rem; }

.role-page.hp .hp-chip { border-color: var(--line); color: var(--ink); }
.role-page.hp .hp-chip:hover { border-color: var(--fsm-teal); }
.role-page.hp .hp-chip:focus { box-shadow: none; }
.role-page.hp .hp-chip:focus-visible { outline: 3px solid var(--fsm-teal); outline-offset: 2px; }
.role-page.hp .hp-chip.is-active { background: var(--fsm-teal); border-color: var(--fsm-teal); color: #fff; }
.role-page.hp .hp-chip span { color: var(--muted); }
.role-page.hp .hp-chip.is-active span { color: rgba(255, 255, 255, .85); }
.role-page.hp .hp-chip[hidden] { display: none; }
.role-page.hp .hp-dot.is-closed { background: #8a94a0; }

/* --------------------------------------------------------------- Cards */
.role-page.hp .hp-grid { gap: 16px; }
.role-page.hp .hp-card {
    padding: 22px 22px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: none;
    transition: border-color .15s ease;
}
.role-page.hp .hp-card:hover { transform: none; box-shadow: none; border-color: var(--fsm-teal); }
.role-page.hp .hp-card:has(.hp-card-link:focus-visible) { border-color: var(--fsm-teal); box-shadow: var(--ring); }

.role-page.hp .hp-card-top { margin-bottom: 12px; justify-content: flex-start; }
.role-page.hp .hp-countdown { font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.role-page.hp .hp-countdown.is-urgent { animation: none; color: var(--fsm-red-text); }
.role-page.hp .hp-countdown.is-closed { background: #eef0f3; color: #4b5563; }

.role-page.hp .hp-card-title {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.45;
}
.role-page.hp .hp-card-link { color: inherit; text-decoration: none; }
.role-page.hp .hp-card-link:focus { outline: none; }
/* The whole card is the link target; the visible "Forma git" is just a cue. */
.role-page.hp .hp-card-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.role-page.hp .hp-card-text {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .9375rem;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.role-page.hp .hp-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 0;
}
.role-page.hp .hp-card-text + .hp-card-foot { margin-top: 16px; }
.role-page.hp .hp-card-date { margin: 0; color: var(--muted); font-size: .8125rem; }
.role-page.hp .hp-card-go { display: inline-flex; align-items: center; gap: 6px; color: var(--fsm-teal-ink); font-size: .875rem; font-weight: 700; }
.role-page.hp .hp-card-go i { transition: transform .15s ease; }
.role-page.hp .hp-card:hover .hp-card-go i { transform: translateX(3px); }

.role-page.hp .hp-card.is-closed,
.role-page.hp .hp-card.is-soon { background: #fafbfc; }
.role-page.hp .hp-card.is-closed:hover,
.role-page.hp .hp-card.is-soon:hover { border-color: var(--line); }
.role-page.hp .hp-card.is-closed .hp-card-title { color: #4b5563; }

/* ------------------------------------------------- Expired forms group */
.role-page.hp .hp-archive { grid-column: 1 / -1; margin-top: 8px; }
.role-page.hp .hp-archive[hidden] { display: none; }
.role-page.hp .hp-archive > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-family: Quicksand, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}
.role-page.hp .hp-archive > summary::-webkit-details-marker { display: none; }
.role-page.hp .hp-archive > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease;
}
.role-page.hp .hp-archive[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.role-page.hp .hp-archive > summary:focus-visible { outline: 3px solid var(--fsm-teal); outline-offset: 2px; border-radius: 6px; }
.role-page.hp .hp-archive-count {
    padding: 1px 9px;
    border-radius: 999px;
    background: #eef0f3;
    color: #4b5563;
    font-family: "Open Sans", sans-serif;
    font-size: .8125rem;
    font-weight: 600;
}
.role-page.hp .hp-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding-top: 8px;
}

/* --------------------------------------------------------- Empty states */
.role-page.hp .hp-empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.role-page.hp .hp-empty p { max-width: 52ch; margin: 0 auto; color: var(--muted); }
.role-page.hp .hp-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 10px; }
.role-page.hp .hp-suggest-chip {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: .875rem;
    cursor: pointer;
}
.role-page.hp .hp-suggest-chip:hover { border-color: var(--fsm-teal); color: var(--fsm-teal-ink); }
.role-page.hp .hp-link-btn {
    margin-top: 6px;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--fsm-teal-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.role-page.hp :is(.hp-suggest-chip, .hp-link-btn, .rp-clear):focus-visible { outline: 3px solid var(--fsm-teal); outline-offset: 2px; }

/* Footer copyright on this page: #90a4ae on white is 2.6:1. */
.footer .float-md-left { color: #5b6670; }

/* --------------------------------------------------------------- Mobile */
@media (max-width: 767.98px) {
    .role-page.hp .hp-hero { padding: 28px 20px 26px; border-radius: 16px; }
    .role-page.hp .hp-hero-art {
        width: 100%;
        opacity: .5;
        -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 55%);
        mask-image: linear-gradient(200deg, #000 0%, transparent 55%);
    }
    .role-page.hp .hp-lead { margin-bottom: 20px; font-size: .9375rem; }
    .role-page.hp .hp-toolbar { flex-direction: column; align-items: stretch; gap: 10px; margin: 0 -8px 12px; padding: 12px 8px 10px; }
    .role-page.hp .hp-filters { flex-wrap: wrap; overflow: visible; }
    .role-page.hp .hp-archive-grid { grid-template-columns: 1fr; gap: 14px; }
}
