/* ---------------------------------------------------------
   FOOTER STYLING (Fixed Alignment)
   --------------------------------------------------------- */

.pe-footer {
    background: var(--bg-subtle);
    padding: 80px 0 50px;
    margin-top: 100px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    position: relative;
}

/* Dark Mode: Deep Rich Background */
[data-theme="dark"] .pe-footer {
    background: #0b1120; 
    border-top-color: #1e293b;
}

/* Top Gradient Border */
.pe-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.3;
}

/* Stack Wrapper */
.pe-footer-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

/* 1. Brand */
.pe-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.pe-footer-logo-img img {
    height: 48px;
    width: auto;
    display: block;
}

.pe-footer-site-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.2;
}

/* 2. Description */
.pe-footer-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 30px 0;
    max-width: 500px;
}

/* ---------------------------------------------------------
   3. SOCIAL ICONS (Grid Centering Fix)
   --------------------------------------------------------- */
.pe-social-links {
    display: flex;
    justify-content: center;
    gap: 16px; /* Increased gap for better touch targets */
    margin-bottom: 40px;
}

.pe-social-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* The Fix: Grid places items perfectly in the center */
    display: grid;
    place-items: center;
    
    width: 48px;
    height: 48px;
    border-radius: 50%;
    
    /* Reset Box Model */
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    
    /* Appearance */
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    
    /* Remove Text Properties that cause misalignment */
    line-height: 0;
    font-size: 0;
    text-decoration: none;
    
    transition: all 0.2s ease;
}

/* Ensure SVG fills the space correctly but doesn't overflow */
.pe-social-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

/* Stroke-based icons (Instagram) */
.pe-social-btn svg[fill="none"] { fill: none; }

/* Hover Effects */
.pe-social-btn:hover {
    transform: translateY(-3px);
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);
}

/* Dark Mode Specifics */
[data-theme="dark"] .pe-social-btn {
    background: rgba(255, 255, 255, 0.05); 
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .pe-social-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* 4. Separator Line */
.pe-footer-sep {
    width: 80px;
    height: 1px;
    background: var(--border-color);
    margin-bottom: 40px;
    opacity: 0.6;
}

/* 5. Quick Links */
.pe-footer-links {
    width: 100%;
}

.pe-links-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
}

.pe-footer-menu-centered {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 35px;
}

.pe-footer-menu-centered li a {
    font-size: 0.95rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.pe-footer-menu-centered li a::after {
    content: "";
    position: absolute;
    bottom: -4px; left: 0; width: 0; height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.pe-footer-menu-centered li a:hover {
    color: var(--primary);
}
.pe-footer-menu-centered li a:hover::after {
    width: 100%;
}

/* 6. Copyright */
.pe-footer-copyright {
    margin-top: 50px;
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.8;
}

.pe-copyright-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 600;
}
.pe-copyright-link:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 600px) {
    .pe-footer { padding: 60px 20px 40px; }
    
    .hidden-mobile { display: none; }
    
    .pe-footer-menu-centered {
        flex-direction: column;
        gap: 15px;
    }
    
    .pe-social-links {
        gap: 12px;
    }
}