/*
Theme Name: EngPedia Pro
Theme URI: https://engpedia.com/
Author: Antigravity Custom Themes
Author URI: https://engpedia.com/
Description: A premium, ultra-fast, and completely independent Custom WordPress Theme built specifically for EngPedia. Includes built-in SEO controls, automatic XML sitemaps, structural breadcrumbs, and OpenGraph metadata without requiring any external plugins.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: engpedia
*/

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* --- Design System & CSS Variables --- */
:root {
    --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Curated Premium Color Palette (Charcoal, Deep Navy & Sky Blue) */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-hover: #f1f5f9;
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-text-inverse: #ffffff;
    
    --color-primary: #0f172a;       /* Dark Navy Slate */
    --color-primary-light: #1e293b;
    --color-accent: #0ea5e9;        /* Sky Blue Accent */
    --color-accent-hover: #0284c7;
    --color-accent-light: #e0f2fe;
    
    --color-border: #e2e8f0;
    --color-border-hover: #cbd5e1;
    --color-error: #f43f5e;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    
    /* Layout Constants */
    --max-width: 1240px;
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(226, 232, 240, 0.8);
    --glass-blur: blur(16px);
}

/* --- Base & Reset Rules --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-top: 2.5rem; }
h3 { font-size: clamp(1.35rem, 3vw, 1.65rem); margin-top: 2rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-md);
}

/* --- Container Wrappers --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding: 2.5rem 0;
}

/* --- Top Info Bar --- */
.top-bar {
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-date {
    color: var(--color-accent);
}

/* --- Sticky Header & Navigation --- */
.site-header {
    background-color: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

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

/* Site Logo */
.site-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.logo-icon {
    color: var(--color-accent);
    animation: rotateLogo 8s linear infinite;
}

.site-logo a span {
    color: var(--color-accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Primary Menu (Desktop) */
.main-navigation {
    display: none; /* Mobile first hidden */
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.main-navigation a {
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 0.925rem;
    padding: 0.5rem 0.25rem;
    position: relative;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--color-primary);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--color-accent);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

/* Header Search Form (Desktop) */
.header-search-container {
    display: none;
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 280px;
}

.search-field {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
    outline: none;
}

.search-field:focus {
    border-color: var(--color-accent);
    background-color: var(--color-surface);
    box-shadow: 0 0 0 4px var(--color-accent-light);
}

.search-submit {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-text-light);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.search-submit:hover {
    color: var(--color-accent);
    background-color: rgba(14, 165, 233, 0.1);
}

/* Mobile Actions */
.mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-search-toggle {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.mobile-search-toggle:hover,
.mobile-search-toggle.is-active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* Hamburger Toggle Button */
.menu-toggle {
    background: transparent;
    border: 1.5px solid var(--color-border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.menu-toggle:hover {
    border-color: var(--color-accent);
    background-color: var(--color-bg);
}

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

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 20px;
    height: 2px;
    background-color: var(--color-primary);
    position: absolute;
    transition: var(--transition-fast);
    border-radius: 2px;
}

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

.hamburger-inner::before {
    content: '';
    top: -6px;
}

.hamburger-inner::after {
    content: '';
    bottom: -6px;
}

.menu-toggle.is-active .hamburger-inner {
    background-color: transparent;
}

.menu-toggle.is-active .hamburger-inner::before {
    transform: translateY(6px) rotate(45deg);
    background-color: var(--color-accent);
}

.menu-toggle.is-active .hamburger-inner::after {
    transform: translateY(-6px) rotate(-45deg);
    background-color: var(--color-accent);
}

/* Mobile Search Drawer */
.mobile-search-bar {
    max-height: 0;
    overflow: hidden;
    background-color: var(--color-surface);
    border-bottom: 0 solid var(--color-border);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-bottom-width 0.1s;
}

.mobile-search-bar.search-active {
    max-height: 80px;
    border-bottom-width: 1px;
}

.mobile-search-bar .container {
    display: flex;
    align-items: center;
    height: 80px;
}

.mobile-search-bar .search-form {
    max-width: 100%;
}

.mobile-search-bar .search-field {
    font-size: 1rem;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
}

/* --- Breadcrumbs --- */
.breadcrumbs-nav {
    padding: 0.75rem 0;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.breadcrumbs-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumbs-container a {
    color: var(--color-text-light);
}

.breadcrumbs-container a:hover {
    color: var(--color-accent);
}

.breadcrumbs-separator {
    color: var(--color-border-hover);
    display: flex;
    align-items: center;
}

.breadcrumbs-current {
    color: var(--color-primary);
    font-weight: 600;
}

/* --- Hero Banner (Homepage) --- */
.hero-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e293b 50%, var(--color-primary) 100%);
    color: var(--color-text-inverse);
    padding: clamp(3.5rem, 8vw, 6rem) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(2, 132, 199, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-section h1 {
    color: var(--color-text-inverse);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 680px;
    margin: 0 auto 2rem auto;
    font-weight: 400;
}

.hero-search-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.hero-search-wrapper .search-form {
    max-width: 100%;
}

.hero-search-wrapper .search-field {
    padding: 0.9rem 3.5rem 0.9rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-inner);
    backdrop-filter: blur(8px);
}

.hero-search-wrapper .search-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.hero-search-wrapper .search-field:focus {
    border-color: var(--color-accent);
    background-color: var(--color-surface);
    color: var(--color-primary);
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.3);
}

.hero-search-wrapper .search-submit {
    right: 8px;
    color: rgba(255, 255, 255, 0.6);
}

.hero-search-wrapper .search-field:focus ~ .search-submit {
    color: var(--color-accent);
}

/* --- Card Grid & Post Cards --- */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.post-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.25);
}

.post-card-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.post-card:hover .post-card-image img {
    transform: scale(1.04);
}

/* Category Badge over card */
.post-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: var(--border-radius-sm);
    letter-spacing: 0.05em;
    z-index: 5;
    box-shadow: var(--shadow-sm);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-card-title {
    font-size: 1.25rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

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

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

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    flex: 1;
}

.post-card-more {
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-accent);
    margin-top: auto;
    width: fit-content;
}

.post-card-more:hover {
    color: var(--color-accent-hover);
}

.post-card-more svg {
    transition: var(--transition-fast);
}

.post-card-more:hover svg {
    transform: translateX(4px);
}

/* --- Single Post Page Layout --- */
.single-post-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.post-header {
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    line-height: 1.15;
    margin-bottom: 1rem;
    font-weight: 900;
}

.post-meta-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.post-meta-item svg {
    color: var(--color-accent);
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-featured-image img {
    width: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
}

/* --- Technical Content Typography --- */
.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-primary-light);
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h2, .entry-content h3, .entry-content h4 {
    color: var(--color-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.entry-content ul, .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

/* Custom styled Tables for engineering data */
.entry-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5rem 0;
    font-size: 0.9rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.entry-content th, .entry-content td {
    padding: 0.85rem 1.15rem;
    text-align: left;
}

.entry-content th {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--color-primary-light);
}

.entry-content td {
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.entry-content tr:last-child td {
    border-bottom: none;
}

.entry-content tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.5);
}

/* Custom Styled blockquotes */
.entry-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--color-bg);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    font-style: italic;
    color: var(--color-text-light);
}

