/* =========================================================================
   EAOY Factory — Elementor bridge
   ---------------------------------------------------------------------
   Elementor ships its own layout engine (percentage columns + per-column
   padding as the gutter) and its own widget styling (kit globals). This file
   reconciles the two so a page built in the Elementor panel renders exactly
   like the theme's hand-built templates, and so a client dragging widgets in
   the panel still gets on-brand output.

   Load order matters: this file is enqueued after theme.css and after
   Elementor's frontend.min.css + per-page post-{id}.css, so equal-specificity
   rules here win. Nothing in this file uses !important.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Container — Elementor caps boxed sections at 1140px; the theme grid is
      1360px with 64px gutters (--wrap / --pad).
   ---------------------------------------------------------------------- */

.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: var(--wrap);
}

/* -------------------------------------------------------------------------
   2. Column gutter — Elementor's gutter is the column's own padding, so the
      gap between two columns is twice the padding value. Halve it to land on
      the theme's 32px grid gap, and pull the outer edge back so the first and
      last column of text align flush with .wrap.
   ---------------------------------------------------------------------- */

.elementor-section > .elementor-container > .elementor-column > .elementor-element-populated {
    padding: 0 16px;
}

.elementor-section.elementor-section-boxed > .elementor-container {
    padding-inline: calc(var(--pad) - 16px);
}

/* Sections that are deliberately full-bleed keep Elementor's own handling. */
.elementor-section.eaoy-bleed > .elementor-container {
    max-width: none;
    padding-inline: 0;
}

.elementor-section.eaoy-bleed > .elementor-container > .elementor-column > .elementor-element-populated {
    padding: 0;
}

/* --- responsive: match the theme's grid breakpoints --------------------- */

@media (max-width: 980px) {
    /* Three- and four-up rows drop to two-up; Elementor only stacks at 768. */
    .elementor-section.eaoy-cols-3 > .elementor-container > .elementor-column,
    .elementor-section.eaoy-cols-4 > .elementor-container > .elementor-column {
        width: 50%;
    }
}

/* Sections whose two columns are text-and-table rather than two comparable
   blocks want to stack before 768px — at 880px the narrow column is only
   ~440px and its half-width cells fall to ~200px, which breaks phrases such as
   "38 — 28 production, 10 quality" across lines. Opt in per section. */
@media (max-width: 880px) {
    .elementor-section.eaoy-stack-880 > .elementor-container > .elementor-column {
        width: 100%;
    }

    .elementor-section.eaoy-stack-880 > .elementor-container > .elementor-column
    + .elementor-column > .elementor-element-populated {
        padding-top: 40px;
    }
}

@media (max-width: 720px) {
    .elementor-section > .elementor-container > .elementor-column > .elementor-element-populated {
        padding: 0;
    }
    /* Boxed sections keep the theme gutter as the viewport narrows, but the
       bleed sections above must stay flush — a bare `.elementor-section-boxed`
       selector here has the same specificity as `.eaoy-bleed` and, being
       later, silently re-padded every full-width hero to 18px, which showed
       up as white slivers down both edges of the photo. */
    .elementor-section.elementor-section-boxed:not(.eaoy-bleed) > .elementor-container {
        padding-inline: var(--pad);
    }
    /* Elementor stacks columns at 768px; re-assert it for the whole row. */
    .elementor-section.eaoy-cols-2 > .elementor-container > .elementor-column,
    .elementor-section.eaoy-cols-3 > .elementor-container > .elementor-column,
    .elementor-section.eaoy-cols-4 > .elementor-container > .elementor-column {
        width: 100%;
    }
    .elementor-section.eaoy-stack-880 > .elementor-container > .elementor-column
    + .elementor-column > .elementor-element-populated {
        padding-top: 32px;
    }
}

/* -------------------------------------------------------------------------
   3. Vertical rhythm — the kit sets a 32px widget gap, matching .grid. Only
      the last widget in a column should lose its trailing margin.
   ---------------------------------------------------------------------- */

.elementor-widget:not(:last-child) {
    --kit-widget-spacing: 32px;
}

/* A text-editor that only holds utility paragraphs should not add its own
   block margins on top of the widget rhythm. */
