/**
 * SD Theme Main Structural and Responsive Stylesheet
 * 
 * ES6 Custom Properties based styling, ultra light and fast.
 */

/* ==========================================================================
   1. Layout Core & Container
   ========================================================================== */
.sd-container {
    width: 100%;
    max-width: var(--sd-container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.sd-content-area {
    padding-top: 60px;
    padding-bottom: 80px;
    flex-grow: 1;
}

/* ==========================================================================
   2. Cabeçalho Semântico (Header)
   ========================================================================== */
.site-header {
    width: 100%;
    background-color: var(--sd-color-bg-light);
    border-bottom: 1px solid #f1f5f9;
    z-index: 9999;
    transition: var(--sd-transition-smooth);
}

.sd-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* Sticky Header Style */
.site-header.sd-header-sticky {
    position: sticky;
    top: 0;
    left: 0;
    box-shadow: var(--sd-shadow-sm);
}

/* Glassmorphism Header Style (UICore style) */
.site-header.sd-header-glass {
    background-color: var(--sd-color-bg-glass-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Branding */
.site-branding a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sd-color-text-dark);
    letter-spacing: -0.02em;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

/* ==========================================================================
   3. Navegação (Menu)
   ========================================================================== */
.main-navigation {
    display: flex;
    align-items: center;
}

.sd-nav-menu-container ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.sd-nav-menu-container ul a {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155; /* Slate 700 */
    padding: 8px 0;
    position: relative;
}

.sd-nav-menu-container ul a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--sd-color-primary);
    transition: var(--sd-transition-smooth);
}

.sd-nav-menu-container ul a:hover {
    color: var(--sd-color-primary);
}

.sd-nav-menu-container ul a:hover::after {
    width: 100%;
}

.sd-nav-menu-container ul li.current-menu-item a {
    color: var(--sd-color-primary);
}

.sd-nav-menu-container ul li.current-menu-item a::after {
    width: 100%;
}

/* Hamburguer Mobile Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger-box {
    width: 24px;
    height: 18px;
    display: inline-block;
    position: relative;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 24px;
    height: 2px;
    background-color: var(--sd-color-text-dark);
    position: absolute;
    border-radius: 4px;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before {
    content: "";
    top: -7px;
}

.hamburger-inner::after {
    content: "";
    bottom: -7px;
}

/* ==========================================================================
   4. Posts e Layout de Blog (High Performance)
   ========================================================================== */
.sd-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.sd-blog-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: var(--sd-radius-md);
    overflow: hidden;
    box-shadow: var(--sd-shadow-sm);
    transition: var(--sd-transition-smooth);
    display: flex;
    flex-direction: column;
}

.sd-blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sd-shadow-lg);
    border-color: #e2e8f0;
}

.sd-card-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.sd-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sd-transition-smooth);
}

.sd-blog-card:hover .sd-card-thumbnail img {
    transform: scale(1.05);
}

.sd-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sd-card-meta {
    font-size: 0.8rem;
    color: var(--sd-color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.sd-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.sd-card-title a {
    color: var(--sd-color-text-dark);
}

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

.sd-card-summary {
    color: #475569;
    font-size: 0.9375rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.sd-card-footer {
    margin-top: auto;
}

.sd-btn-link {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--sd-color-primary);
}

/* ==========================================================================
   5. Rodapé Semântico (Footer)
   ========================================================================== */
.site-footer {
    background-color: var(--sd-color-bg-dark);
    color: #94a3b8; /* Slate 400 */
    padding: 60px 0;
    border-top: 1px solid #1e293b;
}

.sd-footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info a {
    color: #ffffff;
    font-weight: 700;
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.footer-navigation a {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

.footer-navigation a:hover {
    color: #ffffff;
}

/* ==========================================================================
   6. Responsividade (Mobile-First / Touch-First)
   ========================================================================== */
@media (max-width: 768px) {
    .sd-header-wrap {
        height: 70px;
    }
    
    .menu-toggle {
        display: block;
        z-index: 10000;
    }
    
    /* Menu Mobile Overlay Estilo Premium */
    .sd-nav-menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: var(--sd-shadow-lg);
        padding: 80px 30px 40px 30px;
        display: flex;
        flex-direction: column;
        z-index: 9999;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sd-nav-menu-container.menu-active {
        right: 0;
    }
    
    .sd-nav-menu-container ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        width: 100%;
    }
    
    .sd-nav-menu-container ul a {
        font-size: 1.125rem;
        width: 100%;
        display: block;
    }
    
    .sd-footer-wrap {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Animação do Botão Hamburguer no Mobile */
    .menu-toggle.toggle-active .hamburger-inner {
        background-color: transparent;
    }
    
    .menu-toggle.toggle-active .hamburger-inner::before {
        transform: translateY(7px) rotate(45deg);
    }
    
    .menu-toggle.toggle-active .hamburger-inner::after {
        transform: translateY(-7px) rotate(-45deg);
    }
}
