/* I AM EJ — Portfolio / category pages v1.2
 * Built to work WITH (not replace) the installed Adas Personal Portfolio
 * parent theme, adas-child/style.css, and Elementor's existing styles.
 *
 * The Homepage uses Elementor Canvas + a boxed Elementor container.
 * Escape Elementor Shortcode widget width constraints while keeping
 * the 1200px boxed width configured for the site.
 */

.e-con { --row-gap: var(--widgets-spacing-row, 0px) !important;}
.ej-portfolio-page,
.ej-portfolio-page * { box-sizing: border-box; }

.ej-portfolio-page {
    --ej-primary: var(--xa-primary, #FC6761);
    --ej-secondary: var(--xa-secondary, #273C66);
    --ej-panel: #e5e5e5;
    /* Unified to match the homepage's Elementor content width (1320px)
       so no page looks zoomed relative to another. */
    --ej-box-width: 1320px;

    /* Width is based on the original site's .container (1200px),
       not on a possibly narrower Elementor Shortcode widget. */
    width: min(var(--ej-box-width), calc(100vw - 32px));
    max-width: none;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 50px 0 48px;

    display: grid;
    /* Standardized to the 25/75 ratio used site-wide for 2-column pages. */
    grid-template-columns: minmax(0, 25fr) minmax(0, 75fr);
    align-items: stretch;
    font-family: inherit;  /* Homepage Poppins from Kirki/Elementor. */
    color: var(--ej-secondary);
}

/* Keep the shortcode wrapper from visually clipping the wider layout. */
.elementor-widget-shortcode:has(> .elementor-widget-container .ej-portfolio-page),
.elementor-widget-shortcode .elementor-widget-container:has(.ej-portfolio-page) {
    overflow: visible;
}

/* Left: match the coral column and white inset from the homepage. */
.ej-portfolio-page .ej-portfolio-sidebar {
    min-width: 0;
    background: var(--ej-primary);
    padding: 0px;
}
.ej-portfolio-page .ej-portfolio-profile {
    background: #fff;
    /* Match the homepage Elementor card padding (10px). */
    padding: 10px;
    text-align: center;
}
.ej-portfolio-page .ej-portfolio-photo {
    display: block;
    /* Match the homepage exactly: square photo that fills the white card,
       no border-radius (homepage uses 0px), no width cap. */
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 0;
    object-fit: cover;
    margin: 0 auto 10px;
}
.ej-portfolio-page .ej-portfolio-name {
    /* Typography inherited from the global theme/Elementor styles. */
    margin: 0 0 6px;
}
.ej-portfolio-page .ej-portfolio-bio {
    /* Typography inherited from the global theme/Elementor styles. */
    margin: 0 0 14px;
}
.ej-portfolio-page .ej-portfolio-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.ej-portfolio-page .ej-portfolio-social a {
    width: 28px;
    height: 28px;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #dce1e9;
    border-radius: 2px;
    color: var(--ej-secondary);
    text-decoration: none;
}
.ej-portfolio-page .ej-portfolio-social svg {
    display: block;
    /* Match the homepage social icon size (17px). */
    width: 17px;
    height: 17px;
    fill: currentColor;
}
.ej-portfolio-page .ej-portfolio-social a:hover,
.ej-portfolio-page .ej-portfolio-social a:focus-visible {
    color: var(--ej-primary);
    border-color: var(--ej-primary);
}
.ej-portfolio-page .ej-portfolio-menu {
    display: grid;
    gap: 7px;
}
.ej-portfolio-page .ej-portfolio-menu a {
    display: block;
    padding: 10px 8px;
    background: var(--ej-primary);
    color: #fff !important;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
}
.ej-portfolio-page .ej-portfolio-menu a[aria-current="page"] {
    background: var(--ej-secondary);
    pointer-events: none;
    cursor: default;
}
.ej-portfolio-page .ej-portfolio-menu a:not([aria-current="page"]):hover,
.ej-portfolio-page .ej-portfolio-menu a:not([aria-current="page"]):focus-visible {
    background: var(--ej-secondary);
    color: #fff !important;
}

/* Right: continuous gray panel, like Featured Projects on Home. */
.ej-portfolio-page .ej-portfolio-main {
    min-width: 0;
    background: #ffffff;
    padding: 40px 15px;
}
.ej-portfolio-page .ej-portfolio-intro {
    background: transparent;
    padding: 0;
    margin: 0 0 16px;
}
.ej-portfolio-page .ej-portfolio-kicker {
    display: block;
    margin: 0 0 5px;
    color: var(--ej-primary);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: .015em;
}
.ej-portfolio-page .ej-portfolio-intro h1 {
    /* Size/weight inherited from global heading typography. */
    margin: 0;
    color: var(--ej-secondary);
}
.ej-portfolio-page .ej-portfolio-intro p {
    /* Size inherited from global body typography. */
    margin: 8px 0 0;
    color: #666;
}
.ej-portfolio-page .ej-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
}
/* Single column of cards for the three-column layout. */
.ej-portfolio-page .ej-portfolio-grid--single {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
.ej-portfolio-page .ej-portfolio-card {
    min-width: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
}
.ej-portfolio-page .ej-portfolio-thumb-link {
    display: block;
    text-decoration: none;
    background: #fff;
    overflow: hidden;
}
.ej-portfolio-page .ej-portfolio-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 2.1 / 1;
    height: auto;
    object-fit: cover;
}
.ej-portfolio-page .ej-portfolio-no-image {
    aspect-ratio: 2.1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ej-secondary);
}
.ej-portfolio-page .ej-portfolio-card-body {
    padding: 7px 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ej-portfolio-page .ej-portfolio-card-title {
    margin: 0 0 7px;
    color: var(--ej-secondary);
    font-size: 18px;
    line-height: 1.45;
    font-weight: 600;
}
.ej-portfolio-page .ej-portfolio-card-title a {
    color: inherit;
    text-decoration: none;
}
.ej-portfolio-page .ej-portfolio-card-title a:hover,
.ej-portfolio-page .ej-portfolio-card-title a:focus-visible {
    color: var(--ej-primary);
}
.ej-portfolio-page .ej-portfolio-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 0 12px;
}
.ej-portfolio-page .ej-portfolio-badge {
    display: inline-block;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 500;
    line-height: 2;
    color: #fff !important;
    background: var(--ej-secondary);
    text-decoration: none;
}
.ej-portfolio-page .ej-portfolio-badge:hover,
.ej-portfolio-page .ej-portfolio-badge:focus-visible {
    color: #fff !important;
    background: var(--ej-primary);
}
.ej-portfolio-page .ej-portfolio-view {
    display: block;
    width: 100%;
    margin-top: auto;
    background: var(--ej-primary);
    color: #fff !important;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}
.ej-portfolio-page .ej-portfolio-view:hover,
.ej-portfolio-page .ej-portfolio-view:focus-visible {
    background: var(--ej-secondary);
    color: #fff !important;
}
.ej-portfolio-page .ej-portfolio-empty { grid-column: 1 / -1; }
.adas-personal-portfolio-footer {display:none;}
/* Category archive template doesn't use Elementor Canvas. */
body.ej-archive-page {
    margin: 0;
    background: #f0f0f0 url('https://iamej.dev/wp-content/uploads/2025/03/white-bg.webp') center top / cover fixed;
}
@media (max-width: 900px) {
    .ej-portfolio-page {
        grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
    }
    .ej-portfolio-page .ej-portfolio-grid { gap: 16px 10px; }
    .ej-portfolio-page .ej-portfolio-main { padding: 12px; }
}
@media (max-width: 700px) {
    .ej-portfolio-page {
        width: calc(100vw - 24px);
        grid-template-columns: minmax(0, 1fr);
        margin-top: 20px;
    }
    .ej-portfolio-page .ej-portfolio-sidebar { padding: 10px; }
    .ej-portfolio-page .ej-portfolio-photo { width: 112px; }
    .ej-portfolio-page .ej-portfolio-grid { gap: 16px 10px; }
}
@media (max-width: 490px) {
    .ej-portfolio-page .ej-portfolio-grid { grid-template-columns: 1fr; }
}

/* ===============================================================
 * Single post — three-column layout (profile | content | recent)
 * Matches the homepage's three-column format. Column 1 keeps the
 * same 25% sidebar; the remaining 75% is split between the post
 * content and a narrower recent-projects column.
 * =============================================================== */
.ej-portfolio-single {
    /* Fixed 300px profile sidebar to match the homepage, then content +
       similar-projects share the remaining space (roughly 2:1). */
    grid-template-columns: 300px minmax(0, 2fr) minmax(0, 1fr);
}

/* Post content column: white reading panel for legibility. */
.ej-portfolio-single .ej-portfolio-single-main {
    background: #fff;
    padding: 24px 28px;
}
.ej-portfolio-single .ej-portfolio-intro h1 {
    /* Inherit global heading size. */
    margin-bottom: 10px;
}
.ej-portfolio-single-content {
    color: #3a3f47;
    font-size: 15px;
    line-height: 1.75;
}
.ej-portfolio-single-content p { margin: 0 0 1em; }
.ej-portfolio-single-content img { max-width: 100%; height: auto; }
.ej-portfolio-single-content h2,
.ej-portfolio-single-content h3,
.ej-portfolio-single-content h4 {
    color: var(--ej-secondary);
    line-height: 1.3;
    margin: 1.2em 0 .5em;
}
.ej-portfolio-single-content a {
    color: var(--ej-primary);
    text-decoration: none;
}
.ej-portfolio-single-content a:hover { text-decoration: underline; }

/* Recent projects column (col 3). */
.ej-portfolio-related {
    min-width: 0;
    background: var(--ej-panel);
    padding: 0;
}
.ej-portfolio-related-title {
    margin: 15px 0 12px;
    color: #fff;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.3;
	text-transform:uppercase;
	padding:15px;
	background-color:var(--ej-secondary);
}
.ej-portfolio-related-list {
    display: grid;
    gap: 14px;
	padding:15px;
}
.ej-portfolio-mini-card {
    display: flex;
    flex-direction: column;
    background: transparent;
}
.ej-portfolio-mini-card .ej-portfolio-thumb-link {
    display: block;
    background: #fff;
    overflow: hidden;
}
.ej-portfolio-mini-card .ej-portfolio-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 2.1 / 1;
    height: auto;
    object-fit: cover;
}
.ej-portfolio-mini-title {
    margin: 7px 0 0;
    font-size: 18px;
    line-height: 135%;
    font-weight: 600;
}
.ej-portfolio-mini-title a {
    color: var(--ej-secondary);
    text-decoration: none;
}
.ej-portfolio-mini-title a:hover,
.ej-portfolio-mini-title a:focus-visible {
    color: var(--ej-primary);
}

