/* =========================================================
   ArmorPlus page shell
   Brings the ArmorPlus home page and the recipe pages in line
   with the wiki's flat "clean Minecraft" look. Loaded last;
   everything is scoped to body.ap-page so styles.css is
   untouched for the rest of the site.
   ========================================================= */

.ap-page {
    --font-heading: "Press Start 2P", "Orbitron", sans-serif;

    --wiki-bg: #0f0f13;
    --wiki-surface: #17171d;
    --wiki-surface-2: #1e1e26;
    --wiki-slot: #0b0b0f;
    --wiki-border: #2c2c36;
    --wiki-border-strong: #3d3d4a;
    --wiki-text: #e8e8ec;
    --wiki-text-muted: #a8a8b3;
    --wiki-text-dim: #8a8a96;
    --wiki-accent: #c23b2c;
    --wiki-accent-text: #e5604f;
    --wiki-accent-hover: #a83125;
    --wiki-radius: 2px;

    /* Re-point the legacy styles.css variables at the wiki palette. */
    --accent: var(--wiki-accent-text);
    --bg-color: var(--wiki-bg);
    --card-bg: var(--wiki-surface);
    --text-color: var(--wiki-text);
    --border-glow: none;

    background: var(--wiki-bg);
    color: var(--wiki-text);
}


/* ---------- Breadcrumb ---------- */

.ap-page .breadcrumb {
    background: var(--wiki-bg);
    border-bottom: 1px solid var(--wiki-border);
    box-shadow: none;
}

