/*
Theme Name: MovieMonthly Theme
Author: MovieMonthly
Version: 1.4
Description: Custom WordPress Theme with Dynamic Category Queries, Sub-menus, and Refined Typography.
*/

:root {
    --bg-color: #111111;
    --text-color: #f4f4f4;
    --accent-color: #888888;
    --border-color: #333333;
    --font-serif: "Zen Old Mincho", "Noto Serif SC", "Source Han Serif SC", STSong, SimSun, serif;
    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.6;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Header & Navigation Bar
   ========================================================================== */

/* Base Header: Default solid dark background for Single Posts, Category Archives, etc. */
header,
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background-color: #111111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-wrap: nowrap !important;
}

/* Homepage Hero Overlay: Transparent Header over Hero Image */
body.home header,
body.front-page header,
body.home .site-header,
body.front-page .site-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
}

/* Subtle gradient overlay at top of homepage hero to maintain nav text legibility */
body.home .hero::before,
body.front-page .hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 2;
    pointer-events: none;
}

/* WP Admin Bar Handling when Logged In */
body.admin-bar header,
body.admin-bar .site-header {
    top: 32px !important;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Primary Nav Layout */
nav > ul,
nav > div > ul,
nav ul.menu {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    gap: 2.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Top-Level Menu Items */
nav li {
    position: relative !important;
    list-style: none !important;
}

nav li a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
    opacity: 0.85;
}

nav li:hover > a {
    opacity: 1;
    color: #ffffff;
}

/* Indicator Arrow for Menu Items with Sub-Categories */
nav li.menu-item-has-children > a::after,
nav li.page_item_has_children > a::after {
    content: " ▾";
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.6;
}

/* Sub-Category Dropdown Box */
nav ul.sub-menu,
nav ul ul {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 220px !important;
    background-color: #181818 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
    padding: 0.5rem 0 !important;
    z-index: 1001 !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
}

/* Hover Bridge for Dropdowns */
nav ul.sub-menu::before,
nav ul ul::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

/* Show Sub-Menu on Hover/Focus */
nav li:hover > ul.sub-menu,
nav li:hover > ul,
nav li:focus-within > ul {
    display: flex !important;
}

/* Sub-Menu Links Styling */
nav ul.sub-menu li,
nav ul ul li {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

nav ul.sub-menu li a,
nav ul ul li a {
    display: block !important;
    padding: 0.7rem 1.25rem !important;
    font-size: 0.8rem !important;
    color: var(--accent-color) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    white-space: nowrap !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
}

nav ul.sub-menu li a:hover,
nav ul ul li a:hover {
    opacity: 1 !important;
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Nested 3rd Level Sub-Menus */
nav ul ul ul {
    top: 0 !important;
    left: 100% !important;
}

/* ==========================================================================
   Hero Section (Homepage)
   ========================================================================== */

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    padding: 6rem 4rem;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(17,17,17,1) 0%, rgba(17,17,17,0.3) 50%, rgba(17,17,17,0.1) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero h1 a {
    color: inherit;
    text-decoration: none;
}

.hero p {
    font-size: 1.1rem;
    color: var(--accent-color);
    max-width: 600px;
    margin-bottom: 2rem;
}

/* Slider Controls */
.slider-control {
    position: absolute;
    bottom: 4rem;
    right: 4rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.slider-dots {
    display: flex;
    gap: 0.75rem;
}

.dot {
    width: 30px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: #ffffff;
    width: 50px;
}

.slider-arrows {
    display: flex;
    gap: 1rem;
}

.arrow-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.arrow-btn:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Article Grid & Main Layout
   ========================================================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 4rem;
}

.section-title {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.article-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-img-wrapper {
    width: 100%;
    height: 350px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background-color: #222;
}

.article-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    filter: grayscale(20%);
}

.article-card:hover .article-img-wrapper img {
    transform: scale(1.03);
    filter: grayscale(0%);
}

.article-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.article-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--accent-color);
    line-height: 1.6;
}

footer,
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Category & Archive Page Styling
   ========================================================================== */

.category-page {
    padding-top: 10rem;
}

.archive-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 4rem;
}

