/* ==========================================================================
   ATS Resume Builder - main.css
   Design tokens, reset, typography, and the site-level chrome (top nav,
   footer, legal/info page content) shared by every page. Builder-specific
   layout lives in builder.css; this file never styles anything inside
   #resume-builder-app besides what it inherits from these tokens.
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------------- */
:root {
    --rb-color-primary: #2563eb;
    --rb-color-primary-dark: #1d4ed8;
    --rb-color-secondary: #0f766e;
    --rb-color-success: #166534;
    --rb-color-warning: #b45309;
    --rb-color-error: #dc2626;

    --rb-color-background: #f4f6fb;
    --rb-color-surface: #ffffff;
    --rb-color-surface-muted: #eef1f7;
    --rb-color-border: #cbd5e1;
    --rb-color-text: #0f172a;
    --rb-color-muted: #475569;
    --rb-color-inverse: #ffffff;

    --rb-color-focus: var(--rb-color-primary);
    --rb-color-primary-soft: rgba(37, 99, 235, 0.1);
    --rb-color-success-soft: rgba(22, 163, 74, 0.12);
    --rb-color-warning-soft: rgba(180, 83, 9, 0.12);
    --rb-color-error-soft: rgba(220, 38, 38, 0.1);

    --rb-font-main: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    --rb-font-resume: Georgia, "Times New Roman", Times, serif;
    --rb-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --rb-radius: 8px;
    --rb-radius-sm: 4px;
    --rb-radius-pill: 999px;

    --rb-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 20px rgba(15, 23, 42, 0.08);

    --rb-space-1: 4px;
    --rb-space-2: 8px;
    --rb-space-3: 16px;
    --rb-space-4: 24px;
    --rb-space-5: 32px;
    --rb-space-6: 48px;

    --rb-transition-fast: 150ms ease;
    --rb-transition-medium: 250ms ease;

    --rb-topbar-height: 64px;

    /* Builder app shell measurements - referenced by both builder.css
       (desktop) and responsive.css (mobile) so the two never drift out
       of sync on how much vertical space the sticky chrome occupies. */
    --rb-builder-toolbar-height: 56px;
    --rb-mobile-tabs-height: 48px;
    --rb-mobile-actionbar-height: 60px;
    --rb-sidebar-width: 240px;
    --rb-ats-drawer-width: 380px;

    /* On-screen A4 page proportions for the resume preview (210mm x
       297mm) - print.css defines the actual @page size for printing;
       this is only the visual approximation shown on screen. */
    --rb-a4-width: 210mm;
    --rb-a4-ratio: 210 / 297;

    /* Named z-index scale so every layered element (sticky chrome,
       drawer, backdrop, modal) has a single source of truth instead of
       ad-hoc numbers scattered across files. */
    --rb-z-sticky-toolbar: 30;
    --rb-z-drawer-backdrop: 45;
    --rb-z-drawer: 50;
    --rb-z-modal: 100;
}

/* -------------------------------------------------------------------------
   2. Reset / base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--rb-color-background);
    color: var(--rb-color-text);
    font-family: var(--rb-font-main);
    font-size: 1rem;
    line-height: 1.5;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 var(--rb-space-2);
    line-height: 1.25;
    color: var(--rb-color-text);
}

p {
    margin: 0 0 var(--rb-space-3);
}

a {
    color: var(--rb-color-primary);
}

ul,
ol {
    margin: 0 0 var(--rb-space-3);
    padding-left: 1.25rem;
}

button {
    font-family: inherit;
}

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

/* -------------------------------------------------------------------------
   3. No-JS warning
   ------------------------------------------------------------------------- */
.no-js-warning {
    margin: var(--rb-space-3);
    padding: var(--rb-space-3) var(--rb-space-4);
    background: var(--rb-color-warning-soft);
    border: 1px solid var(--rb-color-warning);
    border-radius: var(--rb-radius);
    color: var(--rb-color-warning);
    font-weight: 600;
}

/* -------------------------------------------------------------------------
   4. Site header / navigation
   ------------------------------------------------------------------------- */
.rb-site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--rb-topbar-height);
    background: var(--rb-color-surface);
    border-bottom: 1px solid var(--rb-color-border);
    box-shadow: var(--rb-shadow-card);
}

.rb-site-header-inner {
    display: flex;
    align-items: center;
    gap: var(--rb-space-4);
    height: 100%;
    padding: 0 var(--rb-space-4);
}

.rb-brand {
    display: flex;
    align-items: center;
    gap: var(--rb-space-2);
    text-decoration: none;
    color: var(--rb-color-text);
    font-weight: 800;
    flex-shrink: 0;
}