/* Responsive: collapse the single-post 3 columns. */
@media (max-width: 1100px) {
    .ej-portfolio-single {
        grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
    }
    /* Recent projects drops below the content on narrower screens. */
    .ej-portfolio-single .ej-portfolio-related {
        grid-column: 1 / -1;
    }
    .ej-portfolio-single .ej-portfolio-related-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .ej-portfolio-single {
        grid-template-columns: minmax(0, 1fr);
    }
    .ej-portfolio-single .ej-portfolio-related-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===============================================================
 * Three-column portfolio / category layout
 * col 1 = profile (25%) | col 2 = cards | col 3 = category nav
 * Mirrors the single-post three-column proportions so every
 * non-home page is visually identical.
 * =============================================================== */
.ej-portfolio-threecol {
    grid-template-columns: minmax(0, 24fr) minmax(0, 48fr) minmax(0, 28fr);
}

/* "Browse by Category" navigation column (col 3). */
.ej-portfolio-catnav-list {
    display: grid;
    gap: 7px;
}
.ej-portfolio-catnav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #dce1e9;
    color: var(--ej-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.ej-portfolio-catnav-link:hover,
.ej-portfolio-catnav-link:focus-visible {
    background: var(--ej-primary);
    border-color: var(--ej-primary);
    color: #fff;
}
.ej-portfolio-catnav-link[aria-current="page"] {
    background: var(--ej-secondary);
    border-color: var(--ej-secondary);
    color: #fff;
    pointer-events: none;
    cursor: default;
}
.ej-portfolio-catnav-count {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 1px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    background: var(--ej-panel);
    color: var(--ej-secondary);
}
.ej-portfolio-catnav-link:hover .ej-portfolio-catnav-count,
.ej-portfolio-catnav-link:focus-visible .ej-portfolio-catnav-count,
.ej-portfolio-catnav-link[aria-current="page"] .ej-portfolio-catnav-count {
    background: rgba(255, 255, 255, .85);
}

/* Responsive: collapse the three columns on narrower screens. */
@media (max-width: 1100px) {
    .ej-portfolio-threecol {
        grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
    }
    .ej-portfolio-threecol .ej-portfolio-catnav {
        grid-column: 1 / -1;
    }
    .ej-portfolio-threecol .ej-portfolio-catnav-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .ej-portfolio-threecol .ej-portfolio-grid--single {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .ej-portfolio-threecol {
        grid-template-columns: minmax(0, 1fr);
    }
    .ej-portfolio-threecol .ej-portfolio-grid--single {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ===============================================================
 * Mirrored sidebar width fix.
 * The homepage CSS (post-8741.css) sets the profile container
 * 46cae30 to --width:50% at >=768px, which is correct on the
 * homepage but wrong inside our 25% sidebar column. Reset it so
 * the mirrored profile fills its column on the other pages only.
 * =============================================================== */
.ej-portfolio-mirror .elementor-element.elementor-element-46cae30 {
    --width: 100% !important;
    width: 100% !important;
}
@media (min-width: 768px) {
    .ej-portfolio-mirror .elementor-element.elementor-element-46cae30 {
        --width: 100% !important;
        width: 100% !important;
    }
}

/* The inner profile container (fc61108) has no padding on the homepage
 * (effective 0), but Elementor's default container padding leaks in on the
 * other pages. Force it to 0 to match the homepage exactly. */
.ej-portfolio-mirror .elementor-element.elementor-element-fc61108 {
    --padding-top: 0px !important;
    --padding-right: 0px !important;
    --padding-bottom: 0px !important;
    --padding-left: 0px !important;
    padding: 0 !important;
}
