/* =============================================
   ROARK CARD
   Component for card-based layouts
   ============================================= */

:root {
    /* ── Radius scale ────────────────────────────────────────────────────── */
    --roark-radius-pill: 999px;

    /* ── Button roles ────────────────────────────────────────────────────── */
    /* --roark-btn-primary-bg/-bg-hover/-fg and --roark-btn-secondary-* are
       defined once, as theme-aware aliases, in roark-tokens.css (registered
       as this stylesheet's dependency in AssetsManager) — not redeclared
       here, so there is a single source of truth for the fallback chain. */
}

.roark-card {
    background: #fff;
    border-radius: var(--roark-radius-card, 10px);
    box-shadow: var(--roark-shadow-card, 0 15px 15px -10px rgba(0, 0, 0, 0.05));
    overflow: hidden;
}

/* ── Button roles ───────────────────────────────────────────────────────
   Defaults only. Elementor's own core CSS ships a bare `.elementor-button`
   default (grey, ~#6b7280) that both `.roark-property-button` and
   `.roark-agent-iframe-open` carry alongside their own class, at normal
   (0,1,0) specificity — so a same-specificity (0,1,0) default here would
   lose that tie-break to Elementor's core stylesheet regardless of source
   order. Doubling the class (or qualifying with the button's own always-
   present wrapper) raises us to (0,2,0), which reliably beats that bare
   default while still losing — on source order, since `roark-card` is
   declared as a style dependency of every widget below and therefore
   prints before Elementor's per-instance generated CSS — to any Background/
   Border colour a user sets via the widget's own Style controls (also
   (0,2,0), via `{{WRAPPER}} .the-class`). No `!important` needed. */
.roark-property-button.roark-property-button,
.roark-agent-iframe-widget .roark-agent-iframe-open {
    display: inline-block;
    background-color: var(--roark-btn-primary-bg);
    border: 1px solid var(--roark-btn-primary-bg);
    color: var(--roark-btn-primary-fg);
    border-radius: var(--roark-radius-btn, 6px);
    /* Theme-hardening: themes style bare buttons/links with these. */
    font-family: inherit;
    text-transform: var(--roark-btn-transform, none);
    letter-spacing: var(--roark-btn-letter-spacing, normal);
    text-shadow: none;
    box-shadow: none;
    min-width: 0;
}

.roark-property-button.roark-property-button:hover,
.roark-property-button.roark-property-button:focus-visible,
.roark-agent-iframe-widget .roark-agent-iframe-open:hover,
.roark-agent-iframe-widget .roark-agent-iframe-open:focus-visible {
    background-color: var(--roark-btn-primary-bg-hover);
    border-color: var(--roark-btn-primary-bg-hover);
    color: var(--roark-btn-primary-fg);
}

/* QForm valuation buttons ("Lagebewertung starten" / "Immobilienbewertung
   starten") read as secondary/outline actions next to the primary card and
   search buttons. Same specificity as the primary rule above; wins on
   source order (it comes later in this file). */
.roark-agent-iframe-widget .roark-agent-iframe-open--secondary {
    background-color: var(--roark-btn-secondary-bg);
    border-color: var(--roark-btn-secondary-border);
    color: var(--roark-btn-secondary-fg);
}

.roark-agent-iframe-widget .roark-agent-iframe-open--secondary:hover,
.roark-agent-iframe-widget .roark-agent-iframe-open--secondary:focus-visible {
    background-color: var(--roark-btn-secondary-bg-hover);
    border-color: var(--roark-btn-secondary-border);
    color: var(--roark-btn-secondary-fg);
}

.roark-property-button.roark-property-button:focus-visible,
.roark-agent-iframe-widget .roark-agent-iframe-open:focus-visible {
    outline: 2px solid var(--roark-btn-primary-bg);
    outline-offset: 2px;
}

/* Some Elementor kits ship a `.elementor-kit-N .elementor-button` rule (or a
   mobile-only media-query variant) at the same (0,2,0) specificity as the
   defaults above, printed after this stylesheet in the kit's own CSS file —
   so on a same-specificity tie it wins on source order and the button falls
   back to Elementor's grey default, typically only visible on mobile where
   the kit's responsive rule applies. Elementor always wraps a widget's markup
   in `.elementor-widget-<get_name()>`, so scoping under that class raises us
   to (0,3,0), which reliably beats any such kit rule without `!important`.
   Widget name from PropertyButtonWidget::NAME. */
