/* Main Styles for Nathan Duggins Portfolio Website */

/* ===== GLOBAL STYLES ===== */
body {
    font-family: 'Helvetica', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #333;
    color: white;
}

/* ===== LAYOUT ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.left-sidebar, .right-sidebar {
    background-color: #333;
    padding: 2rem;
    width: 150px;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    padding-top: 120px;
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #333;
    color: white;
    position: fixed;
    top: 0;
    left: 100px;
    right: 100px;
    height: 120px;
    z-index: 1000;
    box-sizing: border-box;
}

header .logo h1 {
    font-family: 'Helvetica', sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: white;
    text-decoration: none;
    margin: 0;
}

header .logo a {
    text-decoration: none;
    color: white;
}

/* ===== NAVIGATION ===== */
nav {
    display: flex;
}

nav a {
    font-family: 'Helvetica', sans-serif;
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 400;
}

nav a.active {
    border-bottom: 2px solid #f00;
}

/* ===== MAIN CONTENT ===== */
main {
    background-color: #333;
    color: white;
    padding: 1rem;
    flex-grow: 1;
}

/* ===== RESUME PAGE STYLES ===== */
.summary-section {
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.summary-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #f00;
}

.two-column-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-gap: 2rem;
    position: relative;
}

.two-column-layout::after {
    content: '';
    position: absolute;
    top: -1px;
    bottom: 0;
    left: 65.5%;
    width: 1px;
    background-color: #f00;
}

/* ===== TYPOGRAPHY ===== */
h1, h2 {
    color: white;
    margin: 0 0 1rem;
}

p {
    margin: 1rem 0;
}

h4 {
    margin-bottom: 0;
}

.job-date {
    display: block;
    margin-top: 0;
    line-height: 1;
}

/* ===== PORTFOLIO STYLES ===== */
.projects-section {
    margin-top: 3rem;
    position: relative;
    padding-top: 2rem;
}

.projects-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #f00;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
    padding: 20px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    grid-column: span 1;
    grid-row: span 1;
}

/* Use pseudo-element to maintain square aspect ratio for grid cells */
.portfolio-item::before {
    content: '';
    display: block;
    padding-bottom: 100%;
}

/* Position content absolutely to fill the square */
.portfolio-item > .portfolio-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.portfolio-item.wide {
    grid-column: span 2;
}

.portfolio-item.wide::before {
    padding-bottom: calc(100% / 2); /* Half height for 2-wide items */
}

.portfolio-item.extra-wide {
    grid-column: span 3;
}

.portfolio-item.extra-wide::before {
    padding-bottom: calc(100% / 3); /* One-third height for 3-wide items */
}

.portfolio-item.tall {
    grid-row: span 2;
}

.portfolio-item.tall::before {
    /* For 1-wide, 2-tall: the pseudo creates the first square,
       and the grid-row: span 2 makes it extend into the second row */
    padding-bottom: 200%;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    will-change: opacity;
    pointer-events: none;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    will-change: transform;
}

.portfolio-item:hover .portfolio-thumbnail {
    transform: scale(1.05);
}

/* Video thumbnails */
.portfolio-item video.portfolio-thumbnail {
    object-fit: cover;
}

/* ===== PORTFOLIO ITEM PAGE ===== */
.portfolio-item-page {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    margin: 0 auto;
}

.portfolio-item-page .portfolio-description {
    flex: 1;
}

.portfolio-item-page .portfolio-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.portfolio-item-page .portfolio-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}


/* ===== MAP CONTAINER ===== */
#map-container {
    width: 100%;
    height: 400px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

/* ===== ZOOMABLE IMAGE ===== */
#zoomable-image {
    cursor: zoom-in;
    max-width: 100%;
    height: auto;
}

.zoom-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.zoom-overlay .zoomed-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: none;
    max-height: none;
}

.zoom-overlay .close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.zoom-overlay .close-btn:hover,
.zoom-overlay .close-btn:focus {
    color: #bbb;
    text-decoration: none;
}

/* ===== CONTACT PAGE STYLES ===== */
.contact-page {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    position: relative;
}

/* Red divider line between columns */
.contact-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background-color: #f00;
}

.contact-info h1 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 30px;
    color: white;
}

.contact-info p {
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 20px;
}

