/*
Theme Name: MagazinePro
Theme URI: https://example.com/magazinepro
Author: Godswill
Author URI: https://example.com
Description: An elegant, modern dark-mode news and magazine theme featuring magazine-style grid layouts, a per-category color scheme system, deep Elementor compatibility, social sharing, Open Graph and Twitter Card featured images, comprehensive Google News schema markup, automated popular-post counters, and a built-in newsletter widget.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: magazinepro
Tags: news, blog, dark, grid-layout, custom-logo, custom-colors, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   MagazinePro Dark Mode Design System
   ========================================================================== */

:root {
  --mp-bg: #0e1116;
  --mp-bg-alt: #161b22;
  --mp-card: #1b222c;
  --mp-border: #2a3340;
  --mp-text: #e6e9ee;
  --mp-text-muted: #9aa4b2;
  --mp-accent: #e63946;
  --mp-accent-2: #4ea1ff;
  --mp-heading-font: Georgia, 'Times New Roman', serif;
  --mp-body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mp-radius: 10px;
  --mp-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --mp-cat-color: var(--mp-accent);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: var(--mp-body-font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--mp-accent-2); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--mp-accent); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--mp-heading-font);
  color: var(--mp-text);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}

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

.mp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal;
}

/* ==========================================================================
   Header
   ========================================================================== */

.mp-topbar {
  background: var(--mp-bg-alt);
  border-bottom: 1px solid var(--mp-border);
  font-size: 13px;
  color: var(--mp-text-muted);
}
.mp-topbar .mp-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
}

.site-header {
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
}
.site-header .mp-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-branding { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-branding .custom-logo-link img {
  width: var(--mp-logo-width, 180px);
  max-width: 100%;
  height: auto;
  display: block;
}
.site-title {
  font-family: var(--mp-heading-font);
  font-size: 30px;
  margin: 0;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.site-title a { color: var(--mp-text); }
.site-title a:hover { color: var(--mp-accent); }
.site-description { margin: 0; font-size: 13px; color: var(--mp-text-muted); }

/* Navigation */
.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-navigation li { position: relative; }
.main-navigation a {
  display: block;
  padding: 10px 14px;
  color: var(--mp-text);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
}
.main-navigation a:hover { background: var(--mp-card); color: var(--mp-accent); }
.main-navigation ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  box-shadow: var(--mp-shadow);
  flex-direction: column;
  display: none;
  padding: 6px;
  z-index: 1000;
}
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul { display: flex; }

.mp-menu-toggle {
  display: none;
  background: var(--mp-card);
  color: var(--mp-text);
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 15px;
  cursor: pointer;
}

/* ==========================================================================
   Magazine Grid Layouts
   ========================================================================== */

.mp-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: 250px;
  gap: 20px;
  margin: 32px 0;
}
.mp-hero-grid .mp-card:first-child { grid-row: span 2; }

.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}
.mp-grid-2 { grid-template-columns: repeat(2, 1fr); }

