/* first teh photo save features - the Katka feature 
-----------------------------------------------------*/


:root {
    --PH_TEXT_COLOUR: #1c1c1c;
    --PH_HEADER_COLOUR: #0606a7;
    --PH_BANNER_COLOUR: #414191;
    --PH_BUTTON_BACK: #f7d9ad;
    --PH_BUTTON_BACK_HOVER: #f7cf95;

    --KBX_PHOTO_BORDER_COLOUR: #343434;
    --KBX_PHOTO_SMALL_BORDER_COLOUR: #515151;
    --KBX_PHOTO_BORDER_THICK: 8px;

    --KBX_CAPTION_COLOUR: #bebebe;
    --KBX_CAPTION_HOVER_COLOUR: #faaf41;
    --KBX_CAPTION_FONT: Arial, Helvetica, sans-serif;
    --KBX_CAPTION_FONT_SIZE: 18px;



    --KBX_CONTROLS_COLOUR_STRONG: #faaf41;
    --KBX_CONTROLS_COLOUR_WEAK: #bebebe;
    --KBX_CONTROLS_BACKGROUND: rgb(26, 18, 12, 0.7);
    --KBX_CONTROLS_BACKGROUND_HOVER: rgb(26, 18, 12, 1.0);
    --KBX_CONTROLS_BACKGROUND_TOPBAR: #363636;
    --KBX_CONTROLS_FONT: Arial, Helvetica, sans-serif;
    --KBX_CONTROLS_FONT_SIZE: 17px;
}

#save_image_box {
    display: none;
    z-index: 1000;
    border: 4px solid #69638d;
    border-radius: 8px;
    width: auto;
    height: auto;
    max-height: 96vh;
    box-shadow: 8px 8px 9px #363636;
    position: fixed;
    top: 15%;
    left: 75%;
    transform: translate(-75%, -15%);
    color: var(--PH_TEXT_COLOUR);
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
    padding: 10px;
    margin: 0px;
    width: 250px;
    background-color: antiquewhite;
}

@media all and (max-height:900px) {

    /* 800 or 900 will depend on slightly different contents of this box */
    #save_image_box {
        overflow-y: scroll;
        overflow-x: hidden;
    }

    #save_image_box::-webkit-scrollbar {
        width: 10px;
    }

    /* Track */
    #save_image_box::-webkit-scrollbar-track {
        background: gainsboro;
        border-radius: 5px;
    }

    /* Handle */
    #save_image_box::-webkit-scrollbar-thumb {
        background: var(--PH_BANNER_COLOUR);
        border-radius: 5px;
    }

    /* Handle on hover */
    #save_image_box::-webkit-scrollbar-thumb:hover {
        background: var(--PH_BANNER_COLOUR);
    }
}

#save_image_box h1,
#save_image_box h2 {
    border: none;
    color: var(--PH_HEADER_COLOUR);
    letter-spacing: normal;
}

#save_image_box h1 {
    margin: -10px -10px -10px -10px;
    font-size: 1.2em;
    color: #fffcf8;
    background-color: var(--PH_BANNER_COLOUR);
    padding: 4px 10px 4px 6px;
    letter-spacing: 1px;
    font-weight: 400;
}

#save_image_box h2 {
    margin: 8px 0px 0px -4px;
    font-size: 1.1em;
}

#save_image_box p {
    border: none;
    font-size: 1em;
    line-height: normal;
    margin: 10px 0px 5px 0px;
    padding: 0px;
}

.ph_button {
    margin: 0 auto;
    background-color: var(--PH_BUTTON_BACK);
    color: var(--PH_HEADER_COLOUR);
    font-weight: 700;
    padding: 6px;
    width: 85%;
    font-size: 1em;
    border-radius: 8px;
    border: 1px grey solid;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 6px;
}

.ph_button:active,
.ph_button:hover {
    box-shadow: 4px 4px 4px #808080;
    background-color: var(--PH_BUTTON_BACK_HOVER);
}

#button_section {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: auto;
    margin: 0 auto;
}

.sub_text {
    font-size: 0.75em;
}

#size_0_text {
    display: inline-block;
}

#thumb_container {
    margin: 0 auto;
}

#photo_thumb {
    /*height: 120px;*/
    margin: 0px;
    z-index: 1001;
    border: 1px solid var(--PH_TEXT_COLOUR);
    object-fit: contain;
    /* max-width: 200px;*/
    width: 200px;
}

