/* FILENAME: style.css
   LOCATION: /wp-content/themes/media-yield-theme/style.css
*/

/*
Theme Name: The Media Yield Native
Theme URI: https://themediayield.com
Author: Gemini
Description: A high-performance, AdSense-optimized WordPress theme using native CSS.
Version: 2.8
License: GNU General Public License v2 or later
*/

/* --- 1. Variables & Reset --- */
:root {
    --primary: #4f46e5;    /* Indigo 600 */
    --primary-dark: #4338ca;
    --accent: #581c87;     /* Purple 900 */
    --text-main: #0f172a;  /* Slate 900 */
    --text-muted: #475569; /* Slate 600 */
    --bg-body: #f8fafc;    /* Slate 50 */
    --bg-white: #ffffff;
    --border: #e2e8f0;
    
    --container-width: 1200px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-dropdown: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

/* --- 2. Layout & Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { background-color: var(--primary-dark); transform: translateY(-1px); color: white; }

.btn-secondary {
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}
.btn-secondary:hover { background-color: rgba(255,255,255,0.1); color: white; }

.btn-sub {
    background-color: #0f172a;
    color: white;
    padding: 10px 20px;
    font-size: 0.875rem;
}
.btn-sub:hover { background-color: #1e293b; color: white; }

/* --- 3. Header & Navigation --- */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-main);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transform: rotate(-6deg);
    transition: transform 0.3s;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}
.site-logo:hover .logo-icon { transform: rotate(0); }

/* Main Menu Styles */
.main-menu {
    display: block; 
}

.main-menu > ul {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0;
    padding: 0;
    align-items: center;
}
.main-menu > ul > li {
    position: relative;
}
.main-menu > ul > li > a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 8px 0;
    display: block;
}
.main-menu > ul > li > a:hover { color: var(--primary); }

/* Dropdown Menu Styles */
.main-menu ul ul {
    position: absolute;
    top: 100%;
    left: -20px;
    background: white;
    box-shadow: var(--shadow-dropdown);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    width: 300px;
    display: none; 
    flex-direction: column;
    gap: 4px;
    z-index: 100;
}

/* Show dropdown on hover */
.main-menu li:hover > ul {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.main-menu ul ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    line-height: 1.2;
}

.main-menu ul ul li a:hover {
    background: #f8fafc;
    color: var(--primary);
}

.menu-icon-svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 4px;
}
.main-menu ul ul li a:hover .menu-icon-svg {
    color: white;
    background: var(--primary);
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 4. Hero Section --- */
.hero-section {
    background-color: var(--accent);
    padding: 80px 0 60px; 
    position: relative;
    overflow: hidden;
    color: white;
    text-align: left; 
}

.hero-section::before, .hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
}
.hero-section::before {
    top: -50%; right: -20%; width: 800px; height: 800px;
    background: rgba(99, 102, 241, 0.3); /* Indigo */
}
.hero-section::after {
    top: -20%; left: -20%; width: 600px; height: 600px;
    background: rgba(168, 85, 247, 0.3); /* Purple */
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 100%; 
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 70, 229, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.5);
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
    max-width: 800px;
}
.hero-title span {
    background: linear-gradient(to right, #e0e7ff, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* --- 5. Article & Category Grid --- */
.section-latest { padding: 80px 0; background: var(--bg-body); }
.section-header { margin-bottom: 48px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-title { font-size: 2rem; font-weight: 800; color: var(--text-main); }

.post-grid {
    display: grid;
    /* Forces 3 columns on large screens */
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

/* Disciplines (Category) Card Styling */
.discipline-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.discipline-header {
    padding: 32px 24px 24px; 
    display: flex;
    align-items: flex-end;
}

.discipline-icon {
    width: 40px;
    height: 40px;
}

.discipline-content {
    padding: 24px;
    background: white;
    flex-grow: 1;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Standard Article Card Styling */
.card-image-link {
    display: block;
    height: 200px;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.article-card:hover .card-image { transform: scale(1.05); }

.category-pill {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    margin-top: auto;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- 6. Single Post & Page --- */
.single-container { padding-top: 120px; padding-bottom: 80px; }
.single-header { text-align: center; max-width: 800px; margin: 0 auto 60px; }
.single-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 30px;
}

.single-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #334155;
}

/* Prose Typography */
.prose h2 { font-size: 1.75rem; font-weight: 800; margin: 48px 0 24px; color: var(--text-main); }
.prose h3 { font-size: 1.4rem; font-weight: 700; margin: 32px 0 16px; color: var(--text-main); }
.prose p { margin-bottom: 24px; line-height: 1.8; }
.prose ul { padding-left: 20px; margin-bottom: 24px; list-style-type: disc; }
.prose blockquote {
    border-left: 4px solid var(--primary);
    background: #eef2ff;
    padding: 24px;
    font-style: italic;
    margin: 32px 0;
    border-radius: 0 8px 8px 0;
}

.ad-slot-native {
    width: 100%;
    padding: 40px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    text-align: center;
    color: #94a3b8;
    margin: 40px 0;
}
.ad-slot-native::before {
    content: 'ADVERTISEMENT';
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

/* --- 7. Footer --- */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}
.footer-col h4 { font-weight: 700; margin-bottom: 20px; color: var(--text-main); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }

.newsletter-section {
    background: #0f172a;
    padding: 80px 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}
.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 450px;
    margin: 30px auto 0;
    flex-wrap: wrap;
}
.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    min-width: 250px;
}
.newsletter-form button {
    background: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

/* --- 8. Category Color Themes --- */
.cat-theme-emerald { background-color: #d1fae5; color: #059669; }
.cat-theme-purple { background-color: #f3e8ff; color: #9333ea; }
.cat-theme-blue { background-color: #dbeafe; color: #2563eb; }
.cat-theme-slate { background-color: #f1f5f9; color: #475569; }
.cat-theme-rose { background-color: #ffe4e6; color: #e11d48; }
.cat-theme-indigo { background-color: #e0e7ff; color: #4f46e5; }

/* Desktop Force Display */
@media (min-width: 769px) {
    .main-menu {
        display: block !important;
    }
    .mobile-toggle {
        display: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .post-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.5rem; }
    .nav-wrapper { flex-wrap: wrap; }
    
    .mobile-toggle { display: block; }
    
    /* Default hidden on mobile */
    .main-menu { display: none; width: 100%; margin-top: 20px; order: 3; }
    
    /* Show when active */
    .main-menu.active { display: block; }
    
    .main-menu > ul { flex-direction: column; gap: 16px; }
    .main-menu li:hover > ul { position: static; box-shadow: none; border: none; padding-left: 20px; display: flex; opacity: 1; visibility: visible; transform: none; width: 100%; }
}