/*
 * Link Card (1.17.3) — photo, title, short text and a circle-arrow link in one
 * clickable card. Uses the shared main-page pieces from bw-page-sections.css
 * (.bw-sec colours and font, .bw-frame image frame, .bw-sec-cta circle arrow).
 * Styles: .style-card (photo on top, text below) and .style-overlay (1.17.4,
 * text over the photo on a dark fade; 1.17.5: capitals title, text on hover;
 * 1.17.6: the title slants and gets a white underline on hover, like the
 * home page product tiles).
 */

/* fill the grid cell, so every card in a row has the row's height */
.elementor-widget-bw-link-card,
.elementor-widget-bw-link-card > .elementor-widget-container {
    height: 100%;
}

.bw-sec.bw-lc {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--bw-line);
    border-radius: 22px;
    background: #ffffff;
    color: var(--bw-ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.bw-sec.bw-lc:hover,
a.bw-sec.bw-lc:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(20, 20, 24, 0.1);
    color: var(--bw-ink);
}

a.bw-sec.bw-lc:focus-visible {
    outline: 2px solid var(--bw-blue);
    outline-offset: 3px;
}

/* ------------------------------------------------------------ photo */

.bw-sec.bw-lc .bw-lc-media {
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;
    border: 0;
    border-bottom: 1px solid var(--bw-line);
    border-radius: 0;
}

.bw-sec.bw-lc.ratio-4-3 .bw-lc-media {
    aspect-ratio: 4 / 3;
}

.bw-sec.bw-lc.ratio-1-1 .bw-lc-media {
    aspect-ratio: 1 / 1;
}

.bw-sec.bw-lc .bw-lc-media img {
    transition: transform 0.45s ease;
}

a.bw-sec.bw-lc:hover .bw-lc-media img,
a.bw-sec.bw-lc:focus-visible .bw-lc-media img {
    transform: scale(1.04);
}

/* ------------------------------------------------------------- text */

.bw-sec.bw-lc .bw-lc-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 26px 28px 28px;
}

.bw-sec.bw-lc .bw-lc-title {
    margin: 0 0 12px;
    font-family: "Open Sans", sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
    color: var(--bw-heading);
}

.bw-sec.bw-lc .bw-lc-text {
    flex: 1 1 auto;
    margin: 0 0 24px;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: #3c3c46;
}

/* ------------------------------------------------ circle-arrow link */

.bw-sec.bw-lc .bw-lc-cta {
    gap: 12px;
}

.bw-sec.bw-lc .bw-sec-cta-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.bw-sec.bw-lc .bw-sec-cta-icon svg {
    width: 20px;
    height: 20px;
}

.bw-sec.bw-lc .bw-sec-cta-label {
    font-size: 14px;
}

a.bw-sec.bw-lc:hover .bw-sec-cta-icon,
a.bw-sec.bw-lc:focus-visible .bw-sec-cta-icon {
    background: var(--bw-blue);
}

a.bw-sec.bw-lc:hover .bw-sec-cta-icon svg,
a.bw-sec.bw-lc:focus-visible .bw-sec-cta-icon svg {
    fill: #ffffff;
}

/* ------------------------------------- overlay style (text on photo) */
/* The photo fills the card; the title (in capitals) and the circle arrow sit
   on a dark fade at the bottom. The short text opens between them on hover or
   keyboard focus (1.17.5); touch screens have no hover, so there it is always
   shown. */