.elementor-widget-text-editor > .elementor-widget-container > p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   4. Buttons — map Elementor's button widget onto the theme .button so an
      editor-placed button is pixel-identical to a template one.
   ---------------------------------------------------------------------- */

.elementor-button,
.elementor-widget-button .elementor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid var(--dark);
    border-radius: var(--radius);
    background-color: var(--dark);
    color: #fff;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.elementor-button:hover,
.elementor-button:focus,
.elementor-widget-button .elementor-button:hover {
    background-color: var(--dark-hover);
    border-color: var(--dark-hover);
    color: #fff;
}

.elementor-button .elementor-button-text {
    /* Elementor wraps the label; keep it inline so the flex centring holds. */
    display: inline-block;
}

/* Accent and ghost variants, selected from the panel via CSS Classes. */
.elementor-button.eaoy-btn--accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

.elementor-button.eaoy-btn--accent:hover {
    background-color: #d3f07a;
    border-color: #d3f07a;
    color: var(--ink);
}

.elementor-button.eaoy-btn--ghost {
    background-color: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.elementor-button.eaoy-btn--ghost:hover {
    background-color: var(--soft);
    border-color: var(--dark);
    color: var(--ink);
}

/* On a dark section the ghost button must invert. */
.section--dark .elementor-button.eaoy-btn--ghost,
.page-header--image .elementor-button.eaoy-btn--ghost {
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
}

.section--dark .elementor-button.eaoy-btn--ghost:hover,
.page-header--image .elementor-button.eaoy-btn--ghost:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

/* -------------------------------------------------------------------------
   5. Headings — the theme's type scale is tighter and lighter than the kit
      defaults. Re-assert it over the per-page Elementor CSS.
   ---------------------------------------------------------------------- */

.elementor-widget-heading .elementor-heading-title {
    font-family: var(--font);
    color: var(--ink);
    letter-spacing: -0.02em;
}

.elementor-widget-heading h1.elementor-heading-title {
    font-size: clamp(40px, 5.2vw, 72px);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.elementor-widget-heading h2.elementor-heading-title {
    font-size: clamp(30px, 3.2vw, 44px);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.18;
}

.elementor-widget-heading h3.elementor-heading-title {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.elementor-widget-heading h4.elementor-heading-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.elementor-widget-heading h5.elementor-heading-title,
.elementor-widget-heading h6.elementor-heading-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

/* An eyebrow is a heading widget carrying the class `eyebrow`. */
.elementor-widget-heading .elementor-heading-title.eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.09em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--muted);
}

.section--dark .elementor-widget-heading .elementor-heading-title,
.page-header--image .elementor-widget-heading .elementor-heading-title {
    color: #fff;
}

.section--dark .elementor-widget-heading .elementor-heading-title.eyebrow,
.page-header--image .elementor-widget-heading .elementor-heading-title.eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

/* -------------------------------------------------------------------------
   6. Text — body copy inherits the theme voice, not the kit's Roboto/grey.
   ---------------------------------------------------------------------- */

.elementor-widget-text-editor,
.elementor-widget-text-editor .elementor-widget-container {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
}

.elementor-widget-text-editor .elementor-widget-container > ul,
.elementor-widget-text-editor .elementor-widget-container > ol {
    margin: 0 0 1.1em;
    padding-left: 1.2em;
}

/* `lead` and `u-muted` are paragraph classes an editor can type in the
   text-editor widget; the theme already defines them, these just guard
   against the widget-container colour winning. */
.elementor-widget-text-editor .elementor-widget-container .lead {
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.55;
    color: var(--muted);
}

.elementor-widget-text-editor .elementor-widget-container .u-muted {
    color: var(--muted);
}

.section--dark .elementor-widget-text-editor,
.section--dark .elementor-widget-text-editor .elementor-widget-container,
.page-header--image .elementor-widget-text-editor .elementor-widget-container {
    color: #fff;
}

.section--dark .elementor-widget-text-editor .elementor-widget-container .lead,
.section--dark .elementor-widget-text-editor .elementor-widget-container .u-muted,
.page-header--image .elementor-widget-text-editor .elementor-widget-container .lead {
    color: rgba(255, 255, 255, 0.72);
}

.section--dark .elementor-widget-text-editor .elementor-widget-container a,
.page-header--image .elementor-widget-text-editor .elementor-widget-container a {
    color: var(--accent);
}

/* -------------------------------------------------------------------------
   7. Page header — a section carrying `page-header--image` becomes the hero:
      the background image is set in the Elementor panel, the scrim comes from
      the theme. The container needs the z-index lift the theme gives .wrap.
   ---------------------------------------------------------------------- */

.page-header--image .elementor-container {
    position: relative;
    z-index: 1;
}

.page-header--image.elementor-section > .elementor-container > .elementor-column > .elementor-element-populated {
    padding: 0 16px;
}

/* -------------------------------------------------------------------------
   8. Widgets the theme has no opinion about — normalise their spacing so a
      section reads as one block rather than a stack of stray margins.
   ---------------------------------------------------------------------- */

.elementor-widget-divider .elementor-divider-separator {
    border-color: var(--line);
}

.elementor-widget-image img {
    border-radius: var(--radius);
}

/* Cards built from a column: mark the column with `card` in the panel. */
.elementor-column.card > .elementor-element-populated {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}

.elementor-column.card--soft > .elementor-element-populated {
    background: var(--soft);
    border-color: transparent;
}

.elementor-column.card > .elementor-element-populated > .elementor-widget:not(:last-child) {
    margin-bottom: 0;
}

/* A column holding only stacked widgets needs no bottom rhythm fighting. */
.elementor-column.eaoy-stack > .elementor-element-populated > .elementor-widget:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   9. Button rows — Elementor stacks widgets vertically inside a column, so a
      side-by-side button group is authored as a nested inner section carrying
      `eaoy-btn-row`. This neutralises the inner section's own wrapper chrome
      and lays its columns out as a wrapping flex row.
   ---------------------------------------------------------------------- */

.elementor-section.eaoy-btn-row {
    padding: 0;
    background: none;
}

.elementor-section.eaoy-btn-row > .elementor-container {
    max-width: none;
    padding-inline: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.elementor-section.eaoy-btn-row > .elementor-container > .elementor-column {
    width: auto;
}

.elementor-section.eaoy-btn-row > .elementor-container > .elementor-column > .elementor-element-populated {
    padding: 0;
}

.elementor-section.eaoy-btn-row .elementor-widget-button {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   10. EAOY data blocks — the plugin renders its own markup and CSS. Inside an
      Elementor column it should span the full column width.
   ---------------------------------------------------------------------- */

.elementor-widget[class*="elementor-widget-eaoy_"] .elementor-widget-container > * {
    margin-top: 0;
}

/* Elementor columns are flex containers; a data block that itself lays out
   should not be stretched to equal height with a shorter sibling. */
.elementor-section > .elementor-container > .elementor-column > .elementor-element-populated {
    align-self: flex-start;
}

/* -------------------------------------------------------------------------
   11. Photo grids — captioned photographs authored as columns inside a
      nested section carrying `eaoy-shot-grid--N`. Same shape as the button
      row: strip the inner section's chrome, then lay the columns out.
   ---------------------------------------------------------------------- */

.elementor-section[class*="eaoy-shot-grid"] {
    padding: 0;
    background: none;
}

.elementor-section[class*="eaoy-shot-grid"] > .elementor-container {
    max-width: none;
    padding-inline: 0;
}

.elementor-section[class*="eaoy-shot-grid"] > .elementor-container > .elementor-column > .elementor-element-populated {
    padding: 0;
}

/* These grids span the content column, so the column padding the bridge
   normally adds would fight the gap between photographs. The gutter is
   rebuilt here from a negative container margin plus per-cell padding, so
   the outer edges stay flush with the rest of the page. */
.elementor-section[class*="eaoy-shot-grid"] > .elementor-container {
    margin-inline: -10px;
}

.elementor-column.eaoy-shot-cell > .elementor-element-populated {
    padding: 0 10px;
}

.elementor-column.eaoy-shot-cell {
    margin-bottom: 24px;
}

.elementor-column.eaoy-shot-cell > .elementor-element-populated > .elementor-widget:last-child {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .elementor-section[class*="eaoy-shot-grid"] > .elementor-container {
        margin-inline: -7px;
    }
    .elementor-column.eaoy-shot-cell > .elementor-element-populated {
        padding: 0 7px;
    }
    .elementor-column.eaoy-shot-cell {
        margin-bottom: 16px;
    }
}
