/* ===================================================================================
   HEXXXA BASE
   Reset, design tokens, typography, layout primitives, forms, buttons, WordPress core
   classes and post/page content. Loaded on every page; component styles build on it.
   Rules: sharp corners (border-radius 0), Oswald headings, Roboto text, max width 1320px.
===================================================================================== */

:root {
    --hexxxa-gold: #C8A882;
    --hexxxa-gold-dark: #b8986f;
    --hexxxa-brown: #8B7355;
    --hexxxa-brown-dark: #6b5a45;
    --hexxxa-topbar: #977849;
    --hexxxa-accent: #ceb17a;
    --hexxxa-cream: #f8f6f0;
    --hexxxa-cream-strong: #f3efe6;
    --hexxxa-dark: #2c2c2c;
    --hexxxa-heading: #222222;
    --hexxxa-text: #5f5f5f;
    --hexxxa-muted: #6b7280;
    --hexxxa-line: #ebe5da;
    --hexxxa-line-strong: #dcd3c3;
    --hexxxa-white: #ffffff;
    --hexxxa-error: #b3261e;
    --hexxxa-success: #2f6b3a;
    --hexxxa-container: 1320px;
    --hexxxa-gutter: 20px;
    --hexxxa-font-text: "Roboto", Arial, sans-serif;
    --hexxxa-font-heading: "Oswald", "Arial Narrow", sans-serif;

    /* Surfaces and states (DESIGN.md → Farby) */
    --hexxxa-selected: #fbf6ee;
    --hexxxa-option-line: #ece7dc;
    --hexxxa-dark-section: #26241f;
    --hexxxa-footer: #2c2c2c;
    --hexxxa-footer-band: #1f1f1f;
    --hexxxa-footer-bottom: #1a1a1a;
    --hexxxa-disabled: #c7c0b3;

    /* Type scale (DESIGN.md → Typografia) */
    --hexxxa-fs-display: 46px;   /* section title */
    --hexxxa-fs-page-title: 40px;
    --hexxxa-fs-product-title: 38px;
    --hexxxa-fs-card-title: 24px;
    --hexxxa-fs-lead: 19px;
    --hexxxa-fs-body: 16px;
    --hexxxa-fs-small: 14px;
    --hexxxa-fs-caption: 13px;
    --hexxxa-fs-price: 42px;

    /* Spacing scale */
    --hexxxa-space-1: 4px;
    --hexxxa-space-2: 8px;
    --hexxxa-space-3: 12px;
    --hexxxa-space-4: 16px;
    --hexxxa-space-5: 24px;
    --hexxxa-space-6: 32px;
    --hexxxa-space-7: 48px;
    --hexxxa-space-8: 64px;
    --hexxxa-space-9: 96px;

    /* Controls, depth, motion */
    --hexxxa-control-h: 52px;
    --hexxxa-cta-h: 58px;
    --hexxxa-focus-ring: 0 0 0 1px var(--hexxxa-brown) inset;
    --hexxxa-shadow-card: 0 8px 30px rgba(44, 36, 24, 0.08);
    --hexxxa-shadow-bar: 0 -6px 24px rgba(44, 36, 24, 0.10);
    --hexxxa-ease: 0.2s ease;

    /* Older component files use these names: same values, one source. */
    --primary-gold: var(--hexxxa-gold);
    --primary-gold-dark: var(--hexxxa-gold-dark);
    --secondary-brown: var(--hexxxa-brown);
    --secondary-brown-dark: var(--hexxxa-brown-dark);
    --light-cream: var(--hexxxa-cream);
    --text-dark: var(--hexxxa-dark);
    --text-muted: var(--hexxxa-muted);
    --text-soft: #5f5a52;
    --white: var(--hexxxa-white);
    --line: var(--hexxxa-line);
    --line-strong: var(--hexxxa-line-strong);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--hexxxa-white);
    color: var(--hexxxa-text);
    font-family: var(--hexxxa-font-text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

img {
    border-style: none;
    vertical-align: middle;
}

figure {
    margin: 0;
}

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

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 1rem;
    color: var(--hexxxa-heading);
    font-family: var(--hexxxa-font-heading);
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

h1 { font-size: 40px; }
h2 { font-size: 35px; }
h3 { font-size: 28px; }
h4 { font-size: 22px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--hexxxa-brown);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--hexxxa-topbar);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--hexxxa-brown);
    outline-offset: 2px;
}

