/*
Theme Name: Nexa EduFamilia
Author: EduFamilia
Author URI: https://edufamilia.fundivel.org
Description: Tema personalizado para EduFamilia - Plataforma de aprendizaje LMS. Integración completa con NexaLMS.
Requires at least: 6.0
Tested up to: 6.3
Requires PHP: 7.4
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nexa
Tags: lms, education, learning, courses, custom-menu, custom-logo, featured-images, theme-options
*/

/* ========================================
   NEXA EduFamilia - Design System
   ======================================== */

:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --secondary: #06B6D4;
    --secondary-dark: #0891B2;
    --accent: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;

    --header-footer-bg: #1E293B;
    --header-footer-text: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --max-width: 1280px;
    --header-height: 72px;
}

/* ========================================
   RESET & BASE
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   SKIP LINK
   ======================================== */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
}
.skip-link:focus {
    left: 50%;
    transform: translateX(-50%);
}

/* ========================================
   HEADER
   ======================================== */

.site-header {
    background: var(--header-footer-bg);
    color: var(--header-footer-text);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: var(--shadow-md);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand .custom-logo-link {
    display: flex;
    align-items: center;
}

.header-brand .custom-logo {
    max-height: 44px;
    width: auto;
}

.header-brand a {
    color: var(--header-footer-text);
    text-decoration: none;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--header-footer-text);
    margin: 0;
    line-height: 1.2;
}

.header-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Main Menu */
.main-menu {
    display: flex;
    align-items: center;
}

.main-menu ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-menu ul li {
    position: relative;
}

.main-menu ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--header-footer-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.main-menu ul li a:hover,
.main-menu ul li.current-menu-item a {
    background: rgba(255,255,255,0.1);
    color: var(--primary-light);
}

/* Submenus */
.main-menu ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--header-footer-bg);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: 8px 0;
    z-index: 100;
}

.main-menu ul li:hover > ul,
.main-menu ul li.focus > ul {
    display: block;
}

.main-menu ul li ul li a {
    padding: 10px 20px;
    white-space: nowrap;
}

.main-menu ul li ul li ul {
    left: 100%;
    top: 0;
}

/* Hamburger button */
.check-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-icon {
    width: 24px;
    height: 18px;
    position: relative;
}

.menu-icon .bar1,
.menu-icon .bar2,
.menu-icon .bar3 {
    width: 24px;
    height: 2px;
    background: var(--header-footer-text);
    border-radius: 2px;
    transition: 0.3s;
    position: absolute;
    left: 0;
}

.menu-icon .bar1 { top: 0; }
.menu-icon .bar2 { top: 8px; }
.menu-icon .bar3 { top: 16px; }

/* ========================================
   MAIN CONTENT
   ======================================== */

.site-main {
    flex: 1;
    padding: 40px 0;
}

/* ========================================
   PAGE TEMPLATE
   ======================================== */

.page-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.page-header {
    text-align: center;
    padding: 48px 0 32px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   BLOG / ARCHIVE
   ======================================== */

.blog-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.articles-list {
    display: grid;
    gap: 32px;
}

.article-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
}

.article-card .entry-header {
    padding: 24px 24px 0;
}

.article-card .entry-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.article-card .entry-title a {
    color: var(--text-primary);
}

.article-card .entry-title a:hover {
    color: var(--primary);
}

.article-card .entry-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.article-card .entry-content {
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.article-card .entry-thumbnail {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

/* ========================================
   SINGLE POST
   ======================================== */

.single-post .blog-page {
    grid-template-columns: 1fr 320px;
}

.single-post .entry-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.author-box {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 32px 0;
}

.author-box .author-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box .author-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.author-box .author-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
}

.sidebar .widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: var(--header-footer-bg);
    color: var(--header-footer-text);
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.footer-widgets .widget {
    font-size: 0.9rem;
    color: #CBD5E1;
}

.footer-widgets .widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--header-footer-text);
    margin-bottom: 16px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #94A3B8;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 32px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========================================
   COMMENTS
   ======================================== */

.comments-area {
    padding: 32px 0;
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    font-style: normal;
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   SEARCH FORM
   ======================================== */

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-form input[type="search"]:focus {
    border-color: var(--primary);
}

.search-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* ========================================
   ERROR 404
   ======================================== */

.error-article {
    text-align: center;
    padding: 80px 24px;
}

.error-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.error-excerpt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ========================================
   FORMS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-primary);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

button,
input[type="submit"] {
    cursor: pointer;
    font-family: var(--font-sans);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .blog-page {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .check-button {
        display: block;
    }

    .main-menu ul {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--header-footer-bg);
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-lg);
    }

    .main-menu ul.toggled {
        display: flex;
    }

    .main-menu ul li {
        width: 100%;
    }

    .main-menu ul li a {
        padding: 12px 16px;
    }

    .main-menu ul li ul {
        position: static;
        box-shadow: none;
        padding-left: 16px;
        background: transparent;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 32px 0 24px;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }
}
