/* Scoped adjustments preserve the desktop theme and Bootstrap collapse behavior. */
#project .portal-card-link { display: block; position: relative; color: inherit; text-decoration: none; }
#project .portal-card-link:focus-visible { outline: 3px solid #f36700; outline-offset: 4px; }
#myModal .modal-dialog { max-width: min(1630px, 96vw); }
#myModal .contact-img { display: block; width: 100%; height: auto; }
@media (max-width: 991.98px) {
    .frontend-one-page header #main-nav { height: auto; background: #f06f00; }
    #main-nav::before, #main-nav .container-fluid.bg-below { display: none !important; }
    #main-nav > .container { flex-wrap: wrap; }
    #main-nav #logo img { width: auto; max-width: 100%; height: 56px; }
    #main-nav #navbarMain { flex-basis: 100%; max-height: 70vh; overflow-y: auto; }
    #main-nav #navbarMain.collapse:not(.show) { display: none !important; }
    #main-nav #navbarMain.collapse.show { display: block !important; }
    #main-nav .navbar-nav.main-menu { flex-direction: column; align-items: center !important; gap: .25rem; width: 100%; margin: 0; background: transparent; box-shadow: none !important; }
    #main-nav .main-menu > li { float: none; width: 100%; text-align: center; }
    #main-nav .main-menu > li > a.nav-link { color: #111 !important; height: auto; line-height: 1.5; padding: .65rem 1rem; }
    .frontend-one-page #process .step .box > .row > [class*="col-md-"] { width: 100%; flex: 0 0 100%; }
    .frontend-one-page #process .step .text-wrap .text-content { position: relative; padding: 24px; width: auto; }
    .frontend-one-page #process .step .text-wrap { height: auto; min-height: 0; }
    .frontend-one-page #process .step .img-wrap { height: auto; }
    .frontend-one-page #process .step .img-wrap img { width: 100%; height: auto; }
    .frontend-one-page #process .step .arco-lean-invi { display: none; }
    .frontend-one-page #process .step.right .box > .row { flex-direction: column-reverse; }
    #service .custom_overlay_image_container { padding-right: 12px; padding-left: 12px; }
    #service .row.g-0 > .col-md-9 { width: 100%; }
    #service .col-sm-4 { width: 50%; }
    .frontend-one-page #service h4.service-title { height: auto; min-height: 64px; overflow-wrap: break-word; }
}
@media (max-width: 575.98px) {
    #service .col-sm-4 { width: 100%; }
    .frontend-one-page #process .step .step-icon { margin: 12px auto 24px; }
    .frontend-one-page #process .step .step-icon:after { display: none; }
    .frontend-one-page #process .step .text-wrap .text-content { padding: 20px; }
    .frontend-one-page .title-section { font-size: clamp(32px, 9vw, 50px); overflow-wrap: break-word; }
    .frontend-one-page .subtitle-section { font-size: clamp(21px, 6vw, 30px); }
}

/* Keep navigation on one line before switching to the compact menu. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    #main-nav .navbar-nav.main-menu { gap: 0; }
    #main-nav .main-menu > li > a.nav-link { font-size: .85rem; padding-left: .55rem; padding-right: .55rem; }
    #main-nav #logo img { max-width: 150px; height: auto; }
}
/* Let timeline entries grow with their text before drawing the blue band. */
.frontend-one-page #about .box-content {
    height: auto;
    min-height: 200px;
    padding-bottom: 24px;
}
.frontend-one-page #about .box-content > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    column-gap: 20px;
    align-items: start;
}
.frontend-one-page #about .box-content h4.title-time {
    grid-column: 1;
    grid-row: 1;
    float: none;
    line-height: 1.2;
}
.frontend-one-page #about .box-content p.detail {
    grid-column: 1;
    grid-row: 2;
    float: none;
    width: auto;
    margin: 0;
    overflow-wrap: break-word;
}
.frontend-one-page #about .box-content .img-effect {
    grid-column: 2;
    grid-row: 1 / 3;
    float: none;
}
@media (min-width: 992px) {
    .frontend-one-page #about #about-carousel .item {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        grid-template-rows: auto 45px auto;
    }
    .frontend-one-page #about #about-carousel article.year {
        display: contents;
    }
    .frontend-one-page #about .box-content {
        width: min(400px, calc(100% - 50px));
    }
    .frontend-one-page #about .year.even > .box-content:not(.below) {
        grid-column: 1;
        grid-row: 1;
    }
    .frontend-one-page #about .year.odd > .box-content {
        grid-column: 2;
        grid-row: 1;
    }
    .frontend-one-page #about .year.even > .line-time {
        grid-column: 1;
        grid-row: 2;
    }
    .frontend-one-page #about .year.odd > .line-time {
        grid-column: 2;
        grid-row: 2;
    }
    .frontend-one-page #about .year.even > .box-content.below {
        grid-column: 1;
        grid-row: 3;
        width: 400px;
    }
}
@media (min-width: 992px) and (max-width: 1200px) {
    .frontend-one-page #about #about-carousel .item {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}
@media (max-width: 991.98px) {
    .frontend-one-page #about .history {
        padding: 0;
    }
    .frontend-one-page #about .box-content,
    .frontend-one-page #about .box-content.below {
        width: calc(100% - 70px);
        margin-left: 70px;
        padding-top: 0;
    }
}
@media (max-width: 575.98px) {
    .frontend-one-page #about .box-content > div {
        grid-template-columns: minmax(0, 1fr) 100px;
        column-gap: 12px;
    }
    .frontend-one-page #about .box-content .img-effect {
        width: 100px;
        height: 100px;
    }
    .frontend-one-page #about .box-content .img-effect:after {
        width: 100%;
        height: 100%;
    }
}


/* Avoid accidental browser selection while opening or dragging the directory. */
#project .portal-card-link[data-bs-target="#myModal"],
#myModal .contact-img {
    -webkit-user-select: none;
    user-select: none;
}
#myModal .contact-img {
    -webkit-user-drag: none;
}
