/* General Header Styles */
.header {
    width: auto;
    background-color: #ffffff;
    min-height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5% 5%;
    padding-bottom: 0px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.header-logo-home {
    position: absolute; /* Position the logo absolutely */
    left: 15%;          /* Move it to the center horizontally */
    transform: translateX(-50%); /* Adjust for the logo's width */
    display: flex;
    justify-content: center;
    align-items: center;
    
}

.header-logo-home img {
    height: 100px;
    width: auto;
    object-fit: contain;
    display: block;
}

.header-text-home {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: flex-end;
    text-align: right;
    margin-left: auto;
    height: 120px;
}

.header-title {
    color: black;
    font-size: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 400; 
    line-height: 0;
    padding-bottom: 0px;
    margin-bottom: 0;
}

/* Header Links */
.header-links {
    display: flex;
    flex-direction: column; /* Stack the flags and text vertically */
    gap: 10px; /* Add spacing between each flag and text */
    align-items: flex-end; /* Align the flags and text to the right */
}

.header-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: black;
    gap: 10px; /* Add spacing between the flag and the text */
}

.header-link img {
    height: auto; /* Set a consistent height for all flags */
    width: 30px;
}

.header-link span {
    font-size: 20px; /* Match the font size of "National Agoras" */
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-align: right; /* Align the text to the right */
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-link img {
        height: 20px; /* Adjust flag size for smaller screens */
    }

    .header-link span {
        font-size: 20px; /* Adjust font size for smaller screens */
    }
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 15px;
    }
    
    .header-links {
        justify-content: center;
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .header-title {
        font-size: 18px;
    }
    
    .header-link span {
        font-size: 12px;
    }
    
    .header-link img {
        height: 20px;
    }
}
/* General Footer Styles */
.footer {
    background-color: #ffffff;
    padding: 0; /* Remove padding here to avoid conflicts */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    position: relative;
    bottom: 0;
    z-index: 1000;
    width: 100%;
}

/* Footer Top Section */
.footer .top-section {
    display: flex;
    align-items: center;
    justify-content: space-around; /* Changed from space-between to space-around */
    padding: 20px 30px; /* Reduced horizontal padding from 50px to 30px */
    gap: 15px; /* Reduced gap from 20px to 15px */
    width: 100%;
    box-sizing: border-box;
}

.footer .top-section .democrat-logo {
     flex: 0 0 auto;
    max-height: 100px;
    width: auto;
}

.footer .catalan-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.footer .catalan-logo {
    /* Catalan Department of Education logo */
    flex: 0 0 auto;
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.footer .funding-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 40%; /* Increased from 50% to 60% to use more space */
}

.footer .europe-flag {
    flex: 0 0 auto;
    width: 150px;
    height: auto;
}

.footer .funding-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

.footer .catcollab {
    font-size: 13px; /* Change this value to your desired size */
    font-style: italic;
    color: #666;
    text-align: center;
    display: block;
    margin-top: 5px;
}

/* Footer Bottom Section */
.footer .bottom-section {
    padding: 10px 50px 20px 50px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.footer .bottom-section span {
    font-size: 12px;
    color: #666;
}

.footer .bottom-section a {
    font-size: 12px;
    color: #0056b3;
    text-decoration: none;
}

.footer .bottom-section a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .footer .top-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .footer .funding-container {
        max-width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .footer .catalan-logo {
        max-width: 120px;
        max-height: 50px;
    }
    
    .footer .bottom-section {
        padding: 10px 20px 20px 20px;
    }
}

.main-content {
    max-width: 900px;
    margin: 15px auto 0 auto; /* 15px top margin */
    background: #fff;
}

.videos-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
    gap: 20px;
    flex-wrap: wrap;
}

.videos-header-bar .section-title {
    margin: 0 !important;
    font-size: 2rem !important;
    font-weight: bold !important;
}

.videos-header-bar .search-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

#peertube-search {
    width: 220px;
    padding: 8px;
    font-size: 16px;
}

#peertube-videos-list {
    padding-top: 20px;
}

@media (max-width: 600px) {
    .videos-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .videos-header-bar .section-title {
        font-size: 1.3rem !important;
    }
    #peertube-search {
        width: 100%;
    }
}

/* Blog grid styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #eee;
}

.blog-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.blog-card-meta {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 10px;
}

.blog-card-excerpt {
    flex: 1;
    font-size: 1rem;
    color: #444;
    margin-bottom: 12px;
}

.blog-card-link {
    align-self: flex-start;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.98rem;
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .blog-card img {
        height: 140px;
    }
}

/* Resource grid layout */
#library-resources-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
    padding-bottom: 40px;
}

#english-project-resources-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
    padding-bottom: 40px;
}

#english-other-resources-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
    padding-bottom: 40px;
}

.resource-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Remove height: 100%; */
    padding: 18px 16px 16px 16px;
    transition: box-shadow 0.2s;
}

.resource-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}

.resource-title {
    font-size: 1.08rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #222;
    word-break: break-word;
}

.resource-meta {
    font-size: 0.97rem;
    color: #666;
    margin-bottom: 12px;
}

.resource-link {
    align-self: flex-start;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.98rem;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 6px 14px;
    background: #f7faff;
    transition: background 0.2s, color 0.2s;
}

.resource-link:hover {
    background: #007bff;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 900px) {
    #library-resources-list {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    #library-resources-list {
        grid-template-columns: 1fr;
    }
}