/*
Theme Name:  Publisher Clone
Theme URI:   https://yoursite.com
Author:      Your Name
Description: A magazine & blog WordPress theme inspired by Publisher, compatible with Elementor Free. Includes custom Theme Options, One Click Demo Import, and full responsive design.
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License:     GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: publisher-clone
Tags:        blog, news, magazine, elementor, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, responsive-layout, translation-ready
*/

/* ============================================================
   TABLE OF CONTENTS
   1. CSS Variables (theme colors injected by customizer)
   2. Reset & Base
   3. Typography
   4. Layout
   5. Header
   6. Navigation
   7. Mobile Menu
   8. Footer
   9. Blog / Archive
   10. Single Post
   11. Sidebar & Widgets
   12. Buttons
   13. Forms
   14. Responsive
   ============================================================ */

/* 1. CSS Variables – overridden via wp_add_inline_style() from customizer */
:root {
    --primary-color: #E74C3C;
    --secondary-color: #2C3E50;
    --accent-color: #3498DB;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --border-color: #E0E0E0;
    --heading-font: 'Georgia', serif;
    --body-font: 'Arial', sans-serif;
}

/* 2. Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
    line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 3. Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--secondary-color);
    line-height: 1.3;
    margin-bottom: .75rem;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
p { margin-bottom: 1rem; }

/* 4. Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.site-main { padding: 40px 0; }
.content-area { width: 70%; float: left; padding-right: 30px; }
.widget-area  { width: 30%; float: left; }
.clearfix::after { content: ''; display: table; clear: both; }

/* Elementor full-width pages: no sidebar */
.elementor-page .content-area,
.page-template-elementor-canvas .content-area {
    width: 100%; padding: 0; float: none;
}
.elementor-page .widget-area { display: none; }

/* 5. Header */
.site-header {
    background: var(--bg-color);
    border-bottom: 3px solid var(--primary-color);
    position: sticky; top: 0; z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: box-shadow .3s;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}
.site-logo img { max-height: 60px; width: auto; }
.site-logo .site-title {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* 6. Navigation */
.main-navigation ul { list-style: none; display: flex; gap: 0; }
.main-navigation ul li { position: relative; }
.main-navigation ul li a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: color .2s, background .2s;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
    color: var(--primary-color);
    background: var(--bg-secondary);
    text-decoration: none;
}
/* Dropdown */
.main-navigation ul ul {
    position: absolute; top: 100%; left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    min-width: 200px;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 100;
}
.main-navigation ul li:hover > ul { display: flex; }
.main-navigation ul ul li a { padding: 10px 16px; font-size: 13px; }

/* 7. Mobile Menu */
.menu-toggle {
    display: none;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 4px;
}

/* 8. Footer */
.site-footer { background: var(--secondary-color); color: #ccc; padding: 50px 0 0; }
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}
.footer-widget h3 {
    color: #fff; font-size: 1rem;
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px; margin-bottom: 16px;
}
.footer-widget a { color: #bbb; }
.footer-widget a:hover { color: var(--primary-color); text-decoration: none; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
}
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    color: #ccc; font-size: 14px; margin-left: 6px;
    transition: background .2s, color .2s;
}
.footer-social a:hover { background: var(--primary-color); color: #fff; text-decoration: none; }

/* 9. Blog / Archive */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}
.post-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
}
.post-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); transform: translateY(-3px); }
.post-card-thumbnail { aspect-ratio: 16/9; overflow: hidden; }
.post-card-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card-thumbnail img { transform: scale(1.05); }
.post-card-body { padding: 16px; }
.post-category {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--primary-color);
    background: rgba(231,76,60,.1);
    padding: 2px 8px; border-radius: 3px;
    margin-bottom: 8px;
}
.post-card-title { font-size: 1rem; line-height: 1.4; margin-bottom: 8px; }
.post-card-title a { color: var(--secondary-color); }
.post-card-title a:hover { color: var(--primary-color); text-decoration: none; }
.post-meta { font-size: 12px; color: var(--text-light); }
.post-meta span + span::before { content: ' · '; }

/* 10. Single Post */
.single-post-header { margin-bottom: 30px; }
.single-post-thumbnail { border-radius: 6px; overflow: hidden; margin-bottom: 24px; }
.single-post-content { font-size: 17px; line-height: 1.85; }
.single-post-content p { margin-bottom: 1.2rem; }
.single-post-content h2, .single-post-content h3 { margin-top: 2rem; margin-bottom: 1rem; }
.author-box {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 24px; background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    margin: 40px 0;
}
.author-avatar { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; }
.related-posts { margin-top: 50px; }
.related-posts h3 { font-size: 1.2rem; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }

/* 11. Sidebar & Widgets */
.widget { margin-bottom: 32px; }
.widget-title {
    font-size: 1rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; border-left: 4px solid var(--primary-color);
    padding-left: 10px; margin-bottom: 16px;
}
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.widget ul li a { color: var(--text-color); }
.widget ul li a:hover { color: var(--primary-color); text-decoration: none; }

/* 12. Buttons */
.btn {
    display: inline-block; padding: 10px 24px;
    background: var(--primary-color); color: #fff;
    border-radius: 4px; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer; transition: background .2s, transform .15s;
}
.btn:hover { background: var(--secondary-color); text-decoration: none; transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover { background: var(--primary-color); color: #fff; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0; }
.pagination a, .pagination span {
    padding: 8px 14px; border: 1px solid var(--border-color);
    border-radius: 4px; font-size: 14px; color: var(--text-color);
    transition: all .2s;
}
.pagination a:hover, .pagination .current {
    background: var(--primary-color); color: #fff;
    border-color: var(--primary-color); text-decoration: none;
}

/* 13. Forms */
input[type="text"], input[type="email"], input[type="search"], textarea, select {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border-color); border-radius: 4px;
    font-size: 14px; font-family: var(--body-font);
    background: var(--bg-color); color: var(--text-color);
    transition: border-color .2s;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231,76,60,.15);
}

/* 14. Responsive */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    .content-area, .widget-area { width: 100%; float: none; padding: 0; }
    .widget-area { margin-top: 40px; }
    .post-grid { grid-template-columns: 1fr; }
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
    .menu-toggle { display: block; }
    .main-navigation ul { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-color); border-top: 3px solid var(--primary-color); box-shadow: 0 4px 12px rgba(0,0,0,.12); padding: 8px 0; }
    .main-navigation.toggled ul { display: flex; }
    .main-navigation ul ul { position: static; box-shadow: none; border-top: none; background: var(--bg-secondary); }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 480px) {
    .footer-widgets { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; }
}
