/* ==========================================================================
   OXYLLIUM - Base Typography & Elements
   ========================================================================== */

/* NOTE: Google Fonts loaded via <link> in HTML head for better performance */

/* ===== BASE ===== */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--color-gray-800);
    background-color: var(--color-white);
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-secondary);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: clamp(var(--text-4xl), 5vw, var(--text-7xl));
    font-weight: var(--font-extrabold);
    letter-spacing: var(--tracking-tighter);
}

h2 {
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    font-weight: var(--font-bold);
}

h3 {
    font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
}

h4 {
    font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
}

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

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

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

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--color-gray-600);
}

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

/* ===== LINKS ===== */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* Link with underline effect */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base) var(--ease-out-expo);
}

.link-underline:hover::after {
    width: 100%;
}

/* ===== LISTS ===== */
ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

li:last-child {
    margin-bottom: 0;
}

/* Styled list */
.list-styled {
    list-style: none;
    padding-left: 0;
}

.list-styled li {
    position: relative;
    padding-left: var(--space-6);
}

.list-styled li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    transform: rotate(45deg);
}

/* Check list */
.list-check {
    list-style: none;
    padding-left: 0;
}

.list-check li {
    position: relative;
    padding-left: var(--space-8);
    margin-bottom: var(--space-3);
}

.list-check li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25em;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== BLOCKQUOTE ===== */
blockquote {
    position: relative;
    padding: var(--space-6) var(--space-8);
    margin: var(--space-8) 0;
    border-left: 4px solid var(--color-primary);
    background: var(--color-gray-50);
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--color-gray-700);
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: var(--text-6xl);
    font-family: var(--font-heading);
    color: var(--color-primary);
    opacity: 0.3;
    line-height: 1;
}

blockquote cite {
    display: block;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    font-style: normal;
    font-weight: var(--font-semibold);
    color: var(--color-secondary);
}

/* ===== CODE ===== */
code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
    color: var(--color-primary-dark);
}

pre {
    padding: var(--space-6);
    background: var(--color-secondary);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: none;
    color: var(--color-gray-100);
}

/* ===== HORIZONTAL RULE ===== */
hr {
    border: none;
    height: 1px;
    background: var(--color-gray-200);
    margin: var(--space-12) 0;
}

hr.divider-gradient {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

/* ===== SELECTION ===== */
::selection {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ===== MARK ===== */
mark {
    background: var(--color-accent);
    color: var(--color-secondary);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-sm);
}

/* ===== STRONG & EM ===== */
strong {
    font-weight: var(--font-semibold);
    color: var(--color-secondary);
}

em {
    font-style: italic;
}

/* ===== ABBREVIATION ===== */
abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* ===== IMAGE PLACEHOLDER ===== */
.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E") center center no-repeat;
    opacity: 0.5;
}

.placeholder-text {
    position: relative;
    z-index: 1;
    color: var(--color-white);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-align: center;
    padding: var(--space-4);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-gray-500); }
.text-white { color: var(--color-white); }

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

.font-light { font-weight: var(--font-light); }
.font-regular { font-weight: var(--font-regular); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-widest { letter-spacing: var(--tracking-widest); }
