/* ==========================================================
   EVERKI Design System (Global, Hyvä-safe)
   - Use these classes in CMS blocks/templates for consistency
   - Avoid element-level overrides unless explicitly intended
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Containers */
    --ek-container: 1280px;
    --ek-container-narrow: 980px;

    /* Gutters + vertical rhythm */
    --ek-gutter: clamp(16px, 4vw, 48px);
    --ek-section-major-y: clamp(56px, 6vw, 96px);
    --ek-section-minor-y: clamp(36px, 4vw, 64px);

    /* Type */
    --ek-font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Brand + UI colors */
    --ek-text: #111827;
    --ek-muted: #374151;
    --ek-subtle: #6b7280;

    --ek-bg: #ffffff;
    --ek-surface: #f9fafb;

    /* Subtle separators/dividers (not for primary control boundaries) */
    --ek-border: rgba(17, 24, 39, 0.12);

    /* UI control boundary (stronger for WCAG non-text contrast on white) */
    --ek-border-ui: #80848b;

    --ek-accent: #c2410c;
    --ek-accent-hover: #7c2d12;

    /* Focus ring system */
    --ek-focus-outer: var(--ek-accent);

    /* Radius + shadow */
    --ek-radius-sm: 12px;
    --ek-radius-md: 16px;
    --ek-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
}


body { font-family: var(--ek-font-sans); color: var(--ek-text); background: var(--ek-bg); }


.ek-scope {
    font-family: var(--ek-font-sans);
    color: var(--ek-text);
    background: transparent;
}

/* Accessibility baseline: visible focus on light and dark surfaces */
.ek-scope :focus-visible {
    outline: none;
    /* Two-ring focus: inner white ring + outer brand ring */
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ek-focus-outer);
}

/* ---------- Layout primitives ---------- */
.ek-container {
    max-width: var(--ek-container);
    margin-inline: auto;
    padding-inline: var(--ek-gutter);
}

.ek-container--narrow {
    max-width: var(--ek-container-narrow);
}

.ek-section {
    padding-block: var(--ek-section-major-y);
}

.ek-section--minor {
    padding-block: var(--ek-section-minor-y);
}

/* Full-bleed backgrounds/media, with inner gutters via .ek-container */
.ek-section--fullbleed {
    width: 100%;
    padding-inline: 0;
}

/* Simple stack helpers */
.ek-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ek-stack-gap, 16px);
}

.ek-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ek-row-gap, 12px);
    align-items: center;
}

/* ---------- Typography (classes, not element overrides) ---------- */
.ek-eyebrow {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ek-h1 {
    margin: 0;
    font-size: clamp(32px, 3.6vw, 56px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ek-h2 {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 42px);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ek-lead {
    margin: 0;
    font-size: clamp(15px, 1.35vw, 18px);
    line-height: 1.6;
    font-weight: 600;
    color: var(--ek-muted);
}

.ek-body {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    font-weight: 500;
    color: var(--ek-muted);
}

.ek-prose {
    max-width: 70ch; /* long-copy limit */
}

/* Tight, predictable spacing between common text blocks */
.ek-text-block > .ek-eyebrow { margin-bottom: 12px; }
.ek-text-block > .ek-h1,
.ek-text-block > .ek-h2 { margin-bottom: 12px; }
.ek-text-block > .ek-lead,
.ek-text-block > .ek-body { margin-top: 0; margin-bottom: 0; }

/* ---------- Links (optional but helpful for consistency) ---------- */
.ek-link {
    color: var(--ek-accent);
    text-decoration: none;
    font-weight: 700;
}
.ek-link:hover { color: var(--ek-accent-hover); text-decoration: underline; }

/* ---------- Buttons ---------- */
.ek-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--ek-radius-sm);
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.ek-btn:active { transform: translateY(1px); }

.ek-btn--primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* touch target */
    padding: 0.7rem 2rem;
    border-radius: 9999px;
    /* Regular state (close to your "Regular" image) */
    background: linear-gradient(180deg, #EEA128 0%, #EEA128 100%);
    border: 1px solid rgba(0, 0, 0, 0.10);
    /* Black text is ADA-safe here */
    color: #111827;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    /* subtle bevel */
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        0 1px 2px rgba(0,0,0,0.08);
    transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}
/* Hover state (close to your "Hover" image) */
.ek-btn--primary:hover {
    background: linear-gradient(180deg, #ED981F 0%, #EA841B 100%);
}
/* Active press */
.ek-btn--primary:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 0 0 rgba(0,0,0,0);
}
/* Keyboard focus (ADA) */
.ek-btn--primary:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 3px;
}
/* Optional disabled */
.ek-btn--primary[aria-disabled="true"],
.ek-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.ek-btn--secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* touch target */
    padding: 0.7rem 2rem;
    border-radius: 9999px;
    background: transparent;
    border: 1px solid var(--ek-border-ui);
    color: var(--ek-text);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease, border-color 120ms ease;
}
.ek-btn--secondary:hover {
    background: rgba(17, 24, 39, 0.04);
    border-color: rgba(17, 24, 39, 0.55);
}
.ek-btn--secondary:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}
.ek-btn--secondary:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 3px;
}
.ek-btn--secondary[aria-disabled="true"],
.ek-btn--secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- Form controls (use for inputs/selects/textarea wrappers) ---------- */
.ek-control {
    border: 1px solid var(--ek-border-ui);
    border-radius: var(--ek-radius-sm);
    background: #fff;
    color: var(--ek-text);
}
.ek-control::placeholder { color: rgba(17, 24, 39, 0.55); }

/* ---------- Media helpers ---------- */
.ek-media-cover img { width: 100%; height: 100%; object-fit: cover; }
.ek-media-contain img { width: 100%; height: 100%; object-fit: contain; }

/* Line clamp utility (titles, etc.) */
.ek-line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ---------- Grids ---------- */
.ek-grid {
    display: grid;
    gap: var(--ek-grid-gap, clamp(12px, 1.8vw, 24px));
}

/* Apple-style tiles: 1-col mobile, 2-col desktop */
.ek-grid--tiles {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .ek-grid--tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Products: responsive fill */
.ek-grid--products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
    .ek-grid--products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ---------- Product card system ---------- */
.ek-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ek-border);
    border-radius: var(--ek-radius-md);
    background: var(--ek-bg);
    overflow: hidden;
    box-shadow: var(--ek-shadow-sm);
}

.ek-product-card__media {
    aspect-ratio: 4 / 5; /* default product image ratio */
    background: var(--ek-surface);
    display: block;
    overflow: hidden;
}

.ek-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* avoid cropping bags */
    padding: 10%;        /* consistent “safe area” */
}

.ek-product-card__body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ek-product-card__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 800;
    color: var(--ek-text);
}

.ek-product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    color: var(--ek-subtle);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
}

.ek-product-card__price {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 900;
    color: var(--ek-text);
}

/* Pins CTA row to bottom for equal-height cards */
.ek-product-card__cta {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Section title consistency helper ----------
   Use on all homepage/landing section headings.
------------------------------------------------------ */
.ek-section-title {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: clamp(18px, 2vw, 28px);
}

/* ---------- Divider (subtle) ---------- */
.ek-divider {
    height: 1px;
    background: var(--ek-border);
    border: 0;
    margin: 0;
}