.rb-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--rb-color-inverse);
    background: linear-gradient(135deg, var(--rb-color-primary), var(--rb-color-secondary));
    border-radius: var(--rb-radius);
    font-size: 0.85rem;
    font-weight: 900;
}

.rb-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.rb-brand-text span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-color-muted);
}

.rb-nav-toggle {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--rb-color-border);
    border-radius: var(--rb-radius-sm);
    cursor: pointer;
}

.rb-nav-toggle-bar,
.rb-nav-toggle-bar::before,
.rb-nav-toggle-bar::after {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--rb-color-text);
}

.rb-site-nav {
    margin-left: auto;
}

.rb-site-nav ul {
    display: flex;
    align-items: center;
    gap: var(--rb-space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.rb-site-nav a {
    text-decoration: none;
    color: var(--rb-color-muted);
    font-weight: 600;
    font-size: 0.92rem;
}

.rb-site-nav a:hover,
.rb-site-nav a[aria-current="page"] {
    color: var(--rb-color-primary);
}

/* -------------------------------------------------------------------------
   5. Site footer
   ------------------------------------------------------------------------- */
.rb-site-footer {
    padding: var(--rb-space-4);
    background: var(--rb-color-surface);
    border-top: 1px solid var(--rb-color-border);
    color: var(--rb-color-muted);
    font-size: 0.85rem;
}

.rb-site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--rb-space-2);
}

.rb-site-footer p {
    margin: 0;
}

.rb-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rb-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.rb-footer-links a {
    color: var(--rb-color-muted);
    text-decoration: none;
}

.rb-footer-links a:hover {
    color: var(--rb-color-primary);
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   6. Static info/legal page content
   ------------------------------------------------------------------------- */
.rb-content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--rb-space-6) var(--rb-space-4);
}

.rb-content-page h1 {
    font-size: 1.8rem;
}

.rb-content-page h2 {
    margin-top: var(--rb-space-5);
    font-size: 1.25rem;
}

.rb-content-page .rb-updated-note {
    color: var(--rb-color-muted);
    font-size: 0.85rem;
}

/* Informational guide placed after the interactive builder. It stays in
   normal document flow and does not affect the editor workspace. */
.rb-builder-guide {
    width: min(1120px, calc(100% - 32px));
    margin: 48px auto;
    padding: 32px;
    color: var(--rb-color-text);
    background: var(--rb-color-surface);
    border: 1px solid var(--rb-color-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-card);
}

.rb-builder-guide section {
    margin-top: 40px;
}

.rb-builder-guide h2 {
    margin: 0 0 12px;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.25;
}

.rb-builder-guide h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.rb-builder-guide p,
.rb-builder-guide li {
    line-height: 1.7;
}

.rb-builder-guide ol {
    padding-left: 1.4rem;
}

.rb-builder-guide-intro {
    max-width: 800px;
}

.rb-guide-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.rb-guide-card-grid > div {
    padding: 20px;
    background: var(--rb-color-surface-muted);
    border: 1px solid var(--rb-color-border);
    border-radius: var(--rb-radius-sm);
}

.rb-builder-faq details {
    padding: 16px 0;
    border-top: 1px solid var(--rb-color-border);
}

.rb-builder-faq details:last-child {
    border-bottom: 1px solid var(--rb-color-border);
}

.rb-builder-faq summary {
    color: var(--rb-color-text);
    font-weight: 700;
    cursor: pointer;
}

.rb-builder-faq summary:focus-visible {
    outline: 3px solid var(--rb-color-focus);
    outline-offset: 3px;
}

.rb-builder-faq details p {
    margin: 12px 0 0;
}

@media (max-width: 640px) {
    .rb-builder-guide {
        width: calc(100% - 24px);
        margin-block: 32px;
        padding: 20px;
    }

    .rb-guide-card-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
   7. Contact form (contact.php only, but reuses the shared .rb-field/
   .rb-btn styles from builder.css)
   ------------------------------------------------------------------------- */
.rb-contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--rb-space-1);
    max-width: 480px;
}

.rb-form-success {
    padding: var(--rb-space-3);
    background: var(--rb-color-success-soft);
    border: 1px solid var(--rb-color-success);
    border-radius: var(--rb-radius);
    color: var(--rb-color-success);
    font-weight: 600;
}

.rb-form-errors {
    padding: var(--rb-space-3);
    background: var(--rb-color-error-soft);
    border: 1px solid var(--rb-color-error);
    border-radius: var(--rb-radius);
    color: var(--rb-color-error);
}

.rb-form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}
