/* HXH-RPG — Atelier et sac : même langage d'équipement, sans effacer les lieux. */
/* Styles locaux aux deux pages, chargés après site-design.css. */
.hxh-site :is(.hxh-workshop-page, .hxh-inventory-page) {
    --equipment-ink: #4d351d;
    --equipment-muted: #786146;
    --equipment-border: #c8a878;
    --equipment-gold: #896333;
    --equipment-paper: #fff9e9;
    --equipment-parchment: #f4e7c9;
    color: var(--equipment-ink);
}
.hxh-site :is(.hxh-workshop-page, .hxh-inventory-page) :is(h1, h2, h3, h4, .item-name) {
    color: var(--equipment-ink);
    font-family: 'Cinzel', serif;
    overflow-wrap: anywhere;
}
.hxh-site .hxh-workshop-page {
    background: radial-gradient(ellipse at 80% 0, #fff7dd 0, transparent 55%), linear-gradient(155deg, #fff9e9, #f0dfba);
    border: 2px solid var(--equipment-border);
    box-shadow: 0 12px 30px #4d351d12, inset 0 0 0 4px #fff9e999;
    padding: clamp(1rem, 3vw, 2.5rem);
    max-width: 1220px;
    margin-inline: auto;
}
.hxh-site .hxh-workshop-heading {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--equipment-border);
}
.hxh-site .hxh-workshop-portrait {
    width: 150px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 5px double #8a693f;
    border-radius: 50%;
    background: #e9d5b0;
    box-shadow: 0 5px 15px #4d351d24;
}
.hxh-site .hxh-workshop-portrait img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hxh-site .hxh-workshop-eyebrow {
    color: var(--equipment-muted); text-transform: uppercase;
    font-size: .78rem; letter-spacing: .16em; margin: 0 0 .4rem;
}
.hxh-site .hxh-workshop-intro h1 { font-size: clamp(1.5rem, 3vw, 2.4rem); margin-bottom: .75rem; }
.hxh-site .hxh-workshop-intro p:not(.hxh-workshop-eyebrow) { line-height: 1.65; max-width: 74ch; margin-bottom: .55rem; }
.hxh-site .hxh-workshop-nav {
    display: flex; flex-wrap: wrap; gap: .5rem; padding: 1.2rem 0;
    border-bottom: 1px solid var(--equipment-border);
}
.hxh-site .hxh-workshop-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.1rem;
    color: var(--equipment-ink); border: 1px solid #cdb486;
    background: linear-gradient(180deg, #fff9ea, #ead7ad); border-radius: 4px;
    font-weight: 700; text-decoration: none; transition: border-color .15s, background-color .15s;
}
.hxh-site .hxh-workshop-nav a:hover { border-color: #886538; background: #fff3d6; }
.hxh-site .hxh-workshop-section { padding-top: clamp(1.75rem, 4vw, 2.5rem); scroll-margin-top: 90px; }
.hxh-site .hxh-workshop-section + .hxh-workshop-section {
    border-top: 1px solid var(--equipment-border); margin-top: 2rem;
}
.hxh-site .hxh-workshop-section-heading { margin-bottom: 1.4rem; }
.hxh-site .hxh-workshop-section-heading h2 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); margin-bottom: .4rem; }
.hxh-site .hxh-workshop-section-heading p { color: var(--equipment-muted); margin: 0; }
.hxh-site .hxh-stock-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.hxh-site .hxh-stock-card {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    border: 1px solid var(--equipment-border);
    border-top: 3px solid #8e734f; border-radius: 7px;
    background: linear-gradient(#fffcf3, #fff6e5);
    box-shadow: 0 4px 12px #4d351d0f;
}
.hxh-site .hxh-stock-card--rare { border-top-color: #38699b; }
.hxh-site .hxh-stock-card--epic { border-top-color: #7150a0; }
.hxh-site .hxh-stock-card--legendary { border-top-color: #b27a20; }
.hxh-site .hxh-stock-card--material { border-top-color: #58765c; }
.hxh-site .hxh-stock-visual {
    margin: 0; height: 175px; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(circle at 50% 40%, #fffaf0, #e8d6b5);
    border-bottom: 1px solid #e2ceaa;
}
.hxh-site .hxh-stock-visual img {
    display: block; max-width: 100%; max-height: 150px; width: auto; height: auto; object-fit: contain;
    filter: drop-shadow(0 6px 6px #422f2422);
}
.hxh-site .hxh-stock-details { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hxh-site .hxh-stock-rarity {
    width: fit-content; font-size: .76rem; letter-spacing: .08em; color: #6d4c23;
    border: 1px solid #d8bf91; padding: .15rem .5rem; background: #f8eacb; border-radius: 3px;
}
.hxh-site .hxh-stock-card--epic .hxh-stock-rarity { color: #614384; }
.hxh-site .hxh-stock-card--rare .hxh-stock-rarity { color: #305a86; }
.hxh-site .hxh-stock-card--legendary .hxh-stock-rarity { color: #865a10; }
.hxh-site .hxh-stock-details h3 { font-size: 1.08rem; line-height: 1.4; margin: .65rem 0; }
.hxh-site .hxh-stock-description { color: var(--equipment-muted); line-height: 1.5; font-size: .91rem; margin: 0 0 .85rem; overflow-wrap: anywhere; }
.hxh-site .hxh-stock-bonuses {
    margin: 0 0 .85rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem;
}
.hxh-site .hxh-stock-bonuses li {
    font-size: .8rem; padding: .25rem .45rem; color: #445f3d; background: #ecf1df;
    border: 1px solid #d1ddc2; border-radius: 3px;
}
.hxh-site .hxh-stock-effect { font-size: .88rem; line-height: 1.5; margin: 0 0 .75rem; }
.hxh-site .hxh-stock-bottom { border-top: 1px solid #dfcaa4; margin-top: auto; padding-top: .8rem; }
.hxh-site .hxh-stock-price { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.hxh-site .hxh-stock-price-label { width: 100%; color: var(--equipment-muted); font-size: .78rem; }
.hxh-site .hxh-stock-price strong { font-size: 1.12rem; }
.hxh-site .hxh-stock-price img { width: 20px; height: 20px; object-fit: contain; }
.hxh-site .hxh-stock-form { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; margin: 0; }
.hxh-site .hxh-stock-form label { color: var(--equipment-muted); font-size: .85rem; width: 100%; margin-bottom: -.4rem; }
.hxh-site .hxh-stock-form input[type='number'] {
    color: var(--equipment-ink); background: #fffdf6; border: 1px solid #bba278;
    border-radius: 4px; font: inherit; padding: .55rem; width: 76px; height: 44px;
}
.hxh-site .hxh-stock-form .hxh-button { flex: 1; min-width: 110px; }
.hxh-site .hxh-workshop-empty {
    color: var(--equipment-muted); border: 1px dashed #bba278;
    border-radius: 5px; background: #fff9e9; padding: 1.35rem; line-height: 1.6;
}
.hxh-site .hxh-workshop-empty--schematics { background: #f5e6c9; }
.hxh-site .hxh-workshop-empty p { margin: 0; }

/* Le sac garde ses images et catégories, mais retrouve le même papier que la forge. */
.hxh-site .hxh-inventory-page {
    max-width: 1220px; margin-inline: auto; background: linear-gradient(145deg, #fff9e9, #f1e2c2);
    border: 2px solid var(--equipment-border); border-radius: 8px;
    box-shadow: 0 12px 30px #4d351d12; padding: clamp(1rem, 3vw, 2rem) !important;
}
.hxh-site .hxh-inventory-page .inventory-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: .03em; text-transform: none;
    color: var(--equipment-ink); margin-bottom: 1.5rem;
}
.hxh-site .hxh-inventory-page .hxh-inventory-surface {
    background: #fff8e8; border: 1px solid var(--equipment-border);
    border-radius: 7px; box-shadow: none !important; min-width: 0;
}
.hxh-site .hxh-inventory-page .inventory-tabs {
    display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--equipment-border); gap: .4rem; padding: .2rem;
}
.hxh-site .hxh-inventory-page .inventory-tabs .nav-link {
    color: var(--equipment-ink); background: #f1dfbb; border: 1px solid #d2b68a;
    border-radius: 4px; margin: 0; min-height: 44px; padding: .65rem .8rem;
    font-weight: 700; box-shadow: none; transform: none;
}
.hxh-site .hxh-inventory-page .inventory-tabs .nav-link.active {
    color: #fff5db; background: linear-gradient(#896536, #64481f);
    border-color: #64481f; box-shadow: none; transform: none;
}
.hxh-site .hxh-inventory-page .tab-content { min-width: 0; }
.hxh-site .hxh-inventory-page .item-card {
    color: var(--equipment-ink); background: linear-gradient(#fffdf4, #f9efd9);
    border: 1px solid #d9c196; border-left: 4px solid #987447;
    border-radius: 6px; box-shadow: 0 3px 9px #4d351d12;
}
.hxh-site .hxh-inventory-page .consumable-card { border-left-color: #638254; }
.hxh-site .hxh-inventory-page .quest-card { border-left-color: #8a6a3a; }
.hxh-site .hxh-inventory-page .material-card { border-left-color: #657e72; }
.hxh-site .hxh-inventory-page .weapon-card { border-left-color: #85653b; }
.hxh-site .hxh-inventory-page .weapon-rare { border-left-color: #38699b; }
.hxh-site .hxh-inventory-page .weapon-epic { border-left-color: #7150a0; }
.hxh-site .hxh-inventory-page .weapon-legendary { border-left-color: #b27a20; }
.hxh-site .hxh-inventory-page .item-image-container {
    background: radial-gradient(circle, #fffaf0, #e9d7b3);
    border-bottom: 1px solid #dfc99e;
}
.hxh-site .hxh-inventory-page .item-name { color: var(--equipment-ink); line-height: 1.45; }
.hxh-site .hxh-inventory-page .item-quantity {
    background: #72532c; color: #fff6df; border: 1px solid #fff2d2;
    box-shadow: none; border-radius: 4px;
}
.hxh-site .hxh-inventory-page .item-actions { border-top-color: #d7bd8f; }
.hxh-site .hxh-inventory-page .quantity-input { border-color: #bfa477; background: #fffdf6; color: var(--equipment-ink); }
.hxh-site .hxh-inventory-page .empty-tab { color: var(--equipment-muted); padding: 2.5rem 1rem; }
.hxh-site .hxh-inventory-page .item-card:hover { box-shadow: 0 5px 14px #4d351d20; transform: none; }

/* Mouvement facultatif et jamais requis pour révéler le contenu. */
@media (prefers-reduced-motion: no-preference) {
    .hxh-site .hxh-stock-card, .hxh-site .hxh-inventory-page .item-card {
        transition: transform .18s ease, box-shadow .18s ease;
    }
    .hxh-site .hxh-stock-card:hover, .hxh-site .hxh-inventory-page .item-card:hover {
        transform: translateY(-3px); box-shadow: 0 7px 18px #4d351d1e;
    }
}
@media (max-width: 1020px) {
    .hxh-site .hxh-stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .hxh-site .hxh-stock-grid { grid-template-columns: minmax(0, 1fr); }
    .hxh-site .hxh-workshop-heading { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .hxh-site .hxh-workshop-nav { justify-content: center; }
    .hxh-site .hxh-workshop-nav a { flex: 1 1 auto; justify-content: center; }
    .hxh-site .hxh-stock-card { flex-direction: row; }
    .hxh-site .hxh-stock-visual { width: 33%; min-width: 110px; height: auto; border-bottom: 0; border-right: 1px solid #e2ceaa; }
    .hxh-site .hxh-stock-visual img { max-height: 120px; }
    .hxh-site .hxh-stock-details { width: 67%; }
    .hxh-site .hxh-inventory-page .inventory-tabs .nav-link { flex: 1 1 calc(50% - .4rem); }
}
@media (max-width: 410px) {
    .hxh-site .hxh-stock-card { flex-direction: column; }
    .hxh-site .hxh-stock-visual { width: 100%; min-width: 0; height: 150px; border-right: 0; border-bottom: 1px solid #e2ceaa; }
    .hxh-site .hxh-stock-details { width: 100%; }
}