.bw-sec.bw-lc.style-overlay {
    position: relative;
    isolation: isolate;
    justify-content: flex-end;
    min-height: 400px;
    border: 0;
    background: var(--bw-heading, #141418);
    color: #ffffff;
}

a.bw-sec.bw-lc.style-overlay:hover,
a.bw-sec.bw-lc.style-overlay:focus-visible {
    box-shadow: 0 18px 38px rgba(20, 20, 24, 0.22);
    color: #ffffff;
}

/* the photo fills the whole card, behind the text */
.bw-sec.bw-lc.style-overlay .bw-lc-media {
    position: absolute;
    inset: 0;
    z-index: -2;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: var(--bw-heading, #141418);
}

.bw-sec.bw-lc.style-overlay .bw-lc-media img {
    height: 100%;
    object-fit: cover;
}

/* ::before = dark fade at the bottom (title + arrow);
   ::after  = the deeper shade that comes in with the text */
.bw-sec.bw-lc.style-overlay::before,
.bw-sec.bw-lc.style-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bw-sec.bw-lc.style-overlay::before {
    background: linear-gradient(180deg, rgba(20, 20, 24, 0) 40%, rgba(20, 20, 24, 0.5) 68%, rgba(20, 20, 24, 0.85) 100%);
}

.bw-sec.bw-lc.style-overlay::after {
    background: linear-gradient(180deg, rgba(20, 20, 24, 0.2) 0%, rgba(20, 20, 24, 0.62) 42%, rgba(20, 20, 24, 0.92) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bw-sec.bw-lc.style-overlay .bw-lc-body {
    flex: 0 0 auto;
    padding: 28px 30px 30px;
}

.bw-sec.bw-lc.style-overlay .bw-lc-title {
    position: relative;
    align-self: flex-start;
    margin-bottom: 18px;
    font-size: 22px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* white underline under the title, drawn in from the left on hover */
.bw-sec.bw-lc.style-overlay .bw-lc-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 4px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.bw-sec.bw-lc.style-overlay .bw-lc-text {
    flex: 0 0 auto;
    max-height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: max-height 0.35s ease, margin-bottom 0.35s ease, opacity 0.25s ease;
}

a.bw-sec.bw-lc.style-overlay:hover::after,
a.bw-sec.bw-lc.style-overlay:focus-visible::after {
    opacity: 1;
}

a.bw-sec.bw-lc.style-overlay:hover .bw-lc-text,
a.bw-sec.bw-lc.style-overlay:focus-visible .bw-lc-text {
    max-height: 12em;
    margin-bottom: 22px;
    opacity: 1;
}

a.bw-sec.bw-lc.style-overlay:hover .bw-lc-title,
a.bw-sec.bw-lc.style-overlay:focus-visible .bw-lc-title {
    font-style: italic;
}

a.bw-sec.bw-lc.style-overlay:hover .bw-lc-title::after,
a.bw-sec.bw-lc.style-overlay:focus-visible .bw-lc-title::after {
    transform: scaleX(1);
}

.bw-sec.bw-lc.style-overlay .bw-sec-cta-icon {
    border-color: #ffffff;
}

.bw-sec.bw-lc.style-overlay .bw-sec-cta-icon svg {
    fill: #ffffff;
}

.bw-sec.bw-lc.style-overlay .bw-sec-cta-label {
    color: #ffffff;
}

a.bw-sec.bw-lc.style-overlay:hover .bw-sec-cta-icon,
a.bw-sec.bw-lc.style-overlay:focus-visible .bw-sec-cta-icon {
    border-color: var(--bw-blue);
    background: var(--bw-blue);
}

/* touch screens (no hover): the text is always shown */
@media (hover: none) {
    .bw-sec.bw-lc.style-overlay::after {
        opacity: 1;
    }

    .bw-sec.bw-lc.style-overlay .bw-lc-text {
        max-height: none;
        margin-bottom: 20px;
        opacity: 1;
    }
}

/* ------------------------------------------------------------ phone */

@media (max-width: 767px) {
    .bw-sec.bw-lc {
        border-radius: 16px;
    }

    .bw-sec.bw-lc .bw-lc-body {
        padding: 20px 20px 22px;
    }

    .bw-sec.bw-lc .bw-lc-title {
        font-size: 20px;
    }

    .bw-sec.bw-lc .bw-lc-text {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .bw-sec.bw-lc.style-overlay .bw-lc-body {
        padding: 20px 20px 22px;
    }

    .bw-sec.bw-lc.style-overlay .bw-lc-title {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bw-sec.bw-lc,
    .bw-sec.bw-lc .bw-lc-media img,
    .bw-sec.bw-lc.style-overlay::after,
    .bw-sec.bw-lc.style-overlay .bw-lc-text,
    .bw-sec.bw-lc.style-overlay .bw-lc-title::after {
        transition: none;
    }

    a.bw-sec.bw-lc:hover,
    a.bw-sec.bw-lc:focus-visible,
    a.bw-sec.bw-lc:hover .bw-lc-media img,
    a.bw-sec.bw-lc:focus-visible .bw-lc-media img {
        transform: none;
    }
}
