/* ===== Base ===== */
body {
    margin:0;
    font-family:'Open Sans',sans-serif;
    color:#000;
    background:#fff;
}
.container {
    width:85%;
    margin:auto;
}

/* Header */
header {
    background:#fff;
    padding:20px 0;
    border-bottom:1px solid #ddd;
    position:sticky;
    top:0;
    z-index:999;
}
.header-container {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 15px; /* margem das extremidades do ecrã */
}
nav {
    display:flex;
}
nav a {
    margin-left:20px;
    text-decoration:none;
    color:#000;
}
.btn-nav {
    background:#FDC010;
    color:#000;
    padding:8px 15px;
    border-radius:4px;
    font-weight:600;
}
#menu-toggle {
    display:none;
    font-size:28px;
    cursor:pointer;
}

/* Hero */
.hero {
    background-size:cover;
    background-position:center;
    position:relative;
    padding:80px 0;
    text-align:center;
    color:#000;
}
.hero-overlay {
    background:rgba(255,255,255,0.2);
    padding:80px 0;
}

/* Botões */
.btn-primary {
    display:inline-block;
    background:#FDC010;
    color:#000;
    padding:12px 25px;
    border-radius:5px;
    text-decoration:none;
    margin-top:20px;
    font-weight:600;
    transition:all 0.3s ease;
}
.btn-primary:hover {
    background:#e6b50f;
    transform:translateY(-2px);
    box-shadow:0 4px 15px rgba(0,0,0,0.2);
}

/* Secções */
.servicos, .portfolio, .apoio, .sobre, .contacto {
    padding:60px 0;
    text-align:center;
}

/* Grids */
.grid-4 {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}
.grid-2 {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
}

/* Cards / Projects */
.card, .project {
    background:#fff;
    padding:25px;
    border:1px solid #ddd;
    border-radius:6px;
    overflow:hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover, .project:hover {
    transform:scale(1.05);
    box-shadow:0 15px 25px rgba(0,0,0,0.15);
}
.project img {
    width: 100%;       /* ocupa toda a largura da coluna */
    max-width: 400px;  /* limite para não crescer demais */
    height: auto;      /* mantém proporção */
    border-radius: 6px;
    margin-bottom: 15px;
    object-fit: cover;
}
.project h4 a {
    color: inherit;           /* Mantém a cor do h4 */
    text-decoration: none;    /* Remove sublinhado */
    transition: color 0.3s;
}

.project h4 a:hover {
    color: #FDC010;           /* Cor de destaque ao passar o mouse */
}

/* Skills */
.skills {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:15px;
    margin-top:20px;
}
.skill {
    font-weight:600;
    color:#FDC010;
    padding:5px 10px;
    border:1px solid #FDC010;
    border-radius:5px;
}
.skill img {
    width:24px;
    height:24px;
    object-fit:contain;
}

/* Footer */
footer {
    background:#f9f9f9;
    padding:20px 0;
    text-align:center;
}

/* Lightbox */
#lightbox {
    display:none;
    position:fixed;
    z-index:1000;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.9);
    justify-content:center;
    align-items:center;
}
#lightbox img.lightbox-content {
    max-width:90%;
    max-height:90%;
    border-radius:6px;
}
#lightbox .close {
    position:absolute;
    top:20px;
    right:35px;
    color:#fff;
    font-size:40px;
    font-weight:bold;
    cursor:pointer;
}

/* Fade-in */
.fade-in {
    opacity:0;
    transform:translateY(20px);
    transition:opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity:1;
    transform:translateY(0);
}

/* ===== Melhorias para imagens responsivas ===== */
.project img {
    max-width:100%;
    height:auto;
}
@media(min-width:1025px){
    .project img {
        max-height:400px; /* limita altura para ecrãs grandes */
        object-fit:cover;
    }
}
@media(max-width:1024px){
    .project img {
        max-height:350px;
    }
}
@media(max-width:768px){
    .project img {
        max-height:300px;
    }
}
@media(max-width:480px){
    .project img {
        max-height:250px;
    }
}

/* Responsivo geral */
@media(max-width:1024px){
    .grid-4 {grid-template-columns:repeat(2,1fr);}
    .grid-2 {grid-template-columns:1fr;}
}
@media(max-width:768px){
    .header-container {flex-direction:row; justify-content:space-between; align-items:center; padding:0 15px;}
    nav {display:none; flex-direction:column; width:100%;}
    nav a {margin:10px 0;}
    #menu-toggle {display:block;}
    .grid-4,.grid-2{grid-template-columns:1fr;}
    .hero h2 {font-size:28px;}
    .btn-primary {padding:10px 20px;}
}
@media(max-width:480px){
    .hero {padding:50px 20px;}
    .hero h2 {font-size:22px;}
    .servicos,.portfolio,.apoio,.sobre,.contacto{padding:40px 20px;}
    .skills {gap:10px;}
    .skill img {width:20px; height:20px;}
}