/* ==========================================================================
   Row Clickable Link — hover effects for linked WPBakery rows / inner rows.
   Classes come from iidc_row_click_filter_output() (includes/row-clickable.php):
   .vcrcl-clickable on the row + one .vcrcl-has-{effect} per selected effect.
   --vcrcl-* custom properties are set per row by row-clickable.js from the
   row's data-hover-* attributes. Without the script (e.g. WPBakery editor
   preview) the var() fallbacks apply; bgcolor/textcolor have none, so those
   two effects need the script. Class names must match the PHP/JS: do not rename.
   Every effect also applies on keyboard focus: each rule uses
   :is(:hover, :focus-visible, :has(:focus-visible)) - the row itself
   (role="link") or a link/button inside it. :has() is inside :is() so
   browsers without :has() keep the hover part of the rule.
   This file is enqueued on every frontend page (see the post-title clamp at
   the end), unlike row-clickable.js.
   ========================================================================== */

/* Base: every linked row (positioning context for the overlay, pointer cursor). */
.vcrcl-clickable {
    position: relative;
    cursor: pointer;
    transition: background-color var(--vcrcl-speed, 300ms) ease,
                color var(--vcrcl-speed, 300ms) ease,
                box-shadow var(--vcrcl-speed, 300ms) ease,
                transform var(--vcrcl-speed, 300ms) ease,
                opacity var(--vcrcl-speed, 300ms) ease,
                border-color var(--vcrcl-speed, 300ms) ease;
}

/* Keyboard focus on a row made focusable by row-clickable.js (role="link"). */
.vcrcl-clickable[role="link"]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Overlay */
.vcrcl-clickable.vcrcl-has-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--vcrcl-overlay-color, rgba(0,0,0,0.15));
    opacity: 0;
    transition: opacity var(--vcrcl-speed, 300ms) ease;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

.vcrcl-clickable.vcrcl-has-overlay:is(:hover, :focus-visible, :has(:focus-visible))::before {
    opacity: 1;
}

/* Zoom */
.vcrcl-clickable.vcrcl-has-zoom {
    overflow: hidden;
}

.vcrcl-clickable.vcrcl-has-zoom > * {
    transition: transform var(--vcrcl-speed, 300ms) ease;
}

.vcrcl-clickable.vcrcl-has-zoom:is(:hover, :focus-visible, :has(:focus-visible)) > * {
    transform: scale(1.03);
}

/* Shadow.
   Note: the shadow/opacity/lift/border blocks re-declare `transition` without
   background-color/color, so combining one of them with the Background/Text
   color effects makes those color changes instant. To animate them too, add
   background-color/color to these transition lists. */
.vcrcl-clickable.vcrcl-has-shadow {
    transition: box-shadow var(--vcrcl-speed, 300ms) ease,
                transform var(--vcrcl-speed, 300ms) ease,
                opacity var(--vcrcl-speed, 300ms) ease,
                border-color var(--vcrcl-speed, 300ms) ease;
}

.vcrcl-clickable.vcrcl-has-shadow:is(:hover, :focus-visible, :has(:focus-visible)) {
    box-shadow: 0 8px 30px var(--vcrcl-shadow-color, rgba(0,0,0,0.25));
}

/* Opacity */
.vcrcl-clickable.vcrcl-has-opacity {
    transition: opacity var(--vcrcl-speed, 300ms) ease,
                box-shadow var(--vcrcl-speed, 300ms) ease,
                transform var(--vcrcl-speed, 300ms) ease,
                border-color var(--vcrcl-speed, 300ms) ease;
}

.vcrcl-clickable.vcrcl-has-opacity:is(:hover, :focus-visible, :has(:focus-visible)) {
    opacity: 0.8;
}

/* Lift (move up) */
.vcrcl-clickable.vcrcl-has-lift {
    transition: transform var(--vcrcl-speed, 300ms) ease,
                box-shadow var(--vcrcl-speed, 300ms) ease,
                opacity var(--vcrcl-speed, 300ms) ease,
                border-color var(--vcrcl-speed, 300ms) ease;
}

.vcrcl-clickable.vcrcl-has-lift:is(:hover, :focus-visible, :has(:focus-visible)) {
    transform: translateY(-5px);
}

/* Border */
.vcrcl-clickable.vcrcl-has-border {
    border: 2px solid transparent;
    transition: border-color var(--vcrcl-speed, 300ms) ease,
                box-shadow var(--vcrcl-speed, 300ms) ease,
                transform var(--vcrcl-speed, 300ms) ease,
                opacity var(--vcrcl-speed, 300ms) ease;
}

.vcrcl-clickable.vcrcl-has-border:is(:hover, :focus-visible, :has(:focus-visible)) {
    border-color: var(--vcrcl-border-color, #333333);
}

/* Background color */
.vcrcl-clickable.vcrcl-has-bgcolor:is(:hover, :focus-visible, :has(:focus-visible)) {
    background-color: var(--vcrcl-bg-color) !important;
}

/* Text color. The !important on every descendant also beats the inline
   (non-important) color set by the "Heading color" effect in row-clickable.js,
   so when both are selected the text color wins on headings too. */
.vcrcl-clickable.vcrcl-has-textcolor:is(:hover, :focus-visible, :has(:focus-visible)),
.vcrcl-clickable.vcrcl-has-textcolor:is(:hover, :focus-visible, :has(:focus-visible)) * {
    color: var(--vcrcl-text-color) !important;
}

/* Headings: max 3 lines.
   Clamps every heading inside ANY linked row to 3 lines, regardless of the
   selected effects. */
.vcrcl-clickable h1,
.vcrcl-clickable h2,
.vcrcl-clickable h3,
.vcrcl-clickable h4,
.vcrcl-clickable h5,
.vcrcl-clickable h6,
.vcrcl-clickable .vc_custom_heading {
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Post titles: max 3 lines, site-wide.
   Intentionally NOT scoped to .vcrcl-clickable: this file loads on every
   frontend page, so post titles everywhere (theme .entry-title cards,
   WPBakery post grids, h1.entry-title) are clamped to 3 lines. Do not scope
   or remove. Check this rule first when a title appears cut off. */
.entry-title,
.post-title,
h1.entry-title,
.vc_gitem-post-data-source-post_title h1,
.vc_gitem-post-data-source-post_title h2,
.vc_gitem-post-data-source-post_title h3,
.vc_gitem-post-data-source-post_title h4,
.vc_gitem-post-data-source-post_title h5,
.vc_gitem-post-data-source-post_title h6 {
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    overflow: hidden !important;
}
