/**
 * Veyra global theme styles.
 *
 * Layout tokens and most editor controls are generated by theme.json.
 * This file contains structural helpers, responsive templates and
 * progressively enhanced visual states that theme.json does not express.
 */

:root {
    --veyra-transition: 180ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

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

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 3px;
}

.wp-site-blocks {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.veyra-main {
    width: 100%;
    flex: 1 0 auto;
}

/*
 * Container helpers.
 * Gutenberg's constrained and wide layouts remain the preferred default.
 * These classes cover cases where a named commercial layout is clearer.
 */
.veyra-container,
.veyra-container--narrow,
.veyra-container--content,
.veyra-container--wide {
    width: 100%;
    margin-inline: auto;
}

.veyra-container {
    max-width: var(--wp--custom--layout--content);
}

.veyra-container--narrow {
    max-width: var(--wp--custom--layout--narrow);
}

.veyra-container--content {
    max-width: var(--wp--custom--layout--content);
}

.veyra-container--wide {
    max-width: var(--wp--custom--layout--wide);
}

.veyra-container--full {
    width: 100%;
    max-width: none;
}

/*
 * Page sections.
 */
.veyra-section {
    padding-block: var(--wp--preset--spacing--70);
}

.veyra-section--compact {
    padding-block: var(--wp--preset--spacing--60);
}

.veyra-section--spacious {
    padding-block: clamp(5rem, 12vw, 10rem);
}

.veyra-section--surface {
    background: var(--wp--preset--color--surface);
}

.veyra-section--contrast {
    color: var(--wp--preset--color--base);
    background: var(--wp--preset--color--contrast);
}

/*
 * Two-column layouts with an editor-managed template part.
 * Content remains first in the document and mobile reading order.
 */
.veyra-layout {
    width: 100%;
    max-width: var(--wp--custom--layout--wide);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, var(--wp--custom--layout--sidebar));
    grid-template-areas: "content sidebar";
    gap: var(--wp--custom--layout--gap);
    align-items: start;
}

.veyra-layout--sidebar-left {
    grid-template-columns: minmax(15rem, var(--wp--custom--layout--sidebar)) minmax(0, 1fr);
    grid-template-areas: "sidebar content";
}

.veyra-layout__content {
    grid-area: content;
    min-width: 0;
}

.veyra-layout__sidebar {
    grid-area: sidebar;
    min-width: 0;
}

.veyra-sidebar {
    display: grid;
    gap: var(--wp--preset--spacing--40);
}

/*
 * Reusable visual surfaces, available as classes and block styles.
 */
.veyra-surface,
.wp-block-group.is-style-veyra-surface {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--large);
}

.veyra-card,
.wp-block-group.is-style-veyra-card {
    height: 100%;
    padding: clamp(1.25rem, 2vw, 2rem);
    background: var(--wp--preset--color--base);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--large);
    box-shadow: var(--wp--preset--shadow--soft);
    transition:
        transform var(--veyra-transition),
        box-shadow var(--veyra-transition),
        border-color var(--veyra-transition);
}

.veyra-card:hover,
.wp-block-group.is-style-veyra-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(
        in srgb,
        var(--wp--preset--color--primary) 35%,
        var(--wp--preset--color--border)
    );
    box-shadow: var(--wp--preset--shadow--elevated);
}

.wp-block-group.is-style-veyra-bordered {
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--medium);
}

.veyra-eyebrow {
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/*
 * Content defaults.
 */
.wp-block-post-content :where(p, li) > a {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.wp-block-post-content :where(pre, table, .wp-block-image, .wp-block-gallery) {
    margin-block: var(--wp--preset--spacing--50);
}

.wp-block-query-pagination {
    margin-top: var(--wp--preset--spacing--60);
}

@media (max-width: 900px) {
    .veyra-layout,
    .veyra-layout--sidebar-left {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "content"
            "sidebar";
    }
}

@media (max-width: 600px) {
    .veyra-section,
    .veyra-section--compact,
    .veyra-section--spacious {
        padding-block: var(--wp--preset--spacing--60);
    }

    .veyra-card,
    .wp-block-group.is-style-veyra-card {
        padding: var(--wp--preset--spacing--40);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