.archive-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.05em;
}

.archive-description {
    margin-top: 1rem;
    color: var(--accent-color);
    max-width: 700px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-meta {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.1em;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 5rem;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.pagination-wrapper a, 
.pagination-wrapper .current {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.pagination-wrapper a:hover,
.pagination-wrapper .current {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

/* ==========================================================================
   Single Post Page Layout & Typography
   ========================================================================== */

body.single .single-post-container,
.single-post-container,
main.single-post-container {
    max-width: 820px;
    margin: 0 auto;
    padding-top: 160px !important; /* Top clearance to clear fixed nav */
    padding-bottom: 6rem;
    position: relative;
    z-index: 1;
}

/* Clean, centered vertical stack for single post header */
.entry-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 2;
    background: transparent !important; /* Removes unwanted background box */
    padding: 0 !important;
    border: none !important;
}

.entry-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.entry-categories .cat-link {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
    margin: 0;
}

.entry-categories .cat-link:hover {
    color: #ffffff;
}

.entry-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    max-width: 95%;
}

.entry-meta {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.meta-divider {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.entry-featured-image {
    margin-bottom: 3rem;
    width: 100%;
    overflow: hidden;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
}

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

.entry-content h2, 
.entry-content h3, 
.entry-content h4 {
    color: #ffffff;
    font-weight: 700;
    margin: 3rem 0 1.5rem 0;
    line-height: 1.3;
}

.entry-content h2 { font-size: 1.75rem; }
.entry-content h3 { font-size: 1.4rem; }

.entry-content a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.entry-content blockquote {
    margin: 2.5rem 0;
    padding-left: 2rem;
    border-left: 2px solid #ffffff;
    font-style: italic;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    display: block;
}

.entry-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.entry-tags {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    margin-bottom: 2rem;
}

.tags-label {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.entry-tags a {
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.6rem;
    margin-right: 0.4rem;
    display: inline-block;
    transition: var(--transition);
}

.entry-tags a:hover {
    background: #ffffff;
    color: #111111;
}

.author-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 2rem;
}

.author-label {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
}

.author-name {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.post-navigation a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
    max-width: 350px;
    display: inline-block;
}

.post-navigation a:hover {
    color: #ffffff;
}

/* ==========================================================================
   Responsive & Media Queries
   ========================================================================== */

/* Tablet & iPad Screen Adjustments */
@media (max-width: 1100px) {
    header,
    .site-header {
        padding: 1.25rem 2rem !important;
    }

    nav > ul,
    nav > div > ul,
    nav ul.menu {
        gap: 1.2rem !important;
    }

    nav li a {
        font-size: 0.75rem !important;
    }

    .logo-text {
        font-size: 1rem !important;
    }
}

@media (max-width: 1024px) {
    .article-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .hero h1 { 
        font-size: 2.5rem; 
    }
}

@media (max-width: 782px) {
    body.admin-bar header,
    body.admin-bar .site-header {
        top: 46px !important;
    }
}

@media (max-width: 768px) {
    header,
    .site-header { 
        padding: 1.5rem 2rem !important; 
    }
    nav ul.menu, 
    nav > ul { 
        display: none !important;
    } 
    .hero, 
    .hero-slide { 
        padding: 4rem 2rem; 
    }
    .slider-control { 
        bottom: 2rem; 
        right: 2rem; 
    }
    .container { 
        padding: 4rem 2rem; 
    }
    .article-grid { 
        grid-template-columns: 1fr; 
    }
    body.single .single-post-container,
    .single-post-container {
        padding-top: 130px !important;
    }
    .entry-title {
        font-size: 1.8rem;
    }
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}