/* --- VARIABILI GLOBALI --- */
:root {
    --text-dark: #2B2118;
    --text-light: #5e4d41;
    --main-color: #7A1F2B;
    --accent: #004777;
    --bg-page: #F7F3ED;
    --bg-section: #ffffff;
    --bg-card: #ffffff;
    --bg-media: #f2ece4;
    --bg-contact: #f2ece4;
}

/* --- BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    font-size: 18px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, .quote, .quote-box, .latin-quote {
    font-family: 'Lora', serif;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- TOP HEADER --- */
.site-header-wrapper {
    background-color: var(--bg-section);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px 20px 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.header-logo {
    width: 110px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text {
    text-align: center;
    flex: 1;
    max-width: 800px;
}

.header-text h1 {
    font-size: 42px;
    color: var(--main-color);
    font-style: italic;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 5px;
}

.header-text h2 {
    font-size: 32px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-dark);
    margin: 0 auto;
    max-width: 700px;
}

.subtitle strong {
    color: var(--accent);
}

/* --- NAVIGATION & BREADCRUMBS --- */
.breadcrumb-bar {
    background-color: var(--main-color);
    color: white;
    text-align: center;
    padding: 12px 20px;
    font-size: 18px;
}

.breadcrumb-bar a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}

/* --- PAGE INTRO --- */
.page-intro {
    text-align: center;
    padding: 40px 20px;
}

.page-intro h3 {
    font-size: 36px;
    color: var(--main-color);
    margin-bottom: 20px;
}

.disclaimer-box {
    background-color: white;
    border-left: 4px solid var(--accent);
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
    text-align: left;
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 0 4px 4px 0;
}

.latin-quote {
    font-size: 22px;
    color: var(--accent);
    font-style: italic;
}

.latin-sub {
    font-size: 18px;
    color: var(--text-light);
}

.latin-quote-2 {
    font-size: 32px;
    color: var(--accent);
    font-style: italic;
}

/* --- HOME: HERO IMAGE --- */
.hero-image {
    width: 100%;
    object-fit: cover;
    display: block;
}

/* --- HOME: DOCUMENTS NAV --- */
.documents-nav {
    background-color: var(--main-color);
    padding: 30px 20px;
    text-align: center;
}

.documents-nav h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 20px;
    font-style: italic;
}

.lang-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.lang-btn {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: white;
    color: var(--main-color);
    transform: translateY(-2px);
}

/* --- HOME: DOCUMENT & MEDIA SEARCH --- */
.search-wrapper {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.search-label {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.search-input-wrapper {
    position: relative;
    max-width: 550px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--accent);
    pointer-events: none;
    transition: color 0.3s;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 2px solid white;
    border-radius: 50px;
    background: rgba(0,0,0,0.25);
    color: white;
    font-size: 16px;
    font-family: 'Work Sans', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.45);
}

.search-input:focus {
    border-color: var(--accent);
    background: rgba(0,0,0,0.35);
    box-shadow: 0 0 20px rgba(0, 71, 119, 0.2);
}

.search-input:focus ~ .search-icon {
    color: #fff;
}

.search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.search-clear:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

.search-clear.visible {
    display: flex;
}

