/*
Theme Name: GlamNews
Theme URI: https://example.com/glamnews
Author: Your Name
Author URI: https://example.com
Description: A modern, glamorous entertainment and celebrity news magazine theme inspired by Pinkvilla. Features a clean, image-focused layout with pink accents, perfect for Bollywood, Hollywood, fashion, and lifestyle content.
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: glamnews
Tags: entertainment, news, magazine, blog, celebrity, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready, rtl-language-support, editor-style, block-styles
*/

/* ==========================================
   CSS Variables
   ========================================== */
:root {
    --primary-color: #ff4f8b;
    --primary-dark: #e63d75;
    --primary-light: #ff6b9d;
    --secondary-color: #6c757d;
    --accent-gold: #d4af37;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --text-light: #999999;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #e9ecef;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;
    --max-width: 1320px;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--bg-white);
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Prevent layout shift from images without dimensions */
img[width][height] {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ==========================================
   Typography
   ========================================== */
p {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.2rem;
}

/* ==========================================
   Container & Layout
   ========================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    padding: 40px 0;
}

/* Grid children must shrink below their content width on mobile */
.main-content,
.sidebar {
    min-width: 0;
}

/* ==========================================
   Header & Navigation
   ========================================== */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-top {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: var(--text-gray);
    margin-left: 15px;
    font-size: 14px;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
}

.main-navigation {
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.site-logo span {
    color: var(--primary-color);
}

.primary-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.primary-menu a {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-dark);
    padding: 10px 0;
    position: relative;
}

.primary-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.primary-menu a:hover::after,
.primary-menu .current-menu-item a::after {
    width: 100%;
}

/* =============================
   Mega Menu
   ============================= */

/* Make the nav a positioning context for the mega panel */
.main-navigation {
    position: relative;
}

.primary-menu > li {
    position: static;
}

/* The drop-down panel */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    animation: megaFadeIn 0.2s ease;
}

@keyframes megaFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.primary-menu > li.mega-open > .mega-menu {
    display: block;
}

.mega-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 24px;
}

.mega-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mega-menu-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.mega-view-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.mega-view-all:hover {
    color: var(--primary-dark);
    gap: 8px;
}

.mega-menu-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.mega-post-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mega-post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mega-post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.mega-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mega-post-item:hover .mega-post-thumb img {
    transform: scale(1.05);
}

.mega-post-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 28px;
}

.mega-post-info {
    padding: 0 4px 8px;
}

.mega-post-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mega-post-item:hover .mega-post-info h4 {
    color: var(--primary-color);
}

.mega-post-date {
    font-size: 11px;
    color: var(--text-light);
}

/* Arrow indicator on menu items that have a mega menu */
.primary-menu > li.has-mega-menu > a::before {
    content: '';
}

.primary-menu > li.has-mega-menu > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-menu > li.has-mega-menu > a .mega-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--text-light);
}

.primary-menu > li.mega-open > a .mega-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* Backdrop overlay */
.mega-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.mega-backdrop.active {
    display: block;
}

/* Hide mega menu on mobile — handled by mobile drawer */
@media (max-width: 768px) {
    .mega-menu {
        display: none !important;
    }
}

/* Narrow screen: 2-column posts grid */
@media (max-width: 1024px) and (min-width: 769px) {
    .mega-menu-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-toggle,
.mobile-menu-toggle {
    font-size: 18px;
    color: var(--text-dark);
    transition: var(--transition);
}

.search-toggle:hover,
.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
}

/* Hide mobile-only drawer close button on desktop */
.mobile-menu-close {
    display: none;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-form-wrapper {
    width: 90%;
    max-width: 700px;
}

.search-overlay .search-form {
    position: relative;
}

.search-overlay input[type="search"] {
    width: 100%;
    padding: 20px 60px 20px 20px;
    font-size: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    background: var(--bg-white);
    color: var(--text-dark);
}

.search-overlay button[type="submit"] {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary-color);
}

.search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 40px;
    color: var(--bg-white);
    cursor: pointer;
}

/* ==========================================
   Featured Section (Hero)
   ========================================== */
.featured-section {
    padding: 40px 0;
    background: var(--bg-light);
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.featured-post {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 500px;
}

.featured-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.featured-post:hover img {
    transform: scale(1.05);
}

.featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--bg-white);
}

.featured-content h2 {
    color: var(--bg-white);
    font-size: 2rem;
    margin-bottom: 15px;
}

.category-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: var(--bg-white);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.post-meta i {
    margin-right: 5px;
}

.featured-secondary {
    display: grid;
    gap: 20px;
}

.featured-small {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 240px;
}

.featured-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.featured-small:hover img {
    transform: scale(1.05);
}

.featured-small .featured-content {
    padding: 20px;
}

