.mod-articles-items > li {
  list-style: none;
}

#sp-menu {
  text-transform: uppercase;
}


.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; 
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}






/***************** LOGO FOOTER *********************************/
@media (min-width: 992px) {
    /* 1. Structural Grid: Keeps all 3 columns strictly equal in width */
    #sp-bottom1, 
    #sp-bottom2, 
    #sp-bottom3 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
        width: 33.333333% !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    /* 2. Isolation Strategy: Keep col 1 & 2 left-aligned */
    #sp-bottom1 { align-items: flex-start !important; }
    #sp-bottom2 { align-items: flex-start !important; }

    /* 3. The Fix: Centers the right menu inside its own 1/3 column space. 
          This creates a massive visual gap away from the map. */
    #sp-bottom3 {
        align-items: center !important; /* Shifts the menu container to the center zone of column 3 */
    }
    #sp-bottom3 .sp-column {
        text-align: center !important;  /* Centers the text links inside the menu */
        width: auto !important;
    }
}

/* Reset list padding so centering calculations are perfectly balanced */
#sp-bottom3 ul.menu {
    padding-left: 0 !important;
    margin-left: 0 !important;
    list-style: none !important;
    display: inline-block !important; 
}

/* Apply to the outer container wrapping your sp-bottom columns */
#sp-bottom {
    background-color: #124a83 !important; /* Deep Midnight Navy */
    color: #f8f9fa !important;            /* Crisp off-white text */
}

/* Ensures your footer menu links contrast perfectly against the dark background */
#sp-bottom1 a, #sp-bottom3 a {
    color: #e2e8f0 !important;
}
#sp-bottom1 a:hover, #sp-bottom3 a:hover {
    color: #38bdf8 !important; /* Tech blue accent on hover */
}

/*****************LOGOS ***************************/
#sp-bottom4 .mod-custom .flex {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important; 
    gap: 1.5rem !important; /* Slightly increased gap for the larger size */
}

#sp-bottom4 .h-12 {
    height: auto !important;
    width: auto !important;
}

#sp-bottom4 .mod-custom img {
    height: 6rem !important; /* Doubled from 3rem to 6rem (96px) */
    width: auto !important;
    display: block !important;
}

/************** projecos *********************************************/
/* 1. Inicia o contador na secção principal dos projetos */
#projectos {
    counter-reset: project-counter;
}

/* 2. Prepara os blocos de texto especificamente dentro desta secção */
#projectos .sppb-addon-content {
    position: relative;
}

/* 3. Desenha o número e aplica o destaque suave (soft highlight) */
#projectos .sppb-addon-content::before {
    counter-increment: project-counter;
    content: counter(project-counter); 
    
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 40px;
    height: 40px;
    background-color: rgba(30, 90, 165, 0.1); /* Fundo azul muito suave */
    color: #1e5aa5;                           /* Texto azul do logotipo */
    border-radius: 50%;                       
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);   
}

/* =========================================
   4. LAYOUT MOBILE (Ícone à esquerda)
   ========================================= */
@media (max-width: 991px) {
    #projectos .sppb-addon-content {
        padding-left: 55px !important; 
        text-align: left !important;
    }
    #projectos .sppb-addon-content::before {
        top: 0;
        left: 0; 
    }
}

/* =========================================
   5. LAYOUT DESKTOP (Ícone no topo e centrado)
   ========================================= */
@media (min-width: 992px) {
    #projectos .sppb-addon-content {
        padding-top: 55px !important; 
        text-align: center !important; 
    }
    #projectos .sppb-addon-content::before {
        top: 0;
        left: 50%;
        transform: translateX(-50%); 
    }
}

/*****************************************************/
/* Mobile responsive adjustment */
@media (max-width: 768px) {
    h1, .h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
}






/**************** ACTIVIDADES *******************************************/
/**************** actividades *****************************************/
/* Ensure the row behaves correctly */
/* Container for the 4 columns, scoped to your specific module */
/* Container for the 4 columns */
.moduloactividades .mod-articles-items {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Desktop layout: 4 columns */
@media (min-width: 992px) {
    .moduloactividades .mod-articles-items {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Flexbox card content.
  By applying the blue background here, everything below the image 
  is unified inside the blue area.
*/
.moduloactividades .mod-articles-item-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #0056b3; /* Brand blue moved to parent container */
}

/* Force Image to the top */
.moduloactividades .article-intro-image {
    order: 1; 
    width: 100%;
    height: 180px; /* Fixed thumbnail height constraint */
    margin: 0 !important;
}

/* Maintain image proportions and cover the space */
.moduloactividades .article-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

/* Date Container (Details List)
  Forced below the image (order 2) and formatted with white text.
*/
.moduloactividades .list-unstyled {
    order: 2; 
    margin: 0;
    padding: 15px 15px 0 15px; /* Padding for top and sides */
    text-align: center;
}

/* Hide the accessibility label and the calendar icon */
.moduloactividades .article-info-term,
.moduloactividades .icon-calendar {
    display: none !important;
}

/* Style the date text */
.moduloactividades .mod-articles-date {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    opacity: 0.8; /* Slight opacity makes the date subtle compared to the title */
    display: block;
}

/* Force Title below the date (order 3) */
.moduloactividades .mod-articles-title {
    order: 3;
    background-color: transparent; /* Removed blue background from here */
    margin: 0;
    padding: 5px 15px 15px 15px; /* Slight top padding so it sits near the date */
    text-align: center;
    flex-grow: 1; /* Ensures buttons/bottoms align if titles are different lengths */
    display: flex;
    align-items: flex-start; /* Aligns text neatly near the date */
    justify-content: center;
}

/* White text for the title links */
.moduloactividades .mod-articles-title .mod-articles-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
    font-weight: bold;
}

.moduloactividades .mod-articles-title .mod-articles-link:hover {
    text-decoration: underline;
}

/****************** Actividades Recentes Blog List ********************/


/* Container for the Leading Article */
.articles-leading {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid #333; /* Thicker line to separate from the rest */
}

/* Make the leading article a column layout for impact */
.articles-leading .blog-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Hero Thumbnail Styling */
.articles-leading .article-intro-image {
    width: 100%;
    max-height: 500px; /* Limits portrait images from being too tall */
    overflow: hidden;
    border-radius: 12px;
}

.articles-leading .article-intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops nicely to a wide "hero" format */
    object-position: center 20%; /* Adjusts focus to the top-ish of the photo */
}

