/**
 * Base Styles — Reset, RTL foundation, Typography
 * Tafaoulat By Yalmos.ma
 *
 * Load order: tokens.css → base.css
 * All values reference tokens from tokens.css.
 */

/* =========================================================
   RESET
   ========================================================= */

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

body, h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
}

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

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

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* =========================================================
   ROOT & BODY — RTL base
   ========================================================= */

body {
    direction: rtl;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image: url('../../images/tile-pattern.svg');
    background-repeat: repeat;
    background-size: 200px 200px;
    background-attachment: fixed;
    min-height: 100vh;
}

/* =========================================================
   TYPOGRAPHY — Headings
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-text);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-base); }
h6 { font-size: var(--fs-sm); }

/* Article body paragraphs — editorial line-height */
.entry-content p,
article p {
    font-size: var(--fs-lg);
    line-height: var(--lh-relaxed);
}

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

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

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

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

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

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

/* =========================================================
   LAYOUT HELPER
   ========================================================= */

.tafaoulat-container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}
