﻿@import ".././main/variables.css";
@import ".././main/layout/header/header_logo.css";
@import ".././main/layout/header/header_language-switch.css";

* {
    box-sizing: border-box;
}

body {
    color: #494242;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
}

img {
    height: auto;
    width: 100%;
}

@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }

    .wrapper {
        max-width: 1170px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* basic image credit styles */

div.basic-image-container,
figure.basic-image-container {
    font-size: 0;
    padding: 0;
    position: relative;
}

div.basic-image-container img.basic-image,
figure.basic-image-container img.basic-image {
    height: auto;
    margin: 0;
    padding: 0;
    width: 100%;
}

div.basic-image-container span.basic-image-credit,
figure.basic-image-container figcaption.basic-image-credit,
figure.basic-image-container span.basic-image-credit {
    color: #494242;
    display: inline-block;
    font-size: 0.625rem;
    padding: 5px 15px 5px 0;
    text-align: left;
    width: 100%;
}


/* Header */

header {
    padding: 20px;
}

header .wrapper {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}
/* Main */

main {
    margin: 15px;
}

/* Main heading */

h1 {
    font-family: "Libre Baskerville", serif;
    font-size: 2.5rem;
    line-height: 3.125rem;
}

/* Item information table */

.item-information {
    display: grid;
    font-size: 0.8125rem;
    font-weight: bold;
    gap: 10px;
    grid-template-columns: 30% 1fr;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.information-label {
    color: #b92025;
}

.information-value {
    color: #767676;
}

/* Item assets */

.item-asset {
    margin: 50px 20px;
}

.item-asset-video iframe {
    aspect-ratio: 16 / 9;
    height: auto;
    width: 100%;
}

.asset-image {
    width: 100%;
}

.asset-caption {
    font-family: "Crimson Text", serif;
    font-size: 0.875rem;
    line-height: 1.125rem;
    margin-top: 10px;
    text-align: center;
}

/* Basic slideshow */

.slide {
    display: none;
}

.active {
    display: block;
}

.slideshow {
    position: relative;
}

.slideshow-button {
    background-repeat: no-repeat;
    border: 0;
    color: transparent;
    cursor: pointer;
    display: block;
    height: 36px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
}

.slideshow-button.previous {
    background: url(https://cdn.redcross.ca/prodmedia/crc/azure/history/ui/slider-arrow-left_2.png);
}

.slideshow-button.next {
    background: url(https://cdn.redcross.ca/prodmedia/crc/azure/history/ui/slider-arrow-right.png);
    right: 0;
}

/* Main content */

.item-description {
    font-size: 0.9375rem;
    line-height: 1.5625rem;
    margin-top: 30px;
}

.item-description a {
    color: inherit;
}

.item-description a:hover {
    color: var(--tertiary-red);
}

.item-description blockquote {
    color: var(--tertiary-red);
    font-family: 'Crimson Text', serif;
    font-size: 1.625rem;
    font-style: italic;
    line-height: 2.375rem;
    margin: 50px 0;
}

/* Social share */

.item-share {
    align-items: center;
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.share-title {
    font-size: 0.6875rem;
    font-weight: bold;
    letter-spacing: .5px;
    margin-bottom: 0;
    text-transform: uppercase;
}

.share-icons {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.icon {
    background: #5e5e5e;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    height: 25px;
    padding: 0;
    position: relative;
    width: 25px;
}

.icon:hover,
.icon:focus-within {
    opacity: 0.9;
}

.icon img {
    height: 100%;
    width: 100%;
}

.callout-popup {
    background: #555;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: var(--white);
    font-size: 0.6rem;
    font-weight: bold;
    left: 50%;
    line-height: 1.7;
    padding: 2px 10px;
    position: absolute;
    text-transform: uppercase;
    translate: -50% 0;
    top: -25px;
    visibility: hidden;
}

.popup {
    animation: popup 2s ease-in-out forwards;
}

@keyframes popup {
    0% {
        opacity: 1;
        visibility: visible;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Item navigation (previous and next) */

.item-navigation {
    border-top: 1px solid #e6e6e6;
    margin: 100px -15px 50px;
    padding: 20px 15px;
}

.item-navigation .wrapper {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
}

.item-navigation-link {
    color: inherit;
    display: inline-block;
    font-size: 0.875rem;
    font-weight: bold;
    letter-spacing: .5px;
    position: relative;
    text-decoration: none;
    text-transform: uppercase;
}

.item-navigation-previous .item-navigation-link {
    padding-left: 20px;
}

.item-navigation-previous .item-navigation-link::before {
    content: url(https://cdn.redcross.ca/prodmedia/crc/azure/history/ui/icon-arrow-back.png);
    display: block;
    left: 0;
    position: absolute;
    transition: left 100ms ease-out;
}

.item-navigation-previous:hover a::before {
    left: -5px;
}

.item-navigation-next {
    text-align: right;
}

.item-navigation-next .item-navigation-link {
    padding-right: 20px;
}

.item-navigation-next .item-navigation-link::after {
    content: url(https://cdn.redcross.ca/prodmedia/crc/azure/history/ui/icon-arrow-forward.png);
    display: block;
    position: absolute;
    right: 0;
    transition: right 100ms ease-out;
    top: 0;
}

.item-navigation-next:hover .item-navigation-link::after {
    right: -5px;
}

/* Related items */

h2 {
    font-family: "Libre Baskerville", serif;
    font-size: 1.625rem;
    line-height: 2.375rem;
}

.related-item-image {
    height: auto;
    width: 100%;
}

.related-item {
    margin: 0 0 30px;
}

.related-item-caption {
    text-align: center;
}

.related-item-name {
    font-family: "Libre Baskerville", serif;
    font-size: 1.0625rem;
    font-weight: bold;
    line-height: 1.625rem;
    margin-top: 1em;
}

.related-item-link {
    color: inherit;
    text-decoration: none;
}

.related-item-date {
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1.3rem;
    margin-top: 0px;
}

.related-item-date::before {
    border-top: 1px solid #e00;
    content: '';
    display: block;
    margin: 7px auto;
    width: 20px;
}

.related-item-overlay,
.related-item-share {
    display: none;
}

/* Tablet */

@media (min-width: 768px) {
    .sticky-wrapper {
        display: grid;
        gap: 50px;
        grid-template-columns: 1fr 1fr;
    }

    .item-details-container,
    .item-assets {
        align-self: start;
        position: sticky;
        top: 0;
    }

    .slide {
        display: block;
    }

    .slideshow-button {
        display: none;
    }

    .related-items {
        display: grid;
        gap: 30px;
        grid-template-columns: 1fr 1fr;
    }

    .related-items h2 {
        grid-column: 1 / 3;
    }
}

/* Desktop */

@media (min-width: 1024px) {

    .related-items {
        align-items: start;
        grid-template-columns: 1fr 1fr 1fr;
    }

    .related-items h2 {
        grid-column: 1 / 4;
    }

    .related-item {
        margin-bottom: 0;
        padding: 20px;
        position: relative;
    }

    .related-item-image {
        padding: 100px 0 0;
    }

    .related-item-overlay {
        background: rgba(236, 237, 234, 0.9);
        display: block;
        height: 100%;
        left: 0;
        opacity: 0;
        padding: 40px;
        position: absolute;
        text-align: center;
        top: 0;
        transition: opacity 0.3s ease-out;
        visibility: hidden;
        width: 100%;
    }

    .related-item:hover .related-item-overlay,
    .related-item:focus-within .related-item-overlay,
    .related-item:hover .related-item-share,
    .related-item:focus-within .related-item-share {
        opacity: 1;
        visibility: visible;
    }

    .related-item:hover figcaption,
    .related-item:focus-within figcaption {
        visibility: hidden;
    }

    .related-item-description {
        font-size: 0.9375rem;
        line-height: 1.5625rem;
        margin-top: 20px;
        text-align: left;
    }

    .related-item-read-more {
        color: var(--primary-red);
        font-size: 0.6875rem;
        font-weight: bold;
        letter-spacing: .5px;
        margin-top: 5px;
        text-align: left;
        text-decoration: none;
        text-transform: uppercase;
    }

    .related-item-read-more:hover {
        text-decoration: underline;
    }

    .related-item-share {
        bottom: 40px;
        display: block;
        left: 50%;
        opacity: 0;
        position: absolute;
        transition: opacity 0.3s ease-out;
        translate: -50% 0;
        visibility: hidden;
    }

    .related-item-share-icons {
        margin-top: 20px;
    }
}
/* FOOTER */
footer {
  background: var(--grey-black);
  color: var(--white);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  font-size: .75rem;
  padding: 40px 30px 69px;
  margin-top: 40px;
}