/* Leading Typography */
.articles-leading .article-header h2 {
    font-size: 2.2rem; /* Significantly larger than list items */
    font-weight: 800;
    line-height: 1.1;
    margin: 0.5rem 0;
    letter-spacing: -0.02em;
}

.articles-leading .article-header a {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

/* Make the intro text more prominent */
.articles-leading .article-introtext {
    font-size: 1.2rem; /* Larger font for better readability */
    line-height: 1.7;
    color: #444;
    max-width: 800px; /* Prevents text lines from getting too long */
    -webkit-line-clamp: 4; /* Slightly longer summary for the leader */
}

/* Metadata (Date) styling */
.articles-leading .article-info {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    font-size: 0.8rem;
    color: #cc0000; /* Accented color for the primary article */
}


/**************ENd of leading article ***************************************/

/* The Main Container */
.actividades-list {
    max-width: 1000px;      /* Prevents the list from stretching too wide on big screens */
    margin: 4rem auto;      /* Centers the list and gives top/bottom breathing room */
    padding: 0 2rem;        /* Side padding so text doesn't touch the screen edges */
}

.actividades-list .article {
  border: 0;
}

/* Individual Item Spacing */
.actividades-list .row {
    margin-bottom: 3rem;    /* Generous space between activities */
    padding-bottom: 3rem;
    border-bottom: 1px solid #f0f0f0;
}

/* Remove border from the very last item */
.actividades-list .row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* --- Mobile Responsive Settings --- */
@media (max-width: 768px) {
    .actividades-list {
        margin: 2rem auto;  /* Reduce top/bottom margin on mobile */
        padding: 0 1.2rem;  /* Tighter side margins for more "real estate" */
    }

    .actividades-list .row {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
}

/******************end of margis **********************************/

/* 1. Remove the default top margin from the header container and the H2 */
.actividades-list .article-header,
.actividades-list .article-header h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1.2; /* Tightens the line height so the 'ascenders' of letters align with the image top */
}

/* 2. Ensure the article body itself doesn't have offset padding */
.actividades-list .article-body {
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Forces content to the very top */
}

/* 3. Fix the image container to ensure no "ghost" padding at the top */
.actividades-list .article-intro-image {
    line-height: 0; /* Removes any baseline gap below/above images */
    margin-top: 0 !important;
}

.actividades-list .article-intro-image img {
    display: block; /* Removes the default inline gap */
}


/********* ENd Reset ********************************/
/* Container and Row Spacing */
.actividades-list .row {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

/* Flexbox Layout for the Article */
.actividades-list .article {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Thumbnail Constraints */
.actividades-list .article-intro-image {
    flex: 0 0 250px; /* Fixed width for the thumbnail area */
    max-width: 250px;
}

.actividades-list .article-intro-image img {
    width: 100%;
    height: 180px; /* Fixed height for uniform thumbnails */
    object-fit: cover; /* Prevents stretching */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.actividades-list .article-intro-image img:hover {
    transform: scale(1.03);
}

/* Typography and Content */
.actividades-list .article-body {
    flex: 1;
}

.actividades-list .article-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.actividades-list .article-header a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.actividades-list .article-header a:hover {
    color: #0056b3;
}

/* Date/Info Styling */
.actividades-list .article-info {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
    display: block;
}

.actividades-list .article-introtext {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Change this number to show more/fewer lines */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* Optional: ensures a consistent height and spacing */
    max-height: 4.8em; /* Roughly 3 lines of text */
    line-height: 1.6em;  
}

.actividades-list .article-introtext p {
    margin: 0;
    display: inline; /* Keeps the ellipsis at the end of the text block */
}

/* Responsive Adjustments (Mobile) */
@media (max-width: 768px) {
    .actividades-list .article {
        flex-direction: column;
    }
    
    .actividades-list .article-intro-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .actividades-list .article-intro-image img {
        height: auto;
        max-height: 250px;
    }
}