 @font-face {
    font-family: Open Sans; /* Имя шрифта */
    src: url(../fonts/OpenSans-Regular.ttf); /* Путь к файлу со шрифтом */
   }

.card_g:hover {
border-radius: 10px;
-webkit-box-shadow: 7px 7px 5px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 7px 7px 5px 0px rgba(0, 0, 0, 0.3);
box-shadow: 7px 7px 5px 0px rgba(0, 0, 0, 0.3);

-webkit-transition: -webkit-box-shadow 0.7s;
-moz-transition: -moz-box-shadow 0.7s;
-o-transition: box-shadow 0.7s;
transition: box-shadow 0.7s;
}

.gallery {
display: flex;
display: box; 
/*display: flexbox;
display: -moz-box;*/
display: -ms-flexbox;
display: -webkit-box;
display: -webkit-flex;
flex-flow: row wrap;
justify-content: center;
width: 100%; 
position: relative; 
margin: 1em auto;
}

.card_g {  
display: block;
padding: 12px;
position: relative;
width: 10em;
height: 13em;
margin: 0em auto;
font-family: Open Sans;
text-align: center;
z-index: 1;
background: #80c468;
background: -moz-linear-gradient(top, #80c468 0%, #3b9d32 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, #80c468), color-stop(100%, #3b9d32));
background: -webkit-linear-gradient(top, #80c468 0%, #3b9d32 100%);
background: -o-linear-gradient(top, #80c468 0%, #3b9d32 100%);
background: -ms-linear-gradient(top, #80c468 0%, #3b9d32 100%);
background: linear-gradient(to bottom, #80c468 0%, #3b9d32 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80c468', endColorstr='#3b9d32', GradientType=0 );
border-radius:10px;
color: white;
cursor: pointer;
}

.card_g figure {
width:100%;
padding-bottom: 0em;
padding-top: 0.7em;
}

.card_g figure>img {
height: 6.5em;
width:auto;
border: 3px solid #3b9d32;
border-radius:7px;
}

.card_g figure>img.h_img{
max-width:7em;
height:auto;
}

.card_g figcaption {
display: block;
text-align: center;
font-family:Open Sans;
font-size: 0.9em;
color:#fff;
padding-top:0.3em;
width:100%;
}

.gallery_popup_left {
width:50%;
float:left;
}

.popup figure.left_img {
display: block;
float: left;
width: 25%;
padding-bottom: 0em;
padding-top: 1em;
margin-right: 1em;
}

/***---------  Всплывающие окна с инфой  --------***/

.gallery .add-w {text-decoration:none; margin:0.4em; margin-bottom:1em;}

/* Базовые стили слоя затемнения и модального окна  */
.overlay {
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10000;
visibility: hidden;
/* фон затемнения */
background-color: rgba(0, 0, 0, 0.7);
opacity: 0;
/*position: absolute;*/
cursor: default; /* тип курсара */
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
.overlay.active {
visibility: visible;
opacity: 1;
}

/* стили модального окна */
.popup {
right: 0;
left: 0;
font-size: 1em;
z-index: 10000;
display: block;
visibility: hidden;
margin: 0 auto;
width: 90%;
max-height: 80vh;
overflow-y: auto;
overflow-x: hidden;
min-width: 320px;
max-width: 600px;
/* фиксированное позиционирование, окно стабильно при прокрутке */
position: absolute;
padding: 1em;
border: 1px solid #383838;
/* скругление углов */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
background-color: #FFFFFF;
/* внешняя тень */
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
-moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
-ms-box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
-o-box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.8);
/* полная прозрачность окна, появление при клике */
opacity: 0;
/* эффект перехода (появление) */
-webkit-transition: all ease .5s;
-moz-transition: all ease .5s;
-ms-transition: all ease .5s;
-o-transition: all ease .5s;
transition: all ease .5s;
}

.overlay.active+.popup {
margin-top: -1em;
visibility: visible;
opacity: 1;
} 
/* формируем кнопку закрытия */
.close {
position: absolute;
top: 10px;
right: 10px;
padding: 0;
width: 20px;
height: 20px;
border: 2px solid #ccc;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
background-color: rgba(61, 61, 61, 0.8);
text-align: center;
text-decoration: none;
font-weight: bold;
line-height: 12px;

}
.close:before {
color: rgba(255, 255, 255, 0.9);
content: "X";
text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
font-size: 12px;
}
.close:hover {
background-color: rgba(252, 20, 0, 0.8);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);    
}
.popup p, .popup div {
margin-bottom: 10px;
}

.popup h2 { /* заголовок 2 */
color: #80c468;
text-align: left;
text-shadow: 0 1px 3px rgba(0,0,0,.3);
font-size: 22px;
}