.mp-card {
  position: relative;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.mp-card:hover { transform: translateY(-4px); box-shadow: var(--mp-shadow); }

.mp-card-thumb { display: block; overflow: hidden; aspect-ratio: 16 / 9; }
.mp-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.mp-card:hover .mp-card-thumb img { transform: scale(1.05); }

.mp-hero-grid .mp-card { justify-content: flex-end; min-height: 250px; }
.mp-hero-grid .mp-card-thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.mp-hero-grid .mp-card-body {
  position: relative;
  background: linear-gradient(transparent, rgba(5, 8, 12, 0.92));
  padding: 40px 20px 18px;
}

.mp-card-body { padding: 18px 20px 20px; }

.mp-card-title { font-size: 20px; margin: 8px 0 6px; }
.mp-hero-grid .mp-card:first-child .mp-card-title { font-size: 30px; }
.mp-card-title a { color: var(--mp-text); }
.mp-card-title a:hover { color: var(--mp-accent-2); }

.mp-card-meta, .entry-meta {
  font-size: 12.5px;
  color: var(--mp-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.mp-views { display: inline-flex; align-items: center; gap: 4px; }

/* Category color badge — background driven by the category color system */
.mp-cat-badge {
  display: inline-block;
  background: var(--mp-cat-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
}
a.mp-cat-badge:hover { color: #fff; filter: brightness(1.15); }

.mp-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 22px;
  margin: 40px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mp-section-title::after {
  content: "";
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, var(--mp-cat-color, var(--mp-accent)), transparent);
  border-radius: 2px;
}

/* ==========================================================================
   Layout: content + sidebar
   ========================================================================== */

.mp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  margin: 36px auto;
}
.mp-layout.mp-no-sidebar { grid-template-columns: minmax(0, 1fr); }

/* ==========================================================================
   Single post / page
   ========================================================================== */

.entry-header .entry-title { font-size: 40px; letter-spacing: -0.5px; }
.entry-thumbnail img { border-radius: var(--mp-radius); width: 100%; }
.entry-thumbnail { margin: 24px 0; }
.entry-content { font-size: 18px; }
.entry-content p { margin: 0 0 1.4em; }
.entry-content a { border-bottom: 1px solid var(--mp-accent-2); }
.entry-content blockquote {
  border-left: 4px solid var(--mp-cat-color, var(--mp-accent));
  margin: 1.6em 0;
  padding: 8px 24px;
  background: var(--mp-bg-alt);
  border-radius: 0 var(--mp-radius) var(--mp-radius) 0;
  font-style: italic;
}
.entry-content h2 { font-size: 30px; margin-top: 1.4em; }
.entry-content h3 { font-size: 24px; margin-top: 1.3em; }
.entry-content img { border-radius: var(--mp-radius); }

.entry-footer { margin-top: 32px; }
.mp-tags a {
  display: inline-block;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  color: var(--mp-text-muted);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 6px 8px 0;
}
.mp-tags a:hover { border-color: var(--mp-accent); color: var(--mp-accent); }

/* ==========================================================================
   Social Sharing
   ========================================================================== */

.mp-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 28px 0;
  padding: 18px;
  background: var(--mp-bg-alt);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
}
.mp-share-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mp-text-muted);
  margin-right: 4px;
}
.mp-share a, .mp-share button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.mp-share a:hover, .mp-share button:hover { filter: brightness(1.2); transform: translateY(-2px); color: #fff; }
.mp-share-x { background: #000; border: 1px solid #333 !important; }
.mp-share-fb { background: #1877f2; }
.mp-share-li { background: #0a66c2; }
.mp-share-wa { background: #25d366; }
.mp-share-copy { background: var(--mp-card); border: 1px solid var(--mp-border) !important; color: var(--mp-text) !important; }

/* ==========================================================================
   Author box, post navigation, comments
   ========================================================================== */

.mp-author-box {
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  margin: 32px 0;
}
.mp-author-box img { border-radius: 50%; width: 72px; height: 72px; }
.mp-author-box h4 { margin: 0 0 6px; }
.mp-author-box p { margin: 0; color: var(--mp-text-muted); font-size: 15px; }

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
.post-navigation a {
  display: block;
  padding: 16px 20px;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  color: var(--mp-text);
  font-size: 15px;
}
.post-navigation a:hover { border-color: var(--mp-accent); }
.post-navigation .nav-next { text-align: right; }

.comments-area { margin: 40px 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment {
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  padding: 18px 22px;
  margin-bottom: 16px;
}
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 16px; }
.comment-author img { border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.comment-metadata { font-size: 12.5px; color: var(--mp-text-muted); }
.comment-reply-link { font-size: 13px; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.mp-newsletter input[type="email"],
.search-form .search-field {
  width: 100%;
  background: var(--mp-bg-alt);
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  color: var(--mp-text);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
}
.comment-form input:focus, .comment-form textarea:focus,
.mp-newsletter input:focus, .search-form .search-field:focus {
  outline: none;
  border-color: var(--mp-accent-2);
}

.mp-btn, .comment-form .submit, .search-form .search-submit,
.mp-newsletter button {
  display: inline-block;
  background: var(--mp-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.mp-btn:hover, .comment-form .submit:hover, .mp-newsletter button:hover { filter: brightness(1.15); color: #fff; }

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */

.mp-sidebar .widget {
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  padding: 22px;
  margin-bottom: 26px;
}
.widget-title {
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--mp-accent);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--mp-border); font-size: 15px; }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--mp-text); }
.widget a:hover { color: var(--mp-accent-2); }

/* Popular posts widget */
.mp-popular-item { display: flex; gap: 12px; align-items: flex-start; }
.mp-popular-rank {
  font-family: var(--mp-heading-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--mp-accent);
  line-height: 1;
  min-width: 30px;
}
.mp-popular-item img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.mp-popular-title { font-size: 14.5px; font-weight: 600; line-height: 1.4; display: block; }
.mp-popular-views { font-size: 12px; color: var(--mp-text-muted); }

/* Newsletter widget */
.mp-newsletter p { color: var(--mp-text-muted); font-size: 14.5px; margin-top: 0; }
.mp-newsletter form { display: flex; flex-direction: column; gap: 10px; }
.mp-newsletter-msg { font-size: 13.5px; margin-top: 10px; }

/* ==========================================================================
   Archive headers
   ========================================================================== */

.mp-archive-header {
  margin: 36px 0 8px;
  padding: 28px;
  background: var(--mp-card);
  border-left: 6px solid var(--mp-cat-color, var(--mp-accent));
  border-radius: var(--mp-radius);
}
.mp-archive-header .page-title { margin: 0; font-size: 32px; }
.mp-archive-header .archive-description { color: var(--mp-text-muted); margin: 8px 0 0; }

/* Pagination */
.mp-pagination { display: flex; gap: 8px; flex-wrap: wrap; margin: 36px 0; }
.mp-pagination .page-numbers {
  display: inline-block;
  padding: 10px 16px;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  color: var(--mp-text);
  font-size: 14px;
}
.mp-pagination .page-numbers.current { background: var(--mp-accent); border-color: var(--mp-accent); color: #fff; }
.mp-pagination a.page-numbers:hover { border-color: var(--mp-accent-2); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--mp-bg-alt);
  border-top: 1px solid var(--mp-border);
  margin-top: 60px;
  color: var(--mp-text-muted);
}
.mp-footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding: 48px 0;
}
.mp-footer-widgets .widget-title { color: var(--mp-text); }
.mp-footer-bottom {
  border-top: 1px solid var(--mp-border);
  padding: 18px 0;
  font-size: 13.5px;
  text-align: center;
}
.mp-footer-bottom a { color: var(--mp-text-muted); }
.mp-footer-bottom a:hover { color: var(--mp-accent); }

/* ==========================================================================
   Elementor compatibility
   ========================================================================== */

.elementor-page .mp-layout { display: block; margin: 0; max-width: none; }
.elementor-page.mp-elementor-fullwidth .site-content .mp-container { max-width: none; padding: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .mp-layout { grid-template-columns: 1fr; }
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
  .mp-footer-widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .mp-hero-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .mp-hero-grid .mp-card:first-child { grid-row: span 1; min-height: 300px; }
  .mp-grid, .mp-grid-2 { grid-template-columns: 1fr; }
  .mp-footer-widgets { grid-template-columns: 1fr; }
  .entry-header .entry-title { font-size: 30px; }
  .site-header .mp-container { flex-wrap: wrap; }
  .mp-menu-toggle { display: inline-block; }
  .main-navigation { display: none; width: 100%; }
  .main-navigation.toggled { display: block; }
  .main-navigation ul { flex-direction: column; }
  .main-navigation ul ul { position: static; display: flex; box-shadow: none; border: none; padding-left: 18px; }
}
