/*
 * Mesozoic Haven optional/shared components
 * ------------------------------------------
 * These styles are intentionally theme-token driven. Reusable widgets and
 * cards should reference the variables below instead of hard-coding colors.
 *
 * Change the semantic tokens in :root to recolor the whole component family.
 */

:root {
    /* Shared component surfaces/text. */
    --mh-component-bg: var(--mh-surface);
    --mh-component-bg-soft: var(--mh-surface-soft);
    --mh-component-border: var(--mh-border);
    --mh-component-text: var(--mh-text);
    --mh-component-muted: var(--mh-muted);

    /* Semantic accent colors. */
    --mh-accent-info: var(--mh-river-teal);
    --mh-accent-success: var(--mh-fern-green);
    --mh-accent-warning: #9a6700;
    --mh-accent-danger: var(--mh-sail-crimson);
    --mh-accent-neutral: var(--mh-riptide-grey);

    /* Default accent used by theme-aware widgets. */
    --mh-widget-accent: var(--mh-accent-info);
}

/* Optional semantic modifiers. Add one of these to a compatible component. */
.mh-theme-info { --mh-widget-accent: var(--mh-accent-info); }
.mh-theme-success { --mh-widget-accent: var(--mh-accent-success); }
.mh-theme-warning { --mh-widget-accent: var(--mh-accent-warning); }
.mh-theme-danger { --mh-widget-accent: var(--mh-accent-danger); }
.mh-theme-neutral { --mh-widget-accent: var(--mh-accent-neutral); }

/* ========================================================================== 
   Generic callout / notice
   ========================================================================== */

.mh-callout {
    padding: 20px 22px;
    border: 1px solid var(--mh-component-border);
    border-left: 5px solid var(--mh-widget-accent);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
    color: var(--mh-component-text);
}

.mh-callout__title {
    margin: 0 0 6px;
    color: var(--mh-widget-accent);
    font-size: 1.05rem;
}

/* ========================================================================== 
   Native details / FAQ accordion (no JavaScript required)
   ========================================================================== */

.mh-details {
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-details + .mh-details {
    margin-top: 12px;
}

.mh-details > summary {
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 750;
}

.mh-details[open] > summary {
    border-bottom: 1px solid var(--mh-component-border);
    color: var(--mh-widget-accent);
}

.mh-details__body {
    padding: 16px 18px;
}

/* ========================================================================== 
   Quote / source block
   ========================================================================== */

.mh-quote {
    margin: 0;
    padding: 22px 24px;
    border-left: 5px solid var(--mh-widget-accent);
    border-radius: 0 var(--mh-radius-md) var(--mh-radius-md) 0;
    background: var(--mh-component-bg-soft);
}

.mh-quote blockquote {
    margin: 0;
    font-size: 1.08rem;
}

.mh-quote figcaption {
    margin-top: 12px;
    color: var(--mh-component-muted);
    font-size: 0.92rem;
}

/* ========================================================================== 
   Stats / quick metrics
   ========================================================================== */

.mh-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--mh-gap);
}

.mh-stat {
    padding: 20px;
    border: 1px solid var(--mh-component-border);
    border-top: 4px solid var(--mh-widget-accent);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-stat__value {
    display: block;
    font-size: 1.7rem;
    font-weight: 850;
    line-height: 1.1;
}

.mh-stat__label {
    display: block;
    margin-top: 6px;
    color: var(--mh-component-muted);
}

/* ========================================================================== 
   Badges / tags
   ========================================================================== */

.mh-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mh-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--mh-widget-accent) 45%, var(--mh-component-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--mh-widget-accent) 8%, var(--mh-component-bg));
    color: var(--mh-component-text);
    font-size: 0.85rem;
    font-weight: 700;
}

/* ========================================================================== 
   Figure / caption
   ========================================================================== */

.mh-figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.mh-figure figcaption {
    padding: 12px 14px;
    color: var(--mh-component-muted);
    font-size: 0.9rem;
}

/* ========================================================================== 
   Breadcrumbs
   ========================================================================== */

.mh-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    color: var(--mh-component-muted);
    font-size: 0.9rem;
}

.mh-breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 6px;
    color: var(--mh-component-muted);
}

/* ========================================================================== 
   Pagination
   ========================================================================== */

