/**
 * KRP Base Styles
 *
 * CSS reset, typography defaults, and utility classes.
 * Base styles and resets.
 */

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::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: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-foreground);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Home page uses white background; all other pages use #f8fafc */
body.home { background-color: #ffffff; }

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Hide number input spinners for clean qty steppers */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

code,
pre,
kbd {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-foreground);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--font-semibold); }

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

small {
    font-size: var(--text-sm);
}

/* ==========================================================================
   Container
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* ==========================================================================
   Prose Styles (for blog/article content)
   ========================================================================== */
.prose {
    color: var(--color-slate-700);
    line-height: var(--leading-loose);
}

.prose .lead {
    font-size: var(--text-xl);
    line-height: 1.7;
    margin-bottom: var(--space-6);
}

.prose p {
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
    line-height: var(--leading-loose);
}

.prose h2 {
    font-size: 1.75rem;
    font-weight: var(--font-bold);
    line-height: var(--leading-snug);
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    color: var(--color-foreground);
}

.prose h3 {
    font-size: 1.375rem;
    font-weight: var(--font-semibold);
    line-height: 1.4;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    color: var(--color-slate-800);
}

.prose ul {
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
    padding-left: 1.75rem;
    list-style-type: disc;
}

.prose ul li {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
    line-height: var(--leading-loose);
    display: list-item;
}

.prose ul li::marker {
    color: var(--color-primary);
}

.prose ol {
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
    padding-left: 1.75rem;
    list-style-type: decimal;
}

.prose ol li {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
    line-height: var(--leading-loose);
    display: list-item;
}

.prose blockquote {
    font-style: italic;
    border-left: 4px solid var(--color-primary);
    padding: var(--space-6);
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
    color: var(--color-slate-600);
    background-color: #fef3f1;
    border-radius: var(--radius-lg);
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: var(--color-slate-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--color-foreground);
}

.prose strong {
    font-weight: var(--font-semibold);
    color: var(--color-foreground);
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-primary-200);
    text-underline-offset: 2px;
    transition: all var(--transition-base);
}

.prose a:hover {
    color: var(--color-primary-hover);
    text-decoration-color: var(--color-primary);
}

.prose h2 + p,
.prose h3 + p {
    margin-top: var(--space-3);
}

/* Large prose variant */
.prose-lg {
    font-size: var(--text-lg);
    line-height: var(--leading-loose);
}

.prose-lg p {
    line-height: 1.8;
}

.prose-lg h2 {
    font-size: 2rem;
    margin-top: var(--space-12);
    margin-bottom: var(--space-5);
}

.prose-lg h3 {
    font-size: 1.5rem;
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.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;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Select Dropdown (custom arrow)
   ========================================================================== */
select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
