/*
 * DISI – site styles
 * Keeps the original design (2011), cleaned up and extended with a mobile version.
 * Mobile-first: base = mobile, from 1000 px = the original desktop layout (990 px).
 */

:root {
    --c-yellow: #ffcb08;
    --c-yellow-line: #fbce14;
    --c-yellow-light: #fdeca9;
    --c-yellow-title: #f3c311;
    --c-bg: #fff4cb;
    --c-navy: #1c3042;
    --c-navy-dark: #122538;
    --c-navy-text: #152538;
    --c-link: #0068cf;
    --c-link-2: #0d6eb6;
    --c-doc: #1b6aaa;
    --c-muted: #4e6d91;
    --c-years: #8fb9d6;
    --nav-grad: linear-gradient(to bottom, #1f3143 0%, #122435 100%);
    --font: Arial, Helvetica, sans-serif;
    --font-text: Tahoma, Verdana, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--c-bg) url(../../images/bg-1.jpg) repeat-x top center;
    font-family: var(--font);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 0 50px;
    background: url(../../images/grid.png) no-repeat center 101px;
    color: #222;
}

a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }
a img { border: 0; }
img { max-width: 100%; height: auto; }

.alt {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute; left: -9999px; top: 0;
    background: #fff; padding: 8px 12px; z-index: 1000;
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }

p {
    margin: 15px 0;
    font-size: 14px;
    font-family: var(--font-text);
    line-height: 1.65;
}

/* --- Buttons --------------------------------------------------------------- */

.button1 {
    display: inline-block;
    padding: 10px 25px;
    font-size: 12px;
    border: 0;
    border-radius: 3px;
    background: linear-gradient(to bottom, #fefefe 0%, #efefef 100%);
    box-shadow: 0 1px 0 #d6d4d4;
    color: var(--c-link);
    font-family: var(--font);
    cursor: pointer;
}
.button1:hover {
    text-decoration: none;
    background: linear-gradient(to bottom, #f1f1f1 0%, #dddddd 100%);
    box-shadow: 0 1px 0 #c6c4c4;
}

.button2 {
    display: inline-block;
    color: var(--c-link-2);
    border: 1px solid #3d8bc5;
    border-radius: 5px;
    font-weight: bold;
    padding: 7px 26px 7px 7px;
    font-size: 13px;
    font-family: Tahoma, sans-serif;
    background: url(../../images/arrow-right.png) no-repeat right center;
}
.button2:hover { text-decoration: none; background-color: #d5e4ef; }

.linklike {
    background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: inherit; cursor: pointer; text-decoration: underline;
}

/* --- Layout: mobile ------------------------------------------------------- */

#wrapper {
    position: relative;
    margin: 0 auto;
    max-width: 990px;
}

#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 16px 22px;
}

#logo {
    display: block;
    flex: none;
    /* on mobile only the "///DISI" mark (left part of the logo) */
    width: 160px;
    height: 32px;
    background: url(../../images/logo.png) no-repeat left center;
    background-size: auto 32px;
}

#nav-toggle {
    display: none;   /* shown only with JS */
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 4px;
    background: rgba(18,36,53,.6);
    color: #e6edf3;
    font: bold 13px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 9px 12px;
    cursor: pointer;
}
.js #nav-toggle { display: inline-flex; }
#nav-toggle .bars,
#nav-toggle .bars::before,
#nav-toggle .bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
#nav-toggle .bars::before, #nav-toggle .bars::after { content: ''; position: absolute; left: 0; }
#nav-toggle .bars::before { top: -6px; }
#nav-toggle .bars::after { top: 6px; }

#nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.js #nav-wrap { display: none; }
.js #nav-wrap.open { display: block; }

#nav li {
    position: relative;
    height: 52px;
    background: var(--nav-grad);
    border-top: 1px solid rgba(255,255,255,.06);
}
#nav li:hover { background: linear-gradient(to bottom, #415160 0%, #344554 100%); }
#nav li.active { background: #fff; }