#thumb_height_text,
#thumb_width_text {
    font-size: 0.8em;
    text-align: center;
}

.thumb_height_text_spacer,
#thumb_height_text {
    writing-mode: vertical-rl;
    transform: rotate(-180deg);
    width: 14px;
    line-height: 14px;
}

.thumb_spacer,
#thumb_width_text {
    line-height: 14px;
    position: relative;
    top: -5px;
    /* kludge */
}

#save_image_box td,
#save_image_box tr {
    /*  border: 1px black solid; just to debug */
    padding: 0px;
}

.ph_photo_save_36w {
    top: 2px;
    left: 2px;
    width: 36px;
    height: 29px;
    position: absolute;
    opacity: 0.65;
    z-index: 2;
}

.ph_photo_save_36w:hover,
.ph_photo_save_36w:active {
    opacity: 1.0;
    z-index: 3;
}

@media all and ((max-width:700px) or (max-height:700px)) {
    .ph_photo_save_36w {
        top: -26px;
        left: 0px;
        z-index: 1000;
    }
}


#intro_para {
    font-size: 0.85em;
    line-height: normal;
}

.icon_copy_img {
    padding-left: 2px;
    padding-right: 2px;
    position: relative;
    top: 3px;
    background: url(ph_photo_save_30w.webp) no-repeat;
    text-align: left;
    width: 30px;
    height: 24px;
    display: inline-block;
}


#save_image_obscura {
    display: none;
    width: 100%;
    height: 100%;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: fixed;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.87);
    backdrop-filter: blur(2px);
}


/* mobile/desktop and tap/click  - default to desktop/mouse because I want to be sure there is a default */
.can_tap {
    display: none;
}

.can_click {
    display: inline;
}

@media (pointer: coarse) {
    .can_tap {
        display: inline;
    }

    .can_click {
        display: none;
    }
}



/*  Now the lbx_photo base classes override in the parent's .css if needed  
    -----------------------------------------------------------------------*/


.lbx_photo_box {
    float: left;
    display: table;
    position: relative;
    margin: 10px 18px 10px 18px;
    z-index: 2;
}

@media all and (max-width:700px) {
    .lbx_photo_box {
        margin-left: 4px;
        margin-right: 4px;
        margin-top: 28px;
    }
}

@media all and (max-width:500px) {
    .lbx_photo_box {
        margin-left: 2px;
        margin-right: 2px;
    }
}

.lbx_video_caption,
.lbx_photo_caption {
    text-align: left;
    margin-top: 1px;
    font-size: .75em;
    line-height: 15px;
    padding-bottom: 3px;
    word-break: normal;
    /* Chrome only ?? */
    /* to handle the equivalent of width:min-content to constrain the width of the <figcaption> to the width of the image */
    display: table-caption;
    caption-side: bottom;

}

.lbx_video_caption {
    display: block;
}

/* a mobile kludge */

@media all and ((max-width:700px) or (max-height:700px)) {
    .lbx_photo_caption {
        display: block;
        /*   position: relative;
    top: -12px;
    left: 5px;  */
        border: none;
    }
}

.lbx_photo_credit {
    font-size: .85em;
    /* mob is that .75 em is the .small def */
}

/* These fm_photo... are the new versions after going over to using <figure> */

.lbx_photo_box_img {
    position: relative;
    width: auto;

    /*background-color:#333;  because in some cases rounding on image pixel sizes leaves a 1 pixel strip unfilled by the image 
	width: min-content;   this one useful for height defined?? but breaks the width defined*/
}

.lbx_photo {
    width: 100%;
    box-sizing: border-box;
    z-index: 3;
    position: relative;
}

/* the z-index work here is to allow the magnifier to only appear when hovering over the image */
.lbx_photo:hover,
.lbx_photo:active {
    z-index: 1;
}

.lbx_photo_border {
    border: solid 2px var(--KBX_PHOTO_SMALL_BORDER_COLOUR);
}

.lbx_photo_box_caption {
    text-align: left;
    margin-top: 8px;
    font-size: .85em;
    line-height: 12px;
    padding-bottom: 3px;
    border-bottom: solid 1px #333;
}

.lbx_photo_box_credit {
    font-size: .85em;
    /* mob is that .75 em is the .small def */
}

.kbx_corner_plus {
    position: absolute;
    opacity: 1.0;
    z-index: 2;
    bottom: 2px;
    right: 2px;
    width: 36px;
    height: 36px;
}

