/*
 * Mesozoic Haven global static widgets
 * -------------------------------------
 * Small, reusable cards that can be included across otherwise unrelated pages.
 * Widgets may use different layouts when that better fits their purpose, but
 * they should share the site's spacing, typography, borders, and theme tokens.
 */

.mh-widget {
    color: var(--mh-component-text);
}

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

.mh-widget__title {
    margin: 0 0 5px;
    font-size: 1.35rem;
}

.mh-widget__text {
    margin: 0;
    color: var(--mh-component-muted);
}

/* ========================================================================== 
   Chat server invite card
   ========================================================================== */

.mh-chat-card {
    max-width: 560px;
    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);
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.07);
}

.mh-chat-card__title {
    margin: 0 0 5px;
    font-size: 1.35rem;
}

.mh-chat-card__text {
    margin: 0;
    color: var(--mh-component-muted);
}

.mh-chat-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.mh-chat-card__actions .mh-button {
    width: 100%;
}

/* ========================================================================== 
   Watch & Hang Out
   ========================================================================== */

.mh-watch-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 22px 24px;
    border: 1px solid var(--mh-component-border);
    border-left: 5px solid var(--mh-widget-accent);
    border-radius: var(--mh-radius-md);
    background: linear-gradient(110deg, var(--mh-component-bg), color-mix(in srgb, var(--mh-widget-accent) 7%, var(--mh-component-bg)));
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-watch-card__title {
    margin: 0 0 5px;
    font-size: 1.35rem;
}

.mh-watch-card__text {
    margin: 0;
    color: var(--mh-component-muted);
}

.mh-watch-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================================================== 
   Community Basics
   ========================================================================== */

.mh-basics-card {
    max-width: 620px;
    overflow: hidden;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-basics-card__header {
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--mh-component-border);
    background: color-mix(in srgb, var(--mh-widget-accent) 7%, var(--mh-component-bg));
}

.mh-basics-card__title {
    margin: 0;
    font-size: 1.25rem;
}

.mh-basics-card__rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-basics-card__rules li {
    position: relative;
    padding: 18px 16px 18px 34px;
    font-weight: 700;
}

.mh-basics-card__rules li::before {
    content: "✓";
    position: absolute;
    left: 15px;
    color: var(--mh-widget-accent);
    font-weight: 900;
}

.mh-basics-card__rules li + li {
    border-left: 1px solid var(--mh-component-border);
}

.mh-basics-card__link {
    display: block;
    padding: 12px 22px 16px;
    border-top: 1px solid var(--mh-component-border);
    font-weight: 750;
    text-decoration: none;
}

/* ========================================================================== 
   Explore the Haven
   ========================================================================== */

.mh-explore-widget {
    padding: 22px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-explore-widget__header {
    margin-bottom: 14px;
}

.mh-explore-widget__title {
    margin: 0;
    font-size: 1.3rem;
}

.mh-explore-widget__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mh-explore-widget__link {
    display: flex;
    min-height: 92px;
    flex-direction: column;
    justify-content: center;
    padding: 14px 15px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: var(--mh-component-bg-soft);
    color: var(--mh-component-text);
    text-decoration: none;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mh-explore-widget__link:hover,
.mh-explore-widget__link:focus-visible {
    transform: translateY(-2px);
    border-color: var(--mh-widget-accent);
    background: color-mix(in srgb, var(--mh-widget-accent) 8%, var(--mh-component-bg));
    text-decoration: none;
}

.mh-explore-widget__link strong {
    color: var(--mh-widget-accent);
}

.mh-explore-widget__link span {
    margin-top: 3px;
    color: var(--mh-component-muted);
    font-size: 0.9rem;
}

/* ========================================================================== 
   Search the Haven
   ========================================================================== */

.mh-search-haven {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(300px, 1.2fr);
    gap: 22px;
    align-items: center;
    padding: 22px 24px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: color-mix(in srgb, var(--mh-river-night) 4%, var(--mh-component-bg));
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-search-haven__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.mh-search-haven__input {
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: var(--mh-component-bg);
    color: var(--mh-component-text);
    font: inherit;
}

.mh-search-haven__input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mh-widget-accent) 35%, transparent);
    outline-offset: 2px;
    border-color: var(--mh-widget-accent);
}

/* ========================================================================== 
   Riptide Trail Note
   ========================================================================== */

.mh-riptide-trail {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 20px 22px;
    border: 1px solid var(--mh-component-border);
    border-left: 5px solid var(--mh-river-teal);
    border-radius: var(--mh-radius-md);
    background: linear-gradient(120deg, color-mix(in srgb, var(--mh-river-teal) 7%, var(--mh-component-bg)), var(--mh-component-bg));
}

.mh-riptide-trail__mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 50%;
    background: var(--mh-river-night);
    color: var(--mh-fossil-bone);
    font-size: 1.55rem;
    font-weight: 900;
}

.mh-riptide-trail__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
}

.mh-riptide-trail__links a {
    font-weight: 750;
    text-decoration: none;
}

/* ========================================================================== 
   New to the Haven?
   ========================================================================== */

