/* ==========================================================================

Eugene Sy Academic Portfolio - Fixed Popups & Column Borders

========================================================================== */

/* Base Styles */

body {
    font-family: 'Droid Serif', serif;
    font-size: 14px;
    color: #2f2f2f;
    background-color: #f9f7f1;
    padding: 20px;
}

header {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 80px;
    text-transform: uppercase;
    display: inline-block;
    line-height: 72px;
    margin-bottom: 20px;
}

p {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: justify;
}

ul {
    padding-left: 20px;
    margin-bottom: 20px;
    text-align: left;
}

li {
    margin-bottom: 10px;
}

a {
    color: #3b5998;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header Styles */

.head {
    text-align: center;
    position: relative;
}

.headerobjectswrapper {
    margin-bottom: 20px;
    position: relative;
}

.subhead {
    text-transform: uppercase;
    border-bottom: 2px solid #2f2f2f;
    border-top: 2px solid #2f2f2f;
    padding: 12px 0;
    margin-bottom: 20px;
}

/* Main Content Layout - Centered */

.content {
    font-size: 0;
    line-height: 0;
    word-spacing: -.31em;
    display: inline-block;
    margin: 0 2%;
}

.collumns {
    width: 100%;
    display: block;
    text-align: center;
}

/* --- Enhanced Column Borders --- */

.collumn {
    font-size: 14px;
    line-height: 20px;
    width: 31%;
    display: inline-block;
    padding: 10px 1%;
    vertical-align: top;
    margin-bottom: 50px;
    transition: all .5s;
    box-sizing: border-box;
    text-align: left;
    border-left: none;
    border-right: none;
}

/* Enhanced border system - more reliable */
.collumn:not(.lead) {
    border-left: 1px solid #2f2f2f;
}

/* Remove border from first regular column */
.collumn:not(.lead):nth-child(2) {
    border-left: none;
}

/* Remove border from start of new rows */
.collumn:not(.lead):nth-child(5) {
    border-left: none;
}

.collumn:not(.lead):nth-child(8) {
    border-left: none;
}

/* Hover Effect */
.collumn:hover {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    padding-top: 10px;
    padding-bottom: 10px;

}

/* --- Lead Column (Hero Section) --- */

.collumn.lead {
    width: 100%;
    display: block;
    margin-bottom: 50px;
    font-size: 15px;
    line-height: 22px;
    text-align: center;
    border: none !important;
}

.collumn.lead .lead-content {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

.collumn.lead .figure {
    width: 300px;
    margin: 0;
    flex-shrink: 0;
    padding: 24px 24px 18px 24px;
    border-radius: 12px;
    background: #fff;
    transition: all 0.6s ease-in-out;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.collumn.lead .content-text {
    flex: 1;
}

.collumn.lead .content-text p {
    text-align: left;
}

.collumn.lead .figcaption {
    text-align: center;
    margin-top: 18px;
    padding-bottom: 12px;
}

/* --- Hero Image (No Filter) --- */

.collumn.lead .media {
    filter: none !important;
    -webkit-filter: none !important;
    mix-blend-mode: normal !important;
    width: 100%;
    border-radius: 5px;
    transition: all 0.6s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    background: #fff;
    object-fit: cover;
    display: block;
}

.collumn.lead:hover .media {
    opacity: 1;
    transform: scale(1.02);
}

.collumn.lead:hover .figure {
    box-shadow: 0 8px 25px rgba(59, 89, 152, 0.15);
    background-color: #fff;
}

/* Headlines */

.collumn .headline {
    text-align: center;
    line-height: normal;
    font-family: 'Playfair Display', serif;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl1 {
    font-weight: 700;
    font-size: 30px;
    text-transform: uppercase;
    padding: 10px 0;
}

.collumn .headline.hl2 {
    font-weight: 400;
    font-style: italic;
    font-size: 24px;
    box-sizing: border-box;
    padding: 10px 0;
}

.collumn .headline.hl2:before {
    border-top: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 7px;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl2:after {
    border-bottom: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 13px;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl3 {
    font-weight: 400;
    font-style: italic;
    font-size: 36px;
    box-sizing: border-box;
    padding: 10px 0;
}

.collumn .headline.hl4 {
    font-weight: 700;
    font-size: 12px;
    box-sizing: border-box;
    padding: 10px 0;
}

.collumn .headline.hl4:before {
    border-top: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 7px;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl4:after {
    border-bottom: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 10px;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl5 {
    font-weight: 400;
    font-size: 42px;
    text-transform: uppercase;
    font-style: italic;
    box-sizing: border-box;
    padding: 10px 0;
}

.collumn .headline.hl6 {
    font-weight: 400;
    font-size: 18px;
    box-sizing: border-box;
    padding: 10px 0;
}

.collumn .headline.hl6:before {
    border-top: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 7px;
    display: block;
    margin: 0 auto;
}

.collumn .headline.hl6:after {
    border-bottom: 1px solid #2f2f2f;
    content: '';
    width: 100px;
    height: 10px;
    display: block;
    margin: 0 auto;
}

/* Media Elements */

.collumn .figure {
    margin: 0 0 20px;
}

.collumn .figcaption {
    font-style: italic;
    font-size: 12px;
    text-align: center;
}

/* Regular Media (No Filter) */
.media {
    filter: none !important;
    -webkit-filter: none !important;
    mix-blend-mode: normal !important;
    width: 100%;
    border-radius: 5px;
    object-fit: cover;
    display: block;
}

/* CV Button */

.cv-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #3b5998;
    color: #f9f7f1;
    padding: 8px 15px;
    border-radius: 5px;
    font-family: 'Droid Serif', serif;
    font-size: 12px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.3s;
}

.cv-button:hover {
    background-color: #2f2f2f;
    text-decoration: none;
}

/* ==========================================================================

POPUP STYLES - RESTORED & ENHANCED

========================================================================== */

/* View All Button */
.view-all-btn {
    background-color: #3b5998;
    color: #f9f7f1;
    border: none;
    padding: 10px 20px;
    font-family: 'Droid Serif', serif;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 15px;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
}

.view-all-btn:hover {
    background-color: #2f2f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Content */
.popup-content {
    background-color: #f9f7f1;
    border-radius: 10px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-in-out;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Popup Header */
.popup-header {
    background-color: #3b5998;
    color: #f9f7f1;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.popup-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
}

/* Close Button */
.close-btn {
    font-size: 30px;
    cursor: pointer;
    color: #f9f7f1;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ff6b6b;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Popup Body */
.popup-body {
    padding: 30px;
    color: #2f2f2f;
    font-family: 'Droid Serif', serif;
    line-height: 1.6;
}

.popup-body ol {
    padding-left: 20px;
}

.popup-body li {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.popup-body li:last-child {
    border-bottom: none;
}

.popup-body strong {
    color: #3b5998;
}

.popup-body em {
    color: #666;
    font-style: italic;
}

/* Enhanced Award Details */
.award-details {
    margin-top: 10px;
    padding: 15px;
    background-color: #f5f5f5;
    border-left: 4px solid #3b5998;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

/* Custom Scrollbar for Popup */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #3b5998;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #2f2f2f;
}

/* ==========================================================================

RESPONSIVE DESIGN - ENHANCED COLUMN BORDERS

========================================================================== */

/* Large Desktop Layout - 3 columns per row */
@media only all and (min-width: 1201px) {
    .collumn {
        width: 31%;
    }
}

/* Tablet Layout (2 columns) */
@media only all and (max-width: 1200px) and (min-width: 769px) {
    .collumn {
        width: 47%;
        margin-bottom: 40px;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Reset ALL borders for tablet */
    .collumn:not(.lead) {
        border-left: none;
    }

    /* Apply border to second column in each row */
    /* Since lead is child 1, regular columns are 2, 3, 4, 5, 6, 7, 8... */
    /* In 2-column layout: Row 1 = cols 2,3 | Row 2 = cols 4,5 | Row 3 = cols 6,7 | Row 4 = cols 8,9 */
    .collumn:not(.lead):nth-child(3),  /* First row, second column */
    .collumn:not(.lead):nth-child(5),  /* Second row, second column */
    .collumn:not(.lead):nth-child(7),  /* Third row, second column */
    .collumn:not(.lead):nth-child(9)   /* Fourth row, second column (if needed) */
    {
        border-left: 1px solid #2f2f2f;
    }

    /* Hero layout: image left, text right, vertically centered */
    .collumn.lead .lead-content {
        flex-direction: row;
        align-items: center;
        gap: 30px;
        max-width: 1000px;
        margin: 0 auto;
    }

    .collumn.lead .figure {
        width: 220px;
        padding: 10px;
        border-radius: 12px;
        align-items: center;
        justify-content: center;
    }

    .collumn.lead .media {
        width: 100%;
        height: auto;
        border-radius: 10px;
        object-fit: cover;
        display: block;
    }

    .collumn.lead .content-text {
        text-align: left;
    }

    .collumn.lead .figcaption {
        display: block;
    }

    /* Popup Responsive - Tablet */
    .popup-content {
        width: 95%;
        max-height: 85vh;
    }

    .popup-header {
        padding: 15px 20px;
    }

    .popup-header h2 {
        font-size: 20px;
    }

    .popup-body {
        padding: 20px;
    }

    .award-details {
        padding: 12px;
        font-size: 12px;
    }
}

/* Mobile Layout (1 column) */
@media only all and (max-width: 768px) {
    .collumn, .collumn.lead {
        width: 100%;
        display: block;
        margin-bottom: 30px;
        border-left: none !important;
        border-right: none !important;
        padding-left: 10px;
        padding-right: 10px;
    }

    .collumn + .collumn {
        border-left: none;
        border-top: 1px solid #2f2f2f;
        padding-top: 20px;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Hero: image above, text below, image is circular and maximized */
    .collumn.lead .lead-content {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .collumn.lead .figure {
        width: 90vw;
        max-width: 320px;
        padding: 0;
        border-radius: 50%;
        background: none;
        margin-bottom: 0;
        margin-top: 30px;
        align-items: center;
        justify-content: center;
    }

    .collumn.lead .media {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        background: #fff;
    }

    .collumn.lead .figcaption {
        display: none !important;
    }

    .collumn.lead .content-text {
        text-align: center;
    }

    header {
        font-size: 60px;
        line-height: 54px;
    }

    .cv-button {
        position: static;
        display: block;
        margin: 0 auto 20px;
        width: fit-content;
    }

    /* Popup Responsive - Mobile */
    .popup-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }

    .popup-header {
        padding: 15px;
    }

    .popup-header h2 {
        font-size: 18px;
    }

    .popup-body {
        padding: 15px;
    }

    .close-btn {
        font-size: 24px;
    }

    .award-details {
        padding: 10px;
        font-size: 11px;
    }
}

/* ==========================================================================

PRINT STYLES

========================================================================== */

@media print {
    body {
        font-size: 12pt;
        background-color: #fff;
        padding: 1in;
    }

    .head, .cv-button, .headerobjectswrapper, .view-all-btn, .popup-overlay {
        display: none !important;
    }

    .content, .collumns, .collumn, .collumn.lead {
        width: 100% !important;
        display: block !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        border: none !important;
        padding: 0 0 20px 0 !important;
        margin: 0 !important;
    }

    p, ul, li {
        text-align: left;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    a:after {
        content: " (" attr(href) ")";
    }

    .media {
        display: none;
    }

    /* Show all items when printing */
    #research-preview, #awards-preview {
        display: block !important;
    }
}

/* ==========================================================================
FOOTER STYLES
========================================================================== */

.site-footer {
    background-color: #f9f7f1;
    border-top: 3px solid #2f2f2f;
    margin-top: 20px;
    padding: 20px 0 20px;
    font-family: 'Droid Serif', serif;
    color: #2f2f2f;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 20px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h3 {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #3b5998;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #3b5998;
}

.footer-column p {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    color: #3b5998;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #2f2f2f;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 10px;
}

.footer-divider {
    width: 100px;
    height: 1px;
    background-color: #2f2f2f;
    margin: 0 auto 20px;
}

.footer-bottom p {
    margin-bottom: 8px;
    font-size: 11px;
    color: #666;
}

.footer-tagline {
    font-style: italic;
    color: #3b5998 !important;
    font-size: 10px !important;
}

/* Responsive Footer */
@media only all and (max-width: 768px) {
    .footer-columns {
        gap: 25px;
    }

    .footer-column {
        text-align: center;
        gap: 15px;
    }

    .footer-column h3 {
        font-size: 14px;
    }

    .site-footer {
        padding: 15px 0 8px;
    }
}

@media only all and (max-width: 1200px) and (min-width: 769px) {
    .footer-columns {
        gap: 30px;
    }

    .footer-column h3 {
        font-size: 17px;
    }
}
