/* ==========================================================================
   Sudoku.School — Global Neubrutalism Styles (site.css)
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --nb-bg: #FFFDF0;
    --nb-card: #ffffff;
    --nb-border: #222222;
    --nb-shadow: #222222;
    --nb-yellow: #FFD43B;
    --nb-blue: #4DABF7;
    --nb-coral: #FF6B6B;
    --nb-mint: #69DB7C;
    --nb-purple: #B197FC;
    --nb-orange: #FFA94D;
    --nb-border-w: 2.5px;
    --nb-radius: 12px;
    --nb-shadow-sm: 3px 3px 0 var(--nb-shadow);
    --nb-shadow-md: 4px 4px 0 var(--nb-shadow);
    --nb-shadow-lg: 6px 6px 0 var(--nb-shadow);
    --nb-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --nb-transition: 0.15s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.nb-theme {
    font-family: var(--nb-font);
    background-color: var(--nb-bg);
    color: var(--nb-border);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--nb-blue);
    text-decoration: none;
    transition: color var(--nb-transition);
}

a:hover {
    color: var(--nb-coral);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ---------- Skip Link (Accessibility) ---------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--nb-blue);
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    font-weight: 700;
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: var(--nb-radius);
}

.skip-link:focus {
    top: 8px;
    left: 8px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--nb-border);
}

h1 { font-size: 2rem; margin-bottom: 0.5em; }
h2 { font-size: 1.6rem; margin-bottom: 0.5em; }
h3 { font-size: 1.3rem; margin-bottom: 0.4em; }
h4 { font-size: 1.1rem; margin-bottom: 0.3em; }

p {
    margin-bottom: 1em;
}

/* ---------- Utility ---------- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header ---------- */
.site-header {
    background-color: var(--nb-card);
    border-bottom: var(--nb-border-w) solid var(--nb-border);
    box-shadow: 0 3px 0 var(--nb-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 20px;
}

.site-logo img {
    height: 48px;
    width: auto;
}

.nav-toggle {
    display: none;
    font-size: 1.8rem;
    padding: 4px 8px;
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 8px;
    background: var(--nb-yellow);
    box-shadow: var(--nb-shadow-sm);
    color: var(--nb-border);
    line-height: 1;
    transition: transform var(--nb-transition), box-shadow var(--nb-transition);
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--nb-shadow-md);
}

.nav-toggle:active {
    transform: translateY(1px);
    box-shadow: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-menu > li {
    position: relative;
}

.nav-menu li a {
    display: block;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--nb-border);
    border: var(--nb-border-w) solid transparent;
    transition: all var(--nb-transition);
    white-space: nowrap;
}

.nav-menu li a:hover {
    background-color: var(--nb-yellow);
    border-color: var(--nb-border);
    box-shadow: var(--nb-shadow-sm);
    color: var(--nb-border);
    transform: translateY(-1px);
}

.nav-menu li a:active {
    transform: translateY(1px);
    box-shadow: none;
}

.nav-menu li a[aria-current="page"],
.nav-menu li a._active {
    background-color: var(--nb-blue);
    color: #fff;
    border-color: var(--nb-border);
    box-shadow: var(--nb-shadow-sm);
}

/* ---------- Desktop Dropdown ---------- */
.nav-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--nb-border);
    border: var(--nb-border-w) solid transparent;
    transition: all var(--nb-transition);
    background: none;
    font-family: inherit;
    white-space: nowrap;
}

.nav-menu__trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-top: 2px;
    transition: transform 150ms ease;
}

.nav-menu__trigger:hover {
    background-color: var(--nb-yellow);
    border-color: var(--nb-border);
    box-shadow: var(--nb-shadow-sm);
    transform: translateY(-1px);
}

.nav-menu__trigger:active {
    transform: translateY(1px);
    box-shadow: none;
}

.nav-menu > li._dropdown-open > .nav-menu__trigger {
    background-color: var(--nb-yellow);
    border-color: var(--nb-border);
    box-shadow: var(--nb-shadow-sm);
}

.nav-menu > li._dropdown-open > .nav-menu__trigger::after {
    transform: rotate(180deg);
}

.nav-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    padding: 6px;
    background: var(--nb-card);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 12px;
    box-shadow: var(--nb-shadow-lg);
    z-index: 1000;
    flex-direction: column;
    gap: 2px;
}

.nav-menu > li._dropdown-open > .nav-menu__dropdown {
    display: flex;
}

