/*
 * CormackCoreWeb 2.0 - Custom Stylesheet
 * Author: Charlie - Cormack Advertising
 * Add your custom styles here
 */

/* Brochure Banner Styles */
.brochure-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.brochure-banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.brochure-banner-label {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-right: 10px;
}

.brochure-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brochure-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brochure-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brochure-link svg {
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brochure-banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .brochure-banner-label {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .brochure-links {
        justify-content: center;
    }

    .brochure-link {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* --------------------------------------------------------------------------
   Gallery lightbox
   Paired with lightbox() in assets/js/custom.js. Replaces Elementor's, which
   the twin build no longer loads a plugin for. Chrome matches the original:
   counter top-left, tool row top-right, bare chevrons either side.
   -------------------------------------------------------------------------- */

#gallery .elementor-image-gallery .gallery-item a {
    display: block;
    cursor: pointer;
}

html.r106-lightbox-open,
html.r106-lightbox-open body {
    overflow: hidden;
}

.r106-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 72px 64px 40px;
    background: rgba(0, 0, 0, 0.86);
}

.r106-lightbox.is-open {
    display: flex;
    animation: r106-lightbox-in 0.2s ease both;
}

@keyframes r106-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* -- top bar --------------------------------------------------------------- */

.r106-lightbox__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 55px;
    padding: 0 18px;
    background: rgba(0, 0, 0, 0.55);
}

.r106-lightbox__count {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.r106-lightbox__count[hidden] {
    display: none;
}

.r106-lightbox__tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.r106-lightbox__tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.r106-lightbox__tool svg {
    width: 21px;
    height: 21px;
    display: block;
}

.r106-lightbox__tool:hover:not(:disabled) {
    color: #f27721;
}

.r106-lightbox__tool:disabled {
    opacity: 0.35;
    cursor: default;
}

.r106-lightbox__tool:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.7);
    outline-offset: -4px;
}

/* -- arrows ---------------------------------------------------------------- */

.r106-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.2s ease;
}

.r106-lightbox__nav svg {
    width: 34px;
    height: 34px;
    display: block;
    stroke-width: 1.25;
}

.r106-lightbox__nav:hover {
    color: #f27721;
}

.r106-lightbox__nav:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.7);
    outline-offset: -8px;
}

.r106-lightbox__nav[hidden] {
    display: none;
}

.r106-lightbox__prev { left: 4px; }
.r106-lightbox__next { right: 4px; }

/* -- image ----------------------------------------------------------------- */

.r106-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.r106-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.r106-lightbox__stage.is-zoomed .r106-lightbox__img {
    cursor: grab;
    touch-action: none;
}

.r106-lightbox__stage.is-panning .r106-lightbox__img {
    cursor: grabbing;
    transition: opacity 0.2s ease;
}

.r106-lightbox__stage.is-loading .r106-lightbox__img {
    opacity: 0;
}

/* Spinner, shown only while the full-size file is in flight. */
.r106-lightbox__stage.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: r106-lightbox-spin 0.8s linear infinite;
}

@keyframes r106-lightbox-spin {
    to { transform: rotate(360deg); }
}

/* -- share confirmation ---------------------------------------------------- */