.entry-content blockquote p {
    margin-bottom: 0;
}

/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.widget {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    border-bottom: 2px solid var(--color-accent-light);
    padding-bottom: 0.6rem;
    margin-bottom: 1.25rem;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--color-accent);
}

.widget ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.widget li {
    position: relative;
    padding-left: 1.25rem;
}

.widget li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
    transition: var(--transition-fast);
}

.widget li:hover::before {
    transform: translateX(3px);
}

.widget a {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
}

.widget a:hover {
    color: var(--color-accent);
}

/* --- Related Posts --- */
.related-posts {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.related-posts-title {
    font-size: 1.5rem;
    margin-bottom: 1.75rem;
    font-weight: 800;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 4rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--color-border);
    border-radius: 50%;
    background-color: var(--color-surface);
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.page-numbers.current {
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
    border-color: var(--color-accent);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

.page-numbers:hover:not(.current) {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background-color: var(--color-bg);
}

/* --- Footer Area --- */
.site-footer {
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.55);
    padding: 4.5rem 0 2rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.footer-widget-title {
    color: var(--color-text-inverse);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-widget ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.925rem;
    transition: var(--transition-fast);
}

.footer-widget a:hover {
    color: var(--color-text-inverse);
    padding-left: 4px;
}

.footer-about h4 {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.footer-about h4 span {
    color: var(--color-accent);
}

.footer-about-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.85rem;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
}

.footer-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.5);
}