#nav li a {
    display: block;
    width: 100%;
    height: 100%;
    background-position: 24px center;
    background-repeat: no-repeat;
}
#nav .uvod a { background-image: url(../../images/m-uvod.png); }
#nav .profil a { background-image: url(../../images/m-profil-1.png); }
#nav .projekty a { background-image: url(../../images/m-projekty-1.png); }
#nav .elektroenergetika a { background-image: url(../../images/m-elektro-1.png); }
#nav .architekt a { background-image: url(../../images/m-architekt-1.png); }
#nav .kontakt a { background-image: url(../../images/m-kontakt-1.png); }

#content {
    position: relative;
    background: #fff;
    padding: 6px 16px 36px;
    min-height: 300px;
}
#content::after { content: ''; display: table; clear: both; }

/* --- Footer ---------------------------------------------------------------- */

#footer {
    background: var(--c-yellow);
    padding: 24px 16px 20px;
    font-size: 12px;
    color: var(--c-navy);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 40px;
}
#footer .teasers { display: flex; gap: 30px; align-items: center; }
#footer .teaser { display: block; flex: none; }
#footer .teaser.dubovy { background: url(../../images/dubovy.png) no-repeat; width: 136px; height: 62px; }
#footer .teaser.molo { background: url(../../images/molo.png) no-repeat; width: 151px; height: 64px; }
#footer .links a.link { color: var(--c-link-2); display: block; margin-bottom: 10px; font-weight: bold; }
#footer .links a.less { color: var(--c-navy); }
#footer .links span { display: block; margin-bottom: 8px; }
#footer .small, #footer .small a { color: var(--c-navy); font-size: 11px; }

/* --- Headings (original image headings) ------------------------------------ */

h1 {
    margin: 26px 0 10px;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: normal;
    color: var(--c-yellow-title);
    text-transform: uppercase;
    letter-spacing: .02em;
}

h1.img-heading {
    height: 20px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left top;
    padding: 0;
    margin-bottom: 20px;
}
#content.profil h1.img-heading { background-image: url(../../images/h-profil.png); max-width: 296px; }
#content.projekty h1.img-heading { background-image: url(../../images/h-projekty.png); max-width: 342px; }
#content.realizacie h1.img-heading { background-image: url(../../images/h-realizacie.png); max-width: 339px; }
#content.kontakt h1.img-heading { background-image: url(../../images/h-kontakt.png); height: 17px; max-width: 90px; }
#content.architekt h1.img-heading { background-image: url(../../images/h-architekt.png); height: 17px; max-width: 110px; }
#content.elektroenergetika h1.img-heading { background-image: url(../../images/h-elektro.png); height: 17px; max-width: 125px; }
#content.default h1.img-heading {
    background-image: url(../../images/index-headline.png);
    height: auto;
    aspect-ratio: 478 / 85;
    max-width: 478px;
}

/* --- Notice ---------------------------------------------------------------- */

.oznam {
    background: var(--c-yellow);
    color: #000;
    padding: 10px 14px;
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
.oznam a { color: #000; text-decoration: underline; }

/* --- Home ------------------------------------------------------------------ */

#content.default { padding-bottom: 0; }
#content.default .perex { margin-bottom: 25px; }
.home-photo {
    display: block;
    width: calc(100% + 32px);
    max-width: none;
    margin: 30px -16px 0;   /* #content.default has no bottom padding, so no negative margin */
}

/* --- Contact (Profil, Kontakt) --------------------------------------------- */

.contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0 50px;
    margin: 24px 0;
}
.contact p { margin: 0 0 12px; }

.map {
    position: relative;
    aspect-ratio: 510 / 450;
    max-height: 450px;
    background: #f3f1e8;
    border: 1px solid #ece6cf;
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
}
.map-placeholder p { font-size: 13px; color: var(--c-muted); margin: 8px 0; }

#content.profil .more { margin: 6px 0 0; }
#content.realizacie .more { margin: 6px 0 19px; }
p.links a { display: block; font-weight: bold; }

/* --- Submenu --------------------------------------------------------------- */

#content ul.subnav {
    list-style: none;
    margin: 0;
    padding: 0 0 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 30px;
    border-bottom: 1px solid var(--c-yellow-line);
}

/* --- Projects -------------------------------------------------------------- */

