/* ==========================================================
   GloryBound Wiki - pages.css
   Styles for the page fragments loaded into <main> (pages/*.html).
   Layout, header and footer styles live in main.css, which also
   defines the theme variables used here. Load this AFTER main.css.
   ========================================================== */

/* ---------- Wiki page components (shared by all wiki pages) ---------- */

.wiki-breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

.wiki-breadcrumb a {
    color: var(--color-muted-foreground);
    text-decoration: none;
}

.wiki-breadcrumb a:hover {
    color: var(--color-primary);
}

.wiki-breadcrumb [aria-current="page"] {
    font-weight: 500;
    color: var(--color-foreground);
}

.wiki-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0 1.5rem;
}

.title-badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 2.75rem;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.title-badge svg {
    width: 1.5rem;
    height: 1.5rem;
}

.wiki-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--color-foreground);
}

.wiki-section-title {
    margin: 2.5rem 0 1rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--color-foreground);
}

.wiki-accent {
    color: var(--color-primary);
}

.wiki-body {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--color-foreground);
}

.wiki-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wiki-list {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    list-style: disc;
    font-size: 0.9375rem;
    color: var(--color-foreground);
}

.wiki-list li+li {
    margin-top: 0.25rem;
}

/* Panel: brown gradient with cut top-left and bottom-right corners */
.wiki-panel {
    --cut: 14px;
    position: relative;
    background: linear-gradient(180deg, var(--color-panel-top), var(--color-panel-bottom));
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)),
            calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.wiki-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid var(--color-panel-border);
    /* diagonal border along the two cut corners */
    background:
        linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--color-panel-border) calc(50% - 0.5px),
            var(--color-panel-border) calc(50% + 0.5px), transparent calc(50% + 0.5px)) top left / var(--cut) var(--cut) no-repeat,
        linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--color-panel-border) calc(50% - 0.5px),
            var(--color-panel-border) calc(50% + 0.5px), transparent calc(50% + 0.5px)) bottom right / var(--cut) var(--cut) no-repeat;
}

.wiki-panel-pad {
    padding: 1.25rem 1.5rem;
}

/* Used by the Weekly Raids layout: frame + inner card */
.wiki-page>.gb-frame {
    margin-top: 1.5rem;
}

.class-card-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.5rem;
}

.class-card-inner .wiki-section-title {
    margin-top: 0;
}

.wiki-header {
    margin-bottom: 1.5rem;
}

.wiki-eyebrow {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-bronze);
}

.wiki-header .wiki-title {
    margin-top: 0.25rem;
}

.wiki-lead {
    max-width: 48rem;
    margin: 0.75rem 0 0;
    color: var(--color-muted-foreground);
}

.wiki-subtext {
    margin: 0 0 1rem;
    color: var(--color-muted-foreground);
}

.wiki-table-wrap {
    overflow-x: auto;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.wiki-table th,
.wiki-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(74, 55, 36, 0.8);
}

.wiki-table th {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-primary);
}

/* ---------- Trials (pages/trials.html) ---------- */

.trial-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
}

.trial-step {
    width: 100%;
    max-width: 42rem;
    padding: 0.875rem 1rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-foreground);
    background: rgba(26, 16, 10, 0.35);
    border: 1px solid var(--color-panel-border);
}

.trial-arrow {
    display: flex;
    color: var(--color-primary);
}

.trial-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
}

.trial-step-final a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: underline;
}

.trial-step-final a:hover {
    color: var(--color-foreground);
}

.trial-step-final svg {
    width: 1.25rem;
    height: 1.25rem;
}

.boss-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.boss-card {
    padding: 1rem;
}

.boss-media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12.5rem;
    overflow: hidden;
    background: rgba(26, 16, 10, 0.6);
}

.boss-media img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.boss-title {
    margin: 1.25rem 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-foreground);
}

.boss-text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-foreground);
}

.boss-subtitle {
    margin: 1.25rem 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .boss-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wiki-title {
        font-size: 3.5rem;
    }
}

/* ---------- Home (pages/home.html) ---------- */

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.home-main {
    min-width: 0;
}

.home-sidebar {
    position: sticky;
    top: 1.5rem;
    min-width: 0;
}

.discord-widget-container {
    padding: 1rem;
    background: var(--color-panel-deep);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.discord-widget-container .section-heading {
    margin-top: 0;
    margin-bottom: 1rem;
}

.discord-widget-container iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 4px;
}

/* Responsive layout */
@media (max-width: 950px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        position: static;
    }

    .discord-widget-container {
        max-width: 100%;
    }
}

.home-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18rem;
    overflow: hidden;
    text-align: center;
    background: var(--color-panel-deep);
    border: 1px solid var(--color-border);
}

/* Auto-scrolling images, semi-faded and softened at the left/right edges */
.hero-marquee {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
}

.hero-track {
    display: flex;
    width: max-content;
    height: 100%;
    animation: hero-scroll 60s linear infinite;
}

