/* Compatibility/behaviour layer for the Django rebuild. */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
.ip-header { display:none !important; }

/* The original theme expects JS to toggle these states. */
.vc_tta-pageable .vc_tta-panels {
    overflow: hidden;
}

.vc_tta-pageable .vc_tta-panel {
    display: none;
}

.vc_tta-pageable .vc_tta-panel.vc_active {
    display: block;
}

.vc_tta-pageable .vc_tta-panels {
    position: relative;
}

.vc_tta-pageable .vc_tta-panels-container {
    position: relative;
}

.vc_tta-pageable .vc_pagination {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.security-arrow-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.security-arrow {
    width: 28px;
    height: 28px;

    padding: 0;
    border: 0;
    background: transparent;

    font-size: 22px;
    font-weight: 300;
    line-height: 1;

    color: #777;
    cursor: pointer;
    opacity: 0.65;

    transition: opacity 0.2s ease;
}

.security-arrow:hover {
    opacity: 1;
}

@keyframes slideFromBottom {
    from {
        opacity: 0;
        transform: translateY(35px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideFromTop {
    from {
        opacity: 0;
        transform: translateY(-35px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Security Awareness: новая страница наезжает на предыдущую */

.vc_tta-pageable .vc_tta-panels {
    position: relative;
    overflow: hidden;
}

.vc_tta-pageable .vc_tta-panel.security-slide-old {
    display: block;
    position: relative;
    z-index: 1;
}

.vc_tta-pageable .vc_tta-panel.security-slide-new {
    display: block;
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
}

.vc_tta-pageable .vc_tta-panel.security-slide-from-bottom {
    animation: securitySlideFromBottom 0.25s ease both;
}

.vc_tta-pageable .vc_tta-panel.security-slide-from-top {
    animation: securitySlideFromTop 0.25s ease both;
}

@keyframes securitySlideFromBottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes securitySlideFromTop {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Обычные вкладки, например Projects */
.vc_tta-tabs .vc_tta-panel {
    display: none;
}

.vc_tta-tabs .vc_tta-panel.vc_active {
    display: block;
}

.vc_tta-panel.vc_active .vc_tta-panel-body { display:block !important; height:auto !important; opacity:1 !important; visibility:visible !important; }

/* Fixed navbar offset and smooth anchor behaviour. */
section[id] { scroll-margin-top: 85px; }

/* Lightweight language dropdown without Bootstrap JS. */
.navbar .dropdown-menu { display:none; }
.navbar .dropdown.open > .dropdown-menu { display:block; }

@media (max-width: 767px) {
  .navbar-collapse { display:none; }
  .navbar-collapse.open { display:block; }
}

body #s-about-me > .vc_row {
    padding-top: 20px !important;
}

/* Projects: новая вкладка наезжает поверх предыдущей */

.vc_tta-tabs:not(.vc_tta-pageable) .vc_tta-panels {
    position: relative;
    overflow: hidden;
}

.vc_tta-tabs:not(.vc_tta-pageable) .vc_tta-panel.project-slide-old {
    display: block;
    position: relative;
    z-index: 1;
}

.vc_tta-tabs:not(.vc_tta-pageable) .vc_tta-panel.project-slide-new {
    display: block;
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    background: #f7f7f7;
}

.vc_tta-tabs:not(.vc_tta-pageable) .vc_tta-panel.project-slide-from-bottom {
    animation: projectSlideFromBottom 0.25s ease both;
}

.vc_tta-tabs:not(.vc_tta-pageable) .vc_tta-panel.project-slide-from-top {
    animation: projectSlideFromTop 0.25s ease both;
}

.project-detail-section > .vc_row {
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
}

@keyframes projectSlideFromBottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes projectSlideFromTop {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Contacts */

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    margin-left: 20px;
    margin-right: 20px;
}

.contact-grid-item {
    margin-bottom: 30px;
}

.contact-grid-item .vc_column-inner,
.contact-grid-item .wpb_wrapper {
    height: 100%;
}

.contact-tile {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 110px;
    padding: 25px 30px;
    background: #f7f7f7;
    color: #444;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

a.contact-tile:hover,
a.contact-tile:focus {
    background: #ebebeb;
    color: #444;
    text-decoration: none;
}

.contact-tile-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-right: 16px;
    object-fit: contain;
}

.contact-tile-text {
    min-width: 0;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    font-weight: 300;
    overflow-wrap: anywhere;
}

.backToTop {
    margin-bottom: 30px;
}

.ThickBorder .bottom {
    display: none !important;
}

.borderedWrapper {
    padding-bottom: 0 !important;
}

@media screen and (max-width: 767px) {
    .contact-grid {
        display: block;
        margin-left: 10px;
        margin-right: 10px;
    }

    .contact-grid-item {
        width: 100%;
        margin-bottom: 30px;
    }

    .back-to-top-icon {
        display: block;
        width: 28px;
        height: 28px;
        margin: 0 auto 6px;
        object-fit: contain;
    }
}

/* Skills grid */

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 30px;
}

.skills-grid::before,
.skills-grid::after {
    display: none !important;
}

.skill-grid-item {
    float: none !important;
}

@media screen and (max-width: 767px) {
    .skills-grid {
        display: block;
    }

    .skill-grid-item {
        width: 100%;
    }
}

/* Skills grid */

#s-skills .skills-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    row-gap: 30px;
}

#s-skills .skills-grid::before,
#s-skills .skills-grid::after {
    display: none !important;
    content: none !important;
}

#s-skills .skills-grid > .skill-grid-item {
    float: none !important;
    width: 33.33333333%;
}

@media screen and (max-width: 767px) {
    #s-skills .skills-grid {
        display: block !important;
    }

    #s-skills .skills-grid > .skill-grid-item {
        width: 100%;
    }
}

/* Project detail: CKEditor image alignment */

.project-detail-section figure.image {
    max-width: 100%;
}

.project-detail-section figure.image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.project-detail-section figure.image.image-style-block-align-left {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.project-detail-section figure.image.image-style-align-center {
    margin-left: auto !important;
    margin-right: auto !important;
}

.project-detail-section figure.image.image-style-block-align-right {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Project detail: back to projects */

.project-back {
    margin-bottom: 25px;
    text-align: right;
}

.project-back a {
    display: inline-block;
    color: #aaa;
    font-family: "Open Sans", sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.project-back a:hover,
.project-back a:focus {
    color: #777;
    text-decoration: none;
}


/* CKEditor tables on project pages */

/* Tables and cells are borderless by default */
.project-detail-section figure.table,
.project-detail-section figure.table table,
.project-detail-section figure.table td,
.project-detail-section figure.table th {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Explicit borders selected in CKEditor */
.project-detail-section figure.table table[style*="border-style:solid"],
.project-detail-section figure.table td[style*="border-style:solid"],
.project-detail-section figure.table th[style*="border-style:solid"] {
    border-style: solid !important;
}

.project-detail-section figure.table table[style*="border-style:dashed"],
.project-detail-section figure.table td[style*="border-style:dashed"],
.project-detail-section figure.table th[style*="border-style:dashed"] {
    border-style: dashed !important;
}

.project-detail-section figure.table table[style*="border-style:dotted"],
.project-detail-section figure.table td[style*="border-style:dotted"],
.project-detail-section figure.table th[style*="border-style:dotted"] {
    border-style: dotted !important;
}

/* CKEditor table text alignment */

.project-detail-section figure.table td,
.project-detail-section figure.table th {
    text-align: left !important;
}

.project-detail-section figure.table td[style*="text-align:center"],
.project-detail-section figure.table th[style*="text-align:center"] {
    text-align: center !important;
}

.project-detail-section figure.table td[style*="text-align:right"],
.project-detail-section figure.table th[style*="text-align:right"] {
    text-align: right !important;
}

.project-detail-section figure.table td[style*="text-align:left"],
.project-detail-section figure.table th[style*="text-align:left"] {
    text-align: left !important;
}

/* Links in project text */

.project-detail-body a {
    text-decoration: underline;
}

.project-detail-body a:hover,
.project-detail-body a:focus {
    text-decoration: underline;
}

/* Lectures page */

.lectures-section > .vc_row {
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.lectures-list {
    margin-top: 35px;
}

.lecture-item {
    display: flex;
    align-items: flex-start;
    gap: 35px;
    margin-bottom: 50px;
}

.lecture-image {
    flex: 0 0 300px;
}

.lecture-image img {
    display: block;
    width: 100%;
    height: auto;
}

.lecture-content {
    flex: 1;
    min-width: 0;
}

.lecture-content h2 {
    margin-top: 0;
    font-family: "Open Sans", sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.lecture-text a {
    text-decoration: underline;
}

@media screen and (max-width: 767px) {
    .lecture-item {
        display: block;
    }

    .lecture-image {
        width: 100%;
        margin-bottom: 20px;
    }
}

.lectures-toc {
    margin: 20px 0 40px;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    line-height: 1.8;
}

.lectures-toc ol {
    margin: 0;
    padding-left: 25px;
}

.lectures-toc li {
    display: list-item;
}

.lectures-toc a {
    text-decoration: none;
}

.lectures-toc a:hover,
.lectures-toc a:focus {
    text-decoration: none;
}

.lecture-item {
    scroll-margin-top: 100px;
}