#content .project {
    position: relative;
    background: var(--c-yellow-light);
    margin-bottom: 30px;
}
#content .project h2 { margin: 0; padding: 20px 64px 5px 20px; font-size: 18px; }
#content .project h2 a { color: var(--c-navy-text); }
#content .project .more {
    display: block;
    position: absolute; top: 20px; right: 20px;
    width: 28px; height: 9px;
    background: url(../../images/arrow.png);
}
#content .project .more::before { content: ''; position: absolute; inset: -14px; } /* larger touch target */
#content .project .perex { font-size: 13px; color: var(--c-muted); margin: 0; padding: 0 20px 16px; }
#content .project .perex a { color: var(--c-muted); }
#content .project .preview {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
#content .project .preview li { aspect-ratio: 255 / 125; overflow: hidden; }
#content .project .preview a { display: block; height: 100%; }
#content .project .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

#content.projektyDetail .subnav .more {
    display: block;
    padding-left: 35px;
    min-height: 9px;
    background: url(../../images/arrow-2.png) no-repeat left center;
    color: var(--c-navy-text);
    font-size: 14px;
}
#content.projektyDetail h2 { color: var(--c-navy-text); }
#content.projektyDetail p.description { color: var(--c-muted); font-size: 13px; margin-bottom: 5px; }
#content.projektyDetail p.link { margin-top: 5px; }
#content.projektyDetail p.link a { color: var(--c-navy-text); font-size: 13px; }

.gallery {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 2px;
}
.gallery li { aspect-ratio: 1; overflow: hidden; }
.gallery a { display: block; height: 100%; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery a:hover::after {
    content: ''; position: absolute; inset: 0;
    background: var(--c-yellow); opacity: .4;
}

/* --- Architect ------------------------------------------------------------- */

#content.architekt > h1 + h2 { color: var(--c-navy-text); margin-top: 30px; font-size: 20px; }
#content.architekt .perex { color: var(--c-muted); }
#content.architekt .image { display: none; }
#content.architekt h3 {
    color: var(--c-yellow-title);
    font-size: 24px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--c-yellow-line);
}

/* --- Energy ---------------------------------------------------------------- */

#content.elektroenergetika .crossroad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 20px 0 20px;
    border-top: 1px solid var(--c-yellow-line);
    border-bottom: 1px solid var(--c-yellow-line);
    margin-bottom: 40px;
}
#content.elektroenergetika .crossroad a {
    display: block;
    aspect-ratio: 165 / 184;
    background-size: 100% 200%;   /* image = 2 states stacked (normal / hover) */
    background-repeat: no-repeat;
    background-position: 0 0;
}
#content.elektroenergetika .crossroad a:hover { background-position: 0 100%; }
#content.elektroenergetika .crossroad a.domacnosti { background-image: url(../../images/energetika-domacnosti.jpg); }
#content.elektroenergetika .crossroad a.firmy { background-image: url(../../images/energetika-firmy.jpg); }
#content.elektroenergetika .crossroad a.info { background-image: url(../../images/energetika-info.jpg); }
#content.elektroenergetika .crossroad a.archiv {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    width: 67px; height: 23px;
    margin-top: 12px;
    background: url(../../images/04_btn_archiv.png) 0 0;
}
#content.elektroenergetika .crossroad a.archiv:hover { background-position: 0 -23px; }

/* image submenu (3 states in one image: normal / hover / active) */
#content ul.energy-nav { border-bottom: 0; padding-bottom: 10px; }
#content ul.energy-nav a { display: block; height: 23px; background-repeat: no-repeat; background-position: 0 0; }
#content ul.energy-nav a.domacnosti { background-image: url(../../images/01_btn_domacnosti.png); width: 119px; }
#content ul.energy-nav a.firmy { background-image: url(../../images/02_btn_firmy.png); width: 56px; }
#content ul.energy-nav a.info { background-image: url(../../images/03_btn_informacie.png); width: 107px; }
#content ul.energy-nav a.archiv { background-image: url(../../images/04_btn_archiv.png); width: 67px; }
#content ul.energy-nav a:hover { background-position: 0 -23px; }
#content ul.energy-nav a.active { background-position: 0 -46px; }

