/* ============================================
   BUTTERFLAI V3 - BASE STYLES
   Reset and foundational styles
   ============================================ */

/* ─────────────────────────────────────────
   RESET
   ───────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

/* Remove WordPress admin bar spacing for this design */
body.admin-bar {
    margin-top: 0;
}

/* ─────────────────────────────────────────
   TYPOGRAPHY BASE
   ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--text-hero);
}

h2 {
    font-size: var(--text-display);
}

h3 {
    font-size: var(--text-headline);
}

h4 {
    font-size: var(--text-title);
}

h5 {
    font-size: var(--text-subtitle);
}

h6 {
    font-size: var(--text-body);
}

p {
    color: var(--color-text-secondary);
    max-width: var(--max-width-text);
}

/* Large body text for hero sections */
.text-large {
    font-size: var(--text-subtitle);
    line-height: var(--leading-relaxed);
}

/* Small text */
.text-small {
    font-size: var(--text-body-small);
}

.text-caption {
    font-size: var(--text-caption);
    color: var(--color-text-tertiary);
}

.text-micro {
    font-size: var(--text-micro);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

/* ─────────────────────────────────────────
   LINKS
   ───────────────────────────────────────── */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-primary);
    font-size: var(--text-body-small);
    font-weight: var(--weight-medium);
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Primary button */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Secondary button */
.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-text-tertiary);
    color: var(--color-text-primary);
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    padding: var(--space-xs) var(--space-sm);
}

.btn-ghost:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

/* Large button */
.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-body);
}

/* ─────────────────────────────────────────
   LAYOUT UTILITIES
   ───────────────────────────────────────── */

.v3-container {
    width: 100%;
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: 0 var(--section-padding-x);
}

.v3-container-narrow {
    max-width: var(--max-width-text);
}

/* Full viewport sections */
.v3-section {
    width: 100%;
    padding: var(--section-padding-y) 0;
    position: relative;
}

.v3-section-full {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Center content */
.text-center {
    text-align: center;
}

.text-center p {
    margin-left: auto;
    margin-right: auto;
}

/* ─────────────────────────────────────────
   SPACING UTILITIES
   ───────────────────────────────────────── */

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ─────────────────────────────────────────
   IMAGE & MEDIA
   ───────────────────────────────────────── */

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

/* Placeholder for images */
.v3-placeholder {
    background: var(--color-bg-tertiary);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--text-caption);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    aspect-ratio: 16 / 9;
    width: 100%;
}

.v3-placeholder::before {
    content: attr(data-placeholder);
}

/* ─────────────────────────────────────────
   HIDE WORDPRESS DEFAULTS
   ───────────────────────────────────────── */

/* Hide the default WP wrapper styles */
.hfeed.site,
#page.hfeed.site {
    max-width: none;
    padding: 0;
    margin: 0;
    background: transparent;
}

.wrapper#main {
    padding: 0;
    margin: 0;
}

/* Hide parent theme elements we don't need */
.site-header .site-title,
.site-header hgroup {
    display: none;
}

/* ─────────────────────────────────────────
   SELECTION
   ───────────────────────────────────────── */

::selection {
    background: var(--color-primary);
    color: var(--color-text-primary);
}

/* ─────────────────────────────────────────
   SCROLLBAR (Webkit)
   ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--color-bg-secondary);
}
