/* ═══════════════════════════════════════════════════════════════════════════════
   ChatSKU Theme — Main Stylesheet
   All @import statements MUST come first before any CSS rules
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── All Imports First ───────────────────────────────────────────────────── */
@import url('./components/_variables.css');
@import url('./components/_header.css');
@import url('./components/_buttons.css');
@import url('./components/_cards.css');
@import url('./components/_hero.css');
@import url('./components/_accordion.css');
@import url('./components/_forms.css');
@import url('./components/_footer.css');

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Offset for sticky header */
.chatsku-main, .site-main { padding-top: var(--header-height); }
.home .chatsku-main, .home .site-main { padding-top: 0; }

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

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

button { font-family: var(--font-sans); cursor: pointer; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }

code, pre {
    font-family: var(--font-mono);
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
}

code { padding: 2px 6px; font-size: 0.9em; }
pre { padding: var(--space-4); overflow-x: auto; }
pre code { background: none; padding: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Layout Utilities ────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

.container--narrow  { max-width: 860px; }
.container--wide    { max-width: 1440px; }

.section-padding {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
}

/* ── Section Heading ─────────────────────────────────────────────────────── */
.section-head {
    text-align: center;
    margin-bottom: clamp(40px, 5vw, 72px);
}

.section-head__eyebrow {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-accent-glow);
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}

.section-head__title {
    font-family: var(--font-heading);
    font-size: clamp(var(--font-size-3xl), 4vw, var(--font-size-5xl));
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-4);
}

.section-head__title em {
    font-style: normal;
    color: var(--color-accent);
}

.section-head__subtitle {
    font-size: clamp(var(--font-size-base), 1.5vw, var(--font-size-xl));
    color: var(--color-text-muted);
    line-height: var(--line-height-loose);
    max-width: 640px;
    margin: 0 auto;
}

/* ── Section Divider ─────────────────────────────────────────────────────── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
    margin: 0;
}

/* ── Section Backgrounds ─────────────────────────────────────────────────── */
.bg-primary   { background: var(--color-bg-primary); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-gradient  { background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%); }
.bg-accent-subtle { background: linear-gradient(135deg, rgba(0,201,177,0.05) 0%, var(--color-bg-secondary) 100%); }

/* ── Grids ───────────────────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--grid-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap); }
.grid-auto-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--grid-gap); }
.grid-auto-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--grid-gap); }

@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

/* ── Text Utilities ──────────────────────────────────────────────────────── */
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-balance { text-wrap: balance; }

/* Gradient text helper */
.gradient-text {
    background: linear-gradient(135deg, var(--color-accent) 0%, #4eddcc 60%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Scroll Reveal Animations ────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Badge / Chip ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.4;
}

.badge--accent  { background: var(--color-accent-glow); color: var(--color-accent); border: 1px solid var(--color-border-accent); }
.badge--success { background: rgba(34, 197, 94, 0.1); color: var(--color-success); }
.badge--warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.badge--error   { background: rgba(239, 68, 68, 0.1); color: var(--color-error); }

/* ── Glow Separator Lines ────────────────────────────────────────────────── */
.glow-line {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--color-accent) 50%, transparent 100%);
    opacity: 0.6;
    margin: 0;
}

/* ── Checklist ───────────────────────────────────────────────────────────── */
.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.check-list__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height-snug);
}

.check-list__item::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300C9B1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Embed Code Block ────────────────────────────────────────────────────── */
.embed-code-block {
    background: #0d1424;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.embed-code-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--color-border);
}

.embed-code-block__dots {
    display: flex;
    gap: 6px;
}

.embed-code-block__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.embed-code-block__dot:nth-child(1) { background: #ff5f56; }
.embed-code-block__dot:nth-child(2) { background: #ffbd2e; }
.embed-code-block__dot:nth-child(3) { background: #27c93f; }

.embed-code-block__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-faint);
    font-family: var(--font-mono);
}

.embed-code-block__copy {
    font-size: var(--font-size-xs);
    color: var(--color-accent);
    background: transparent;
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background var(--transition-fast);
}

.embed-code-block__copy:hover { background: var(--color-accent-glow); }

.embed-code-block__code {
    padding: var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: #e2e8f0;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

.embed-code-block__code .token-tag    { color: #4eddcc; }
.embed-code-block__code .token-attr   { color: #ffd700; }
.embed-code-block__code .token-string { color: #a5d6ff; }

/* ── WordPress Default Block Styles ──────────────────────────────────────── */
.wp-block-image img { border-radius: var(--radius-lg); }
.wp-block-quote {
    border-left: 3px solid var(--color-accent);
    padding-left: var(--space-5);
    font-style: italic;
    color: var(--color-text-muted);
}
.wp-block-separator { border-color: var(--color-border); }

/* ── Entry Content (blog post body) ─────────────────────────────────────── */
.entry-content {
    color: var(--color-text-secondary);
    line-height: var(--line-height-loose);
}

.entry-content h2 { font-size: var(--font-size-3xl); font-weight: 800; color: var(--color-text-primary); margin: var(--space-10) 0 var(--space-5); letter-spacing: -0.02em; }
.entry-content h3 { font-size: var(--font-size-2xl); font-weight: 700; color: var(--color-text-primary); margin: var(--space-8) 0 var(--space-4); }
.entry-content h4 { font-size: var(--font-size-xl);  font-weight: 700; color: var(--color-text-primary); margin: var(--space-6) 0 var(--space-3); }
.entry-content p  { margin-bottom: var(--space-5); }
.entry-content ul, .entry-content ol { padding-left: var(--space-6); margin-bottom: var(--space-5); }
.entry-content li { margin-bottom: var(--space-2); }
.entry-content a  { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--color-accent-light); }
.entry-content strong { color: var(--color-text-primary); font-weight: 700; }
.entry-content blockquote { margin: var(--space-8) 0; border-left: 3px solid var(--color-accent); padding-left: var(--space-5); color: var(--color-text-muted); font-style: italic; }
.entry-content code { color: var(--color-accent); }
.entry-content pre { margin-bottom: var(--space-6); }
.entry-content img { border-radius: var(--radius-lg); margin: var(--space-6) 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-6); }
.entry-content th, .entry-content td { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); text-align: left; font-size: var(--font-size-sm); }
.entry-content th { background: rgba(255,255,255,0.04); font-weight: 700; color: var(--color-text-primary); }

/* ── Admin Bar Offset ────────────────────────────────────────────────────── */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