.mh-pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mh-pagination a,
.mh-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: var(--mh-component-bg);
    color: var(--mh-component-text);
    text-decoration: none;
}

.mh-pagination .is-current {
    border-color: var(--mh-widget-accent);
    background: var(--mh-widget-accent);
    color: #fff;
}

/* ========================================================================== 
   Timeline
   ========================================================================== */

.mh-timeline {
    margin: 0;
    padding: 0 0 0 22px;
    border-left: 3px solid var(--mh-component-border);
    list-style: none;
}

.mh-timeline__item {
    position: relative;
    padding: 0 0 26px 18px;
}

.mh-timeline__item::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 0.35em;
    width: 12px;
    height: 12px;
    border: 3px solid var(--mh-component-bg);
    border-radius: 50%;
    background: var(--mh-widget-accent);
    box-shadow: 0 0 0 2px var(--mh-widget-accent);
}

.mh-timeline__title {
    margin: 0 0 5px;
}

/* ========================================================================== 
   Definition / glossary list
   ========================================================================== */

.mh-definition-list {
    margin: 0;
}

.mh-definition-list dt {
    margin-top: 16px;
    font-weight: 800;
    color: var(--mh-widget-accent);
}

.mh-definition-list dd {
    margin: 4px 0 0;
}

/* ========================================================================== 
   Event / compact information card
   ========================================================================== */

.mh-event-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-event-card__date {
    min-width: 72px;
    padding: 10px;
    border-radius: var(--mh-radius-sm);
    background: color-mix(in srgb, var(--mh-widget-accent) 10%, var(--mh-component-bg));
    color: var(--mh-widget-accent);
    text-align: center;
    font-weight: 800;
}

.mh-event-card__title {
    margin: 0 0 5px;
}

/* ========================================================================== 
   Media / streaming / spotlight card
   ========================================================================== */

.mh-media-card {
    display: grid;
    grid-template-columns: minmax(180px, 34%) minmax(0, 1fr);
    gap: 20px;
    overflow: hidden;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-media-card__visual {
    min-height: 170px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--mh-widget-accent) 10%, var(--mh-component-bg-soft));
    color: var(--mh-component-muted);
    text-align: center;
}

.mh-media-card__visual img,
.mh-media-card__visual iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mh-media-card__body {
    padding: 20px 20px 20px 0;
}

.mh-media-card__title {
    margin: 0 0 8px;
}

/* ========================================================================== 
   Status / live indicator
   ========================================================================== */

.mh-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 750;
}

.mh-status::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--mh-widget-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mh-widget-accent) 16%, transparent);
}

/* ========================================================================== 
   Stream schedule / compact list
   ========================================================================== */

.mh-schedule {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-schedule__item {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
}

.mh-schedule__item + .mh-schedule__item {
    border-top: 1px solid var(--mh-component-border);
}

.mh-schedule__day {
    font-weight: 800;
    color: var(--mh-widget-accent);
}

.mh-schedule__time {
    color: var(--mh-component-muted);
    white-space: nowrap;
}

/* ========================================================================== 
   Community / server status summary
   ========================================================================== */

.mh-server-summary {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-server-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.mh-server-summary__label {
    color: var(--mh-component-muted);
}

/* ========================================================================== 
   Creature / fossil spotlight helper
   ========================================================================== */

.mh-spotlight {
    padding: 22px;
    border: 1px solid var(--mh-component-border);
    border-top: 5px solid var(--mh-widget-accent);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-spotlight__label {
    margin: 0 0 6px;
    color: var(--mh-widget-accent);
    font-size: 0.8rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.mh-spotlight__title {
    margin: 0 0 10px;
}

/* ========================================================================== 
   Responsive behavior
   ========================================================================== */

@media (max-width: 800px) {
    .mh-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mh-media-card {
        grid-template-columns: 1fr;
    }

    .mh-media-card__body {
        padding: 0 20px 20px;
    }

    .mh-schedule__item {
        grid-template-columns: 1fr auto;
    }

    .mh-schedule__title {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .mh-stat-grid {
        grid-template-columns: 1fr;
    }

    .mh-event-card {
        grid-template-columns: 1fr;
    }

    .mh-event-card__date {
        width: fit-content;
    }

    .mh-schedule__item {
        grid-template-columns: 1fr;
    }

    .mh-schedule__time {
        white-space: normal;
    }
}
