/* Site additions on top of the compiled style.css (which has no source). */

/* Bootstrap draws a focus ring on links and buttons that stays after a mouse click.
   Hide it for mouse/touch; keyboard users still get it through :focus-visible. */
*:focus:not(:focus-visible) {
    outline: none !important;
}

/* Nav logo: the SVG replaces all SummitDISLogo*.png variants (normal, scrolled/affix and retina).
   The box sizes from style.css stay; the logo scales into them. */
.navbar.navbar-default .navbar-brand,
.navbar.navbar-default.affix .navbar-brand {
    background-image: url(../images/summit-dis-horizontal-rgb.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

/* Scrolled (affix) header: smaller logo at the top, as with the old PNG. */
.navbar.navbar-default.affix .navbar-brand {
    background-size: 197px auto;
    background-position: left top;
}

/* ---- References page: on phones the logos fill their tile, leaving about 10px padding ---- */
@media (max-width: 767px) {
    .page-references .client-overview .case-study-box .logo-box img {
        width: calc(100% - 20px);
        height: calc(100% - 20px);
        max-width: none;
        max-height: none;
        object-fit: contain;
    }
}

/* ---- Highlights picker: titles may wrap; titles in the same row get the same height, text centred vertically ---- */
@media (min-width: 768px) {
    .highlight-content .highlight-picker {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch; /* items in a row share the tallest height */
    }

    .highlight-content .highlight-picker .highlight-item {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto; /* keep the Bootstrap column width; a lone last item stays small and on the left */
        margin-left: 0; /* the theme's auto margins did nothing on floats but would centre items in a flex row */
        margin-right: 0;
    }

    .highlight-content .highlight-picker .highlight-item > a,
    .highlight-content .highlight-picker .highlight-preview {
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* fill the item's height */
    }

    .highlight-content .highlight-picker .preview-title {
        flex-grow: 1; /* takes the extra height, so the photos below stay aligned */
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        text-align: center;
    }

    .highlight-content .highlight-picker .preview-img {
        flex-shrink: 0;
    }
}

/* ---- Home page: ISO 27001 block, auditor logo below the text ---- */
.home-contact .iso-auditor {
    display: inline-block;
    margin-top: 10px;
}

.home-contact .iso-auditor img {
    display: block;
    width: 300px;
    max-width: none;
    height: auto;
}

/* ---- YouTube videos at the end of a highlight (content/highlight-videos.php): responsive 16:9 ---- */
.video-embed {
    position: relative;
    padding-top: 56.25%;
    margin: 20px 0;
    overflow: hidden;
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- Photo slider (templates/partials/photo-slider.php) ---- */
.photo-slider {
    max-width: 360px;
    margin: 0 auto 30px;
}

.photo-frame {
    display: block;
    position: relative;
    padding-top: 100%; /* square: the small photo fills 360 x 360 */
    overflow: hidden;
    background: #f2f2f2;
    cursor: zoom-in;
}

.photo-frame img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-slider .photo-zoom-icon.glyphicon {
    position: absolute;
    top: auto; /* Bootstrap's .glyphicon sets top: 1px */
    left: 50%;
    bottom: 12px;
    margin-left: -17px; /* half the width: centred horizontally */
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 15px;
    line-height: 34px;
    text-align: center;
    opacity: .7;
    transition: opacity .2s;
}

.photo-frame:hover .photo-zoom-icon,
.photo-frame:focus .photo-zoom-icon {
    opacity: 1;
}

/* Arrows: round white buttons with a dark red chevron (slider and lightbox) */
.photo-slider .carousel-control.photo-arrow {
    top: 0;
    bottom: 32px; /* leave the dots out, so arrows centre on the photo */
    width: auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    background: none;
    opacity: 1;
    text-shadow: none;
}

/* Desktop: arrows sit next to the photo instead of on top of it (there is room beside the 360px frame). */
@media (min-width: 992px) {
    .photo-slider .carousel-control.photo-arrow {
        padding: 0;
    }

    .photo-slider .carousel-control.photo-arrow.left {
        left: -56px;
    }

    .photo-slider .carousel-control.photo-arrow.right {
        right: -56px;
    }
}

.photo-arrow-icon {
    display: block;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
    transition: background .2s, transform .2s;
}

.photo-arrow-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 11px;
    border-top: 3px solid #ac0033;
    border-right: 3px solid #ac0033;
    transform: translate(-65%, -50%) rotate(45deg);
}

.left .photo-arrow-icon::before,
.photo-lightbox-prev .photo-arrow-icon::before {
    transform: translate(-35%, -50%) rotate(-135deg);
}

.photo-arrow:hover .photo-arrow-icon,
.photo-arrow:focus .photo-arrow-icon {
    background: #fff;
    transform: scale(1.08);
}

/* Dots under the photo */
.photo-slider .carousel-indicators.photo-dots {
    position: static;
    width: auto;
    margin: 14px 0 0;
    height: 18px;
}

.photo-slider .photo-dots li,
.photo-slider .photo-dots li.active {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    border: 0;
    border-radius: 50%;
    background: #ccc;
    vertical-align: middle;
    transition: background .2s, transform .2s;
}

.photo-slider .photo-dots li.active {
    background: #ac0033;
    transform: scale(1.3);
}

/* ---- Lightbox (templates/partials/photo-lightbox.php) ---- */
.photo-lightbox {
    background: rgba(0, 0, 0, .6); /* on top of the Bootstrap backdrop */
}

.photo-lightbox-stage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-lightbox-img {
    /* width/height are set by photo-slider.js to fill the window minus a margin */
    max-width: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .5);
    background: #fff;
}

.photo-lightbox .photo-arrow {
    position: absolute;
    top: 50%;
    margin-top: -20px;
}

.photo-lightbox-prev {
    left: 20px;
}

.photo-lightbox-next {
    right: 20px;
}

.photo-lightbox.single .photo-arrow {
    display: none;
}

.photo-lightbox-close {
    position: absolute;
    top: 12px;
    right: 20px;
    z-index: 2;
    padding: 0 8px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 44px;
    line-height: 1;
    opacity: .85;
}

.photo-lightbox-close:hover,
.photo-lightbox-close:focus {
    opacity: 1;
}

.photo-lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    color: #fff;
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
}

@media (max-width: 767px) {
    .photo-arrow-icon {
        width: 34px;
        height: 34px;
    }

    .photo-lightbox-prev {
        left: 8px;
    }

    .photo-lightbox-next {
        right: 8px;
    }
}