.ap-page .breadcrumb a { color: var(--wiki-accent-text); }
.ap-page .breadcrumb a:hover { color: #ffffff; }
.ap-page .breadcrumb strong { color: #ffffff; }


/* ---------- Banner (matches .wiki-header) ---------- */

.ap-page > header {
    position: relative;
    padding: 3rem 1.5rem;
    background:
        radial-gradient(
            ellipse 60% 120% at center,
            rgba(15, 15, 19, 0.92) 30%,
            rgba(15, 15, 19, 0.78) 100%
        ),
        url("/armorplus/assets/branding/headerimg.png") center / cover no-repeat;
    border-bottom: 1px solid var(--wiki-accent);
    box-shadow: none;
}

.ap-page > header h1,
.ap-page > header p {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.ap-page > header p {
    max-width: 760px;
    margin-inline: auto;
}

.ap-eyebrow {
    display: block;
    margin-bottom: 1rem;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ap-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}


/* ---------- Sections ---------- */

.ap-page .section {
    background: var(--wiki-surface);
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
    box-shadow: none;
}

.ap-page .section h2 {
    color: #ffffff;
    border-bottom: 1px solid var(--wiki-accent);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    line-height: 1.6;
    transition: none;
}

.ap-page .section h2:hover,
.ap-page .section h3:hover { color: inherit; }

.ap-page .section strong { color: #ffffff; }

.ap-page .section a:not(.button):not(.wiki-directory-card):not(.armor-item-link):not(.armor-recipe-link):not(.effects-button):not(.recipe-tabnav-link) {
    color: var(--wiki-accent-text);
}

.ap-page ul li a { color: var(--wiki-accent-text); }

.ap-page footer {
    color: var(--wiki-text-dim);
    border-top: 1px solid var(--wiki-border);
    box-shadow: none;
}


/* ---------- Buttons ---------- */

.ap-page .button {
    background: var(--wiki-slot);
    color: var(--wiki-text);
    border: 1px solid var(--wiki-border-strong);
    border-radius: var(--wiki-radius);
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ap-page .button:hover {
    background: var(--wiki-surface-2);
    border-color: var(--wiki-accent);
    color: #ffffff;
    box-shadow: none;
    transform: none;
}

.ap-page .button.primary {
    background: var(--wiki-accent);
    border-color: var(--wiki-accent);
    color: #ffffff;
}

.ap-page .button.primary:hover { background: var(--wiki-accent-hover); border-color: var(--wiki-accent-hover); }

.ap-page .button:focus-visible,
.ap-page a.wiki-directory-card:focus-visible {
    outline: 2px solid var(--wiki-accent-text);
    outline-offset: 3px;
}


/* ---------- Directory cards (same as wiki.css) ---------- */

.ap-page .wiki-directory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.ap-page a.wiki-directory-card,
.ap-page a.wiki-directory-card:link,
.ap-page a.wiki-directory-card:visited {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.1rem;
    color: inherit;
    background: var(--wiki-slot);
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ap-page a.wiki-directory-card:hover {
    background: var(--wiki-surface-2);
    border-color: var(--wiki-accent);
}

.ap-page .wiki-directory-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--wiki-text-dim);
    font-family: var(--font-heading);
    font-size: 0.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ap-page .section .wiki-directory-card h3 {
    margin: 0 0 0.45rem;
    padding: 0;
    color: var(--wiki-text);
    border: 0;
    font-family: var(--font-accent);
    font-size: 0.85rem;
}

.ap-page .section .wiki-directory-card p {
    flex: 1;
    margin: 0 0 0.8rem;
    color: var(--wiki-text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.ap-page .wiki-directory-action {
    color: var(--wiki-accent-text);
    font-size: 0.72rem;
    font-weight: 600;
}

.ap-page .ap-feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-page .ap-feature-list li {
    margin: 0;
    padding: 0.6rem 0.8rem;
    background: var(--wiki-slot);
    border: 1px solid var(--wiki-border);
    border-left: 2px solid var(--wiki-accent);
    border-radius: var(--wiki-radius);
    font-size: 0.88rem;
}


/* =========================================================
   Armor gallery: compact card grid
   ========================================================= */

.ap-page .gallery-hint {
    color: var(--wiki-text-muted);
    background: var(--wiki-slot);
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
}

.ap-page .gallery-hint-icon { color: var(--wiki-accent-text); }

.ap-page .armor-category {
    background: transparent;
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
    margin-bottom: 0.5rem;
    box-shadow: none;
}

.ap-page .armor-category summary {
    background: var(--wiki-surface-2);
    color: var(--wiki-text);
    border: 0;
    border-radius: 0;
    font-family: var(--font-accent);
    box-shadow: none;
}

.ap-page .armor-category summary:hover { background: #24242e; }

.ap-page .armor-category[open] summary {
    border-bottom: 1px solid var(--wiki-accent);
}

.ap-page .category-arrow { color: var(--wiki-accent-text); }

.ap-page .armor-category-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
}

.ap-page .gallery-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin: 0;
    padding: 0.9rem;
    background: var(--wiki-slot);
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
    box-shadow: none;
    transition: border-color 0.15s ease;
}

.ap-page .gallery-group:hover {
    transform: none;
    border-color: var(--wiki-border-strong);
    box-shadow: none;
}

.ap-page .gallery-group:target {
    border-color: var(--wiki-accent);
    box-shadow: none;
}

.ap-page .armor-items {
    justify-content: space-between;
    gap: 0.4rem;
}

.ap-page .armor-items .armor-item { flex: 1 1 0; }

.ap-page .armor-icon {
    width: 100%;
    max-width: 52px;
    height: auto;
    aspect-ratio: 1;
    background-color: var(--wiki-surface);
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius);
    box-shadow: none;
}

.ap-page .armor-icon:hover {
    border-color: var(--wiki-accent);
    box-shadow: none;
    transform: none;
}

.ap-page .armor-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ap-page .gallery-group h3 {
    margin: 0 0 0.35rem;
    padding: 0;
    color: #ffffff;
    border: 0;
    font-size: 0.9rem;
}

.ap-page .gallery-group p {
    flex: 1;
    margin: 0 0 0.6rem;
    color: var(--wiki-text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.ap-page .armor-static-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0 0 0.6rem;
    padding: 0.4rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--wiki-border);
    border-radius: 0;
}

.ap-page .armor-stat-box {
    display: flex;
    gap: 0.3rem;
    padding: 0;
    background: none;
    border: 0;
    font-size: 0.72rem;
}

.ap-page .armor-stat-box dt { color: var(--wiki-text-dim); }
.ap-page .armor-stat-box dd { margin: 0; color: var(--wiki-text); font-weight: 700; }

.ap-page .armor-actions {
    flex-wrap: nowrap;
    gap: 0.3rem;
    margin-top: 0;
}

.ap-page .effects-button,
.ap-page .armor-recipe-link {
    padding: 0.3rem 0.4rem;
    color: var(--wiki-accent-text);
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--wiki-border-strong);
    border-radius: var(--wiki-radius);
    box-shadow: none;
    font-size: 0.6rem;
    text-decoration: none;
}

.ap-page .armor-recipe-link::before { content: none; }

.ap-page .effects-button:hover,
.ap-page .effects-button:focus-visible,
.ap-page .armor-recipe-link:hover,
.ap-page .armor-recipe-link:focus-visible {
    color: #ffffff;
    background: var(--wiki-surface-2);
    border-color: var(--wiki-accent);
    box-shadow: none;
    transform: none;
}

.ap-page .effects-popup {
    background: var(--wiki-surface);
    border: 1px solid var(--wiki-border-strong);
    border-radius: var(--wiki-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}


/* ---------- Hover parity with the wiki ---------- */

.ap-page .armor-icon {
    transition: border-color 0.15s ease;
}

.ap-page .armor-item-link:hover .armor-icon {
    border-color: var(--wiki-accent);
    box-shadow: none;
    transform: none;
}

.ap-page .recipe-button {
    color: var(--wiki-text);
    background: var(--wiki-slot);
    border: 1px solid var(--wiki-border-strong);
}

.ap-page .recipe-button::before { color: var(--wiki-accent-text); }

.ap-page .recipe-button:hover {
    color: #ffffff;
    background: var(--wiki-surface-2);
    border-color: var(--wiki-accent);
}

.ap-page .button.discord {
    color: var(--wiki-text);
    background: var(--wiki-slot);
    border-color: #5865f2;
}

.ap-page .button.discord:hover {
    color: #ffffff;
    background: var(--wiki-surface-2);
    border-color: #5865f2;
}

@media (prefers-reduced-motion: reduce) {
    .ap-page *,
    .ap-page *::before,
    .ap-page *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .ap-page .armor-category-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .ap-page .armor-category-content,
    .ap-page .wiki-directory-grid { grid-template-columns: 1fr; }

    .ap-page > header { padding: 2rem 1rem; }

    .ap-page .armor-actions { flex-direction: row; }

    .ap-page .armor-actions > *,
    .ap-page .armor-actions .effects-button {
        flex: 1 1 0;
        width: auto;
        justify-content: center;
        text-align: center;
    }
}
