/*
Theme Name: Serene Apps
Theme URI: https://serene-apps.com
Author: Custom Design
Description: A premium, fast, dark-mode WordPress theme inspired by modern cinematic interfaces. Features a 3-column post grid, glassmorphism effects, and highly opinionated centered Gutenberg typography.
Version: 1.2
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Text Domain: serene-apps
*/

:root {
    /* Tell the browser engine this is a dark theme (fixes white scrollbars and white flashes) */
    color-scheme: dark; 
    
    /* Premium Black & Gray Theme */
    --bg-deep: #000000; 
    --bg-surface: #0a0a0a; 
    --bg-card: rgba(20, 20, 20, 0.7); 
    
    /* Accents */
    --accent-primary: #ffffff; 
    --accent-secondary: #a3a3a3; 
    
    /* Borders & Glows */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(255, 255, 255, 0.2);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #d4d4d4; 
    --text-muted: #737373;

    /* Layout */
    --site-width: 1200px;
    --content-width: 750px;
}

/* --- Base Aesthetics --- */
/* Paint the absolute bottom layer of the browser black */
html {
    background-color: var(--bg-deep);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* Swap Inter for standard Helvetica stack */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    background-color: var(--bg-deep);
    background: radial-gradient(circle at 50% -20%, #1a1a1a 0%, #000000 80%) fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading { 
    font-family: 'Outfit', sans-serif; 
    color: var(--text-primary);
}

a { color: var(--text-primary); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--accent-secondary); }

img { max-width: 100%; height: auto; display: block; }

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

.site-main {
    flex: 1;
    width: 100%;
    max-width: 100%; /* Changed from var(--site-width) to 100% */
    margin: 0 auto;
    padding: 4rem 3rem; /* Increased padding slightly so it doesn't touch the absolute edge on large screens */
}

/* --- Header & Navigation --- */
.site-header {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    width: 100%;
    max-width: 100%; /* Expands full width */
    margin: 0 auto;
    padding: 1.5rem 1.5rem; /* Increased vertical padding for more height */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.site-branding-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    line-height: 1;
}

.site-author {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em; /* Spreads out the faint text to match title length */
    margin-top: 5px;
    font-weight: 400;
    opacity: 0.7;
}

.site-branding svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

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

.main-navigation a {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
    letter-spacing: 0.05em;
}

.main-navigation a:hover { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* --- Mobile Menu Toggle --- */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}
.menu-toggle:hover { color: var(--accent-secondary); }

/* --- Homepage Grid (3 Columns) --- */
.page-header { text-align: center; margin-bottom: 4rem; }
.page-title { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; text-shadow: 0 0 30px rgba(255, 255, 255, 0.2); }

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.post-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.post-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #000;
    border: 1px solid rgba(255,255,255,0.05);
}

.post-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.3s; }
.post-card:hover .post-thumb img { opacity: 1; }

.post-card-title { font-size: 1.25rem; margin-bottom: 0.75rem; line-height: 1.3; }
.post-card-excerpt { font-size: 0.9rem; color: var(--text-muted); flex-grow: 1; margin-bottom: 1rem; }
.post-card-meta { font-size: 0.75rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- OPINIONATED GUTENBERG STYLES --- */
.single-header { text-align: center; margin-bottom: 4rem; }
.single-title { font-size: 3.5rem; font-weight: 700; line-height: 1.1; margin-bottom: 0; }
.single-meta { color: var(--text-muted); font-family: 'Outfit', sans-serif; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 1.5rem; }

/* Strictly Centered & Contained Featured Image */
.single-thumb { 
    border-radius: 16px; 
    margin: 0 auto 4rem auto; 
    overflow: hidden; 
    border: 1px solid var(--border-subtle); 
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8); 
    background: #000;
    width: 100%;
    max-width: var(--content-width);
    display: flex;
    justify-content: center;
    align-items: center;
}
.single-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px;
}