.hero-track img {
    flex: none;
    width: auto;
    height: 100%;
    /* margin (not gap) keeps the -50% loop seamless */
    object-fit: cover;
    opacity: 40%;
}

@keyframes hero-scroll {
    to {
        transform: translateX(-50%);
    }
}

/* Darkens the bottom so the title stays readable and blends into the page */
.hero-marquee,
.hero-fade {
    pointer-events: none;
}

.hero-fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(26, 16, 10, 0.55), transparent 70%),
        linear-gradient(to bottom, rgba(26, 16, 10, 0.1), rgba(26, 16, 10, 0.9));
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.hero-eyebrow {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-muted-foreground);
}

.hero-title {
    margin: 0.25rem 0 0;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.025em;
    color: var(--color-foreground);
}

.hero-title span {
    color: var(--color-primary);
}

.hero-tagline {
    margin: 0.75rem 0 0;
    color: var(--color-foreground);
}

@media (prefers-reduced-motion: reduce) {
    .hero-track {
        animation: none;
    }
}

@media (min-width: 768px) {
    .home-hero {
        min-height: 24rem;
    }

    .hero-title {
        font-size: 4rem;
    }
}

/* Sections under the hero */

.home-section {
    margin-top: 2.5rem;
}

.section-heading {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.home-text {
    max-width: 48rem;
    margin: 0 0 0.75rem;
    color: var(--color-muted-foreground);
}

.home-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.home-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    background: var(--color-panel-deep);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    color: var(--color-foreground);
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease;
}

.home-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    color: var(--color-foreground);
}

.home-card-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.home-card-text {
    margin: 0.5rem 0 1rem;
    color: var(--color-muted-foreground);
}

.home-card-more {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

/* ---------- Credits (pages/credits.html) ---------- */
/* Uses the shared wiki components (wiki-panel, wiki-title-row, ...). */

.credits-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.credits-card {
    padding: 1.25rem 1.5rem;
}

.credits-heading {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-foreground);
}

.credits-list li {
    display: flex;
    flex-direction: column;
    padding: 0.625rem 0;
    border-top: 1px solid rgba(110, 78, 47, 0.6);
}

.credits-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.credits-name {
    font-weight: 500;
    color: var(--color-foreground);
}

.credits-role {
    font-size: 0.875rem;
    color: var(--color-primary);
}

.credits-note {
    margin: 2rem 0 0;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

/* ---------- Nothing here (pages/nothing.html) ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 0;
    text-align: center;
}

.empty-state-eyebrow {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-bronze);
}

.empty-state-title {
    margin: 0.5rem 0 0;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    color: var(--color-primary);
}

.empty-state-text {
    max-width: 32rem;
    margin: 1rem 0 0;
    color: var(--color-muted-foreground);
}

.empty-state-detail {
    margin: 0.75rem 0 1.5rem;
    font-size: 0.75rem;
    color: var(--color-bronze);
    word-break: break-all;
}

/* ---------- Trials (pages/trials.html) ---------- */
/* ==============================
   TRIALS PAGE
============================== */

.trials-page .trials-intro {
    margin-bottom: 2rem;
}

.trials-page .trial-progression {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
}

.trial-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    min-height: 2.8rem;
    padding: 0.75rem 1rem;
    background: #2b190f;
    border: 1px solid #5b402a;
    color: #f5e9d8;
    text-align: center;
    font-weight: 700;
}

.trial-arrow {
    padding: 0.35rem 0;
    color: #e9a900;
    font-size: 1.35rem;
    font-weight: bold;
}

.trial-raid-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    min-height: 2.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid #8d6414;
    background: #2b190f;
    color: #f2b51b;
    font-weight: 700;
    text-align: center;
    text-decoration: underline;
    transition: background 0.2s ease;
}

.trial-raid-link:hover {
    background: #402816;
}

.trial-boss-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.trial-boss-card {
    min-width: 0;
}

.trial-boss-card .class-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trial-boss-image {
    display: block;
    width: 100%;
    height: 10.5rem;
    margin-bottom: 1rem;
    object-fit: contain;
    background: #2b190f;
    border: 1px solid #4d3523;
}

.trial-boss-card h4 {
    margin: 0.8rem 0 0.3rem;
    font-size: 1rem;
}

.trial-boss-card .class-name {
    margin-bottom: 0.5rem;
}

.trial-boss-card .wiki-list {
    margin-top: 0.25rem;
}

@media (max-width: 700px) {
    .trial-boss-grid {
        grid-template-columns: 1fr;
    }

    .trial-step,
    .trial-raid-link {
        width: 95%;
    }

    .trial-boss-image {
        height: 12rem;
    }
}

/* ---------- Page scrolling and interaction fixes ---------- */

html {
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

#content {
    position: relative;
    min-height: 60vh;
    height: auto;
    overflow: visible;
    pointer-events: auto;
}

#content a {
    pointer-events: auto;
}

.home-card {
    cursor: pointer;
}