/* Guides page (2026-09-24) - replaces beginnersGuides.css.
   Same card look as the old Beginners Guides (bordered gradient cards,
   uppercase letter-spaced headings, 40px buttons), plus what the event
   guides brought with them: a kicker line, coloured tags, tables, captioned
   pictures and tip / warning / note boxes. Colours come from root.css, so
   the alternative (red) theme works everywhere on the page. */

.guides-container,
.guides-roster,
.guides-admin,
.guides-hidden,
.guide-panel {
    width: 100%;
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.guides-section-title {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* "LIVE 4.10.1" under the hero subtitle - from the VPS worker's check. */
.guides-live {
    display: inline-block;
    margin-top: 0.9rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--highlight-colour);
    border-radius: var(--radius1);
    background: rgba(0, 0, 0, 0.45);
    color: var(--highlight-colour);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
}

/* ------------------------------------------------------------ cards */

.guides-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.guide-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background-image: var(--gradient-light);
    border: 0.125rem solid var(--border-colour);
    border-radius: var(--radius1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.guide-card:hover,
.guide-card.is-active {
    border-color: var(--highlight-colour);
    box-shadow: 0 0 10px var(--glow-colour);
}

.guide-card-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.guide-card-open:focus-visible {
    outline: 2px solid var(--highlight-colour);
    outline-offset: -4px;
}

.guide-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: calc(var(--radius1) / 2);
    background: var(--background-dark);
}

.guide-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 1s ease;
}

.guide-card-title {
    display: block;
    margin-top: auto;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--highlight-colour);
    overflow-wrap: anywhere;
}

/* Scale and slightly shake the picture on hover (as on the old page). */
.guide-card:hover .guide-card-img img {
    scale: 1.08;
    animation: guidesShake 4s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .guide-card:hover .guide-card-img img {
        scale: 1;
        animation: none;
    }
}

@keyframes guidesShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    15% { transform: translate(2px, -2px) rotate(0.3deg); }
    30% { transform: translate(-3px, 1px) rotate(-0.4deg); }
    50% { transform: translate(2px, 3px) rotate(0.5deg); }
    70% { transform: translate(-2px, -3px) rotate(-0.3deg); }
    85% { transform: translate(1px, 2px) rotate(0.2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.guides-empty {
    text-align: center;
    color: var(--muted);
}

@media screen and (max-width: 1024px) {
    .guides-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 480px) {
    .guides-container,
    .guides-roster,
    .guides-admin,
    .guides-hidden,
    .guide-panel {
        padding: 0 1rem;
    }

    .guides-grid {
        gap: 0.75rem;
    }

    .guide-card-open {
        padding: 0.75rem;
    }

    .guide-card-title {
        font-size: 0.85rem;
    }

    .guides-section-title {
        font-size: 1.25rem;
    }
}

/* ------------------------------------------------------------ open guide */

.guide-panel[hidden] {
    display: none;
}

.guide-panel.is-open {
    animation: guidesIn 0.4s ease;
}

@keyframes guidesIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .guide-panel.is-open {
        animation: none;
    }
}

.guide-panel-inner,
.guides-roster {
    position: relative;
    box-sizing: border-box;
}

.guide-panel-inner {
    width: 100%;
    padding: 1.5rem 1.75rem;
    background-image: var(--gradient-light);
    border: 0.125rem solid var(--border-colour);
    border-radius: var(--radius1);
}

.guide-kicker {
    margin: 0 2.75rem 0.3rem 0;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--highlight-colour);
}

.guide-title {
    margin: 0 2.75rem 0.75rem 0;
    font-size: 1.5rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    overflow-wrap: anywhere;
}

.guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
}