.footer-menu a:hover {
    color: var(--color-accent);
}

/* --- Back to Top Float Button --- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: -60px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
    border: none;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s, visibility 0.3s, background-color 0.2s;
}

.back-to-top.is-visible {
    right: 24px;
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
}

/* --- Animation Keyframes --- */
@keyframes rotateLogo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   MEDIA QUERIES (Responsive, Mobile-First Adjustments)
   ========================================================================== */

/* Medium Devices (Tablets, 600px and up) */
@media (min-width: 600px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Devices (Tablets/Laptops, 768px and up) */
@media (min-width: 768px) {
    .site-main {
        padding: 3.5rem 0;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 3rem;
    }
    
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Desktop Devices (Laptops/Desktops, 992px and up) */
@media (min-width: 992px) {
    /* Navigation shows */
    .main-navigation {
        display: block;
    }
    
    .header-search-container {
        display: block;
    }
    
    .mobile-actions {
        display: none;
    }
    
    /* Layout structural changes */
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .single-post-container {
        flex-direction: row;
        gap: 3rem;
    }
    
    .post-content-area {
        flex: 1;
        max-width: calc(100% - 340px);
    }
    
    .sidebar {
        width: 300px;
        margin-top: 0;
    }
}

/* Extra Large Screens (Large Desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 0;
    }
}

/* ==========================================================================
   MOBILE INTERACTION CLASS OVERRIDES (Toggled by JS)
   ========================================================================== */

@media (max-width: 991.98px) {
    /* Mobile Overlay Menu Drawer */
    .main-navigation {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-surface);
        z-index: 98;
        padding: 2.5rem 1.5rem;
        border-top: 1px solid var(--color-border);
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s;
        box-shadow: var(--shadow-lg);
    }
    
    .main-navigation.nav-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .main-navigation a {
        font-size: 1.25rem;
        font-weight: 700;
        display: block;
        width: 100%;
        color: var(--color-primary);
        border-bottom: 1px solid var(--color-bg);
        padding-bottom: 0.75rem;
    }
    
    .main-navigation a::after {
        display: none; /* No underlines on mobile layout */
    }
    
    .main-navigation a:hover,
    .main-navigation .current-menu-item a {
        color: var(--color-accent);
        border-color: var(--color-accent-light);
    }
}

/* ==========================================================================
   GOOGLE ADSENSE SLOT PLACEMENTS & LAYOUTS
   ========================================================================== */
.ad-slot-container {
    background-color: #f1f5f9;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin: 2rem 0;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    overflow: hidden;
}

.ad-slot-container .ad-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

/* Specific Slot Overrides */
.ad-slot-header_ad {
    margin: 0 0 2rem 0;
    min-height: 90px;
    max-height: 120px;
    width: 100%;
}

.ad-slot-sidebar_ad {
    margin: 0;
    min-height: 250px;
    width: 100%;
}

.ad-slot-in-content {
    margin: 2.5rem 0;
    padding: 1.5rem;
    min-height: 250px;
    background-color: rgba(241, 245, 249, 0.4);
    border-color: var(--color-border);
}

.ad-slot-footer_ad {
    margin: 3rem 0 1rem 0;
    min-height: 90px;
    width: 100%;
}

/* Responsive adjustments for ads */
@media (max-width: 768px) {
    .ad-slot-container {
        padding: 0.75rem;
        margin: 1.5rem 0;
        min-height: 100px;
    }
    
    .ad-slot-sidebar_ad {
        min-height: 150px;
    }
}