.kbx_corner_plus:hover,
.kbx_corner_plus:active {
    z-index: 3;
}



@media all and ((max-width:700px) or (max-height:700px)) {
    .kbx_corner_plus {
        z-index: -1;
    }
}

/* THE KBX MODAL SPECIFIC STUFF */
/* ---------------------------- */
/* The Modal (background) */
#kbx_modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.87);
    backdrop-filter: blur(2px);
    margin: 0 auto;
    /* display: block when turned on */
    display: none;
    }

#kbx_modal a:link,
#kbx_modal a:visited {
    color: var(--KBX_CONTROLS_COLOUR_WEAK);
}

#kbx_modal a:hover,
#kbx_modal a:focus {
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
}

#kbx_modal_inside {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-wrap: nowrap;
    line-height: normal;
  }

#kbx_modal_inside_photo {
    position:relative;
}

.kbx_modal_inside_caption {
    width: 100%;
    height: 100%;
   display: inline-block;
}

@media all and (max-width:700px) {
    #kbx_modal_inside_photo {
        margin-left: 5px;
        margin-right: 5px;
    }
}

@media all and (max-height:700px) {
    #kbx_modal_inside_photo{
        margin-top: 5px;
    }
}

#kbx_modal_img {
    box-sizing: border-box;
    margin: 0;
    border: var(--KBX_PHOTO_BORDER_THICK) solid var(--KBX_PHOTO_BORDER_COLOUR);
    max-width: 85vw;
    max-height: 85vh;
    display: block;
}

@media all and ((max-width:700px) or (max-height:700px)) {
    #kbx_modal_inside_photo {
        max-width: 100%;
    }
    #kbx_modal_img {
        border-width: 2px;
    }
}

#kbx_modal_controls img {
    display: inline-block;
}

/* Caption of Modal Image (Image Text) - Same Width as the Image */
#kbx_caption {
    margin: 0;
    color: #ccc;
    text-align: left;
    padding: 0;
    height: auto;
    caption-side: bottom;
    color: var(--KBX_CAPTION_COLOUR);
    font-family: var(--KBX_CAPTION_FONT);
    font-size: var(--KBX_CAPTION_FONT_SIZE);
    position:relative;
    z-index: 102;
}

#kbx_caption img {
    display: inline-block;
}

.kbx_caption_title {
    font-weight: bold;
    padding-right: 10px;
    display: inline-block;
    cursor: help;
}

.kbx_caption_credit,
.kbx_caption_date {
    font-size: 0.8em;
    display: inline-block;
    font-weight: normal;
}

.kbx_caption_right {
    opacity: 0.5;
    display: inline-block;
    float: right;
}

.kbx_caption_right:hover,
.kbx_caption_right:focus {
    opacity: 1.0;
}

.kbx_caption_direction {
    display: inline-block;
    cursor: pointer;
}

.kbx_caption_close {
    display: inline-block;
    cursor: pointer;
}

.kbx_caption_direction:hover,
.kbx_caption_close:hover,
.kbx_caption_direction:focus,
.kbx_caption_close:focus {
    color: var(--KBX_CAPTION_HOVER_COLOUR);
    text-decoration: none;
    cursor: pointer;
}

.kbx_caption_x {
    font-size: 2.0em;
    font-weight: bold;
    position: relative;
    top: 6px;
    line-height: 20px;
}

/* Add Animation - Zoom in the Modal */
#kbx_modal_img,
#kbx_caption {
    animation-name: kbx_zoom;
    animation-duration: 0.6s;
}

@media all and ((max-width:700px) or (max-height:700px)) {
    #kbx_caption {}

    .kbx_caption_title {
        font-weight: normal;
        font-size: 0.8em;
    }
    .kbx_caption_date {}
    .kbx_caption_direction {}
    .kbx_caption_close {}
    .kbx_caption_x {
        font-size: 1.5em;
        top: 0px;
        line-height: 16px;
    }
}

@keyframes kbx_zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}


/* 100% Image Width on Smaller Screens */
@media all and ((max-width:700px) or (max-height:700px)) {
    #kbx_modal_img {
        width: 100%;
    }
}

#kbx_img_ovl_l,
#kbx_img_ovl_r {
    position: absolute;
    opacity: 0.0;
    z-index: 101;
    /*background-color: brown;*/
    top: var(--KBX_PHOTO_BORDER_THICK);
    width: 25%;
    height: 100%;
}