.r106-lightbox__toast {
    position: absolute;
    bottom: 24px;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    letter-spacing: 0.04em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.r106-lightbox__toast.is-visible {
    opacity: 1;
    visibility: visible;
}

/* -- fullscreen ------------------------------------------------------------ */

/* The browser paints its own backdrop behind a fullscreen element, so the
   translucent one would sit on white. */
.r106-lightbox:fullscreen {
    background: #000000;
}

@media (max-width: 767px) {
    .r106-lightbox {
        padding: 64px 8px 32px;
    }

    .r106-lightbox__bar {
        height: 48px;
        padding: 0 8px;
    }

    .r106-lightbox__tool {
        width: 34px;
        height: 34px;
    }

    .r106-lightbox__tool svg {
        width: 19px;
        height: 19px;
    }

    .r106-lightbox__nav {
        width: 40px;
    }

    .r106-lightbox__nav svg {
        width: 26px;
        height: 26px;
    }

    .r106-lightbox__prev { left: 0; }
    .r106-lightbox__next { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .r106-lightbox.is-open,
    .r106-lightbox__stage.is-loading::after {
        animation: none;
    }

    .r106-lightbox__img,
    .r106-lightbox__tool,
    .r106-lightbox__nav,
    .r106-lightbox__toast {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   News post popup
   Paired with postModal() in assets/js/custom.js. Opened by "Read more" in the
   news section; the cards themselves keep their ported Elementor styling.
   -------------------------------------------------------------------------- */

html.r106-modal-open,
html.r106-modal-open body {
    overflow: hidden;
}

.r106-modal {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    background: rgba(1, 22, 64, 0.82);
}

.r106-modal.is-open {
    display: flex;
    animation: r106-modal-in 0.2s ease both;
}

@keyframes r106-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.r106-modal__panel {
    position: relative;
    width: 100%;
    max-width: 840px;
    margin: auto;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.r106-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.r106-modal__close svg {
    width: 20px;
    height: 20px;
    display: block;
}

.r106-modal__close:hover {
    background: #f27721;
}

.r106-modal__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -6px;
}

.r106-modal__media[hidden] {
    display: none;
}

.r106-modal__media img {
    display: block;
    width: 100%;
    height: auto;
}

.r106-modal__body {
    padding: 32px 40px 40px;
}

.r106-modal__date {
    margin: 0 0 6px;
    color: #7a7a7a;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.r106-modal__date[hidden] {
    display: none;
}

.r106-modal__title {
    margin: 0 0 18px;
    color: #323399;
    font-size: 28px;
    line-height: 1.2;
}

.r106-modal__content {
    color: #333333;
    font-size: 16px;
    line-height: 1.7;
}

.r106-modal__content p {
    margin: 0 0 1em;
}

.r106-modal__content p:last-child {
    margin-bottom: 0;
}

.r106-modal__content a {
    color: #f27721;
    text-decoration: underline;
}

.r106-modal__content img {
    max-width: 100%;
    height: auto;
}

/* The inline source the popup reads from — never displayed in the page. */
.r106-post-store {
    display: none;
}

@media (max-width: 767px) {
    .r106-modal {
        padding: 16px 12px;
    }

    .r106-modal__body {
        padding: 24px 20px 28px;
    }

    .r106-modal__title {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .r106-modal.is-open {
        animation: none;
    }

    .r106-modal__close {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Responsive corrections
   The port froze Elementor's JS-computed layout values into the markup and
   lost the scripts that maintained them. These rules cover what the markup
   alone cannot express; the baked-in widths are stripped by the porter's
   unstretch_sections().
   -------------------------------------------------------------------------- */

/* Stretched sections spanned a hard-coded 1920px, so every narrower viewport
   scrolled sideways. Their container is already full-bleed, so ordinary block
   layout is all that is wanted — and unlike 100vw it excludes the scrollbar. */
.elementor-section.elementor-section-stretched {
    width: 100%;
    max-width: 100%;
    left: 0;
}

/* Belt and braces: nothing should be able to widen the document. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* -- mobile navigation: full-screen overlay -------------------------------- */

/* 30x30 is below a comfortable touch target. */
.elementor-menu-toggle {
    min-width: 44px;
    min-height: 44px;
}

.elementor-menu-toggle:focus-visible {
    outline: 2px solid #f27721;
    outline-offset: 2px;
}

/* Below the tablet breakpoint the burger is the only nav, and Elementor's
   dropdown — a cream panel hanging under the header — is replaced by a
   full-screen navy overlay. Everything here is scoped to that breakpoint so
   the desktop horizontal menu is untouched.

   !important appears more than usual below: the panel's colours, margins and
   shadow come from Elementor's per-page stylesheet, whose selectors are built
   from the page and element IDs and outrank anything written by hand. */
@media (max-width: 1024px) {

    /* Out of the header's flow entirely — the panel owns the viewport. The
       porter froze `top: 40px` into the markup as an inline style, so the
       offset has to be overridden rather than merely restated.

       The leading `body` is doing real work: Elementor's per-page rule for
       this widget sets `margin-top: 12px !important` at (0,5,0), so an
       !important of our own is not enough on its own to close the gap it
       leaves along the top edge. */
    body .elementor-widget-nav-menu.elementor-nav-menu--toggle .elementor-menu-toggle + .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        position: fixed;
        top: 0 !important;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        margin: 0 !important;
        padding: 96px 24px;
        z-index: 9998;

        background-color: #011640 !important;
        box-shadow: none !important;

        display: flex;
        justify-content: center;
        overflow-x: hidden;
        overflow-y: auto;
        /* Scroll chaining would otherwise drag the page behind the overlay. */
        overscroll-behavior: contain;

        /* Elementor opens the dropdown by lifting a max-height clamp and
           scaling on the Y axis. Neither reads as a full-screen panel, and the
           clamp is measured from content height, so both are dropped in favour
           of a fade. */
        max-height: none;
        transform: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    }

    body .elementor-widget-nav-menu.elementor-nav-menu--toggle .elementor-menu-toggle.elementor-active + .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.25s ease;
    }

    /* `margin: auto` rather than `align-items: center`: it centres the same way
       but collapses instead of clipping the first items if the list ever grows
       taller than the viewport. */
    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 420px;
        margin: auto 0;
    }

    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item {
        justify-content: center;
        text-align: center;
        color: #ffffff !important;
        background-color: transparent !important;
        font-size: 1.375rem;
        line-height: 1.3;
        letter-spacing: 0.01em;
        padding: 18px 16px !important;
        /* Elementor insets dropdown links with a transparent 8px start border,
           which pulls centred text off-centre by half that. */
        border-inline-start: 0 !important;
    }

    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item:hover,
    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item:focus,
    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item.elementor-item-active,
    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item.highlighted {
        color: #f27721 !important;
        background-color: transparent !important;
    }

    .elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item:focus-visible {
        outline: 2px solid #f27721;
        outline-offset: -2px;
    }

    /* The inherited grey rule is invisible on navy. */
    .elementor-nav-menu--dropdown.elementor-nav-menu__container li:not(:last-child) {
        border-bottom-color: rgba(255, 255, 255, 0.14) !important;
    }

    /* The burger doubles as the close control, so it has to paint above the
       overlay — and lose its cream chip, which reads as a smudge on navy. */
    .elementor-nav-menu--toggle .elementor-menu-toggle {
        position: relative;
        z-index: 9999;
    }

    .elementor-menu-toggle.elementor-active {
        background-color: transparent !important;
        color: #ffffff !important;
    }

    .elementor-menu-toggle.elementor-active svg {
        fill: #ffffff !important;
    }

    /* Set by mobileNav() in custom.js while the overlay is open: the page
       behind must not scroll under it. */
    body.r106-nav-open {
        overflow: hidden;
    }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
    body .elementor-widget-nav-menu.elementor-nav-menu--toggle .elementor-menu-toggle + .elementor-nav-menu--dropdown.elementor-nav-menu__container,
    body .elementor-widget-nav-menu.elementor-nav-menu--toggle .elementor-menu-toggle.elementor-active + .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        transition: none;
    }
}

/* -- mezzanine intro: legibility over the cropped photo -------------------- */

/* The column carries a `cover` background photo anchored at 50% 100%. On a
   wide column that lands the copy over sky; once the column narrows to a
   portrait box the same crop puts white text on bright concrete and the
   paragraph becomes unreadable. A scrim in the section's own navy restores
   contrast without touching the desktop crop. */
@media (max-width: 1024px) {
    .elementor-element-0c136a8 .elementor-widget-wrap.elementor-element-populated {
        position: relative;
    }

    .elementor-element-0c136a8 .elementor-widget-wrap.elementor-element-populated::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(38, 45, 98, 0.15) 0%, rgba(38, 45, 98, 0.78) 48%, rgba(38, 45, 98, 0.9) 100%);
        pointer-events: none;
    }

    /* Positioned siblings paint above the generated box, but be explicit —
       the widgets must not end up behind the scrim. */
    .elementor-element-0c136a8 .elementor-widget-wrap.elementor-element-populated > .elementor-element {
        position: relative;
        z-index: 1;
    }
}

/* -- mezzanine section on mobile ------------------------------------------ */

/* The widgets in this section carry percentage max-widths from the desktop
   composition — 49.8% on the headline, 59.4% on the paragraph. On a 390px
   screen that leaves the headline a 144px box and the copy a 172px one, so
   both ladder down the page in fragments while the column sits half empty.
   On mobile they get the full content width, a common 20px gutter, and type
   that scales with the viewport. */
@media (max-width: 767px) {
    /* Elementor sets the 50px gutter per column at (0,4,0) — matched here so
       the later stylesheet wins. Only the sides change; the vertical padding
       is what separates this section from its neighbours. */
    .elementor-1717 .elementor-element.elementor-element-4d2f9bc > .elementor-element-populated,
    .elementor-1717 .elementor-element.elementor-element-a6dc5a5 > .elementor-element-populated {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Same left edge and same measure for headline and body. */
    .elementor-element-0c136a8 .elementor-element.elementor-widget {
        width: 100%;
        max-width: 100%;
    }

    .elementor-element-0c136a8 .elementor-widget-heading .elementor-heading-title,
    .elementor-element-0c136a8 .elementor-widget-text-editor {
        max-width: 100%;
    }

    .elementor-element-0c136a8 .elementor-widget-heading .elementor-heading-title {
        font-size: clamp(28px, 7.6vw, 40px);
        line-height: 1.15;
    }

    /* The orange "Mezzanine Benefits." heading is a text-editor widget, not a
       heading widget, so it needs matching treatment. */
    .elementor-element-0c136a8 .elementor-element-222c37d .elementor-widget-container {
        font-size: clamp(28px, 7.6vw, 40px);
        line-height: 1.15;
    }

    .elementor-element-0c136a8 .elementor-element-667e9c1 .elementor-widget-container,
    .elementor-element-0c136a8 .elementor-element-72341df .elementor-widget-container {
        font-size: clamp(15px, 4.1vw, 17px);
        line-height: 1.55;
    }

    /* Breaks set to brochure line lengths ladder badly at this width. The
       porter guarantees a space before each one, so dropping them reflows the
       paragraph without running words together. */
    .elementor-element-0c136a8 .elementor-widget-text-editor br {
        display: none;
    }
}

/* -- mobile: widget measure and column gutters ---------------------------- */

/* Elementor stores the desktop composition as percentage max-widths on
   individual widgets — 54.9% here, 73.6% there. Those are fractions of a wide
   column; on a phone they leave paragraphs in ribbons 160-260px wide, indented
   away from their own headline. On mobile every widget gets the full column.
   Same specificity as Elementor's per-widget rule (0,3,0), and this stylesheet
   loads later, so it wins without !important. */
@media (max-width: 767px) {
    /* Elementor writes both properties, so both have to be released — a
       max-width alone leaves the widget pinned at its percentage width. */
    .elementor-1717 .elementor-element.elementor-widget {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    /* Columns whose gutters were set for the desktop grid — several are
       asymmetric (50px one side, 0 the other), which is what pushed body copy
       out of line with its heading. Normalised to a common 20px. Columns that
       already sit at 0 are left alone: those are full-bleed images. */
    .elementor-1717 .elementor-element.elementor-element-85c8819 > .elementor-element-populated,
    .elementor-1717 .elementor-element.elementor-element-432d826 > .elementor-element-populated,
    .elementor-1717 .elementor-element.elementor-element-17fffe0 > .elementor-element-populated {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Headline widgets scale with the viewport rather than jumping at the
       breakpoint. The 30px blocks are text-editor widgets, not heading
       widgets, so they are named individually. */
    .elementor-1717 .elementor-widget-heading .elementor-heading-title {
        font-size: clamp(26px, 7.2vw, 40px);
        line-height: 1.15;
    }

    .elementor-1717 .elementor-element-f441559 .elementor-widget-container,
    .elementor-1717 .elementor-element-e60faf9 .elementor-widget-container,
    .elementor-1717 .elementor-element-e020d87 .elementor-widget-container,
    .elementor-1717 .elementor-element-27a19d6 .elementor-widget-container {
        font-size: clamp(24px, 6.6vw, 30px);
        line-height: 1.2;
    }

    .elementor-1717 .elementor-element-8f22b07 .elementor-widget-container,
    .elementor-1717 .elementor-element-eaee60a .elementor-widget-container {
        font-size: clamp(15px, 4.1vw, 17px);
        line-height: 1.55;
    }
}

/* -- contact strip: agent logos and the LinkedIn icon --------------------- */

/* The three agent marks — Knight Frank, InCore, Savills — at 60% of the sizes
   the port carried over, i.e. 40% smaller, held at every breakpoint:

       Knight Frank   104px -> 62.4px   |  40% -> 24%
       InCore          99px -> 59.4px   |  40% -> 24%
       Savills         40px -> 24px     |  40% -> 24%  |  34% -> 20.4%

   Elementor's own rules for these widgets sit at (0,4,1), so these are hung
   off the section's #contact id rather than stacked with more classes — it
   wins outright instead of leaning on stylesheet order. */
#contact .elementor-element-08dc402 img {
    width: 62.4px;
}

#contact .elementor-element-326077f img {
    width: 59.4px;
}

#contact .elementor-element-88ba9d0 img {
    width: 24px;
}

@media (max-width: 1024px) {
    #contact .elementor-element-08dc402 img,
    #contact .elementor-element-326077f img,
    #contact .elementor-element-88ba9d0 img {
        width: 24%;
    }
}

@media (max-width: 767px) {
    #contact .elementor-element-88ba9d0 img {
        width: 20.4%;
    }
}

/* The icon sat hard right, away from the column it belongs to. */
#contact .elementor-element-683f09a .elementor-icon-wrapper {
    text-align: start;
}