.nav-menu__dropdown li a {
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Highlight parent dropdown when a child is current page */
.nav-menu > li._dropdown-active > .nav-menu__trigger {
    background-color: var(--nb-blue);
    color: #fff;
    border-color: var(--nb-border);
    box-shadow: var(--nb-shadow-sm);
}

.nav-menu > li._dropdown-active > .nav-menu__trigger::after {
    border-top-color: #fff;
}

/* ---------- Mobile Navigation ---------- */
@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nb-card);
        border-bottom: var(--nb-border-w) solid var(--nb-border);
        box-shadow: var(--nb-shadow-md);
        padding: 12px 20px;
        gap: 4px;
        z-index: 999;
    }

    .nav-menu._open {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 10px 16px;
        font-size: 1rem;
        border: var(--nb-border-w) solid transparent;
    }

    /* Mobile accordion sub-menu */
    .nav-menu__trigger {
        width: 100%;
        justify-content: space-between;
        padding: 10px 16px;
        font-size: 1rem;
        border: var(--nb-border-w) solid transparent;
    }

    .nav-menu__dropdown {
        display: none;
        position: static;
        min-width: 0;
        padding: 0 0 0 16px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .nav-menu > li._dropdown-open > .nav-menu__dropdown {
        display: flex;
    }

    .nav-menu__dropdown li a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .site-nav {
        position: relative;
    }
}

/* ---------- Main Content ---------- */
main {
    flex: 1;
}

/* ---------- Neubrutalism Card ---------- */
.nb-card {
    background: var(--nb-card);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: var(--nb-radius);
    box-shadow: var(--nb-shadow-md);
    padding: 24px;
}

/* ---------- Neubrutalism Button ---------- */
.nb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--nb-border);
    background: var(--nb-yellow);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: var(--nb-radius);
    box-shadow: var(--nb-shadow-md);
    transition: transform var(--nb-transition), box-shadow var(--nb-transition);
    cursor: pointer;
}

.nb-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--nb-shadow-lg);
}

.nb-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.nb-btn--blue { background: var(--nb-blue); color: #fff; }
.nb-btn--coral { background: var(--nb-coral); color: #fff; }
.nb-btn--mint { background: var(--nb-mint); }
.nb-btn--purple { background: var(--nb-purple); color: #fff; }

/* ---------- Hero / Intro Section ---------- */
.hero-section {
    text-align: center;
    padding: 32px 20px 16px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 2.2rem;
    margin-bottom: 0.4em;
}

.hero-section p {
    font-size: 1.1rem;
    color: #555;
    max-width: 640px;
    margin: 0 auto 1em;
}

/* ---------- Game Area Wrapper ---------- */
.game-area {
    max-width: 925px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ---------- Article ---------- */
.article-section {
    max-width: 925px;
    margin: 20px auto;
    padding: 0 20px;
}

.article-section article {
    background: var(--nb-card);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: var(--nb-radius);
    box-shadow: var(--nb-shadow-md);
    padding: 32px;
}

.article-section article h2 {
    font-size: 1.8rem;
    margin-bottom: 0.6em;
    padding-bottom: 0.3em;
    border-bottom: var(--nb-border-w) solid var(--nb-border);
}

.article-section article h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--nb-border);
}

.article-section article p {
    line-height: 1.7;
    margin-bottom: 1em;
}

.article-section article ul,
.article-section article ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.article-section article ul {
    list-style: disc;
}

.article-section article ol {
    list-style: decimal;
}

.article-section article li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

.article-section article strong {
    font-weight: 700;
}

.article-section article a {
    color: var(--nb-blue);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color var(--nb-transition);
}

.article-section article a:hover {
    border-bottom-color: var(--nb-blue);
}

/* ---------- Internal links section ---------- */
.internal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.3em 0;
}

.internal-links a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--nb-yellow);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: var(--nb-radius);
    box-shadow: var(--nb-shadow-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--nb-border);
    transition: transform var(--nb-transition), box-shadow var(--nb-transition);
}

.internal-links a:hover {
    transform: translateY(-2px);
    box-shadow: var(--nb-shadow-md);
    color: var(--nb-border);
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--nb-card);
    border-top: var(--nb-border-w) solid var(--nb-border);
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 24px;
}

.footer-brand {
    flex: 1;
    min-width: 220px;
}

.footer-brand img {
    height: 32px;
    width: auto;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.9rem;
    color: #666;
    max-width: 280px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    flex: 2;
}