#kbx_img_ovl_r {
    right: var(--KBX_PHOTO_BORDER_THICK);
}

#kbx_img_ovl_l {
    left: var(--KBX_PHOTO_BORDER_THICK);
}

#kbx_img_ovl_l:hover,
#kbx_img_ovl_l:active,
#kbx_img_ovl_r:hover,
#kbx_img_ovl_r:active {
    opacity: 1.0;
}

.kbx_img_ovl_arr_l,
.kbx_img_ovl_arr_r {
    position: absolute;
    bottom: 50%;
    width: 40px;
    height: 40px;
}

.kbx_img_ovl_arr_l {
    left: 0px;
}

.kbx_img_ovl_arr_r {
    right: 0px;
}

.kbx_caption_slide_start {
    cursor: pointer;
}

.kbx_caption_slide_stop {
    cursor: pointer;
}



/* the kbx slideshow controls top right corner */

#kbx_modal_controls {
    background-color: var(--KBX_CONTROLS_BACKGROUND);
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--KBX_CONTROLS_COLOUR_WEAK);
    border: 1px solid var(--KBX_CONTROLS_COLOUR_WEAK);
    padding: 0px;
    font-family: var(--KBX_CONTROLS_FONT);
    font-size: var(--KBX_CONTROLS_FONT_SIZE);
    opacity: 0.5;
    line-height: normal;
}

@media all and ((max-width:700px) or (max-height:700px)) {
    #kbx_modal_controls {
        background-color: var(--KBX_CONTROLS_BACKGROUND_HOVER);
        opacity: 1.0;
    }
}

#kbx_modal_controls:hover {
    background-color: var(--KBX_CONTROLS_BACKGROUND_HOVER);
    opacity: 1.0;
}

.kbx_con_button {
    background: none;
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
    font-size: 16px;
    margin: 0;
    margin-left: 6px;
    outline-style: solid;
    outline-width: 1px;
    border: none;
    outline-color: var(--KBX_CONTROLS_COLOUR_WEAK);
    font-weight: normal;
}

.kbx_con_button_start_pause {
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
}

.kbx_con_button:hover,
.kbx_con_button:active {
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
    outline-color: var(--KBX_CONTROLS_COLOUR_STRONG);
}

.kbx_con_button_set:hover,
.kbx_con_button_set:active,
.kbx_con_button_set {
    background-color: var(--KBX_CONTROLS_COLOUR_STRONG);
    color: rgb(26, 18, 12);
    font-weight: bold;
    letter-spacing: -1px;
}

.kbx_con_item {

    display: inline-block;
    /*  padding-right: 4px; */
}

.kbx_con_item_ps {
    font-weight: normal;
    display: inline-block;
}

#kbx_con_slideshow_pause {
    display: none;
}

#kbx_con_size {
    border-bottom: 1px solid var(--KBX_CONTROLS_COLOUR_WEAK);
}

#kbx_con_down {
    border-top: 1px solid var(--KBX_CONTROLS_COLOUR_WEAK);
    margin-top: 2px;
}

#kbx_con_size,
#kbx_con_loop,
#kbx_con_interval,
#kbx_con_slideshow,
#kbx_con_down {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    padding: 4px 6px 4px 6px;
    box-sizing: border-box;
}


.kbx_desktop_only {}


@media all and ((max-width:700px) or (max-height:700px)) {
    .kbx_desktop_only {
        display: none;
    }
}

#kbx_controls_toggle {
    position: absolute;
    top: 11px;
    right: 15px;
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
    padding: 0px;
    font-size: 1.6em;
    cursor: pointer;
    z-index: 400;
}

#kbx_con_topbar {
    /*width:100%;*/
    background: var(--KBX_CONTROLS_BACKGROUND_TOPBAR);
    padding: 3px 3px 3px 5px;
    border-bottom: 1px solid var(--KBX_CONTROLS_COLOUR_WEAK);
    margin-bottom: 2px;
    color: var(--KBX_CONTROLS_COLOUR_STRONG);
}


.kbx_modal_controls_open {
    display: block;
    transform: translateX(0px);
    transition: transform 0.2s;
}

.kbx_modal_controls_close {
    transform: translateX(230px);
    transition: transform 0.8s;
}


.kbx_fake_close {
    position: absolute;
    top: 3px;
    left: 3px;
    display: inline-block;
    color: grey;
    font-size: 2.8em;
    cursor: pointer;
  }