.guide-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.guide-pill.is-ok { border-color: #5ee0a8; color: #5ee0a8; }
.guide-pill.is-warn { border-color: #d4b46a; color: #e6c77e; }
.guide-pill.is-hot { border-color: #ff6b6b; color: #ff8a8a; }
.guide-pill.is-off { border-color: #667; color: #9a9aa8; }
.guide-pill.is-info { border-color: var(--highlight-colour); color: var(--highlight-colour); }

/* The guide's own text (also used by the event roster and the preview). */
.guide-body {
    overflow-wrap: break-word;
}

.guide-body p,
.guide-body li {
    font-size: 1rem;
    line-height: 1.6;
    color: #dfe9f2;
}

.guide-body p {
    margin: 0.4rem 0 0.8rem;
}

.guide-body ul,
.guide-body ol {
    margin: 0.3rem 0 0.9rem 1.25rem;
    padding-left: 0.5rem;
}

.guide-body li {
    margin-bottom: 0.4rem;
}

.guide-body li > ul,
.guide-body li > ol {
    margin: 0.4rem 0 0.2rem 0.5rem;
}

.guide-body h3,
.guide-body h4 {
    margin: 1.5rem 0 0.6rem;
    font-size: 1.05rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--highlight-colour);
}

.guide-body h4 {
    font-size: 0.95rem;
    color: #fff;
}

.guide-body a {
    color: var(--highlight-colour);
}

.guide-body code {
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.9em;
}

.guide-body pre.guide-code {
    overflow-x: auto;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius1);
    background: rgba(0, 0, 0, 0.4);
}

.guide-body hr {
    margin: 1.25rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.guide-figure {
    margin: 1rem 0 1.2rem;
}

.guide-figure img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border: 1px solid var(--border-colour);
    border-radius: calc(var(--radius1) / 2);
}

.guide-figure figcaption {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.guide-table-wrap {
    width: 100%;
    margin: 0.6rem 0 1rem;
    overflow-x: auto;
    border: 1px solid var(--border-colour);
    border-radius: calc(var(--radius1) / 2);
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.guide-table th,
.guide-table td {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    color: #dfe9f2;
}

.guide-table th {
    background: var(--background-dark);
    color: var(--highlight-colour);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.18);
}

/* Call-out boxes: > [!TIP] / > [!WARNING] / > [!NOTE] */
.guide-callout {
    margin: 0.9rem 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: calc(var(--radius1) / 2);
}

.guide-callout > :first-child { margin-top: 0; }
.guide-callout > :last-child { margin-bottom: 0; }

.guide-callout.is-tip {
    border-color: var(--highlight-colour);
    background: rgba(61, 187, 255, 0.1);
}

.guide-callout.is-warn {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.09);
}

.guide-callout.is-note {
    border-color: #d4b46a;
    background: rgba(212, 180, 106, 0.09);
}

.guide-callout.is-note p,
.guide-callout.is-note li {
    color: #ecdcb2;
}

.theme-alt .guide-callout.is-tip {
    background: rgba(255, 75, 75, 0.08);
}

/* Close buttons: X in the corner, "Close Guide" at the bottom. */
.guide-close-btn {
    display: flex;
    margin: 1.75rem auto 0;
}

.guide-close-x {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-colour);
    border-radius: var(--radius1);
    background: var(--background-dark);
    color: #fff;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    z-index: 10;
}

.guide-close-x:hover,
.guide-close-x:focus-visible {
    border-color: var(--highlight-colour);
    box-shadow: 0 0 8px var(--glow-colour);
}

@media screen and (max-width: 480px) {
    .guide-panel-inner {
        padding: 1.1rem 1rem;
    }

    .guide-title {
        font-size: 1.2rem;
    }
}

/* ------------------------------------------------------------ roster */

.guides-roster {
    padding: 1.25rem 1.5rem;
    background-image: var(--gradient-light);
    border: 0.125rem solid var(--border-colour);
    border-radius: var(--radius1);
    max-width: calc(1200px - 3rem);
}

.guides-roster-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.guides-roster .guides-section-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.guides-roster .guide-body > p:last-child {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

@media screen and (max-width: 1250px) {
    .guides-roster {
        width: auto;
        margin-inline: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .guides-roster {
        margin-inline: 1rem;
        padding: 1rem;
    }
}

/* ------------------------------------------------------------ admin */

.guides-admin[hidden] {
    display: none;
}

/* The Admin tab: three equal buttons in a row. An <a> and a <button> size
   differently by default (content-box vs border-box), which is why the
   Template link used to stand taller than the two buttons beside it - so
   the box model, height and width are all set here, not left to the tag. */
.guides-admin-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto;
}

.guides-admin-bar .os-btn {
    box-sizing: border-box;
    width: 100%;
    height: var(--control-h);
    min-height: 0;
    margin: 0;
    padding: 0 1rem;
    line-height: 1;
    white-space: nowrap;
}

.guides-admin > .guides-admin-line,
.guides-admin > .guides-admin-warn {
    text-align: center;
}

@media screen and (max-width: 700px) {
    .guides-admin-bar {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The Admin tab lights up when the guides may be out of date. */
.os-tab.has-alert {
    position: relative;
    border-color: #d4b46a;
}

.os-tab.has-alert::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e6c77e;
    box-shadow: 0 0 6px #e6c77e;
}

.guides-admin-line {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.guides-admin-warn {
    margin: 0.6rem 0 0;
    font-size: 0.95rem;
    color: #ff8a8a;
}

.guides-update {
    max-width: 900px;
    margin: 1rem auto 0;
    box-sizing: border-box;
    padding: 1rem 1.2rem;
    border: 1px solid #d4b46a;
    border-left-width: 4px;
    border-radius: var(--radius1);
    background: rgba(212, 180, 106, 0.09);
}

.guides-update-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e6c77e;
}

.guides-update p,
.guides-update li {
    font-size: 0.95rem;
    color: #ecdcb2;
}

.guides-news {
    margin: 0.2rem 0 0.9rem 1.2rem;
}

.guides-news a {
    color: var(--highlight-colour);
}

.guides-news-date {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Edit / move / delete on each card (admins only). */
.guides-card-tools {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    display: flex;
    gap: 0.25rem;
    z-index: 2;
}

.guides-card-tools.is-inline {
    position: static;
}

.guides-icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border-colour);
    border-radius: 0.35rem;
    background: rgba(7, 18, 28, 0.88);
    color: #fff;
    cursor: pointer;
}

.guides-icon-btn:hover,
.guides-icon-btn:focus-visible {
    border-color: var(--highlight-colour);
    box-shadow: 0 0 6px var(--glow-colour);
}

.guides-icon-btn.is-danger:hover {
    border-color: #ff6b6b;
    box-shadow: 0 0 6px #ff6b6b;
}

.guides-icon-btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.guide-card-add {
    border-style: dashed;
}

.guide-card-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--highlight-colour);
    background: rgba(0, 0, 0, 0.25);
}

