/*
Theme Name: Osmova Base
Theme URI: https://osmova.com/
Author: Osmova
Author URI: https://osmova.com/
Description: Reusable WordPress parent theme for Osmova client projects. Ships an accessible template hierarchy, documented hook zones, and an explicit WooCommerce contract. Carries no functional modules (those live in osmova-wp-core) and no site brand (that lives in child themes). Designed to be extended by child themes via Template: osmova-base-theme.
Version: 0.49.0
Requires at least: 6.6
Requires PHP: 8.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: osmova-base
Tags: block-styles, translation-ready, custom-logo, e-commerce
*/

/* -----------------------------------------------------------------------------
 * Baseline only.
 *
 * The parent ships a minimal, namespaced CSS baseline. It deliberately does NOT
 * include a utility framework (Tailwind/Preflight) or a build pipeline. Child
 * themes own the Vite/Tailwind build and brand styling and are the asset owner.
 * Neutral colors are read from CSS variables defined in theme.json so child
 * themes can re-skin the baseline without overriding this file.
 * -------------------------------------------------------------------------- */

:root {
    --osmova-base-color-text: var(--wp--preset--color--foreground, #111827);
    --osmova-base-color-background: var(--wp--preset--color--background, #ffffff);
    --osmova-base-color-muted: var(--wp--preset--color--muted, #6b7280);
    --osmova-base-color-border: var(--wp--preset--color--hairline, var(--wp--preset--color--border, #e5e7eb));
    --osmova-base-color-accent: var(--wp--preset--color--accent, #2563eb);
    --osmova-base-container-width: 72rem;
    --osmova-base-gutter: 1rem;
}

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

body {
    margin: 0;
    color: var(--osmova-base-color-text);
    background: var(--osmova-base-color-background);
    font-family: var(--font-body, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    line-height: var(--text-body--line-height, 1.5);
}

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

a {
    color: var(--osmova-base-color-accent);
}

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

.screen-reader-text:focus {
    top: 1rem;
    left: 1rem;
    z-index: 100000;
    width: auto;
    height: auto;
    padding: 0.75rem 1rem;
    clip: auto;
    background: var(--osmova-base-color-text);
    color: var(--osmova-base-color-background);
}

.osmova-base-container {
    width: min(100% - (var(--osmova-base-gutter) * 2), var(--osmova-base-container-width));
    margin-inline: auto;
}

.osmova-base-site-header,
.osmova-base-site-footer {
    padding-block: 1rem;
    border-block: 1px solid var(--osmova-base-color-border);
}

.osmova-base-site-header .osmova-base-container,
.osmova-base-site-footer .osmova-base-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.osmova-base-site-main {
    padding-block: 2rem;
}

.osmova-base-primary-nav ul,
.osmova-base-site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.osmova-base-entry + .osmova-base-entry {
    margin-block-start: 2rem;
}

.osmova-base-pagination {
    margin-block-start: 2rem;
}

/* -----------------------------------------------------------------------------
 * Type roles on generic elements (docs/typography.md).
 *
 * A low cascade layer with zero-specificity selectors, so any child or block
 * rule wins. An unset token makes its declaration inherit, and the fallbacks
 * repeat the browser defaults (h1 2em bold, small smaller…), so nothing
 * changes until a role is configured. `osmova-base` must be the first
 * (lowest) layer: osmova-ui.css, enqueued earlier, declares it first, and a
 * child that loads its own layered CSS earlier declares `@layer osmova-base;` first.
 * -------------------------------------------------------------------------- */

@layer osmova-base.type {
    :where(body) {
        font-size: var(--text-body);
        font-weight: var(--text-body--font-weight);
        letter-spacing: var(--text-body--letter-spacing);
        text-transform: var(--type-body-case);
    }
    :where(h1) {
        font-family: var(--font-h1);
        font-size: var(--text-h1, 2em);
        font-weight: var(--text-h1--font-weight, bold);
        line-height: var(--text-h1--line-height);
        letter-spacing: var(--text-h1--letter-spacing);
        text-transform: var(--type-h1-case);
    }
    :where(h2) {
        font-family: var(--font-h2);
        font-size: var(--text-h2, 1.5em);
        font-weight: var(--text-h2--font-weight, bold);
        line-height: var(--text-h2--line-height);
        letter-spacing: var(--text-h2--letter-spacing);
        text-transform: var(--type-h2-case);
    }
    :where(h3) {
        font-family: var(--font-h3);
        font-size: var(--text-h3, 1.17em);
        font-weight: var(--text-h3--font-weight, bold);
        line-height: var(--text-h3--line-height);
        letter-spacing: var(--text-h3--letter-spacing);
        text-transform: var(--type-h3-case);
    }
    :where(h4) {
        font-family: var(--font-h4);
        font-size: var(--text-h4, 1em);
        font-weight: var(--text-h4--font-weight, bold);
        line-height: var(--text-h4--line-height);
        letter-spacing: var(--text-h4--letter-spacing);
        text-transform: var(--type-h4-case);
    }
    :where(small) {
        font-family: var(--font-small);
        font-size: var(--text-small, smaller);
        font-weight: var(--text-small--font-weight);
        line-height: var(--text-small--line-height);
        letter-spacing: var(--text-small--letter-spacing);
        text-transform: var(--type-small-case);
    }
    :where(label) {
        font-family: var(--font-label);
        font-size: var(--text-label);
        font-weight: var(--text-label--font-weight);
        line-height: var(--text-label--line-height);
        letter-spacing: var(--text-label--letter-spacing);
        text-transform: var(--type-label-case);
    }
    /* Nav link labels and the properties `.o-button` (a link) inherits. */
    :where(.o-nav__link, .o-nav-band__link) {
        font-family: var(--font-nav);
        font-size: var(--text-nav);
        font-weight: var(--text-nav--font-weight);
        line-height: var(--text-nav--line-height);
        letter-spacing: var(--text-nav--letter-spacing);
        text-transform: var(--type-nav-case);
    }
    :where(.o-button) {
        font-family: var(--font-button);
        letter-spacing: var(--text-button--letter-spacing);
        text-transform: var(--type-button-case);
    }
}