strong,
b {
    font-weight: 700;
}

hr {
    height: 1px;
    margin: 2rem 0;
    border: 0;
    background: var(--hexxxa-line);
}

ul,
ol {
    margin: 0 0 1rem;
    padding-left: 1.4em;
}

blockquote {
    margin: 0 0 1.5rem;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--hexxxa-gold);
    color: var(--hexxxa-dark);
    font-style: italic;
}

table {
    width: 100%;
    margin: 0 0 1.5rem;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 12px;
    border: 1px solid var(--hexxxa-line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--hexxxa-dark);
    font-weight: 600;
}

/* ---- Accessibility ---- */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
    word-wrap: normal !important;
}

.screen-reader-text:focus,
.skip-link:focus {
    top: 8px;
    left: 8px;
    z-index: 100000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 18px;
    clip: auto;
    clip-path: none;
    background: var(--hexxxa-white);
    color: var(--hexxxa-dark);
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ---- Layout ---- */
.hexxxa-container {
    width: 100%;
    max-width: var(--hexxxa-container);
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--hexxxa-gutter);
    padding-left: var(--hexxxa-gutter);
}

.hexxxa-container--narrow {
    max-width: 920px;
}

.hexxxa-main {
    display: block;
}

/* Default page / post wrappers (page.php, index.php) */
.hexxxa-page {
    padding: 40px 0 96px;
}

/* ---- Buttons ---- */
.hexxxa-btn,
.button,
button.button,
input[type="submit"].button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 0;
    background: var(--hexxxa-gold);
    color: var(--hexxxa-white);
    font-family: var(--hexxxa-font-heading);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.8px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.hexxxa-btn:hover,
.button:hover,
button.button:hover {
    background: var(--hexxxa-brown);
    color: var(--hexxxa-white);
}

.hexxxa-btn--outline {
    background: transparent;
    color: var(--hexxxa-brown);
    box-shadow: inset 0 0 0 2px var(--hexxxa-brown);
}

.hexxxa-btn--outline:hover {
    background: var(--hexxxa-brown);
    color: var(--hexxxa-white);
}

.button:disabled,
.button.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---- Forms ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid var(--hexxxa-line-strong);
    border-radius: 0;
    background: var(--hexxxa-white);
    color: var(--hexxxa-dark);
    font-size: 16px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

select {
    padding-right: 40px;
    background: var(--hexxxa-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c2c2c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--hexxxa-brown);
    box-shadow: 0 0 0 1px var(--hexxxa-brown) inset;
    outline: none;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--hexxxa-brown);
}

label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--hexxxa-dark);
    font-size: 14px;
    font-weight: 600;
}

::placeholder {
    color: #9b958b;
    opacity: 1;
}

/* ---- WooCommerce notices (site-wide: product page, account, cart) ---- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
    position: relative;
    margin: 0 0 20px;
    padding: 14px 18px;
    border-left: 3px solid var(--hexxxa-gold);
    background: var(--hexxxa-cream);
    color: var(--hexxxa-dark);
    font-size: 15px;
    line-height: 1.5;
    list-style: none;
}

.woocommerce-error {
    border-left-color: var(--hexxxa-error);
    background: #fdf3f2;
}

.woocommerce-message .button,
.woocommerce-info .button {
    float: right;
    min-height: 0;
    margin-left: 16px;
    padding: 0;
    background: none;
    color: var(--hexxxa-brown);
    font-family: var(--hexxxa-font-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-decoration: underline;
    text-transform: none;
}

.woocommerce-message .button:hover,
.woocommerce-info .button:hover {
    background: none;
    color: var(--hexxxa-brown-dark);
}

/* Inline SVG icons (hexxxa_icon() in inc/icons.php): sized by the font size, coloured by the text colour */
.hexxxa-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.125em;
}

