/*
Theme Name: Wansafe Enterprise
Theme URI: https://wansafe.com
Author: Jarvis
Description: A professional, dark-mode Enterprise Network Security theme with built-in high-performance ad zones.
Version: 1.0
License: Gnv
Text Domain: wansafe
*/

:root {
    /* Cyber Security Palette - Dark Mode */
    --bg-dark: #0a0e17;
    /* Deep Space Blue/Black */
    --bg-panel: #151b2b;
    /* Slightly lighter panel background */
    --text-main: #e0e6ed;
    /* Off-white for readability */
    --text-muted: #94a3b8;
    /* Muted text */
    --accent-neon: #ff3b30;
    /* Red - Call to actions/Links (Matches Logo) */
    --accent-secondary: #0ea5e9;
    /* Cyber Blue - Headers */
    --border-color: #2d3748;

    /* Typo */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-top: 0;
}

h1 a,
h2 a {
    text-decoration: none;
    color: inherit;
}

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

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-neon);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-transform: uppercase;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.site-title a:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.site-title span {
    color: var(--accent-neon);
}

/* Ad Zones */
.ad-zone {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    min-height: 90px;
    /* Standard banner height */
}

.ad-zone-header {
    margin: 0;
    min-width: 320px;
    /* Fallback width */
}

.ad-zone-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
    text-align: center;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin: 2rem auto;
    align-items: start;
    /* Required for sticky sidebar */
}

.sidebar {
    position: sticky;
    top: 2rem;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Posts */
.post-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-secondary);
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Sidebar */
.sidebar-widget {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.widget-title {
    border-bottom: 2px solid var(--accent-secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #fff;
}

/* Footer */
.site-footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    margin: 3rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    background: var(--bg-panel);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination .page-numbers.current {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: #fff;
}

.pagination a.page-numbers:hover {
    border-color: var(--accent-neon);
    color: var(--accent-neon);
    text-shadow: none;
}

.pagination .dots {
    border: none;
    background: transparent;
}

/* Ad Responsive Fixes */
.ad-zone,
.ad-zone-header,
.ad-zone-footer,
.sidebar-widget,
.ad-injection {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.ad-zone img,
.ad-zone iframe,
.ad-zone-header img,
.ad-zone-header iframe,
.sidebar-widget img,
.sidebar-widget iframe,
.ad-injection img,
.ad-injection iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Magazine Layout Updates */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* First post spans full width */
.hero-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .hero-card {
        flex-direction: row;
        align-items: center;
    }

    .hero-card .post-thumbnail {
        flex: 1.5;
        height: 100%;
    }

    .hero-card .post-content-wrap {
        flex: 1;
        padding-left: 2rem;
    }
}

/* Card Styling */
.post-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    border: none;
    background: var(--bg-panel);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
    /* Zoom effect */
}

.post-content-wrap {
    padding: 1.5rem;
}

.post-title a {
    color: #fff;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--accent-secondary);
}

.hero-card .post-title {
    font-size: 2rem;
}

.grid-card .post-title {
    font-size: 1.25rem;
}

.badgie {
    background: var(--accent-neon);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Header Search */
.header-search {
    flex-grow: 0;
    /* Don't expand, stay compact */
    width: 300px;
    /* Fixed width for better control */
    margin-left: auto;
    /* Push to the right */
    margin-right: 0;
}

.search-form {
    display: flex;
    position: relative;
    width: 100%;
}

.search-field {
    width: 100%;
    background: rgba(14, 165, 233, 0.1);
    /* Slight blue tint */
    border: 1px solid var(--accent-secondary);
    /* Always visible border */
    border-radius: 50px;
    /* Pill shape for modern look */
    padding: 0.6rem 1.2rem;
    padding-right: 3rem;
    /* Space for icon */
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
    /* Permanent Glow */
}

.search-field:focus {
    outline: none;
    background: rgba(14, 165, 233, 0.2);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
    /* Stronger Glow */
}

.search-submit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    /* White icon for visibility */
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
    line-height: 0;
}

.search-submit:hover {
    transform: translateY(-50%) scale(1.1);
    color: var(--accent-neon);
}

/* Animated Mock Ad (Cisco Style) */
.tech-ad-unit {
    background: linear-gradient(135deg, #002d72 0%, #00bceb 100%);
    /* Cisco-ish Blues */
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 188, 235, 0.3);
}

.tech-ad-content {
    position: relative;
    z-index: 2;
}

.ad-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.7;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2px 5px;
    border-radius: 2px;
}

.tech-ad-unit h3 {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.tech-ad-unit p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.tech-cta {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #002d72;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: transform 0.2s;
}

.tech-cta:hover {
    transform: translateX(5px);
}

/* Background Animation */
.tech-ad-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
    animation: tech-pulse 4s infinite linear;
}

@keyframes tech-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Newsletter Widget */
.newsletter-widget {
    background: var(--bg-card);
    border: 1px solid var(--accent-neon);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.1);
    /* Red Glow */
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsletter-form input {
    width: 100%;
    padding: 0.8rem;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
}

.newsletter-form button {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent-neon);
    color: #fff;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: #ff6b61;
    /* Lighter red */
}

/* Fix Input Overflow */
*,
*:before,
*:after {
    box-sizing: border-box;
}

.newsletter-form input,
.search-field {
    box-sizing: border-box;
    /* Ensure padding doesn't add to width */
    max-width: 100%;
}

/* In-Feed Ad Styling */
.in-feed-ad {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.in-feed-ad .tech-ad-unit {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    /* Different Blue for variety */
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

/* Smart Sticky Header */
body {
    padding-top: 80px;
    /* Offset for fixed header */
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}