:root {

    --dred: #C00707;
    --dorange: #FF4400;
    --dyellow: #FFB33F;
    --dblue: #134E8E;
    --dsky: #8CE4FF;
    --dfooter: #a16253;
    --dgreen: darkgreen;
}

.clr {
    color:
        #8CE4FF #FEEE91 #FFA239 #FF5656 brown darkgreen darkgrey #e0e0e0;

}

.test {}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #F0F0F0;
}

/* Общая настройка высоты */
html,
body {
    height: 100%;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

/* Flexbox для body */
body {
    display: flex;
    flex-direction: column;
}

/* Header */


header * {
    background-color: var(--dyellow);
    width: auto;

}

/* Основное содержимое */
main {
    flex: 1 0 auto;
    padding: 1rem;
}

/* Footer прижат к низу */
footer {
    flex-shrink: 0;
    background-color: var(--dfooter);
    color: #F0F0F0;
    padding: 5px;
    width: 99vw;
    margin: 0;
    font-size: 1.1rem;
}

footer * {
    background-color: inherit;
}


nav {
    font-size: 1.1rem;
    color: white;
    background-color: inherit;
    display: flex;
    flex-direction: column;
    border: 3px double white;
    padding-left: 5px;
    padding-right: 5px;




}

nav a,
span,
nav a:visited {
    background-color: inherit;
    border: none;
}

a,
a:visited {
    color: #0A0A0A;
    background-color: inherit;
}



h1 {

    font-family: Bergamasco, 'Times New Roman', Times, serif;
    font-size: 2rem;
    text-align: center;

}

h2 {
    margin: 0;
    padding: 2px;
    background-color: inherit;
    color: var(--dorange);
    font-weight: bold;
    font-family: h2font;
    font-size: 4.5rem;
    text-align: center;

}



h3 {
    color: var(--dorange);
    font-weight: bold;
    font-family: Bergamasco;
    font-size: 1.5rem;
}

h4 {
    color: var(--dgreen);
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-weight: bold;
    font-size: 1.3rem;
}

#tmodal {
    width: 100dvw;
    height: 100dvh;
    background-color: #000000;
    top: 0;
    left: 0;
    z-index: 2;
    position: absolute;
    display: none;
    text-align: center;
}

/* #originalimg {
    margin-top: 2vh;
    z-index: 4;
}
 */
.modalimg {
    width: 42px;
    background-color: transparent;
    cursor: pointer;
}

.tmodalimg {
    width: 32px;
    background-color: transparent;
    cursor: pointer;
    right: 4px;
}

#modalmenu {
    display: flex;
    flex-direction: column;
    background-color: #00000050;
    position: absolute;
    width: 40px;
    top: 1.8vh;
    left: 1.8vh;
    border-radius: 10px;
    padding: 5px;


}

.preview {
    cursor: pointer;
}

.card {
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: grid;
    grid-template-rows: 27px auto;
    align-content: center;
    float:left;

}
/*
;
                            margin:4px;
                            padding:4px;
                            border: 1px solid #ddd;
                            border-radius: 12px;
                            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
                            */

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card__header {
    padding: 5px 7px;
    display: flex;
    align-items: center;

    gap: 4px;
    background-color: #fff;
}



.card__body img {
    width: 320px;
    height: 240px;
    overflow: hidden;
    object-fit: scale-down;
    object-position: top center;
    border-radius: 0 0 12px 12px;
}

.card__body_img {
    width: 320px;
    height: 240px;
    object-fit: scale-down;
    border-radius: 0 0 12px 12px;
}

.card__btn  {
    cursor: pointer;
    width: 28px;
    height: 28px;
    padding: 0;

}
.imgcard{
     cursor: pointer;
}
.card__btn:hover {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);

    /*border-radius: 50%;*/
}

