/* Base styles */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: #f5f5f5;
    font-size: 1.1rem;
    color: #555;
    overflow-x: hidden;
}

/* Header */
header {
    background: url('Images/Background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: white;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    height: 50vh;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

header .logo {
    max-width: 700px;
    width: 100%;
    height: auto;
    display: block;
}

/* Main Content */
main {
    padding: 40px 20px; /* Consistent section padding */
    text-align: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Portfolio Item */
.portfolio-item {
    max-width: 950px;
    margin: 0 auto;
    padding: 40px 0; /* Reduced from 60px 0 20px for consistency */
}

.portfolio-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    text-transform: uppercase;
    margin: 0 0 10px;
    color: #333;
    letter-spacing: 2px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.portfolio-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: #00bcd4;
    margin: 5px auto;
}

.portfolio-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 400;
    color: #555;
    margin: 0 0 40px;
}

/* Main Image */
.main-image {
    width: 100%;
    max-width: 950px;
    margin: 20px auto; /* Standardized from 20px auto 0 */
    text-align: center;
}

.main-image .placeholder {
    width: 100%;
    height: 500px;
    background: #d3d3d3;
    display: block;
}

.main-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Color Box Section */
.color-box {
    background: #00bcd4;
    padding: 40px;
    color: white;
    text-align: left; /* Keep left for narrative */
    margin: 0 auto 40px;
    max-width: 950px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.color-box-text {
    font-size: 1.0rem;
    line-height: 1.8;
    margin-bottom: 0;
    flex: 1;
    min-width: 300px;
    text-align: left; /* Explicitly left */
}

.mockup-placeholder {
    width: 600px; /* Fixed width for desktop */
    max-width: 100%; /* Responsive on smaller screens */
}

.mockup-placeholder img {
    width: 100%;
    height: auto;
    display: block;
}

.placeholder-square {
    width: 100%;
    height: 300px;
    background: #d3d3d3;
    display: block;
}

/* Description */
.description {
    max-width: 700px;
    margin: 0 auto 40px;
    font-size: 1.0rem;
    line-height: 1.8;
    color: #555;
    text-align: left; /* Already center, reinforcing */
}

/* Quote Box */
.quote-box {
    width: 100vw; /* Full viewport width */
    margin: 40px 0; /* Remove auto to prevent centering */
    background-color: #00bcd4;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative; /* Ensure proper stacking */
    left: 50%; /* Center the full-width element */
    transform: translateX(-50%); /* Offset to align with viewport */
}

.quote {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 2px;
    margin: 0;
}

.quote-marks {
    font-size: 2rem;
    vertical-align: middle;
}

.short-divider {
    width: 50px;
    height: 2px;
    background-color: white;
    margin: 10px auto;
}

/* PDF Section */
.pdf-section {
    margin: 40px 0;
    text-align: center;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.pdf-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #333;
}

.pdf-section p {
    font-size: 1.0rem;
    line-height: 1.8;
    color: #555;
    margin: 0 0 20px;
    text-align: center; /* Already center via parent, reinforcing */
}

.pdf-reader {
    width: 100%;
    max-width: 950px;
    height: 500px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Three Image Row */
.three-image-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 40px 0; /* Consistent */
    max-width: 950px;
}

.three-image-item {
    width: 30%;
    text-align: center;
}

.three-image-item:first-child {
    margin-left: 0;
}

.three-image-item:last-child {
    margin-right: 0;
}

.three-image-item:nth-child(2) {
    margin: 0 auto;
}

.three-image-item img {
    width: 100%;
    height: auto;
    border: 1px solid #E0E0E0; /* Subtle light gray border */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.three-image-description {
    font-size: 1.0rem;
    line-height: 1.8;
    margin-top: 10px;
    color: #666;
    text-align: left; /* Already center, reinforcing */
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Grid for Home Page and Logo Design */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 0px;
    row-gap: 35px;
    max-width: 950px;
    margin: 20px auto;
    padding: 0 10px;
    justify-content: center;
    width: 100%; /* Ensure it fits container */
    box-sizing: border-box; /* Include padding in width */
}

.grid-item {
    width: 300px;
    height: 300px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.grid-item:hover img {
    opacity: 1;
}

.grid-item .text-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 12%;
    background: rgba(0, 188, 212, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 5px 10px;
}

.grid-item .text-overlay .title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.grid-item .text-overlay .subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #fff;
    margin-top: 2px;
}

/* Bottom Section (Home Page) */
.bottom-section {
    display: flex;
    justify-content: center;
    padding: 20px 0; /* Reduced from 20px 0 */
    margin-top: 40px; /* Consistent */
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
}

.bio-contact-wrapper {
    display: flex;
    justify-content: center;
    width: 822px;
    max-width: 950px;
    margin: 0 auto;
    height: 350px;
}

.bio, .contact {
    width: 390px;
    padding: 10px 40px 20px;
    text-align: center;
    height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bio-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin: 0;
}

.bio-header .hello {
    color: #00bcd4;
    font-size: 1.75rem;
    display: block;
    font-weight: 700;
}

.bio-header .rest {
    color: #333;
    font-size: 0.85rem;
    display: block;
    margin-top: 10px;
}

.bio-text {
    font-size: 1.1rem;
    margin: 20px 0;
    width: 340px;
    text-align: center; /* Change to center from justify */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.bio .button {
    margin-top: 17px;
}

.contact h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin: 0;
}

.divider {
    width: 2px;
    min-width: 2px;
    height: 75%;
    background-color: #d7d7d7;
    margin: 0 20px;
    position: relative;
    z-index: 1;
}

/* Contact Form */
.custom-contact-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.custom-input,
.custom-textarea {
    margin: 5px 0;
    padding: 10px;
    width: 340px;
    border: 1px solid #ddd;
    border-radius: 0;
    background: lightgray;
}

.contact .button {
    margin-top: 25px;
}

/* Button */
.button {
    padding: 10px 10px;
    font-size: 1rem;
    background-color: #00bcd4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    text-decoration: none;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.button:hover {
    background-color: #008c9e;
}

.button a {
    color: white;
    text-decoration: none;
    display: block;
}

/* Float Section */
.float-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* Medium spacing */
    margin-bottom: 40px; /* Consistent */
    max-width: 950px;
}

.float-image {
    width: 30%;
    max-width: 300px;
    height: auto;
    margin-right: 20px;
}

.float-text {
    max-width: 35%;
    text-align: left;
}

.float-text .subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #00bcd4;
}