.elementor-widget-roark_property_button .roark-property-button.elementor-button {
    background-color: var(--roark-btn-primary-bg);
    border: 1px solid var(--roark-btn-primary-bg);
    color: var(--roark-btn-primary-fg);
}

.elementor-widget-roark_property_button .roark-property-button.elementor-button:hover,
.elementor-widget-roark_property_button .roark-property-button.elementor-button:focus-visible {
    background-color: var(--roark-btn-primary-bg-hover);
    border-color: var(--roark-btn-primary-bg-hover);
    color: var(--roark-btn-primary-fg);
}

.elementor-widget-roark_property_button .roark-property-button.elementor-button:focus-visible {
    outline: 2px solid var(--roark-btn-primary-bg);
    outline-offset: 2px;
}

/* Same kit-tie-break risk for the QForm secondary/outline buttons. Only
   ExposeQFormLocationValuationWidget and ExposeQFormPropertyValuationWidget
   set isSecondaryButton() => true, so those are the two widget names scoped
   here (see AbstractExposeAgentIframeWidget::isSecondaryButton callers). */
.elementor-widget-roark_expose_qform_location_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary,
.elementor-widget-roark_expose_qform_property_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary {
    background-color: var(--roark-btn-secondary-bg);
    border: 1px solid var(--roark-btn-secondary-border);
    color: var(--roark-btn-secondary-fg);
}

.elementor-widget-roark_expose_qform_location_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary:hover,
.elementor-widget-roark_expose_qform_location_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary:focus-visible,
.elementor-widget-roark_expose_qform_property_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary:hover,
.elementor-widget-roark_expose_qform_property_valuation .roark-agent-iframe-widget .roark-agent-iframe-open--secondary:focus-visible {
    background-color: var(--roark-btn-secondary-bg-hover);
    border-color: var(--roark-btn-secondary-border);
    color: var(--roark-btn-secondary-fg);
}

/* Responsive padding utilities */
.roark-card--sm {
    padding: 12px;
}

.roark-card--md {
    padding: 20px;
}

.roark-card--lg {
    padding: 30px;
}

/* Elevation variants */
.roark-card--elevated {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.roark-card--flat {
    box-shadow: none;
}

.roark-card--subtle {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Elementor's own `.elementor-icon` base style ships a `font-size: 50px`
   default (meant for the Icon Box widget) that any icon rendered through
   IconControlsTrait::render_icon_html() inherits unless a widget sets its
   own icon-size control — the icon's SVG uses `1em`, so it silently blows
   up to 50×50px. Generic safety net for any Roark icon inside a card that
   doesn't set its own size; widgets with a dedicated icon_size control
   (e.g. ExposeEckdatenWidget, ExposeAgentWidget) already emit their own
   {{WRAPPER}} font-size override at the same specificity, which wins on
   source order (printed after this stylesheet). Feature-badge icons render
   inline SVG directly (no `.elementor-icon` wrapper) and are unaffected. */
.roark-card .elementor-icon,
.roark-list-card-wrap .elementor-icon {
    font-size: 1em;
}

.roark-property-address__icon {
    font-size: 1em;
    width: 1em;
    height: 1em;
    display: inline-flex;
    vertical-align: -0.15em;
}

.roark-property-address__icon svg {
    width: 1em;
    height: 1em;
}

.roark-expose-documents__list {
    margin: 0;
    padding-left: 1.2em;
}

/* Elementor-editor-only note shown instead of an empty widget (missing CRM
   token/subdomain, missing coordinates, etc). Never rendered on the frontend. */
.roark-editor-placeholder {
    padding: 10px 12px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
}


/* Listing → "Hide agent (company) on cards" (prefix_class on the listing widget wrapper). */
.roark-card-agent-hide .roark-expose-agent,
.roark-card-agent-firma-hide .roark-expose-agent-firma {
	display: none !important;
}
