/* ═══════════════════════════════════════════════════════════════════════════
   Legends of Limerick — Shared Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Layout ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
    font-family: sans-serif;
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
    color: #333;
}

a { color: #4a7aff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.nav-left { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav strong { font-size: 1.1em; }
.nav a { color: #4a7aff; text-decoration: none; font-size: 0.9em; }
.nav a:hover { text-decoration: underline; }
.nav-active {
    font-weight: bold;
    color: #333 !important;
    border-bottom: 2px solid #4a7aff;
    padding-bottom: 2px;
}

/* ── Mobile Nav Toggle ──────────────────────────────────────────────────── */
.nav-toggle {
    display: none; background: none; border: none; font-size: 1.5em;
    cursor: pointer; padding: 4px 8px; color: #333;
}
@media (max-width: 600px) {
    body { margin: 10px auto; padding: 0 12px; }
    .nav { flex-wrap: wrap; gap: 8px; }
    .nav-toggle { display: block; }
    .nav-left { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    /* Hide direct-child nav links (not the site name inside <strong>) */
    .nav-left > a { display: none; }
    .nav-left.open > a {
        display: block; width: 100%; padding: 8px 0;
        border-top: 1px solid #f0f0f0;
    }
    .nav-left.open { flex-direction: column; align-items: flex-start; gap: 0; }
    /* Keep site name and hamburger on one row */
    .nav-left > strong, .nav-left > .nav-toggle {
        flex-shrink: 0;
    }
    /* Compact the right-side nav items on mobile */
    .nav-right {
        width: 100%; justify-content: flex-end;
        gap: 10px !important; font-size: 0.82em !important;
        flex-wrap: wrap;
    }
}

/* ── Headings & Subtitles ────────────────────────────────────────────────── */
h1 { margin-bottom: 4px; }
.subtitle { color: #777; font-size: 0.9em; margin-bottom: 24px; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; font-size: 0.92em; }
.alert-error   { background: #fdecea; color: #c62828; border: 1px solid #f5c6cb; border-left: 4px solid #e53935; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c3e6cb; border-left: 4px solid #43a047; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #b3d4f5; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; border-left: 4px solid #ffa000; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.8em; font-weight: bold; }
.badge-yes       { background: #e8f5e9; color: #2e7d32; }
.badge-no        { background: #fdecea; color: #c62828; }
.badge-admin     { background: #e8f0ff; color: #3a5cc7; }
.badge-user      { background: #f0f0f0; color: #555; }
.badge-draft     { background: #f0f0f0; color: #777; }
.badge-open      { background: #e3f2fd; color: #1565c0; }
.badge-ready     { background: #fff8e1; color: #b08000; }
.badge-active    { background: #e8f5e9; color: #2e7d32; }
.badge-completed { background: #ede7f6; color: #4527a0; }

/* Content rating badges. Two render-mode contracts live in
   `templates/fragments/moderation.html`: `ratingBadge` hides
   FAMILY_FRIENDLY (scan-heavy surfaces, badges flag exceptions);
   `ratingBadgeAlways` renders all three (focused-review surfaces, where
   absence of badge would imply "no policy" rather than "default policy").
   Same pill shape as .badge but a distinct class so we can evolve the
   moderation visual language independently of the existing status palette. */
.rating-badge   { display: inline-block; padding: 2px 8px; border-radius: 3px;
                  font-size: 0.78em; font-weight: bold; letter-spacing: 0.02em; }
.rating-family   { background: #e8f5e9; color: #2e7d32; }
.rating-adult    { background: #fff3e0; color: #e65100; }
.rating-explicit { background: #fdecea; color: #b71c1c; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88em;
    text-decoration: none;
}
.btn-sm { padding: 3px 9px; font-size: 0.8em; }
.btn-primary { background: #4a7aff; color: #fff; }
.btn-primary:hover { background: #3a6aef; }
.btn-secondary { background: #f0f0f0; color: #333; border: 1px solid #ddd; }
.btn-secondary:hover { background: #e5e5e5; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #a31f1f; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #255e28; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
th {
    text-align: left;
    padding: 7px 10px;
    font-size: 0.82em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #eee;
    font-weight: normal;
}
td { padding: 9px 10px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── Cards & Sections ────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}
.card h2, .section h2 {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
label { display: block; font-weight: bold; margin-bottom: 6px; font-size: 0.9em; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.93em;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4a7aff;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.empty { color: #bbb; font-size: 0.9em; font-style: italic; padding: 8px 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