.guides-admin .guides-hidden {
    margin: 2rem 0 0;
    padding: 0;
}

.guides-admin .guides-hidden > .guides-admin-line {
    text-align: center;
}

.guides-hidden-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.guides-hidden-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    background-image: var(--gradient-light);
    border: 1px solid var(--border-colour);
    border-radius: var(--radius1);
    font-size: 1rem;
}

.guides-hidden-title {
    flex: 1 1 14rem;
    font-weight: bold;
}

.guides-hidden-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

/* ------------------------------------------------------------ editor popup
   z-index 1200 = the popups layer on the scale at the top of root.css. */

.guides-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: calc(var(--nav-height, 46px) + 1rem) 1rem 2rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.72);
    box-sizing: border-box;
}

body.guides-modal-open {
    overflow: hidden;
}

.guides-modal {
    position: relative;
    width: 100%;
    max-width: 820px;
    padding: 1.5rem 1.5rem 1.25rem;
    box-sizing: border-box;
    background: var(--background-mid);
    border: 0.125rem solid var(--highlight-colour);
    border-radius: var(--radius1);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

.guides-modal-title {
    margin: 0 2.75rem 1rem 0;
    font-size: 1.2rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.guides-field {
    display: block;
    margin-bottom: 1rem;
}

.guides-file {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.45rem;
    box-sizing: border-box;
    border: 1px dashed var(--border-colour);
    border-radius: var(--radius1);
    background: var(--background-dark);
    color: #fff;
    font-size: 0.9rem;
}

.guides-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.guides-hint a {
    color: var(--highlight-colour);
}

.guides-paste {
    margin: -0.4rem 0 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.guides-paste summary {
    cursor: pointer;
}

.guides-textarea {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.6rem;
    box-sizing: border-box;
    border: 1px solid var(--border-colour);
    border-radius: var(--radius1);
    background: var(--background-dark);
    color: #fff;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.guides-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.guides-warnings {
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.8rem 0.6rem 1.8rem;
    border: 1px solid #d4b46a;
    border-radius: var(--radius1);
    background: rgba(212, 180, 106, 0.09);
}

.guides-warnings[hidden],
.guides-preview[hidden] {
    display: none;
}

.guides-warnings li {
    font-size: 0.9rem;
    color: #ecdcb2;
}

.guides-preview {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.guides-preview-card {
    max-width: 280px;
    margin: 0 auto 1rem;
}

.guides-preview .guide-panel-inner {
    padding: 1rem 1.1rem;
}