/* WooCommerce moves focus to notices for screen readers. They are not controls, so no focus
   ring (the browser's default ring has rounded corners). */
.woocommerce-error:focus,
.woocommerce-message:focus,
.woocommerce-info:focus,
.woocommerce-NoticeGroup:focus {
    outline: none;
}

/* Star rating (WooCommerce markup, drawn without the WooCommerce icon font) */
.star-rating {
    position: relative;
    display: inline-block;
    width: 5.4em;
    height: 1em;
    overflow: hidden;
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
}

.star-rating::before,
.star-rating > span::before {
    content: "\2605\2605\2605\2605\2605";
    position: absolute;
    top: 0;
    left: 0;
    letter-spacing: 0.08em;
}

.star-rating::before {
    color: #e3dccd;
}

.star-rating > span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    padding-top: 1.5em;
    color: transparent;
}

.star-rating > span::before {
    color: var(--hexxxa-gold);
}

/* ---- WordPress core classes ---- */
.alignleft {
    float: left;
    margin: 0.4em 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0.4em 0 1em 1.5em;
}

.aligncenter {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.wp-caption,
figure.wp-block-image {
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.wp-caption-text,
figcaption,
.wp-element-caption {
    margin-top: 8px;
    color: var(--hexxxa-muted);
    font-size: 14px;
    text-align: center;
}

.sticky,
.bypostauthor,
.gallery-caption {
    display: block;
}

.wp-block-table table {
    margin: 0;
}

/* ---- Post / page content (VOP, GDPR, blog articles, legal pages) ---- */
.entry-content {
    color: var(--hexxxa-text);
    font-size: 16px;
    line-height: 1.75;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content h1 { font-size: 40px; margin-top: 2.2rem; }
.entry-content h2 { font-size: 34px; margin-top: 2rem; }
.entry-content h3 { font-size: 27px; margin-top: 1.6rem; }
.entry-content h4 { font-size: 20px; margin-top: 1.6rem; }

.entry-content > h1:first-child,
.entry-content > h2:first-child,
.entry-content > h3:first-child {
    margin-top: 0;
}

.entry-content a {
    color: var(--hexxxa-brown);
    text-decoration: underline;
    text-decoration-color: var(--hexxxa-line-strong);
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--hexxxa-brown-dark);
    text-decoration-color: currentColor;
}

.entry-content strong {
    color: var(--hexxxa-dark);
}

.entry-content li {
    margin-bottom: 0.35rem;
}

.entry-content hr,
.entry-content .wp-block-separator {
    width: 100px;
    margin: 2.5rem auto;
    border: 0;
    border-top: 2px solid var(--hexxxa-line-strong);
    background: none;
}

.entry-content .wp-block-separator.is-style-wide {
    width: 100%;
}

.entry-content img {
    height: auto;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    :root {
        --hexxxa-gutter: 16px;
    }

    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }

    .entry-content h1 { font-size: 30px; }
    .entry-content h2 { font-size: 26px; }
    .entry-content h3 { font-size: 22px; }

    .hexxxa-page {
        padding: 28px 0 72px;
    }

    .alignleft,
    .alignright {
        float: none;
        margin: 0 0 1em;
    }

    /* Notice with a link: text first, link below */
    .woocommerce-message:has(> .button),
    .woocommerce-info:has(> .button) {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--hexxxa-space-2);
    }

    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button {
        order: 2;
        float: none;
        margin: 0;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