.entry-content {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Force Center All Headings with Minimalist Spacing */
.entry-content > h1, .entry-content > h2, .entry-content > h3, 
.entry-content > h4, .entry-content > h5, .entry-content > h6 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.entry-content > h1 { font-size: 2.75rem; margin-top: 4rem; margin-bottom: 2rem; }
.entry-content > h2 { font-size: 2.25rem; margin-top: 3.5rem; margin-bottom: 1.5rem; }
.entry-content > h3 { font-size: 1.75rem; margin-top: 3rem; margin-bottom: 1.25rem; }
.entry-content > h4, .entry-content > h5, .entry-content > h6 { font-size: 1.25rem; margin-top: 2.5rem; margin-bottom: 1rem; }

/* Left Align Paragraphs & Lists with readable spacing */
.entry-content > p {
    text-align: left;
    font-size: 1.125rem; /* 18px Desktop */
    line-height: 1.6; /* Tighter line-height looks better with Helvetica */
    color: var(--text-secondary);
    margin-bottom: 2rem; 
    font-weight: 400; /* Normal weight instead of thin 300 */
}

.entry-content > ul, .entry-content > ol {
    text-align: left;
    list-style-position: outside;
    margin-left: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem; /* 18px Desktop */
    font-weight: 400; /* Normal weight instead of thin 300 */
    line-height: 1.6;
}

.entry-content > ul li, .entry-content > ol li {
    margin-bottom: 0.75rem;
}

/* --- In-Post Text Links --- */
.entry-content p a,
.entry-content li a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 4px;
    transition: all 0.2s ease;
    position: relative;
    top: 0;
}

.entry-content p a:hover,
.entry-content li a:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
    top: -2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Center and Round Media (Images, Videos, Iframes) */
.entry-content img,
.entry-content video,
.entry-content iframe,
.entry-content figure,
.wp-block-image,
.wp-block-video,
.wp-block-embed {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    margin-top: 2.5rem;
}

.entry-content figure img,
.entry-content figure video {
    border-radius: 12px;
    margin-top: 0;
    margin-bottom: 0;
}

.wp-block-image figcaption, 
.wp-block-embed figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-family: 'Outfit', sans-serif;
}

/* Quote Box Styling */
.entry-content > blockquote, .wp-block-quote {
    text-align: center;
    margin: 4rem auto;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}
.entry-content > blockquote::before {
    content: '"';
    display: block;
    font-size: 4rem;
    line-height: 1;
    color: var(--border-glow);
    margin-bottom: -1rem;
    font-family: serif;
}
.entry-content > blockquote cite { display: block; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); font-style: normal; text-transform: uppercase; letter-spacing: 0.05em; }

/* Buttons */
.wp-block-buttons { justify-content: center; margin: 3.5rem 0; }
.wp-block-button__link {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 16px 36px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-decoration: none;
    display: inline-block;
}
.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3) !important;
    border-color: white !important;
}

/* --- Pagination (Glassmorphism Pills) --- */
.pagination {
    margin-top: 5rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.pagination .page-numbers.current {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    margin-top: 4rem;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-nav a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s; font-family: 'Outfit', sans-serif; text-transform: capitalize; letter-spacing: 0.05em; }
.footer-nav a:hover { color: #fff; }
.site-info { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .site-main { padding: 3rem 1.5rem; } /* Add padding adjustment for mobile main container */

    .header-inner { 
        padding: 1rem 1.25rem; 
        /* Keep site name left, hamburger right */
        flex-direction: row; 
    }
    
    .menu-toggle { 
        display: block; 
    }
    
    .main-navigation { 
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-subtle);
        padding: 1rem 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    
    .main-navigation.toggled {
        display: block;
    }
    
    .main-navigation ul { 
        flex-direction: column; 
        gap: 0; 
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem 2rem;
        text-align: center;
    }

    .single-title { font-size: 2.5rem; }
    .page-title { font-size: 2.5rem; }
    
    /* Super-readable mobile font size (17px) */
    .entry-content > p, .entry-content > ul, .entry-content > ol { 
        font-size: 1.0625rem; 
    }
}