/* ==========================================================================
   Portfolio item pop-ups
   Clickable portfolio items (those with a <template class="portfolio-item-more">)
   open a modal with the project image, title, engine, description and links.
   Behaviour is wired up in assets/js/portfolio.js.
   ========================================================================== */

/* --- Clickable affordance ------------------------------------------------ */
.portfolio-item--clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.portfolio-item--clickable:hover,
.portfolio-item--clickable:focus-visible {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    outline: none;
}

/* --- Modal --------------------------------------------------------------- */
/* Reserve the scrollbar gutter so hiding page overflow while the modal is
   open doesn't reclaim the scrollbar's width and reflow/shift the page. */
html {
    scrollbar-gutter: stable;
}

.portfolio-modal[hidden] {
    display: none;
}

.portfolio-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portfolio-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

body.portfolio-modal-open {
    overflow: hidden;
}

.portfolio-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    animation: portfolio-modal-in 0.18s ease-out;
}

@keyframes portfolio-modal-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.portfolio-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.portfolio-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.75);
}

.portfolio-modal-media {
    background-color: #f2f2f2;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    line-height: 0;
}

.portfolio-modal-img {
    display: block;
    width: 100%;
    height: auto;
}

.portfolio-modal-body {
    padding: 22px 26px 26px;
}

.portfolio-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.portfolio-modal-subtitle {
    font-size: 13px;
    color: #8f8f8f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.portfolio-modal-content {
    font-size: 17px;
    line-height: 1.6;
    color: #4a4a4a;
}

.portfolio-modal-content p {
    margin-bottom: 14px;
}

/* --- Links --------------------------------------------------------------- */
.portfolio-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.portfolio-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: #0067f6;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.portfolio-links a:hover {
    background-color: #0052c4;
    text-decoration: none;
    color: #ffffff;
}