.card__title {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.card__street-header {
    flex: 1 0 100%;
    color: #3b7ec1;

    margin: 10px 0 8px 0;
    border-bottom: 2px solid #e0e0e0;
    transform: fl
}

.legend {

    display: grid;
    grid-template-columns: 32px 150px;
    margin: 1px;
    padding: 2px;
    row-gap: 4px;
    background-color: inherit;


}

.legend1 {
    width: 190px;
    margin: 1px;
    padding: 2px;
    display: grid;
    grid-template-columns: 32px auto;
    grid-template-rows: auto auto auto;
    color: var(--dblue);
    align-items: start;
    align-content: start;
}

header {
    background-color: var(--dyellow);
    color: #F0F0F0;
    padding: 4px;
    margin: 0px;

    gap: 2px;
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: 1fr auto;
    /*display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    */


    /*grid-template-columns: auto 200px;*/
}

#planka {
    background-color: white;
    margin-top: -12px;
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    grid-template-rows: auto;

    padding: 5px;
}



#itemmenu {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-self: auto;
    background-color: inherit;


}

#itemmenu a {
    margin: 2px;
    padding: 2px;
}


@media (max-width: 767px) {


    /* стили только для смартфонов */
    #dtschemeid {
        display: none;
    }

    #buildingscheme {
        /*transform-origin: bottom left;*/
        /*transform: rotateY(-90deg);*/
        max-width: 95vw;
    }

    #itemmenu {
        margin: 5px 0px;
        padding: 5px 0;
        /*border-bottom: 2px solid var(--dblue);*/
        /*border-top: 2px solid var(--dblue);*/
    }

    #planka {
        grid-template-rows: auto auto auto;
        gap: 4px;
        background-color: white;
        /*border: 1px solid var(--dblue);
        border-radius: 5px;*/
        justify-content: space-between;
        grid-template-columns: auto;
        margin: auto;
    }



    h1,
    h2,
    h3,
    h4 {
        font-family: Verdana, Geneva, Tahoma, sans-serif;
        break-after: avoid;
    }

    h1 {
        font-size: 2.0em;
        text-align: left;
        margin-left: 1em;
        font-weight: bold;
        color: white;

    }

    h2 {
        font-size: 1.4em;
        width: auto;
        background-color: inherit;
        text-align: left;
    }

    h3 {
        font-size: 1.2em;


    }

    h4 {
        font-size: 1.1em;
    }

    #list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
        flex-direction: column;

    }

    .card {
        border: 1px solid #ddd;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
        display: grid;
        width: 91vw;
        grid-template-columns: 90vw;
        grid-template-rows: 40px auto;
        align-content: center;
        text-align: center;
    }

    p,
    div,
    li,
    a,
    span {
        font-size: 1.05em;
    }

    option,
    select {
        font-size: 1.1em;
    }

    #itemmenu {
        border-top: 2px solid var(--dblue);
    }

    header {
        gap: 2px;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    nav {

        margin-left: 1em;
        justify-self: left
    }
}

@media (min-width: 768px) and (max-width: 1600px) {
    /* Стили для планшетов */
}

@media (min-width: 768px) {

    #planka {
        border: 1px var(--dblue) solid;
        border-radius: 5px;
        grid-template-columns: auto auto auto;
        justify-content: space-between;
        grid-template-rows: auto;
    }

    @font-face {
        font-family: 'Bergamasco';
        src: url('font/bergamasco/Bergamasco Regular.ttf');
    }

    @font-face {
        font-family: 'SapphireSativa';
        src: url('font/SapphireSativa/SapphireSativa.otf');
    }


    @font-face {
        font-family: 'h2font';
        src: url('font/allegretto/allegretto.ttf');
    }

    header {

        border-image: url(img/border.png);
        border-image-slice: 29 28 23 28;
        border-image-repeat: repeat;

        border-width: 29px 28px 23px 28px;
        border-style: solid;
        box-sizing: border-box;
    }

    #list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: start;

    }

    .card {
        border: 1px solid #ddd;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
        display: grid;
        grid-template-columns: 320px;
        grid-template-rows: 40px auto;
        align-content: center;
    }

}

div,
a {
    background-color: inherit;
}

.stroked-text {
    -webkit-text-stroke: 1px white;

}

#listselect {
    border: 2px solid var(--dfooter);
    font-size: 1.2rem;
    color: var(--dblue);

}

option {
    border: none;
}

.grayscale {
    filter: grayscale(0.9)
}