.mh-newcomer {
    padding: 22px;
    border: 1px solid var(--mh-component-border);
    border-top: 5px solid var(--mh-sandstone);
    border-radius: var(--mh-radius-md);
    background: linear-gradient(135deg, var(--mh-component-bg), color-mix(in srgb, var(--mh-sandstone) 15%, var(--mh-component-bg)));
    box-shadow: 0 10px 28px rgba(23, 35, 38, 0.07);
}

.mh-newcomer__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.mh-newcomer__step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: var(--mh-component-bg);
    color: var(--mh-component-text);
    font-weight: 750;
    text-decoration: none;
}

.mh-newcomer__step strong {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--mh-river-night);
    color: var(--mh-fossil-bone);
    font-size: 0.85rem;
}

.mh-newcomer__step:hover,
.mh-newcomer__step:focus-visible {
    border-color: var(--mh-widget-accent);
    text-decoration: none;
}

/* ========================================================================== 
   Game Hubs
   ========================================================================== */

.mh-game-hubs {
    display: grid;
    grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.3fr);
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-game-hubs__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mh-game-hub {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: color-mix(in srgb, var(--mh-river-night) 4%, var(--mh-component-bg));
    color: var(--mh-component-text);
    text-decoration: none;
}

.mh-game-hub--all {
    grid-column: 1 / -1;
    min-height: 58px;
    background: var(--mh-component-bg-soft);
}

.mh-game-hub:hover,
.mh-game-hub:focus-visible {
    border-color: var(--mh-widget-accent);
    background: color-mix(in srgb, var(--mh-widget-accent) 8%, var(--mh-component-bg));
    text-decoration: none;
}

.mh-game-hub__name {
    font-weight: 850;
}

.mh-game-hub__hint {
    margin-top: 3px;
    color: var(--mh-component-muted);
    font-size: 0.88rem;
}

/* ========================================================================== 
   Keep Exploring / related content
   ========================================================================== */

.mh-keep-exploring {
    padding: 22px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-component-bg);
}

.mh-keep-exploring__heading {
    margin-bottom: 14px;
}

.mh-keep-exploring__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mh-related-card {
    position: relative;
    display: flex;
    min-height: 112px;
    flex-direction: column;
    justify-content: center;
    padding: 15px 38px 15px 15px;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-sm);
    background: var(--mh-component-bg-soft);
    color: var(--mh-component-text);
    text-decoration: none;
}

.mh-related-card:hover,
.mh-related-card:focus-visible {
    border-color: var(--mh-widget-accent);
    background: color-mix(in srgb, var(--mh-widget-accent) 8%, var(--mh-component-bg));
    text-decoration: none;
}

.mh-related-card__meta {
    margin-bottom: 4px;
    color: var(--mh-widget-accent);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mh-related-card__title {
    line-height: 1.35;
}

.mh-related-card__arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    translate: 0 -50%;
    color: var(--mh-widget-accent);
    font-size: 1.3rem;
    font-weight: 900;
}

/* ========================================================================== 
   Reference-only miniature page preview
   ========================================================================== */

.mh-widget-page-preview {
    overflow: hidden;
    border: 1px solid var(--mh-component-border);
    border-radius: var(--mh-radius-md);
    background: var(--mh-page-bg);
    box-shadow: 0 8px 24px rgba(23, 35, 38, 0.06);
}

.mh-widget-page-preview__bar {
    padding: 8px 14px;
    background: var(--mh-river-night);
    color: var(--mh-fossil-bone);
    font-size: 0.82rem;
    font-weight: 750;
}

.mh-widget-page-preview__hero {
    padding: 22px;
    border-bottom: 1px solid var(--mh-component-border);
    background: var(--mh-component-bg-soft);
}

.mh-widget-page-preview__hero strong {
    display: block;
    font-size: 1.4rem;
}

.mh-widget-page-preview__body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.mh-widget-page-preview__line {
    height: 9px;
    border-radius: 999px;
    background: var(--mh-component-border);
}

.mh-widget-page-preview__line:nth-child(2) { width: 84%; }
.mh-widget-page-preview__line:nth-child(3) { width: 68%; }

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

@media (max-width: 760px) {
    .mh-watch-card,
    .mh-search-haven,
    .mh-game-hubs {
        grid-template-columns: 1fr;
    }

    .mh-watch-card__actions {
        justify-content: flex-start;
    }

    .mh-basics-card__rules,
    .mh-explore-widget__links,
    .mh-newcomer__steps,
    .mh-keep-exploring__grid {
        grid-template-columns: 1fr;
    }

    .mh-basics-card__rules li + li {
        border-top: 1px solid var(--mh-component-border);
        border-left: 0;
    }

    .mh-explore-widget__link,
    .mh-related-card {
        min-height: 0;
    }
}

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

    .mh-riptide-trail__mark {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

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

    .mh-game-hub--all {
        grid-column: auto;
    }
}

@media (max-width: 460px) {
    .mh-chat-card__actions,
    .mh-watch-card__actions,
    .mh-search-haven__form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mh-chat-card__actions .mh-button,
    .mh-watch-card__actions .mh-button,
    .mh-search-haven__form .mh-button {
        width: 100%;
    }
}
