@import url("/static/fonts/fonts.css");

:root {
    color-scheme: light;

    /* Identidad de El Corral */
    --cream: #f7f1e7;
    --paper: #fffdf9;
    --coffee: #3b2923;
    --muted: #796b64;
    --terracotta: #bd5c3d;
    --terracotta-dark: #9e452d;
    --line: #ddd1c3;
    --focus: #9e452d;
    --white: #ffffff;

    /* Estados */
    --success: #2f766f;
    --success-soft: #eef6f3;
    --danger: #9b3d29;
    --danger-soft: #fff0ea;
    --warning: #a96d18;
    --warning-soft: #fff6df;

    /* Tipografía */
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

    /* Escala y forma */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px rgba(59, 41, 35, .08);
    --shadow-md: 0 12px 32px rgba(59, 41, 35, .12);

    /* Un objetivo táctil nunca debe ser menor a 48px. */
    --touch-target: 48px;
    --content-width: 1440px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-family: var(--font-sans);
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
}

/* Mantiene el desplazamiento dentro de cualquier modal del Corral. */
html:has(dialog[open]),
body:has(dialog[open]) {
    overflow: hidden;
    overscroll-behavior: none;
}

dialog[open] {
    overscroll-behavior: contain;
}

.app-modal__body,
.user-editor__body,
.table-editor__body,
.editor-body,
.catalog-content {
    min-height: 0;
    overscroll-behavior: contain;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--coffee);
    background: var(--cream);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
[role="button"],
input[type="button"],
input[type="submit"] {
    min-height: var(--touch-target);
    touch-action: manipulation;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
input[type="button"]:not(:disabled),
input[type="submit"]:not(:disabled) {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .55;
}

a {
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

::selection {
    color: var(--white);
    background: var(--terracotta);
}

.corral-container {
    width: min(100% - (var(--space-6) * 2), var(--content-width));
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

.eu-icon {
    display: inline-block;
    width: 100%;
    height: 100%;
    vertical-align: middle;

    -webkit-mask: var(--icon) no-repeat center;
    -webkit-mask-size: 80% 80%;

    mask: var(--icon) no-repeat center;
    mask-size: 80% 80%;

    background-color: white;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
