/**
 * Quwa Theme - Base Styles
 *
 * Typography, resets, and foundational element styles.
 * Uses CSS custom properties from variables.css
 *
 * @package Quwa_Theme
 * @since 1.0.0
 */

/* =========================================================================
   RESET & BOX SIZING
   ========================================================================= */

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

* {
    margin: 0;
    padding: 0;
}

/* =========================================================================
   DOCUMENT
   ========================================================================= */

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    background-color: #ffffff !important;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
    background-color: #ffffff !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   TYPOGRAPHY - 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-heading);
    margin-bottom: var(--space-4);
}

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);
}

/* Responsive heading sizes */
@media (max-width: 767px) {
    h1 {
        font-size: var(--text-3xl);
    }

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

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

/* =========================================================================
   TYPOGRAPHY - BODY TEXT
   ========================================================================= */

p {
    margin-bottom: var(--space-4);
}

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

/* Article content uses Vollkorn */
.article-content,
.entry-content p,
.prose p {
    font-family: var(--font-article);
    font-size: var(--text-lg);
    line-height: var(--leading-loose);
    color: var(--color-gray-700);
}

.article-content h2,
.article-content h3,
.article-content h4,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--font-heading);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

/* Lead paragraph */
.lead,
.article-content > p:first-of-type {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--color-gray-600);
}

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

/* Strong & emphasis */
strong,
b {
    font-weight: var(--font-bold);
}

em,
i {
    font-style: italic;
}

/* =========================================================================
   LINKS
   ========================================================================= */

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover,
a:focus {
    color: var(--color-link-hover);
}

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Links within article content */
.article-content a,
.entry-content a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.article-content a:hover,
.entry-content a:hover {
    text-decoration-thickness: 2px;
}

/* =========================================================================
   LISTS
   ========================================================================= */

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

li {
    margin-bottom: var(--space-2);
}

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

/* Article content lists */
.article-content ul,
.article-content ol,
.entry-content ul,
.entry-content ol {
    margin-top: var(--space-4);
    margin-bottom: var(--space-6);
}

.article-content li,
.entry-content li {
    font-family: var(--font-article);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
}

/* Reset list styles */
.list-none {
    list-style: none;
    padding-left: 0;
}

/* =========================================================================
   IMAGES & MEDIA
   ========================================================================= */

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

figure {
    margin: var(--space-8) 0;
}

figcaption {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    text-align: center;
}

/* =========================================================================
   BLOCKQUOTES
   ========================================================================= */

blockquote {
    font-family: var(--font-article);
    font-size: var(--text-xl);
    font-style: italic;
    line-height: var(--leading-relaxed);
    color: var(--color-gray-700);
    border-left: 4px solid var(--color-accent);
    padding-left: var(--space-6);
    margin: var(--space-8) 0;
}

blockquote cite {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-style: normal;
    color: var(--color-text-muted);
    margin-top: var(--space-4);
}

blockquote cite::before {
    content: '\2014\00a0';
}

/* =========================================================================
   CODE
   ========================================================================= */

code,
kbd,
samp,
pre {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.875em;
}

code {
    background-color: var(--color-gray-100);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
}

pre {
    background-color: var(--color-gray-900);
    color: var(--color-gray-100);
    padding: var(--space-4);
    border-radius: var(--radius);
    overflow-x: auto;
    margin: var(--space-6) 0;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* =========================================================================
   HORIZONTAL RULE
   ========================================================================= */

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* =========================================================================
   TABLES
   ========================================================================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-6) 0;
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    background-color: var(--color-gray-50);
}

/* =========================================================================
   FORMS (Basic)
   ========================================================================= */

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* =========================================================================
   SELECTION
   ========================================================================= */

::selection {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* =========================================================================
   SCREEN READER ONLY
   ========================================================================= */

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

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: inherit;
}
