/* ================================================================
   WPrime Analytics Theme — main.css
   Design tokens + global layout + header + footer + components
   ================================================================ */

/* ---- Design tokens ---- */
:root {
    --color-primary:     #2563EB;
    --color-primary-h:   #1D4ED8;
    --color-primary-10:  #EFF6FF;
    --color-primary-20:  #DBEAFE;

    --color-green:       #16A34A;
    --color-green-bg:    #DCFCE7;
    --color-blue:        #2563EB;
    --color-blue-bg:     #DBEAFE;
    --color-yellow:      #CA8A04;
    --color-yellow-bg:   #FEF9C3;
    --color-red:         #DC2626;
    --color-red-bg:      #FEE2E2;

    --text-base:         #222;
    --text-muted:        #555;
    --text-subtle:       #888;

    --border:            #d0d0d0;
    --border-strong:     #888;
    --bg-page:           #f6f6f6;
    --canvas:            #FAFAFA;
    --bg-card:           #FFFFFF;
    --bg-sidebar:        #ffffff;
    --bg-sidebar-hover:  #f4f4f4;
    --bg-topbar:         #FFFFFF;

    --radius-sm:         0px;
    --radius-md:         0px;
    --radius-lg:         0px;
    --shadow-sm:         none;
    --shadow-md:         none;

    --font:              'Inter', system-ui, -apple-system, sans-serif;
    --header-h:          60px;

    /* ---- WPrime Write design system — real tokens ---- */
    --ink-900: #080808;
    --ink-1000: #000;
    --ink-700: #353E5C;
    --ink-600: #6D758F;
    --ink-500: #B4B9C9;
    --ink-400: #E1E4ED;
    --ink-300: #F1F3F7;
    --ink-200: #F8FAFF;
    --ink-150: #FAFAFA;
    --ink-100: #fff;
    --accent-lime: #E0FB60;
    --accent-blue: #0824CF;
    --pos-500: #32C44F;
    --pos-300: #ADECBB;
    --pos-100: #EEF9F5;
    --neg-500: #FF2D46;
    --neg-300: #FB93A3;
    --neg-100: #FFECEF;
    --warn-300: #FBE080;
    --warn-100: #FFFAE9;
    --shadow-menu: 0 8px 24px rgba(8,8,8,.10);
    --shadow-btn: 0 1px 4px rgba(25,33,61,.08);

    /* ---- All Projects screen — literal source tokens not covered above ---- */
    --ink-350: #EDEFF5;
    --shadow-menu-alt: 0 8px 24px rgba(25,33,61,.10);
}
.logged-in.page-template-dashboard #site-header {
    display: none !important;
}
.logged-in.page-template-dashboard .site-footer {
    display: none !important;
}
/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 20px;
    color: var(--text-base);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
::selection { background: var(--accent-lime); color: var(--ink-900); }
button, input, select, textarea { font-family: inherit; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* ---- Buttons (literal .btn / .btn.primary / .btn.sm from the design source) ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--ink-400);
    border-radius: 0;
    background: #fff;
    color: var(--ink-900);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    text-decoration: none;
    transition: background .1s, border-color .1s, color .1s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-700); }
.btn:active { background: var(--ink-200); }
.btn:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.btn:disabled, .btn[disabled] { opacity: .3; cursor: not-allowed; pointer-events: none; }

.btn.primary {
    background: var(--ink-900);
    color: #fff;
    border-color: var(--ink-900);
    box-shadow: var(--shadow-btn);
}
.btn.primary:hover { background: #fff; color: var(--ink-700); border-color: var(--ink-700); }
.btn.primary:active { background: var(--ink-700); color: #fff; border-color: var(--ink-900); }
.btn.sm { padding: 7px 12px; font-size: 13px; }

/* ---- Older BEM button modifiers (.btn--primary/.btn--ghost/.btn--sm) — still used
   across pages not yet migrated to the literal .btn.primary/.btn.sm classes above ---- */
.btn--primary {
    background: var(--ink-1000);
    color: #fff;
    border-color: var(--ink-1000);
    font-weight: 600;
    box-shadow: var(--shadow-btn);
}
.btn--primary:hover { background: #fff; border-color: var(--ink-700); color: var(--ink-700); box-shadow: none; }

.btn--ghost {
    background: #fff;
    color: var(--ink-700);
    border-color: var(--ink-400);
}
.btn--ghost:hover { background: var(--ink-200); color: var(--ink-900); border-color: var(--ink-700); }

.btn--sm  { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--lg  { height: 40px; padding: 0 20px; font-size: 14px; }

/* ---- Form inputs ---- */
.input-text,
.input-select {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--ink-400);
    border-radius: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink-900);
    background: var(--ink-200);
    transition: border-color .15s;
    outline: none;
}
.input-text:focus,
.input-select:focus { border-color: var(--ink-700); }
.input-select--sm { height: 28px; font-size: 12px; padding: 0 8px; }

/* ================================================================
   SITE HEADER
   ================================================================ */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.site-header > .container { height: 100%; }

.site-header__inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-base);
}
.site-logo:hover .site-logo__name { color: var(--color-primary); }

.site-nav { flex: 1; }
.site-nav__list { display: flex; gap: 4px; }
.site-nav__list li a {
    display: block;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.site-nav__list li a:hover,
.site-nav__list li.current-menu-item a { background: var(--primary-10); color: var(--color-primary); }

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-user {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-base);
    border-radius: 2px;
    transition: transform .2s;
}

/* ================================================================
   SITE MAIN & FOOTER
   ================================================================ */
.site-main { flex: 1; }

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 20px 0;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-subtle);
}
.site-footer__powered a { color: var(--text-subtle); }
.site-footer__powered a:hover { color: var(--color-primary); }

/* ================================================================
   PAGE CONTENT
   ================================================================ */
.page-content { padding: 48px 0; }
.page-content .page-title { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.entry-content { max-width: 760px; }

/* ================================================================
   HOMEPAGE — HERO
   ================================================================ */
.hero {
    padding: 80px 0 64px;
    background: linear-gradient(135deg, var(--color-primary-10) 0%, #fff 60%);
}
.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}
.hero__badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-primary-20);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.hero__title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-base);
}
.hero__desc {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 440px;
    margin-bottom: 32px;
    line-height: 1.7;
}

/* Preview card */
.preview-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px 24px;
    border: 1px solid var(--border);
}
.preview-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.preview-card__title { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.preview-card__badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.preview-card__badge--green { background: var(--color-green-bg); color: var(--color-green); }
.preview-card__stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.preview-stat__val {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-base);
}
.preview-stat__lbl { font-size: 12px; color: var(--text-subtle); }

/* ================================================================
   HOMEPAGE — FEATURES
   ================================================================ */
.features { padding: 64px 0 80px; }
.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, border-color .2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary-20); }
.feature-card__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-10);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.feature-card p  { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .hero__inner       { grid-template-columns: 1fr; }
    .hero__preview     { display: none; }
    .features__grid    { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .site-nav          { display: none; }
    .site-nav.is-open  { display: block; position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 0; z-index: 100; }
    .site-nav.is-open .site-nav__list { flex-direction: column; padding: 0 16px; }
    .nav-toggle        { display: flex; }
    .site-header__actions .header-user { display: none; }
    .features__grid    { grid-template-columns: 1fr; }
}