#content ul.subnav.years {
    margin: 10px 0 0;
    gap: 8px 22px;
    border-bottom: 0;
    padding-bottom: 0;
}
#content ul.subnav.years a { color: var(--c-years); font-size: 14px; display: inline-block; padding: 4px 0; }
#content ul.subnav.years a:hover { color: #5f8eaa; text-decoration: none; }
#content ul.subnav.years a.active { color: #000; font-weight: bold; }

#content .perex { border-top: 1px solid var(--c-yellow-line); }
#content .perex::after { content: ''; display: table; clear: both; }
#content .perex img { float: left; width: 110px; margin: 20px 18px 6px 0; }
#content .perex h2 { margin: 18px 0 0; font-size: 20px; }
#content .perex p { color: var(--c-muted); }
#content .perex a { color: var(--c-navy-text); }

#content .files h2 {
    color: var(--c-yellow);
    margin-top: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--c-yellow-line);
}

#content.elektroenergetika h3 {
    clear: both;
    margin: 30px 0 0;
    padding: 20px 0 6px;
    border-top: 1px solid #000;
    color: var(--c-navy-dark);
    font-size: 16px;
}

ul.docs { list-style: none; margin: 0; padding: 0; }
ul.docs li { border-bottom: 1px solid #f3ecd2; }
ul.docs li:last-child { border-bottom: 0; }
a.doc {
    display: block;
    padding: 10px 0 10px 28px;
    color: var(--c-doc);
    background: url(../../images/pdf.png) no-repeat 0 12px;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.4;
}
a.doc:hover { text-decoration: underline; }
a.doc .doc-meta {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: normal;
    color: #8a96a3;
}

/* --- Cookies table --------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.cookies-table { border-collapse: collapse; width: 100%; font-size: 13px; font-family: var(--font-text); }
.cookies-table th, .cookies-table td { border-bottom: 1px solid #eee3bd; padding: 8px 6px; text-align: left; vertical-align: top; }
.cookies-table th { color: var(--c-navy-dark); }

/* --- Cookie bar ------------------------------------------------------------ */

.cookie-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    background: var(--nav-grad);
    color: #e6edf3;
    box-shadow: 0 -4px 18px rgba(0,0,0,.25);
    border-top: 3px solid var(--c-yellow);
}
.cookie-bar[hidden] { display: none; }
.cookie-inner { max-width: 990px; margin: 0 auto; padding: 14px 16px; }
.cookie-text { margin: 0 0 10px; font-size: 13px; color: #e6edf3; line-height: 1.5; }
.cookie-text a { color: var(--c-yellow); text-decoration: underline; }
.cookie-settings { margin: 0 0 12px; font-size: 13px; }
.cookie-settings label { display: block; margin: 6px 0; }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-btn {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 10px 16px;
    border: 1px solid var(--c-yellow);
    border-radius: 3px;
    background: var(--c-yellow);
    color: var(--c-navy-dark);
    font: bold 13px var(--font);
    cursor: pointer;
}
.cb-btn:hover { background: #ffd83f; }
.cb-btn.cb-link { background: transparent; color: #e6edf3; border-color: rgba(255,255,255,.4); }
.cb-btn[hidden] { display: none; }

/* --- Lightbox -------------------------------------------------------------- */

.lb-dialog {
    width: 100vw; height: 100vh; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0;
    background: rgba(10, 20, 30, .94);
    color: #fff;
}
.lb-dialog::backdrop { background: rgba(0,0,0,.6); }
.lb-dialog figure {
    margin: 0; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 50px 56px 20px;
}
.lb-dialog img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; }
.lb-dialog figcaption { margin-top: 10px; font-size: 14px; text-align: center; }
.lb-dialog button {
    position: absolute;
    background: none; border: 0; color: #fff;
    font-size: 44px; line-height: 1; padding: 10px 14px; cursor: pointer; opacity: .8;
}
.lb-dialog button:hover { opacity: 1; }
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.lb-close { right: 0; top: 0; }
.lb-count { position: absolute; left: 14px; top: 16px; font-size: 13px; opacity: .8; }

/* --- Small screens --------------------------------------------------------- */

@media (min-width: 560px) {
    /* the logo shrinks to leave room for the Menu button */
    #logo { flex: 1 1 0; min-width: 0; width: auto; max-width: 791px; height: auto; aspect-ratio: 791 / 47; background-size: contain; }
    #nav-toggle { flex: none; }
    #content .perex img { width: 172px; margin-right: 30px; }
    #content.architekt { background: #fff url(../../images/architekt.jpg) no-repeat top right; background-size: 160px auto; }
    #content.architekt > h1 + h2 { max-width: calc(100% - 180px); }
    #content.architekt.projektyDetail { background-image: none; }
    #content.architekt .image { display: block; float: right; width: 150px; height: 170px; }
}

/* --- Desktop: original 990 px layout --------------------------------------- */

@media (min-width: 1000px) {
    body { padding-bottom: 50px; }

    #wrapper { width: 990px; max-width: none; }

    #header { display: block; padding: 50px 0 65px 60px; }
    #logo { width: 792px; height: 47px; aspect-ratio: auto; background-size: auto; }
    .js #nav-toggle { display: none; }

    .js #nav-wrap, #nav-wrap {
        display: block;
        float: left;
        width: 249px;
        margin-left: 58px;
    }
    #nav li { height: 62px; border-top: 0; }
    #nav li::after {
        content: '';
        position: absolute; top: 0; right: 0;
        width: 8px; height: 100%;
        background: url(../../images/m-shadow.png) repeat-y;
        opacity: .2;
    }
    #nav li.active::after { display: none; }
    #nav li:hover { background: linear-gradient(to bottom, #f5f5f5 0%, #e1e1e1 100%); }
    #nav li.active:hover { background: #fff; }
    #nav li a { background-position: 25px center; }

    #content {
        float: left;
        width: 626px;
        padding: 10px 58px 50px;
        min-height: 344px;
    }

    p { font-size: 12px; line-height: 23px; }

    #footer {
        clear: both;
        display: flex;
        flex-wrap: nowrap;
        width: 625px;
        margin: 0 0 0 308px;
        padding: 30px 35px 25px;
        gap: 0;
    }
    #footer .teasers { gap: 50px; margin-right: 50px; }

    h1 { margin-top: 31px; }

    /* home: family photo bottom right as originally */
    #content.default { min-height: 450px; padding-bottom: 290px; }
    #content.default p.perex { width: 410px; }
    .home-photo { position: absolute; right: 0; bottom: 0; margin: 0; width: 524px; }

    .map { width: 510px; height: 450px; aspect-ratio: auto; }

    #content .project h2 { padding: 20px 64px 5px 30px; }
    #content .project .more { right: 30px; }
    #content .project .perex { padding: 0 30px 16px; }

    .gallery { grid-template-columns: repeat(4, 125px); gap: 2px; }
    #content.projektyDetail .gallery li { width: 125px; height: 125px; }

    #content.architekt { background-size: auto; }
    #content.architekt > h1 + h2 { width: 250px; margin-top: 40px; }
    #content.architekt .perex { border: 0; }
    #content.architekt .image { width: 215px; height: 250px; }

    #content.elektroenergetika .crossroad {
        grid-template-columns: 165px 166px 165px;
        padding: 20px 0 20px;
        margin-bottom: 50px;
    }
    #content.elektroenergetika .crossroad a { aspect-ratio: auto; height: 184px; background-size: auto; }
    #content.elektroenergetika .crossroad a.archiv { height: 23px; margin-top: 18px; }

    #content ul.subnav { gap: 10px 35px; }
    #content .perex img { margin-top: 20px; }
    #content .perex h2 { font-size: 1.5em; }

    a.doc { padding: 4px 0 5px 30px; margin-top: 6px; font-size: 12px; background-position: 0 5px; }
    ul.docs li { border-bottom: 0; }

    .cookie-inner { display: flex; align-items: center; gap: 24px; }
    .cookie-text { margin: 0; flex: 1; }
    .cookie-settings { margin: 0; }
    .cb-btn { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
