/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: #F1F1F1;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    background-color: white;
    color: #333;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    margin: 10px 0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #2a6fb8;
    color: white;
}

/* Header Styles */
.hero {
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    background-image: url('../images/placeholder-building.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #31659E;
    opacity: 46%;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.hero-image {
    display: block;
    height: 500px;
    position: relative;
    z-index: 2;
}

.hero-content {
    width: 50%;
    color: white;
    padding: 40px;
    position: relative;
    text-align: center;
}

.ps-logo {
    width: auto;
    max-height: 100px;
    /* keep natural aspect ratio */
    top: 10px;
    right: 10px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* Team Section */
.team {
    padding: 60px 0;
    /* background-color: #ffffff; */
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    display: inline-block;
    padding: 10px 15px;
    background-color: white;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    grid-auto-rows: 1fr;
}

.team-member {
    overflow: hidden;
    position: relative;
    line-height: 0;
    aspect-ratio: 1/1;
}

.team-member img {
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
    filter: grayscale(100%);
    display: block;
}

.team-member:hover img {
    transform: scale(1.03);
    filter: grayscale(0%);
}

.member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    bottom: 0;
    background-color: rgba(49, 101, 158, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.member-overlay h4 {
    color: white;
    text-align: center;
    font-weight: 700;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.team-member:hover .member-overlay {
    background-color: rgba(49, 101, 158, 0.7);
    opacity: 1;
}

.team-member:hover .member-overlay h4 {
    transform: translateY(0);
}

.team-member.featured {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    background-color: #f0f0f0;
    line-height: 1.6;
    /* Allow the featured member card to size naturally so text is not clipped */
    aspect-ratio: auto;
    overflow: visible;
    align-items: stretch;
}

.team-member.featured img {
    width: 50%;
    max-width: 50%;
    height: auto; /* preserve aspect ratio */
    object-fit: contain; /* ensure whole image is visible */
    object-position: center center;
    display: block;
    align-self: stretch;
}

.team-member.featured .team-info {
    width: 50%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    position: static;
    background-color: transparent;
    opacity: 1;
}

.team-member.featured .team-info p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.team-member.featured:hover .team-info {
    background-color: transparent;
}

.team-member.featured h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2a6fb8;
    transform: none;
}

/* Proposals Section */
.proposals {
    padding: 60px 0;
    background-color: #F1F1F1;
}

.proposal {
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    gap: 40px;
}

.proposal:nth-child(even) {
    flex-direction: row-reverse;
}

.proposal-content {
    flex: 1;
}

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

.proposal-text {
    margin-bottom: 20px;
}

/* Proposal lists and notes */
.proposal-text ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.proposal-text li {
    margin-bottom: 0.9rem;
    line-height: 1.5;
}

.proposal-note {
    display: block;
    margin-top: 6px;
    color: #555;
    font-size: 0.95rem;
}

/* Subtle card look for proposal content */
.proposal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(16,24,40,0.04);
}

/* Make media column align with content card */
.proposal-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail {
    height: 320px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16,24,40,0.06);
}

/* Smaller play button on compact screens */
@media (max-width: 576px) {
    .video-thumbnail {
        height: 220px;
    }

    .play-button {
        width: 56px;
        height: 56px;
    }

    .play-button::after {
        border-left-width: 18px;
        border-top-width: 10px;
        border-bottom-width: 10px;
    }
}

.proposal-media {
    flex: 1;
    position: relative;
}

.video-thumbnail {
    width: 100%;
    height: 350px;
    background-color: #ddd;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive embedded video (YouTube) inside the thumbnail container */
.video-thumbnail iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Make video containers keep a 16:9 aspect ratio */
.video-thumbnail.has-video {
    /* Modern browsers */
    aspect-ratio: 16 / 9;
    position: relative; /* for absolute iframe inside */
    overflow: hidden;
}

/* Fallback for browsers without aspect-ratio: use padding-top trick */
@supports not (aspect-ratio: 16/9) {
    .video-thumbnail.has-video {
        height: 0;
        padding-top: calc(9 / 16 * 100%); /* 56.25% */
    }
    .video-thumbnail.has-video iframe {
        position: absolute;
    }
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-left: 25px solid #2a6fb8;
    border-bottom: 15px solid transparent;
    margin-left: 5px;
}

/* 'Coming soon' badge for thumbnails without videos */
.video-thumbnail .coming-soon {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(42,111,184,0.95);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 4;
}

/* Smaller badge on very small screens */
@media (max-width: 576px) {
    .video-thumbnail .coming-soon {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* If a thumbnail has no video, hide the play button and keep a non-interactive placeholder */
.video-thumbnail.no-video {
    cursor: default;
    background-color: #e6e6e6; /* neutral grey placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail.no-video img {
    display: none; /* hide real thumbnail image when video is not available */
}

/* Show the play button, but place the BREVEMENTE label centered over it */
.video-thumbnail.no-video .play-button {
    /* Absolutely center the play button inside the thumbnail */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 100px;
    height: 100px;
    background-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(16,24,40,0.08);
}

/* Make the play affordance decorative and not clickable when there's no video */
.video-thumbnail.no-video .play-button {
    pointer-events: none; /* ignore pointer events */
    cursor: default;
    opacity: 0.98; /* keep visible but slightly subdued if needed */
}

.video-thumbnail.no-video .coming-soon {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(42,111,184,0.95);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    padding: 10px 14px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ensure the placeholder box has the same height as normal thumbnails */
.video-thumbnail.no-video {
    width: 100%;
    height: 350px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 576px) {
    .video-thumbnail.no-video .coming-soon {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}

/* Contact Form */
.contact {
    padding: 60px 0;
    background-color: #ffffff;
    text-align: center;
}

.contact-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.contact-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
    border-radius: 20px;
}

/* Footer */
.footer {
    padding: 30px 0;
    background-color: #f9f9f9;
    text-align: center;
}

.footer-text {
    font-size: 1rem;
    color: #666;
}

/* Team Popup */
.team-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.popup-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #2a6fb8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-popup:hover {
    color: #000;
}

#popup-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2a6fb8;
    font-weight: 700;
}

#popup-text p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.mobile-info-trigger {
    display: none;
    cursor: pointer;
}

/* Media Queries */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
    }
    
    .hero-content {
        width: 100%;
        order: 2;
        text-align: center;
    }
    
    .hero-image {
        order: 1;
        height: auto;
        max-height: 400px;
    }
    
    .proposal {
        flex-direction: column !important;
    }
    
    .proposal-content, .proposal-media {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .team-member.featured {
        grid-column: span 2;
        grid-row: span 2;
        flex-direction: column;
    }
    
    .team-member.featured img, .team-member.featured .team-info {
        width: 100%;
    }
    
    .member-overlay h4 {
        font-size: 14px;
        padding: 0 10px;
        line-height: 1.4;
    }
    
    .member-overlay {
        line-height: normal;
    }
}

/* On large screens give the featured info more horizontal space */
@media (min-width: 900px) {
    .team-member.featured img {
        width: 35%;
        max-width: 35%;
    }

    .team-member.featured .team-info {
        width: 65%;
    }

    /* Slightly increase font-size for readability on wide screens */
    .team-member.featured .team-info p {
        font-size: 1.05rem;
    }
}

@media (max-width: 576px) {
    .hero-content {
        width: 100%;
        padding: 30px 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-btns {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero-image {
        max-height: 300px;
    }
    
    .ps-logo {
        width: auto;
        max-height: 30px;
        top: 5px;
        right: 5px;
    }
    
    .member-overlay h4 {
        line-height: 1.5;
        padding: 10px;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    /* Reduce vertical spacing and allow items to size naturally on small screens */
    .team-grid {
        gap: 10px;
        margin-top: 18px;
        grid-auto-rows: auto; /* let rows size to content */
    }
    
    /* Ensure featured member info (Catarina) is visible on small screens */
    .team-member.featured {
        flex-direction: column;
        align-items: stretch;
    }

    .team-member.featured img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .team-member.featured .team-info {
        display: block;
        width: 100%;
        padding: 18px;
        background-color: white;
        color: #333;
        text-align: left;
    }
    
    /* Allow the featured card to expand vertically and avoid clipping */
    .team-member.featured {
        aspect-ratio: auto;
        overflow: visible;
        line-height: normal;
        min-height: auto;
    }

    /* On very small screens don't force a 1:1 aspect ratio for regular members */
    .team-member {
        aspect-ratio: auto;
        height: auto;
    }
    
    .mobile-info-trigger {
        display: flex;
    }
}