.featured-small h3 {
    color: var(--bg-white);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* ==========================================
   Trending Section
   ========================================== */
.trending-section {
    padding: 40px 0;
    background: var(--bg-white);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.section-title i {
    color: var(--primary-color);
    margin-right: 10px;
}

.trending-slider {
    position: relative;
}

.trending-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.trending-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.trending-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.trending-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 10px;
}

.trending-card h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    font-family: var(--font-body);
}

.trending-card p {
    font-size: 14px;
    color: var(--text-gray);
    margin: 0;
}

/* ==========================================
   Posts Grid
   ========================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-thumbnail .category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
}

.post-content {
    padding: 25px;
}

.post-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a {
    color: var(--text-dark);
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    color: var(--text-light);
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    position: sticky;
    top: 120px;
}

.widget {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.trending-list .trending-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.trending-list .trending-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.trending-item .rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    opacity: 0.5;
    flex-shrink: 0;
}

.trending-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    font-family: var(--font-body);
}

.trending-info .views {
    font-size: 12px;
    color: var(--text-light);
}

/* Tags Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    padding: 8px 16px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 13px;
    border-radius: 20px;
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
}

.newsletter-widget .widget-title {
    color: var(--bg-white);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.newsletter-widget p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.newsletter-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

.newsletter-form button {
    width: 100%;
    padding: 12px;
    background: var(--bg-white);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--text-dark);
    color: var(--bg-white);
}

/* ==========================================
   Breadcrumbs
   ========================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    padding: 16px 0;
}

.breadcrumbs a {
    color: var(--text-gray);
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumb-sep {
    font-size: 9px;
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 500;
}

/* ==========================================
   Single Post Page
   ========================================== */
article.single-post {
    overflow: hidden;
}

.single-post .post-header {
    text-align: center;
    max-width: 800px;
    margin: 40px auto;
}

.single-post .category-badge {
    margin-bottom: 15px;
    display: inline-block;
}

.single-post .entry-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.25;
}

.author-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info {
    text-align: left;
}

.author-name {
    font-weight: 600;
    display: block;
    color: var(--text-dark);
}

.author-name a {
    color: var(--primary-color);
}

.author-name a:hover {
    color: var(--primary-dark);
}

.post-date {
    font-size: 14px;
    color: var(--text-gray);
}

.featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    max-width: 800px;
    margin: 0 auto 40px;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

.entry-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px 20px 20px 30px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-gray);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
}

.entry-content ul, .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 30px;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

/* Page links (multi-page posts) */
.page-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    font-weight: 600;
    color: var(--text-dark);
}

.page-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}

.page-links a:hover {
    background: var(--primary-dark);
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 16px;
    transition: var(--transition);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.pinterest { background: #e60023; }
.share-btn.whatsapp { background: #25d366; }

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Related Posts */
.related-posts {
    padding: 50px 0;
    background: var(--bg-light);
    margin-top: 40px;
    overflow: hidden;
}

.related-posts .section-title {
    margin-bottom: 24px;
}

/* ==========================================
   Comments
   ========================================== */
.comments-wrapper {
    max-width: 800px;
    margin: 40px auto;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-list .children {
    list-style: none;
    padding-left: 30px;
    margin: 0;
    border-left: 3px solid var(--bg-gray);
}

.comment-body {
    display: flex;
    gap: 16px;
}

.comment-body .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

.comment-author a {
    color: var(--text-dark);
}

.comment-author a:hover {
    color: var(--primary-color);
}

.comment-metadata {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.comment-metadata a {
    color: var(--text-light);
}

.comment-content p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.reply a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
}

.reply a:hover {
    color: var(--primary-dark);
}

/* Comment Form */
.comment-respond {
    margin-top: 40px;
}

.comment-respond .comment-reply-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-dark);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition);
    background: var(--bg-white);
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 79, 139, 0.15);
}

.comment-form textarea {
    min-height: 140px;
    resize: vertical;
}

.comment-form p {
    margin-bottom: 16px;
}

