:root {
    --primary-color: #26a69a;
    --primary-light: #e0f7fa;
    --primary-dark: #004d40;
    --text-color: #004d40;
    --footer-bg: #26a69a;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-gray: #b2dfdb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.header {
    background-color: var(--primary-light);
    padding: 1rem 2vw;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
}

.logo-link img {
    height: 48px;
    width: auto;
    display: block;
}

.content {
    width: 100%;
    padding: 2rem 2vw;
    flex: 1;
    box-sizing: border-box;
    margin: 0;
}

.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(38,166,154,0.15);
    margin-bottom: 2rem;
    text-align: center;
    padding: 2rem;
}

.hero-banner-text h1 {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-banner-text p {
    color: var(--primary-light);
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

.cards-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(38,166,154,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--border-gray);
    max-width: 600px;
    width: 100%;
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.card-content p {
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.7;
    font-size: 1.08rem;
}

footer {
    background-color: var(--footer-bg);
    color: var(--white);
    padding: 2.2rem 0 0 0;
    margin-top: 3rem;
    width: 100%;
    margin: 0;
}

.footer-content {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding: 0 2vw;
    box-sizing: border-box;
    margin: 0;
}

.footer-section {
    padding: 0.9rem 0.9rem;
    margin: 0;
}

.footer-section h2 {
    margin-bottom: 1rem;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s ease;
    opacity: 0.9;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: var(--primary-light);
    opacity: 1;
    transform: translateX(4px);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: rgba(255,255,255,0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.tag:hover {
    background-color: #198976;
    color: var(--white);
    transform: none !important;
}

.footer-content p {
    opacity: 0.9;
    font-size: 0.9rem;
    text-align: center;
}

.footer-copyright {
    width: 100%;
    background: #102b26;
    color: #e0f7f4;
    text-align: center;
    padding: 1rem 0 0.7rem 0;
    font-size: 0.92rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    opacity: 0.95;
    letter-spacing: 0.01em;
    box-sizing: border-box;
    margin-top: 2.5rem;
}

@media (min-width: 1200px) {
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    padding: 0 2.5rem;
  }
  .footer-section h2 {
    font-size: 1.25rem;
  }
  .footer-section a, .tag {
    font-size: 1.05rem;
  }
}

@media (min-width: 1600px) {
  .footer-content {
    gap: 4rem;
    padding: 0 4rem;
  }
}

/* --- NAVIGATION MENU E DROPDOWNS --- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: flex-start;
    margin-left: 40px;
}

.nav-item {
    position: relative;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 6px;
    font-size: 0.9rem;
}

.nav-item:hover {
    color: var(--primary-dark);
    background-color: rgba(38,166,154,0.1);
}

.nav-item.has-dropdown::after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    color: var(--primary-color);
}

.nav-item.has-dropdown.active::after {
    transform: rotate(180deg);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(38,166,154,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s ease;
    z-index: 2000;
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

.nav-item:hover .dropdown,
.nav-item.active .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateX(4px);
}

.dropdown-item.has-submenu::after {
    content: "▶";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var(--primary-color);
}

.dropdown-item.has-submenu:hover > .submenu,
.dropdown-item.has-submenu.active > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Garante que apenas o submenu do item ativo abre */
.dropdown .submenu {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px);
    transition: all 0.3s ease;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    z-index: 3000;
    background: var(--white);
    box-shadow: 0 8px 32px rgba(38,166,154,0.2);
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

.dropdown-item.has-submenu:hover > .submenu,
.dropdown-item.has-submenu.active > .submenu {
    z-index: 4000;
}

/* Corrige o submenu de primeiro nível para abrir para baixo */
.dropdown > .submenu {
    left: 0;
    top: 100%;
    min-width: 220px;
    transform: translateY(-15px);
}

/* --- PESQUISA HEADER --- */
.header-search {
    display: flex;
    align-items: center;
    border-radius: 19px;
    box-shadow: none;
    padding: 0;
    max-width: 220px;
    width: auto;
    position: relative;
    overflow: visible;
    background: transparent;
    transition: background 0.2s;
}

.header-search.expanded {
    background: #fff;
}

.header-search input[type="text"] {
    height: 38px;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 1rem;
    outline: none;
    color: #222;
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    border-radius: 19px 0 0 19px;
    position: relative;
    z-index: 1;
}

.header-search button {
    background: #26A699;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 0;
    box-shadow: none;
    transition: background 0.18s, border-radius 0.3s;
    outline: none;
    padding: 0;
    z-index: 2;
    position: relative;
    left: 0;
}

.header-search.expanded button {
    border-radius: 0 19px 19px 0;
    background: #26A699;
    width: 44px;
    height: 38px;
    margin-left: 0;
}

.header-search button:hover, .header-search button:focus {
    background: #1e857a;
}

.header-search button svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

/* --- ACESSIBILIDADE E RESPONSIVIDADE --- */
.nav-item:focus,
.dropdown-item:focus,
.read-more-btn:focus,
.header-search input:focus,
.header-search button:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .dropdown-item,
    .read-more-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 1100px) {
    .cards-container {
        gap: 1.2rem;
    }
    .footer-content {
        gap: 1.2rem;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .content {
        padding: 1.2rem 1vw;
    }
    .hero-banner {
        padding: 1.2rem 0.5rem;
        font-size: 1rem;
    }
    .cards-container {
        flex-direction: column;
        gap: 1.2rem;
    }
    .card-content {
        padding: 1.2rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 1vw;
    }
    .footer-section {
        padding: 0.7rem 0.5rem;
    }
    .footer-section h2 {
        font-size: 1.05rem;
    }
    .footer-section a, .tag {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0.7rem 0.5vw;
    }
    .logo-link img {
        height: 36px;
    }
    .hero-banner-text h1 {
        font-size: 1.3rem;
    }
    .hero-banner-text p {
        font-size: 0.95rem;
    }
    .card-content {
        padding: 0.7rem;
    }
    .card-content h2 {
        font-size: 1.05rem;
    }
    .card-content p {
        font-size: 0.97rem;
    }
    .card {
        border-radius: 10px;
    }
    .footer-section {
        padding: 0.5rem 0.2rem;
    }
    .footer-section h2 {
        font-size: 0.98rem;
    }
    .footer-content {
        gap: 0.7rem;
    }
    .footer-copyright {
        font-size: 0.85rem;
        padding: 0.7rem 0 0.5rem 0;
    }
    .tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 400px) {
    .hero-banner-text h1 {
        font-size: 1.05rem;
    }
    .hero-banner-text p {
        font-size: 0.8rem;
    }
    .card-content h2 {
        font-size: 0.9rem;
    }
    .card-content p {
        font-size: 0.85rem;
    }
}

#pdf-viewer {
    width: 100%;
    min-height: 70vh;
    background: #f8f9fa;
    overflow-x: auto;
    padding: 1rem 0;
    box-sizing: border-box;
    text-align: center;
}
#pdf-viewer canvas {
    max-width: 100%;
    height: auto !important;
    margin: 0 auto 24px auto;
    display: block;
    box-shadow: 0 2px 12px rgba(38,166,154,0.08);
    border-radius: 8px;
    background: #fff;
}
@media (max-width: 700px) {
    #pdf-viewer {
        padding: 0.5rem 0;
    }
    #pdf-viewer canvas {
        margin-bottom: 16px;
        border-radius: 5px;
    }
}