/* ==========================================================================
   registry-list.css — what is inside the panels of Materials, Items and Jobs
   (pages/materials.html, items.html, jobs.html). Load AFTER site.css and registry.css.
   The frame (bar, backdrop, hero, title, glass panels, hover knobs) is the registry shell in
   registry.css; this file adds: the filter strip, the list of cards, the three title looks
   (Materials: faceted shimmer, Items: treasure gleam, Jobs: ember glow) and their ornaments.
   Hover pop uses the shell's --reg-pop-* knobs, so html.calm (Still / reduced motion) stills it.
   Wide screens: one row per card (name, kind, price, description, rarity); 761-1100 px: the
   description drops under the row; phones: a compact card (name + price, kind + rarity, text).
   ========================================================================== */

.reg-list-page { line-height: 1.5; }

/* the longer titles ("Materials Registry") are a little smaller than Economy's one word */
.reg-list-page .reg-title { font-size: clamp(2.4rem, 6.4vw, 5rem); }

/* --- Materials: a faceted shimmer. Cut lines run through the metal and a hard-edged flash of light
       crosses it, as if it turned in the light. (Three background layers: flash, facets, fill.) --- */
.reg-page[data-theme="materials"] .reg-title {
    --title-fill: linear-gradient(180deg, var(--glint) 0%, var(--accent) 42%, var(--accent2) 100%);
    background:
        linear-gradient(105deg, transparent 45%, rgba(255, 255, 255, 0.96) 48.5%, rgba(255, 255, 255, 0.3) 52%, transparent 53%) -160% 0 / 60% 100% no-repeat,
        repeating-linear-gradient(118deg, transparent 0 0.42em, rgba(255, 255, 255, 0.3) 0.42em calc(0.42em + 1px), transparent calc(0.42em + 1px) 0.86em, rgba(20, 0, 60, 0.22) 0.86em calc(0.86em + 1px)) 0 0 / 100% 100%,
        var(--title-fill);
    -webkit-background-clip: text;
    background-clip: text;
    animation-name: reg-shine-facets;
}
@keyframes reg-shine-facets {
    0%   { background-position: -160% 0, 0 0, 0 0; }
    45%  { background-position: 260% 0, 0 0, 0 0; }
    100% { background-position: 260% 0, 0 0, 0 0; }
}
.reg-page[data-theme="materials"] .reg-ornament::after {
    width: 13px; height: 13px;
    border: 1px solid var(--glint);
    background: linear-gradient(135deg, var(--glint) 0 30%, var(--accent) 30% 62%, var(--accent2) 62%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* --- Items: a treasure gleam. A wide soft sweep, then a thin sharp one, over a bevelled gold. --- */
.reg-page[data-theme="items"] .reg-title {
    --title-fill: linear-gradient(180deg, #fffbe8 0%, var(--accent) 38%, var(--accent2) 100%);
    background:
        linear-gradient(105deg, transparent 30%, rgba(255, 251, 232, 0.9) 50%, transparent 70%) -160% 0 / 70% 100% no-repeat,
        linear-gradient(105deg, transparent 47%, #ffffff 50%, transparent 53%) -160% 0 / 40% 100% no-repeat,
        var(--title-fill);
    -webkit-background-clip: text;
    background-clip: text;
    animation-name: reg-shine-gleam;
    animation-duration: 9s;
}
@keyframes reg-shine-gleam {
    0%   { background-position: -160% 0, -160% 0, 0 0; }
    38%  { background-position: 260% 0, -160% 0, 0 0; }
    52%  { background-position: 260% 0, -160% 0, 0 0; }
    88%  { background-position: 260% 0, 260% 0, 0 0; }
    100% { background-position: 260% 0, 260% 0, 0 0; }
}
.reg-page[data-theme="items"] .reg-ornament::after {         /* the centre mark: a four-point twinkle */
    width: 22px; height: 22px;
    border: 0;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 14%, var(--glint) 30%, var(--accent) 70%);
    clip-path: polygon(50% 0, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0 50%, 41% 41%);
    box-shadow: none;
    filter: drop-shadow(0 0 5px var(--accent));
}

/* --- Jobs: an ember glow. Hot metal fill; under the name a line of heat that breathes. --- */
.reg-page[data-theme="jobs"] .reg-title {
    --title-fill: linear-gradient(180deg, #ffe6c8 0%, var(--accent) 38%, var(--accent2) 72%, #b3260d 100%);
    position: relative;
    display: inline-block;
    padding-bottom: 0.02em;
}
.reg-page[data-theme="jobs"] .reg-title::after {
    content: '';
    position: absolute;
    left: 4%; right: 4%; bottom: 0;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, transparent, #b3260d 12%, var(--accent2) 34%, #ffc27a 50%, var(--accent2) 66%, #b3260d 88%, transparent);
    box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent2) 55%, transparent), 0 0 38px 6px color-mix(in srgb, var(--accent2) 24%, transparent);
    animation: reg-ember-breathe 3.6s ease-in-out infinite;
}
@keyframes reg-ember-breathe {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
html.calm .reg-page[data-theme="jobs"] .reg-title::after { animation: none; opacity: 0.85; }
.reg-page[data-theme="jobs"] .reg-ornament::after {          /* the centre mark: an ember drop */
    width: 12px; height: 12px;
    border: 0;
    border-radius: 0 50% 50% 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: radial-gradient(circle at 60% 60%, #fff4de 0 14%, #ffc27a 38%, var(--accent2) 80%);
    box-shadow: 0 0 10px 1px color-mix(in srgb, var(--accent2) 80%, transparent);
}
/* Still / reduced motion: the two titles with extra layers stand still, flash off to the side */
html.calm .reg-page[data-theme="materials"] .reg-title { animation: none; background-position: -160% 0, 0 0, 0 0; }
html.calm .reg-page[data-theme="items"] .reg-title { animation: none; background-position: -160% 0, -160% 0, 0 0; }

/* --- the filter strip: one glass panel, a row of labelled controls --- */
.reg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 18px;
    padding: 22px 26px 26px;
}
.reg-filters .filter-group {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.reg-filters .filter-group:first-child { flex: 1.6 1 220px; }
.reg-filters label {
    font-family: var(--font-fantasy);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.reg-filters input,
.reg-filters select {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    border-radius: 12px;
    background: rgba(8, 6, 18, 0.72);
    color: var(--ink);
    color-scheme: dark;
    font-family: inherit;
    font-size: 1.05rem;              /* 16 px and up: phones do not zoom the page when a box is tapped */
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.reg-filters input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.reg-filters select option { background: #14101f; color: var(--ink); }
.reg-filters input:hover,
.reg-filters select:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.reg-filters input:focus,
.reg-filters select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
    background: rgba(14, 10, 28, 0.85);
}

/* --- the list: one glass panel (no blur: it is tall and its cards are many), a card per row --- */
html[data-quality] .reg-panel.reg-list-panel {
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(20, 16, 34, 0.74), rgba(10, 8, 20, 0.82));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.reg-page .items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reg-page .item-card {
    --rim: color-mix(in srgb, var(--accent) 30%, transparent);   /* the stripe at the card's left edge, by rarity */
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) 150px 140px minmax(0, 2.4fr) 130px;
    gap: 8px 20px;
    align-items: center;
    padding: 16px 22px 16px 24px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(26, 21, 44, 0.86), rgba(13, 10, 26, 0.9));
    box-shadow: inset 3px 0 0 var(--rim);
    transition: transform var(--reg-pop-ms) var(--reg-pop-ease), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.reg-page .item-card:has(.rarity-common)    { --rim: #aaaaaa; }
.reg-page .item-card:has(.rarity-uncommon)  { --rim: #4caf50; }
.reg-page .item-card:has(.rarity-rare)      { --rim: #2196f3; }
.reg-page .item-card:has(.rarity-epic)      { --rim: #b84fd6; }
.reg-page .item-card:has(.rarity-legendary) { --rim: #ffd700; }
.reg-page .item-card:has(.rarity-mythic)    { --rim: #ff9800; }

.reg-page .item-name {
    font-family: var(--font-fantasy);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.25;
    color: color-mix(in srgb, var(--accent) 55%, #ffffff);
    overflow-wrap: anywhere;
}
.reg-page .item-type { color: var(--ink-soft); font-size: 1.05rem; }
.reg-page .item-price-container { display: flex; justify-content: flex-end; align-items: center; }
.reg-page .item-price { color: var(--accent); font-weight: bold; font-size: 1.15rem; white-space: nowrap; }
.reg-page .item-description {
    color: var(--ink);
    font-size: 1.05rem;
    font-style: italic;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.reg-page .item-rarity {
    justify-self: end;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
}
.rarity-common    { color: #aaaaaa; }
.rarity-uncommon  { color: #4caf50; }
.rarity-rare      { color: #2196f3; }
.rarity-epic      { color: #b84fd6; }
.rarity-legendary { color: #ffd700; }
.rarity-mythic    { color: #ff9800; }

/* Items: a card opens to show its lore (items.js toggles .expanded) */
.reg-page .item-card.expandable { cursor: pointer; }
.reg-page .extended-lore-container {
    display: none;
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 16px 20px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.65;
}
.reg-page .item-card.expanded .extended-lore-container { display: block; }
.reg-page .item-card.expanded {
    z-index: 2;
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, rgba(26, 21, 44, 0.92)), rgba(14, 11, 28, 0.94));
    box-shadow: inset 3px 0 0 var(--rim), 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

/* hover pop: a full-width row lifts 2-3 px and grows 1% (3% of a wide row would be ~35 px) */
@media (hover: hover) {
    .reg-page .item-card:hover {
        z-index: 2;
        transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-row));
        border-color: color-mix(in srgb, var(--accent) 55%, transparent);
        background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, rgba(26, 21, 44, 0.92)), rgba(14, 11, 28, 0.94));
        box-shadow: inset 3px 0 0 var(--rim), 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
    }
}
@media (hover: none) {
    .reg-page .item-card:active {
        z-index: 2;
        transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-row));
        border-color: color-mix(in srgb, var(--accent) 55%, transparent);
        box-shadow: inset 3px 0 0 var(--rim), 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 18px color-mix(in srgb, var(--accent) 20%, transparent);
    }
}
html.calm .reg-page .item-card { transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease; }

/* --- 761 to 1100 px: the description drops under the row so the name and price keep their room --- */
@media (max-width: 1100px) {
    .reg-page .item-card {
        grid-template-columns: minmax(0, 1.4fr) 1fr 120px 120px;
        gap: 6px 16px;
    }
    .reg-page .item-description { grid-column: 1 / -1; order: 5; }
    .reg-page .item-rarity { order: 4; }
    .reg-page .item-price-container { order: 3; }
    .reg-page .item-type { order: 2; }
}

/* --- phones: a compact card: name and price, kind and rarity, then the text in full --- */
@media (max-width: 760px) {
    .reg-filters { padding: 16px 14px 18px; gap: 12px; }
    .reg-filters .filter-group { flex: 1 1 140px; }
    .reg-filters .filter-group:first-child { flex: 1 1 100%; }
    .reg-filters label { font-size: 0.78rem; }
    .reg-filters input,
    .reg-filters select { font-size: 1rem; }
    html[data-quality] .reg-panel.reg-list-panel { padding: 12px 10px; }
    .reg-page .items-list { gap: 10px; }
    .reg-page .item-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 12px;
        padding: 14px 14px 14px 18px;
        border-radius: 12px;
    }
    .reg-page .item-name { grid-column: 1; grid-row: 1; font-size: 1.15rem; }
    .reg-page .item-price-container { grid-column: 2; grid-row: 1; order: 0; }
    .reg-page .item-type { grid-column: 1; grid-row: 2; order: 0; font-size: 0.95rem; }
    .reg-page .item-rarity { grid-column: 2; grid-row: 2; order: 0; font-size: 0.78rem; }
    .reg-page .item-description {
        grid-column: 1 / -1; grid-row: 3; order: 0;
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
        margin-top: 4px;
        font-size: 1rem;
    }
    .reg-page .extended-lore-container { grid-row: 4; padding: 12px 14px; font-size: 1rem; }
    .reg-page .item-card:active { transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s)); }
}