.comment-form .form-submit input[type="submit"] {
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form .form-submit input[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================
   Floating Share Bar (desktop — left side)
   ========================================== */
.floating-share-bar {
    position: fixed;
    left: max(calc((100vw - 1200px) / 2 - 70px), 16px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.floating-share-bar.visible {
    opacity: 1;
    visibility: visible;
}

.floating-share-bar .share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-share-bar .share-btn:hover {
    transform: scale(1.15);
}

/* ==========================================
   Sticky Sidebar (desktop only)
   ========================================== */
@media (min-width: 1025px) {
    .content-wrapper {
        align-items: flex-start;
    }

    .sidebar {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Hide floating share bar on mobile/tablet */
@media (max-width: 1024px) {
    .floating-share-bar {
        display: none;
    }
}

/* Hide mobile share bar on desktop */
@media (min-width: 769px) {
    .mobile-share-bar {
        display: none;
    }
}

/* ==========================================
   Author Bio
   ========================================== */
.author-bio {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.author-bio-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-bio-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.author-bio-content p {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.author-social {
    display: flex;
    gap: 12px;
}

.author-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.author-social a:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* ==========================================
   Entry Tags
   ========================================== */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 30px auto;
    max-width: 800px;
    font-size: 14px;
    color: var(--text-gray);
}

.entry-tags .tags-label {
    font-weight: 600;
    color: var(--text-dark);
}

.entry-tags a {
    padding: 5px 14px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 13px;
    transition: var(--transition);
}

.entry-tags a:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* ==========================================
   Responsive content images & embeds
   ========================================== */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.entry-content table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object {
    max-width: 100%;
}

.entry-content pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================================
   Touch targets (WCAG 2.5.5 — min 44×44px)
   ========================================== */
.search-toggle,
.mobile-menu-toggle,
.search-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Footer
   ========================================== */
.site-footer {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 60px 0 20px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: var(--bg-white);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-widget a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================
   Pagination
   ========================================== */
.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 40px 0;
}

.page-numbers {
    padding: 10px 18px;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 6px;
    transition: var(--transition);
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* ==========================================
   Scroll-to-Top Button
   ========================================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* ==========================================
   Section Header & View All
   ========================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    white-space: nowrap;
}

.view-all:hover {
    color: var(--primary-dark);
    gap: 8px;
}

.view-all i {
    transition: var(--transition);
}

.view-all:hover i {
    transform: translateX(5px);
}

/* ==========================================
   Scroll animations
   ========================================== */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-items {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ——— Tablet / large mobile (769px – 1024px) ——— */
@media (max-width: 1024px) and (min-width: 769px) {
    .featured-post {
        height: 400px;
    }

    .featured-small {
        height: 190px;
    }
}

/* ——— Mobile (≤ 768px) ——— */
@media (max-width: 768px) {

    /* ---------- Header top bar ---------- */
    .header-top {
        display: none; /* hide date + social bar to save vertical space */
    }

    /* ---------- Logo ---------- */
    .site-logo {
        font-size: 1.5rem;
    }

    /* ---------- Mobile navigation drawer ----------
       KEY FIX: use right:-100% to hide off-screen instead of display:none,
       so .primary-menu.active can slide it back in.
    -------------------------------------------- */
    .primary-menu {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 85vw);
        height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 0 0 30px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }

    .primary-menu.active {
        right: 0;
    }

    .primary-menu > li {
        border-bottom: 1px solid var(--border-color);
    }

    .primary-menu a {
        display: block;
        padding: 14px 24px;
        font-size: 16px;
    }

    .primary-menu a::after {
        display: none; /* remove underline animation in drawer */
    }

    /* ---------- Back/Close button inside mobile drawer ---------- */
    .mobile-menu-close {
        display: block;
        border-bottom: 1px solid var(--border-color);
        padding: 0;
    }

    .mobile-menu-close button {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-dark);
        background: var(--bg-light);
        border: none;
        cursor: pointer;
        font-family: var(--font-body);
        transition: var(--transition);
    }

    .mobile-menu-close button:hover {
        color: var(--primary-color);
        background: var(--bg-gray);
    }

    .mobile-menu-close button i {
        font-size: 14px;
    }

    /* ---------- Hamburger button ---------- */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 30px;
        height: 25px;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
        flex-shrink: 0;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--text-dark);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* Overlay behind mobile drawer */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1000;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    /* ---------- Featured section ---------- */
    .featured-section {
        padding: 20px 0;
    }

    .featured-post {
        height: 300px;
    }

    .featured-small {
        height: 200px;
    }

    .featured-content {
        padding: 16px;
    }

    .featured-content h2 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .featured-small h3 {
        font-size: 1rem;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }

    /* ---------- Trending section ---------- */
    .trending-section {
        padding: 24px 0;
    }

    .trending-items {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding-bottom: 8px;
    }

    /* hide scrollbar but keep scroll */
    .trending-items::-webkit-scrollbar {
        display: none;
    }
    .trending-items {
        scrollbar-width: none;
    }

    .trending-card {
        flex: 0 0 260px;
        scroll-snap-align: start;
    }

    .trending-number {
        font-size: 2rem;
    }

    /* ---------- Posts grid ---------- */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* ---------- Section header ---------- */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 16px;
    }

    /* ---------- Sidebar ---------- */
    .widget {
        padding: 20px;
    }

    /* ---------- Footer ---------- */
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .site-footer {
        padding: 40px 0 20px;
    }

    /* ---------- Single post ---------- */
    .single-post .post-header {
        margin: 20px auto;
        text-align: left;
        padding-left: 0;
        padding-right: 0;
    }

    .single-post .entry-title {
        font-size: 1.6rem;
    }

    .author-meta {
        justify-content: flex-start;
        gap: 12px;
    }

    .featured-image {
        margin-bottom: 24px;
        border-radius: 8px;
    }

    .entry-content {
        font-size: 1rem;
        margin: 0 auto 24px;
    }

    /* Ensure single-post inner blocks don't touch viewport edges */
    .single-post .post-header,
    .single-post .entry-content,
    .single-post .entry-tags,
    .single-post .share-buttons,
    .single-post .author-bio,
    .single-post .comments-wrapper,
    .single-post .breadcrumbs,
    .single-post .featured-image {
        max-width: 100%;
        box-sizing: border-box;
    }

    .entry-content h2 {
        margin-top: 24px;
        margin-bottom: 14px;
    }

    .entry-content blockquote {
        padding: 14px 14px 14px 20px;
        margin: 20px 0;
    }

    .entry-content ul, .entry-content ol {
        padding-left: 20px;
    }

    .share-buttons {
        gap: 10px;
        margin: 20px 0;
    }

    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }

    .author-bio-avatar {
        width: 70px;
        height: 70px;
    }

    .author-bio-content h3,
    .author-social {
        text-align: center;
        justify-content: center;
    }

    .related-posts {
        padding: 30px 16px;
        margin-top: 24px;
    }

    /* ---------- Comments (mobile) ---------- */
    .comments-wrapper {
        margin: 24px auto;
    }

    .comment-list .children {
        padding-left: 16px;
    }

    .comment-body {
        gap: 12px;
    }

    .comment-body .avatar {
        width: 36px;
        height: 36px;
    }

    .comment-respond {
        margin-top: 24px;
    }

    .comment-form .form-submit input[type="submit"] {
        width: 100%;
        padding: 14px;
    }

    /* ---------- Breadcrumbs (mobile) ---------- */
    .breadcrumbs {
        font-size: 12px;
        gap: 5px;
        padding: 12px 0;
    }

    .breadcrumb-current {
        display: inline-block;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: bottom;
    }

    /* ---------- Post date line compact ---------- */
    .post-date {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }

    /* ---------- Bottom sticky share bar (mobile) ---------- */
    .mobile-share-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: var(--bg-white);
        border-top: 1px solid var(--border-color);
        padding: 8px 0;
        z-index: 999;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    }

    .mobile-share-bar .share-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 16px;
    }

    /* Push page content above the sticky bar */
    body.single-post {
        padding-bottom: 60px;
    }

    /* ---------- Content wrapper ---------- */
    .content-wrapper {
        padding: 24px 0;
        gap: 24px;
    }

    /* ---------- Prevent horizontal overflow ---------- */
    .main-content {
        overflow-x: hidden;
        width: 100%;
    }

    /* ---------- WordPress block alignment overrides ----------
       Gutenberg alignwide/alignfull use negative margins + 100vw
       widths that break mobile layout. Constrain them. */
    .alignwide,
    .alignfull,
    .wp-block-image.alignwide,
    .wp-block-image.alignfull,
    .wp-block-cover.alignwide,
    .wp-block-cover.alignfull,
    .wp-block-group.alignwide,
    .wp-block-group.alignfull {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Force all entry-content direct children to stay in bounds */
    .entry-content > * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ---------- Typography ---------- */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

    /* ---------- Scroll-to-top ---------- */
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    /* ---------- Search overlay ---------- */
    .search-overlay input[type="search"] {
        font-size: 18px;
        padding: 16px 50px 16px 16px;
    }

    .search-overlay button[type="submit"] {
        font-size: 18px;
        right: 16px;
    }

    .search-close {
        top: 20px;
        right: 20px;
        font-size: 30px;
    }
}

/* ——— Small phones (≤ 480px) ——— */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .featured-post {
        height: 240px;
    }

    .featured-small {
        height: 170px;
    }

    .featured-content h2 {
        font-size: 1rem;
    }

    .trending-items {
        grid-template-columns: 1fr;
    }

    .trending-card {
        padding: 16px;
    }

    .post-content {
        padding: 16px;
    }

    .post-thumbnail {
        height: 180px;
    }

    .footer-widgets {
        gap: 20px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .single-post .entry-title {
        font-size: 1.4rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    .featured-image {
        border-radius: 6px;
    }

    .author-bio {
        padding: 16px;
    }

    .related-posts {
        padding: 24px 0;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.1rem; }
}

/* ==========================================
   Utility Classes
   ========================================== */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-40 { margin-top: 40px; }

/* WordPress Core */
.alignleft { float: left; margin-right: 20px; }
.alignright { float: right; margin-left: 20px; }
.aligncenter { display: block; margin: 0 auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 14px; color: var(--text-gray); margin-top: 10px; }

/* Constrain all WordPress block content to their parent */
[class*="wp-block-"] {
    max-width: 100%;
    box-sizing: border-box;
}