.paragraph {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 20px;
    text-align: left; /* Keep left */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    main {
        padding: 20px 10px; /* Reduced padding */
        width: 100%;
        box-sizing: border-box;
    }

    header {
        padding: 40px 20px;
        min-height: auto;
    }

    header .logo {
        max-width: 500px;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0;
        margin: 20px 0;
        width: 100%;
    }

    .grid-item {
        width: 100%; /* Full width of grid cell */
        max-width: 300px; /* Keep max size */
        margin: 0 auto; /* Center within grid */
    }

    .float-section {
        flex-direction: column;
        text-align: center;
    }

    .float-image, .float-text {
        width: 100%;
        max-width: 400px;
    }


    /* Fix three-image-row overflow */
    .three-image-row {
        flex-direction: column;
        align-items: center;
        margin: 40px 0;
    }

    .three-image-item {
        width: 100%;
        max-width: 300px;
        margin: 20px 0;
    }

    .bottom-section {
        flex-direction: column;
        align-items: center;
        margin-top: 40px;
    }

    .bio-contact-wrapper {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        height: auto;
        margin: 0 auto;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .bio, .contact {
        width: 100%;
        padding: 20px 0; /* Reduced side padding */
        height: auto;
        text-align: center;
    }

    .divider {
        width: 50%;
        height: 1px;
        margin: 20px auto;
        background-color: #666;
    }

    .bio .button, .contact .button {
        margin-top: 20px;
    }

    .bio-text, .custom-input, .custom-textarea {
        width: 100%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    .color-box {
        flex-direction: column; /* Stack vertically on smaller screens */
        padding: 20px; /* Reduce padding */
    }

    .mockup-placeholder {
        width: 100%; /* Full width on mobile */
        margin: 0; /* Remove margins for cleaner stacking */
    }

    .color-box-text {
        min-width: 0; /* Allow full width */
    }
}

@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr; /* Single column */
    }

    .portfolio-title {
        font-size: 1.5rem;
    }

    .portfolio-subtitle {
        font-size: 1.2rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .three-image-item {
        width: 100%;
    }

    .pdf-reader {
        height: 300px;
    }
}