/* Search Tabs */
.search-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.search-tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.search-tab-btn.active {
    background: white;
    color: var(--main-color);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-tab-count {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
}

.search-tab-btn.active .search-tab-count {
    background: var(--main-color);
    color: white;
}

/* Search Results */
.search-results {
    margin-top: 25px;
    display: none;
}

.search-results.active {
    display: block;
}

.search-results-info {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.search-results-info strong {
    color: white;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    animation: cardFadeIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-result-card:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.result-meta-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-items: flex-start;
}

.result-lang-tag {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.result-lang-tag.lang-english    { background: #2563eb; color: #fff; }
.result-lang-tag.lang-italiano   { background: #16a34a; color: #fff; }
.result-lang-tag.lang-swahili    { background: #ea580c; color: #fff; }
.result-lang-tag.lang-francais   { background: #7c3aed; color: #fff; }
.result-lang-tag.lang-kikongo    { background: #0d9488; color: #fff; }
.result-lang-tag.lang-lingala    { background: #db2777; color: #fff; }
.result-lang-tag.lang-espanol    { background: #ca8a04; color: #fff; }

.result-type-tag {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.result-type-tag.type-doc      { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.result-type-tag.type-telegram { background: #229ED9; color: #fff; }
.result-type-tag.type-rumble   { background: #85c742; color: #fff; }
.result-type-tag.type-youtube  { background: #FF0000; color: #fff; }
.result-type-tag.type-website  { background: #004777; color: #fff; }
.result-type-tag.type-video    { background: #9333ea; color: #fff; }

.result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    min-width: 0;
}

.result-title {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

.result-title mark {
    background: var(--accent);
    color: white;
    padding: 0 2px;
    border-radius: 2px;
}

.result-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.3;
    font-weight: 400;
}

.result-action-btn {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.result-action-btn:hover {
    background: #0066ad;
    transform: scale(1.05);
}

.result-action-btn.btn-media {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.result-action-btn.btn-media:hover {
    background: white;
    color: var(--text-dark);
}

/* No results */
.search-no-results {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255,255,255,0.5);
    font-size: 15px;
}

.search-no-results span {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
    .search-result-card {
        flex-wrap: wrap;
        gap: 8px;
    }
    .result-content {
        order: -1;
        width: 100%;
        flex-basis: 100%;
    }
    .result-action-btn {
        margin-left: auto;
    }
}

/* --- HOME: TELEGRAM SECTION --- */
.telegram-section {
    padding: 60px 20px;
    background-color: #f0f4f8;
    text-align: center;
}

.telegram-section h3 {
    font-size: 32px;
    color: var(--main-color);
    margin-bottom: 40px;
    font-style: italic;
}

.tg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.tg-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    cursor: pointer;
}

.tg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.tg-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.tg-card h4 {
    color: var(--main-color);
    font-size: 20px;
    margin-bottom: 5px;
}

.tg-card p {
    font-size: 18px;
    color: var(--text-light);
}

/* --- HOME: VIDEO SECTION --- */
.video-section {
    padding: 80px 20px;
    background-color: var(--bg-section);
}

.video-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.video-text {
    flex: 1;
    min-width: 300px;
}

.video-text h3 {
    font-size: 32px;
    margin-bottom: 20px;
}

.video-text p {
    font-size: 18px;
    color: var(--text-light);
    text-align: justify;
}

.video-player {
    flex: 1;
    min-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: #000;
}

.video-link {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.video-link img {
    width: 100%;
    display: block;
    opacity: 0.9;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(0, 71, 119, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.play-button::before {
    content: '';
    display: block;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent white;
    margin-left: 5px;
}

.video-link:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.video-link:hover .play-button {
    background-color: var(--accent);
    transform: translate(-50%, -50%) scale(1.15);
}

/* --- INNER PAGE: LIBRARY SECTION --- */
.library-section {
    padding: 20px 20px 60px;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.doc-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.doc-card-2 {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 71, 119, 0.15);
    border-color: var(--accent);
}

.doc-image-container {
    height: 200px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.doc-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.doc-info {
    padding: 20px 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.doc-info h4 {
    font-size: 18px;
    color: var(--main-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.download-badge {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* --- INNER PAGE: MEDIA SECTION --- */
.media-section {
    background-color: var(--bg-media);
    padding: 60px 20px;
    border-top: 1px solid #e1e8f0;
}

.section-title {
    text-align: center;
    font-size: 28px;
    color: var(--main-color);
    margin-bottom: 40px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.media-card {
    background: white;
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.media-card:hover {
    transform: scale(1.02);
}

.media-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    object-fit: cover;
}

.media-info h5 {
    font-size: 18px;
    color: var(--main-color);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
}

.media-info p {
    font-size: 18px;
    color: var(--text-light);
    margin-top: 5px;
}

.platform-label {
    font-size: 18px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- USEFUL LINKS: LINKS GRID --- */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.link-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 71, 119, 0.1);
    border-color: var(--accent);
}

.link-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 2px solid #f0f0f0;
}

.link-info {
    flex: 1;
}

.link-meta {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    color: #888;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-badge {
    background-color: var(--bg-contact);
    color: var(--main-color);
    padding: 3px 8px;
    border-radius: 4px;
}

.link-info h4 {
    font-size: 18px;
    color: var(--main-color);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

/* --- USEFUL LINKS: CONTACT FORM --- */
.contact-section {
    background-color: var(--bg-contact);
    padding: 70px 20px;
    border-top: 1px solid #e1e8f0;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
}

.contact-title {
    font-size: 32px;
    color: var(--main-color);
    margin-bottom: 5px;
}

.contact-subtitle {
    font-size: 18px;
    color: var(--accent);
    font-style: italic;
    font-weight: 600;
    margin-bottom: 30px;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 18px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--main-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background-color: var(--accent);
}

/* --- QUOTE SECTION & FOOTER --- */
.quote-section {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--bg-page);
}

.quote-box {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 40px 40px 110px;
    background-color: #fff;
    border-left: 6px solid var(--main-color);
    border-radius: 8px;
    font-style: italic;
    font-size: 18px;
    color: var(--main-color);
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: left;
}

.quote-icon {
    font-size: 120px;
    color: var(--main-color);
    position: absolute;
    top: 20px;
    left: 20px;
    line-height: 0.8;
    font-family: 'Lora', serif;
    background: transparent;
    padding: 0;
    transform: none;
}

.quote-icon-2 {
    font-size: 120px;
    color: var(--main-color);
    position: absolute;
    right: 20px;
    line-height: 79px;
    font-family: 'Lora', serif;
    background: transparent;
    padding: 0;
    transform: rotateY(180deg);
}

.quote-box p {
    margin: 0;
    line-height: 1.8;
}

.quote-box cite {
    display: block;
    font-size: 14px;
    font-style: italic;
    color: var(--text-light);
    margin-top: 20px;
    font-family: 'Nunito Sans', sans-serif;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: white;
    font-size: 18px;
    color: var(--text-light);
    border-top: 1px solid #eee;
}

footer a {
    color: var(--accent);
    font-weight: bold;
}

/* --- COOKIE MODAL --- */
.cookie-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.cookie-modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--accent);
}
.cookie-modal-content h3 {
    margin-bottom: 15px;
    color: var(--main-color);
    font-family: 'Lora', serif;
}
.cookie-modal-content p {
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}
.cookie-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-cookie {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Work Sans', sans-serif;
}
.btn-accept {
    background-color: var(--accent);
    color: #fff;
}
.btn-accept:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}
.btn-reject {
    background-color: #e0e0e0;
    color: var(--text-dark);
}
.btn-reject:hover {
    background-color: #cccccc;
    transform: translateY(-2px);
}

/* --- RESPONSIVE / MOBILE --- */
@media (max-width: 768px) {
    .site-header { 
        flex-direction: column; 
        gap: 20px;
        padding: 30px 20px;
    }
    .header-logo {
        width: 80px;
    }
    .header-text h1 {
        font-size: 32px;
    }
    .header-text h2 {
        font-size: 24px;
    }
    .video-container {
        flex-direction: column;
    }
}

@media (max-width: 450px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
    .media-card {
        padding: 5px;
    }
}
