/* A capital H in CSS varibale names stands for height; W stands for width */
/* 0 stands for max 600 px width and 1 for min 600 */
:root {
    /* Colors */
    --c1: #ffd394;
    --c2: #87CEFA;
    --c3: #90EE90;
    --c4: #FFFFF0;
    --c5: #fa7970;
    --c6: #dcdcdc;
    --c7: #333333;

    /* Fixed heights and widths */
    --bodyH1: 67rem;
    --bodyW1: 40rem;
    --titleH0: 4rem;
    --titleH1: 5rem;
    --buttonContainerH0: 3rem;
    --buttonContainerH1: 4rem;
    --captionH: 4rem;
    --salesContainerH: 2rem;
    --carouselContainerH0: 6rem;
    --carouselContainerH1: 10rem;
    --thumbnailH0: 10rem;
    --thumbnailH1: 14rem;
    --carouselH0: 5rem;
    --carouselH1: 7rem;
    --highresCaptionH: 3rem;

    /* Variable heights, set by JavaScript */
    /* https://dev.to/nirazanbasnet/dont-use-100vh-for-mobile-responsive-3o97 */
    --bodyHeight: 100%;
    --bodyWidth: 100%;
    --viewH0: calc(var(--bodyHeight) - var(--titleH0) - var(--buttonContainerH0));
    --viewH1: calc(var(--bodyH1) - var(--titleH1) - var(--buttonContainerH1));
    --highresContainer0: calc(var(--viewH0) - var(--carouselContainerH0) - var(--highresCaptionH));
    --highresContainer1: calc(var(--viewH1) - var(--carouselContainerH1) - var(--highresCaptionH));
    --asaImage0: calc(var(--bodyWidth) * 0.5);
    --asaImage1: calc(var(--bodyW1) * 0.5);
}

@media screen and (max-width: 600px) { /* Denoted XS */
    html {
	background: var(--c7);
	height: 100%;
    }
    body { /* See JavaScript */
	height: var(--bodyHeight);
	width: var(--bodyWidth);
	padding: 0;
	margin: 0;
    }
    #title {
	font-size: 1.7rem;
	flex: 0 0 var(--titleH0);
    }
    #buttonContainer {
	flex: 0 0 var(--buttonContainerH0);
    }
    #highresContainer {
	flex: 0 0 var(--highresContainer0);
    }
    #highres {
	max-height: var(--highresContainer0);
    }
    .thumbnail {
	height: var(--thumbnailH0);
    }
    #carouselContainer {
	flex: 0 0 var(--carouselContainerH0);
    }
    .carousel {
	height: var(--carouselH0);
    }
    #asaImage {
	width: var(--asaImage0);
	margin: 0.4rem 0.7rem;
    }
}

@media screen and (min-width: 600px) {
    body {
	margin: 0 auto;
	height: var(--bodyH1);
	width: var(--bodyW1);
    }
    #title {
	font-size: 2rem;
	flex: 0 0 var(--titleH1);
    }
    #buttonContainer {
	flex: 0 0 var(--buttonContainerH1);
    }
    #highresContainer {
	flex: 0 0 var(--highresContainer1);
    }
    #highres {
	max-height: var(--highresContainer1);
    }
    .thumbnail {
	height: var(--thumbnailH1);
    }
    #carouselContainer {
	flex: 0 0 var(--carouselContainerH1);
    }
    .carousel {
	height: var(--carouselH1);
    }
    #asaImage {
	width: var(--asaImage1);
	margin: 0.5rem 1.3rem;
    }
}

    /* HTML, BODY */
    * {
	box-sizing: border-box;
    }
html { /* For screen widths > 600px */
    background: var(--c6);
}
body {
    font-family: "Ubuntu", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1rem;
    color: var(--c4);
    background: var(--c7);
    display: flex;
    flex-flow: column;
}

/* DISPLAYS */
.flexCenter {
    display: flex;
    justify-content: center; 
    align-items: center;
}
.flexBetween {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.none {
    display: none;
}

/* IMAGES */
.thumbnail {
    padding: 0.5rem;
    border-radius: 1rem;
}
figure {
    position: relative;
    margin: 0;
}
figcaption {
    background-color: var(--c7);
    color: var(--c4);
    padding: 0.1rem;
    font-size: 12px;
    position: absolute;
    bottom: 0.7rem;
    right: 1rem;
}
.carousel {
    padding: 0.3rem;
    border-radius: 0.6rem;
}
#counter {
    padding-left: 0.5rem;
    padding-right: 1rem;
}
.imageBorder {
    border: 1px solid var(--c4);
    pointer-events: none;
}
.notVisible {
    visibility: hidden;
}

/* VIEWS */
#galleryContainer {
    flex-wrap: wrap;
    overflow-y: auto;
}
#imageContainer {
    flex-direction: column;
}
#asaContainer {
    padding: 0 1rem;
    overflow-y: auto;
}

/* HIGH RESOLUTION CONTAINER */
#imageCaption {
    width: 100%;
    height: 2rem;
}

/* BUTTONS */
button {
    color: var(--c7);
    outline: none;
    border: 1px solid var(--c4);
    border-radius: 0.4rem;
}    
.menuItem {
    font-size: 1rem;
    width: 100px;
    height: 30px;
    background: var(--c1);
}
#salesButton {
    background: var(--c3);
    height: 1.5rem;
}

/* IMAGES */
.dim {
    opacity: 0.5;
}
.arrow {
    flex: 0 0 5rem;
    width: 5rem;
    font-size: 2rem;
    font-weight: bold;
}
@keyframes opacityReduce {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 0;
    } 
    100% {
        opacity: 1;
    }
}
#highresContainer {
    animation: opacityReduce 0.5s;
}
#highres {
    max-width: 100%;
    object-fit: contain;
}
#highresCaption {
    flex: 0 0 var(--highresCaptionH);
}

/* DETAILS */
details {
    padding-top: 10px;
    line-height: 1.4rem;
}
details:first-child {
    padding-top: 5px;
}
summary {
    color: var(--c2);
    font-weight: bold;
}
.smallFont {
    font-size: 0.8rem;
}
.year {
    display: inline-block;
    width: 3em;
}
.label {
    color: var(--c1);
}
.indentYear {
    text-indent: 3rem hanging;
}
.indentInterval {
    text-indent: 8.3rem hanging;
}
.coming {
    color: var(--c3);
}
.link {
    color: var(--c2);
}
.link:visited {
    color: var(--c2);
}
#asaImage {
    float: right;
}

/* DIALOG */
#dialogHeadingText {
    font-size: 1.1rem;
    overflow: auto;
}
::backdrop {
    background: var(--c7);
    opacity: 0.5;
}
#dialog {
    /* width: 20rem; */
    /* min-width: 20rem; */
    color: var(--c4); 
    background: var(--c7);
    border: 1px solid var(--c4);
    border-radius: 0.3rem;
}
#dialogClose {
    background: var(--c7);
    color: var(--c5);
    outline: none;
    border: 1px solid var(--c5);
    border-radius: 0.3rem;
    font-size: 1.3rem;
    line-height: 1.3rem;
    width: 1.5rem;
    height: 1.5rem;
}

