/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #222;
    background-color: #ffffff;
}

/* Header */
.header {
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #a2a9b1;
    padding: 0.75em 1em;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5em;
}

.mw-logo {
    display: flex;
    align-items: center;
    gap: 0.5em;
    text-decoration: none;
    color: #000;
}

.mw-logo-container {
    display: flex;
    flex-direction: column;
}

.search-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.search-form {
    display: flex;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    width: 100%;
    max-width: 500px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding-left: 0.5em;
}

.search-icon {
    margin-right: 0.5em;
}

.search-input {
    border: none;
    outline: none;
    padding: 0.5em;
    width: 100%;
    background: transparent;
}

.search-button {
    background-color: #f8f9fa;
    border: none;
    border-left: 1px solid #a2a9b1;
    padding: 0.5em 1em;
    cursor: pointer;
}

.search-button:hover {
    background-color: #e9ecef;
}

.user-links {
    display: flex;
    align-items: center;
    gap: 1em;
}

.user-links a {
    color: #0645ad;
    text-decoration: none;
    font-size: 0.9em;
}

.user-links a:hover {
    text-decoration: underline;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1em;
    padding: 1em;
    /* Garante que o conteúdo principal tenha espaço suficiente */
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    width: 200px;
    flex-shrink: 0;
}

.sidebar h3 {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #222;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2em;
}

.sidebar ul {
    list-style: none;
    margin-bottom: 1.5em;
}

.sidebar li {
    margin-bottom: 0.2em;
}

.sidebar a {
    color: #0645ad;
    text-decoration: none;
    font-size: 0.9em;
    display: block;
    padding: 0.2em 0;
}

.sidebar a:hover {
    text-decoration: underline;
}

/* Conteúdo principal */
.main-content {
    flex: 1;
    min-width: 0;
    position: relative;
    margin: 0;
    padding: 0;
    /* Força o conteúdo a ocupar todo o espaço disponível */
    width: 100%;
}

.page-title {
    font-size: 2.2em;
    font-weight: normal;
    margin-bottom: 0.5em;
    border-bottom: 3px solid #a2a9b1;
    padding-bottom: 0.2em;
    font-family: 'Linux Libertine', Georgia, Times, serif;
    width: 100%;
    clear: none;
    margin-left: 0;
    margin-right: 0;
}

/* Força todos os parágrafos a ocuparem o espaço disponível */
.main-content p {
    margin-top: 0;
    margin-bottom: 1em;
    text-align: justify;
    margin-left: 0;
    margin-right: 0;
    /* Garante que o texto flua ao redor da infobox */
    line-height: 1.6;
}

/* Força o primeiro parágrafo a começar imediatamente após o título */
.main-content > p:first-of-type {
    margin-top: 0;
}

/* Infobox */
.infobox {
    float: right;
    width: 300px;
    margin: 0 0 1em 1em;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    font-size: 0.9em;
    clear: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 3px;
    position: relative;
    z-index: 1;
    /* Garante que a infobox não interfira no fluxo do texto */
    shape-outside: margin-box;
}

.infobox-title {
    background: linear-gradient(to bottom, #ccccff 0%, #b3b3ff 100%);
    font-weight: bold;
    text-align: center;
    padding: 0.6em;
    font-size: 1.1em;
    border-bottom: 1px solid #a2a9b1;
}

.infobox-image {
    text-align: center;
    padding: 0.75em;
    background-color: #ffffff;
    border-bottom: 1px solid #eaecf0;
}

.infobox-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #a2a9b1;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.infobox-content {
    padding: 0;
}

.infobox-row {
    display: flex;
    border-bottom: 1px solid #a2a9b1;
}

.infobox-row:last-child {
    border-bottom: none;
}

.infobox-label {
    background-color: #eaecf0;
    font-weight: bold;
    padding: 0.3em 0.5em;
    width: 40%;
    border-right: 1px solid #a2a9b1;
}

.infobox-value {
    padding: 0.3em 0.5em;
    width: 60%;
}

/* Seções */
section {
    margin-bottom: 2em;
    /* Remove clear: both que pode estar interferindo */
}

h2 {
    font-size: 1.5em;
    font-weight: normal;
    margin: 1.5em 0 0.5em 0;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2em;
    font-family: 'Linux Libertine', Georgia, Times, serif;
    /* Remove clear que pode estar interferindo */
}

h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin: 1em 0 0.5em 0;
}

p {
    margin-bottom: 1em;
    text-align: justify;
    /* Remove margens que podem estar interferindo */
    margin-left: 0;
    margin-right: 0;
}

/* Links */
a {
    color: #0645ad;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #0b0080;
}

/* Referências */
.reference {
    font-size: 0.8em;
    vertical-align: super;
}

.reference a {
    color: #0645ad;
}

/* Listas */
ul, ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.3em;
}

/* Estilos para a seção de certificados */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5em;
    margin: 1.5em 0;
    clear: both;
}

.certificate-item {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 1em;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.certificate-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

.certificate-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #ffffff;
    padding: 4px;
    border: 1px solid #e1e5e9;
    flex-shrink: 0;
}

.certificate-info {
    flex: 1;
}

.certificate-info h4 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 0.3em;
    color: #0645ad;
}

.certificate-info p {
    margin-bottom: 0.3em;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.certificate-info p strong {
    color: #222;
}

.certificate-status {
    display: inline-block;
    background-color: #fef9e7;
    color: #8a6d3b;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #faebcc;
}

.categories-section {
    margin-top: 2em;
    padding: 1em;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    clear: both;
}

.categories-section p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.categories-section a {
    color: #0645ad;
    text-decoration: none;
}

.categories-section a:hover {
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0.5em;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .infobox {
        float: none;
        width: 100%;
        margin: 1em 0;
    }
    
    .certificates-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }
    
    .certificate-item {
        flex-direction: column;
        text-align: center;
    }
    
    .certificate-logo {
        align-self: center;
        width: 100px;
        height: 100px;
    }
    
    .search-container input {
        width: 200px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.5em;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8em;
    }
    
    .certificate-item {
        padding: 0.8em;
    }
    
    .certificate-logo {
        width: 80px;
        height: 80px;
    }
    
    .search-container input {
        width: 150px;
    }
}