.contact-form-wrapper {
    padding-left: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-size: 14px;
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #222;
    border: 1px solid #555;
    color: white;
    font-family: 'Helvetica', sans-serif;
    font-size: 14px;
    border-radius: 2px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f00;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background-color: #aa0000;
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-family: 'Helvetica', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 2px;
    font-weight: 400;
}

.submit-btn:hover {
    background-color: #cc0000;
}

.sending-message {
    padding: 30px;
    background-color: #222;
    border-radius: 4px;
    text-align: center;
}

.sending-message p {
    color: #ddd;
    font-size: 18px;
    margin: 0;
}

.success-message {
    padding: 30px;
    background-color: #222;
    border-radius: 4px;
    text-align: center;
}

.success-message p {
    color: #ddd;
    font-size: 18px;
    margin: 0;
}

.error-message-box {
    padding: 30px;
    background-color: #222;
    border-radius: 4px;
    text-align: center;
}

.error-message-box p {
    color: #ddd;
    font-size: 18px;
    margin: 0;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #ff6b6b;
}

/* Honeypot spam protection - hidden from humans */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===== PORTFOLIO NAVIGATION ARROWS ===== */
.portfolio-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    /*font-size: 60px; change in nav span instead*/
    font-weight: 100;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    z-index: 500;
}

.portfolio-nav:hover {
    opacity: 1;
}

.portfolio-nav-prev {
    left: 20px;
}

.portfolio-nav-next {
    right: 20px;
}

.portfolio-nav span {
    display: block;
    line-height: 1;
    font-size: 60px;
}

/* Hide arrows on mobile for better UX */
@media (max-width: 768px) {
    .portfolio-nav {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .portfolio-nav-prev {
        left: 10px;
    }
    
    .portfolio-nav-next {
        right: 10px;
    }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    .wrapper {
        flex-direction: column;
    }

    .left-sidebar, .right-sidebar {
        display: none;
    }

    .main-content {
        padding-top: 100px;
    }

    header {
        flex-direction: column;
        height: auto;
        left: 0;
        right: 0;
        width: 100%;
        padding: 0.5rem 0;
    }

    header .logo {
        margin-bottom: 1rem;
        text-align: center;
    }

    nav {
        display: flex;
        width: 100%;
    }

    nav a {
        flex: 1;
        text-align: center;
        margin: 0;
        padding: 0.5rem 0;
    }

    nav a:not(:last-child) {
        border-right: 1px solid #555;
    }

    .summary-section::after,
    .projects-section::before,
    .two-column-layout::after {
        display: none;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .portfolio-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        position: relative;
        padding-bottom: 15px;
        border-bottom: 2px solid #f00;
    }

    /* Remove the border from the last item */
    .portfolio-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Remove pseudo-element on mobile */
    .portfolio-item::before {
        display: none;
    }

    /* Reset positioning on mobile */
    .portfolio-item > .portfolio-link {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }

    .portfolio-item.wide,
    .portfolio-item.extra-wide,
    .portfolio-item.tall {
        display: flex;
        flex-direction: column;
    }

    .portfolio-item.wide > .portfolio-link,
    .portfolio-item.extra-wide > .portfolio-link,
    .portfolio-item.tall > .portfolio-link {
        aspect-ratio: 16 / 9;
    }

    .portfolio-thumbnail {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .portfolio-overlay {
        position: static;
        opacity: 1;
        background: transparent;
        padding: 10px 0 0 0;
        pointer-events: auto;
    }

    .portfolio-overlay h3 {
        margin: 0 0 5px 0;
    }

    .portfolio-overlay p {
        margin: 0;
    }

    .portfolio-item:hover .portfolio-thumbnail {
        transform: none;
    }

    .portfolio-item-page {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }

    .portfolio-item-page .portfolio-image {
        order: -1;
        margin-bottom: 20px;
    }

    .portfolio-item-page .portfolio-description {
        width: 100%;
    }

    .portfolio-item-page .portfolio-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .zoom-overlay .close-btn {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    .zoom-overlay .close-btn {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    /* Contact Page Mobile Styles */
    .contact-page {
        padding: 20px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-container::after {
        display: none;
    }

    .contact-info h1 {
        font-size: 36px;
    }

    .contact-form-wrapper {
        padding-left: 0;
    }

    .submit-btn {
        width: 100%;
    }
}

@media (min-width: 769px) {
    /* Hide the map container on desktop */
    .portfolio-item-page > #map-container {
        display: none;
    }
}
