/* ============================================
   site.css — Global styles for iunscramble.com
   ============================================ */

/* --- Design Tokens --- */
:root {
    --bg: #FFFFFF;
    --bg-subtle: #F9FAFB;
    --bg-muted: #F3F4F6;
    --text: #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --hero-bg: #1E293B;
    --accent: #10B981;
    --accent-light: #ECFDF5;
    --accent-dark: #065F46;
    --accent-shadow: rgba(16, 185, 129, 0.3);
    --nav-bg: #111827;
    --nav-text: #F9FAFB;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    --max-width: 1200px;
    --tool-max-width: 640px;
}

/* --- Reset / Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
    text-decoration: underline;
}

ul, ol {
    padding-left: 1.5rem;
}

/* --- Typography (16px minimum) --- */
h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text);
}

/* --- Layout --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-band {
    background: var(--hero-bg);
    border-bottom: 1px solid #334155;
    color: #F1F5F9;
}

.hero-band h1,
.hero-band .tool-subtitle {
    color: #F1F5F9;
}

.hero-band .tool-subtitle {
    opacity: 0.8;
}

.hero-band .solver-input {
    background: #fff;
    color: var(--text);
}

.hero-band .filters-toggle {
    color: #94A3B8;
}

.hero-band .filter-input,
.hero-band .filter-select {
    background: #fff;
    color: var(--text);
}

.hero-band .filter-toggle {
    color: #CBD5E1;
}

.hero-band .wordle-exclude-label {
    color: #CBD5E1;
}

.tool-section {
    max-width: var(--tool-max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Navigation --- */
.site-nav {
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 2rem;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-logo-img {
    height: 28px;
    width: auto;
}

body.nav-open {
    overflow: hidden;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    color: var(--nav-text);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--nav-text);
    text-decoration: none;
}

.nav-link.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
}

/* More dropdown */
.nav-more {
    position: relative;
}

.nav-more-btn {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.nav-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--nav-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 110;
}

.nav-dropdown.open {
    display: block;
}

.nav-dropdown .nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
}

/* Hamburger */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-hamburger svg {
    width: 24px;
    height: 24px;
}

/* Mobile nav overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--nav-bg);
    z-index: 99;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* --- Content Sections --- */
.content-section {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
}

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.content-section th,
.content-section td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
}

.content-section th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text);
}

.content-section td {
    color: var(--text);
}

/* --- FAQ Accordion --- */
.faq-section {
    margin-bottom: 2.5rem;
}

.faq-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    gap: 1rem;
}

.faq-question:hover {
    color: var(--accent-dark);
}

.faq-indicator {
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-indicator {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 0 1rem;
    color: var(--text);
    line-height: 1.6;
}

.faq-answer.open {
    display: block;
}

/* --- Sidebar --- */
.sidebar-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.sidebar-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
}

.sidebar-card a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text);
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.15s;
}

.sidebar-card a:last-child {
    border-bottom: none;
}

.sidebar-card a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Ad Slots --- */
.ad-slot {
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 0;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 3rem 1.5rem 2rem;
    margin-top: 3rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent);
}

.footer-col a {
    display: block;
    color: rgba(249, 250, 251, 0.7);
    font-size: 1rem;
    padding: 0.25rem 0;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: var(--accent);
    text-decoration: none;
}

.footer-about {
    color: rgba(249, 250, 251, 0.7);
    font-size: 1rem;
    line-height: 1.6;
}

.footer-copy {
    color: rgba(249, 250, 251, 0.5);
    font-size: 1rem;
    margin-top: 1rem;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(249, 250, 251, 0.5);
    font-size: 1rem;
}

/* --- Tool Subtitle --- */
.tool-subtitle {
    color: var(--text-muted);
    font-size: 1.0625rem;
    margin-bottom: 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem 1rem 2rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    .tool-section {
        padding: 1.5rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .tool-section {
        padding: 1.25rem 0.75rem 1rem;
    }

    .content-grid {
        padding: 1rem 0.75rem 1.5rem;
    }

    .breadcrumbs {
        padding: 0.5rem 0.75rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* --- Error Page --- */
.error-page {
    padding-top: 3rem;
    padding-bottom: 3rem;
    text-align: center;
}

.error-request-id {
    color: var(--text-muted);
}

.error-cta {
    margin-top: 2rem;
}

.error-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: #FFFFFF;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    min-height: 44px;
}

.error-home-btn:hover {
    background: var(--accent-dark);
    color: #FFFFFF;
    text-decoration: none;
}

/* --- Privacy Page --- */
.privacy-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* --- Skip Link --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 200;
    font-size: 1rem;
}
.skip-link:focus {
    top: 0;
}

/* --- Focus-Visible --- */
.nav-link:focus-visible,
.word-chip:focus-visible,
.faq-question:focus-visible,
.letter-pill:focus-visible,
.wl-page-link:focus-visible,
.view-toggle-btn:focus-visible,
.solver-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