.footer-col {
    min-width: 120px;
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--nb-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul li {
    margin-bottom: 6px;
}

.footer-col ul li a {
    font-size: 0.9rem;
    color: #555;
    transition: color var(--nb-transition);
}

.footer-col ul li a:hover {
    color: var(--nb-blue);
}

.footer-bottom {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid #ddd;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

/* ---------- Footer Responsive ---------- */
@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        gap: 24px;
        padding: 24px 20px 16px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 20px;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-brand img {
        margin: 0 auto 12px;
    }

    .footer-brand p {
        max-width: 100%;
    }
}

/* ---------- Page Content (for non-game pages) ---------- */
.page-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-content .nb-card {
    padding: 32px;
}

.page-content h1 {
    margin-bottom: 0.6em;
}

.page-content p {
    line-height: 1.7;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }

.page-content li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

.page-hero {
    max-width: 925px;
    margin: 28px auto 18px;
    padding: 26px 28px;
}

.page-hero h1 {
    margin-bottom: 0.35em;
}

.page-hero p {
    margin-bottom: 0;
    max-width: 62ch;
    color: #5b6270;
    font-size: 1.02rem;
    line-height: 1.75;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 999px;
    background: var(--nb-yellow);
    box-shadow: var(--nb-shadow-sm);
    color: var(--nb-border);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-section.nb-card {
    max-width: 925px;
    margin: 18px auto;
    padding: 26px 28px;
}

.article-section__header {
    margin-bottom: 18px;
}

.article-section__header h2 {
    margin-bottom: 10px;
}

.article-section__header p,
.article-section.nb-card p,
.page-content p {
    color: #5b6270;
    line-height: 1.75;
}

.article-section.nb-card h2 {
    margin-bottom: 0.55em;
}

.article-section.nb-card h3 {
    margin: 1.1em 0 0.45em;
    font-size: 1.12rem;
}

.article-section.nb-card ul,
.article-section.nb-card ol,
.page-content ul,
.page-content ol {
    margin: 0 0 1em;
    padding-left: 1.3em;
}

.article-section.nb-card ul,
.page-content ul {
    list-style: disc;
}

.article-section.nb-card ol,
.page-content ol {
    list-style: decimal;
}

.article-section.nb-card li,
.page-content li {
    color: #5b6270;
    margin-bottom: 0.55em;
    line-height: 1.7;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.feature-list {
    list-style: none !important;
    padding-left: 0 !important;
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
}

.feature-list li {
    position: relative;
    padding: 12px 14px 12px 42px;
    background: #fffdf7;
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 12px;
    box-shadow: var(--nb-shadow-sm);
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 14px;
    top: 12px;
    font-weight: 800;
    color: var(--nb-blue);
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.contact-sidekick {
    display: grid;
    gap: 16px;
}

.contact-sidekick-block {
    background: #fffdf7;
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 12px;
    box-shadow: var(--nb-shadow-sm);
    padding: 18px;
}

.contact-sidekick-block h3 {
    margin-top: 0;
    margin-bottom: 0.6em;
}

.contact-sidekick-block p:last-child {
    margin-bottom: 0;
}

.contact-alt {
    margin-top: 14px;
    font-size: 0.95rem;
}

.form-help {
    font-size: 0.92rem;
    color: #707887;
}

.contact-form,
.nb-form {
    display: grid;
    gap: 16px;
}

.contact-form label,
.nb-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--nb-border);
}

.contact-form input,
.contact-form textarea,
.contact-form select,
.nb-form input,
.nb-form textarea,
.nb-form select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: var(--nb-font);
    border: var(--nb-border-w) solid var(--nb-border);
    border-radius: 8px;
    background: #fffefa;
    box-shadow: var(--nb-shadow-sm);
    transition: box-shadow var(--nb-transition), border-color var(--nb-transition);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus,
.nb-form input:focus,
.nb-form textarea:focus,
.nb-form select:focus {
    outline: none;
    box-shadow: var(--nb-shadow-md);
    border-color: var(--nb-blue);
}

.contact-form textarea,
.nb-form textarea {
    min-height: 160px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.nb-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ---------- Responsive Typography ---------- */
@media (max-width: 900px) {
    .article-grid,
    .contact-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    .hero-section h1 {
        font-size: 1.7rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .article-section article {
        padding: 20px;
    }

    .page-content .nb-card,
    .page-hero,
    .article-section.nb-card {
        padding: 20px;
    }
}

/* ---------- Print ---------- */
@media print {
    html,
    body,
    body.nb-theme {
        background: #fff !important;
        color: #000 !important;
    }

    *,
    *::before,
    *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .site-header,
    .site-footer,
    .ad-slot,
    .nav-toggle,
    .action-buttons-wrapper,
    .quicktools-outer,
    .quickmenu-outer,
    .keyboard-hints-outer {
        display: none !important;
    }

    .nb-card,
    .page-hero,
    .article-section.nb-card,
    .contact-sidekick-block {
        background: #fff !important;
        border-color: #000 !important;
    }

    a,
    a:visited {
        color: #000 !important;
    }
}