/*
Theme Name: HyperMag
Theme URI: https://jansamparkindia.com/
Author: HyperMag WP Conversion Team
Author URI: https://probloggertemplates.com/
Description: Complete, pixel-perfect, production-ready WordPress conversion of HyperMag Magazine Theme. Features multi-layer navigation, hot topics ticker, hero featured posts grid, mobile slide drawer, responsive ad slots, dark mode, customizer controls, live AJAX search, and dynamic magazine layouts.
Version: 1.3.0
Requires at least: 6.0
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: hypermag
Tags: news, magazine, grid-layout, two-columns, dark-mode, custom-menu, featured-images, translation-ready
*/

:root {
  --body-font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --menu-font: 'Instrument Sans', sans-serif;
  --title-font: 'Instrument Sans', sans-serif;
  --text-font: 'Instrument Sans', sans-serif;
  --body-bg-color: #f3f4f6;
  --body-bg: #ffffff;
  --outer-bg: #ffffff;
  --accent-color: #2563eb;
  --accent-color-lite: rgba(37, 99, 235, 0.5);
  --white-color: #ffffff;
  --title-color: #111827;
  --title-hover-color: #2563eb;
  --text-color: #4b5563;
  --summary-color: #6b7280;
  --meta-color: #586271;
  --header-bg: #ffffff;
  --header-color: #111827;
  --header-hover-color: #2563eb;
  --submenu-bg: #111827;
  --submenu-color: #f9fafb;
  --submenu-hover-color: #2563eb;
  --footer-bg: #071d35;
  --footer-color: #f9fafb;
  --footer-hover-color: #f4c34f;
  --footer-text-color: #c1cfdd;
  --footerbar-bg: #031326;
  --footerbar-color: #aebdcb;
  --footerbar-hover-color: #ffffff;
  --btn-bg: var(--accent-color);
  --btn-color: var(--white-color);
  --modal-bg: #ffffff;
  --header: 4.5rem;
  --logo: 2.5rem;
  --container: 75rem;
  --sidebar: 20rem;
  --gap: 2rem;
  --aspect-ratio: 16/11;
  --radius: 0.375rem;
  --jsi-navy: #08284a;
  --jsi-navy-deep: #04172b;
  --jsi-red: #c9152b;
  --jsi-gold: #f4c34f;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

html.is-dark {
  --body-bg-color: #0f172a;
  --outer-bg: #1e293b;
  --body-bg: #1e293b;
  --title-color: #f8fafc;
  --title-hover-color: #60a5fa;
  --text-color: #cbd5e1;
  --summary-color: #94a3b8;
  --meta-color: #94a3b8;
  --header-bg: #0f172a;
  --header-color: #f8fafc;
  --submenu-bg: #020617;
  --submenu-color: #f8fafc;
  --footer-bg: #020617;
  --footerbar-bg: #000000;
  --modal-bg: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--body-bg-color);
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--title-hover-color); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }

.site-outer { width: 100%; max-width: 100%; background: var(--outer-bg); margin: 0 auto; min-height: 100vh; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.flex-c { display: flex; justify-content: center; align-items: center; }
.flex-sb { display: flex; justify-content: space-between; align-items: center; }
.flex-col { display: flex; flex-direction: column; }

/* Top Network Bar */
.jsi-network-bar { background: #05080c; color: #fff; font-family: Arial, sans-serif; border-bottom: 3px solid var(--jsi-red); position: relative; z-index: 120; }
.jsi-network-inner { min-height: 38px; display: flex; align-items: center; overflow-x: auto; white-space: nowrap; }
.jsi-network-brand { font-size: 11px; font-weight: 900; letter-spacing: 0.75px; color: #fff; border-right: 1px solid #49515c; padding-right: 14px; margin-right: 10px; }
.jsi-network-links { display: flex; align-items: center; }
.jsi-network-links a, .jsi-network-actions > a { font-size: 11px; font-weight: 700; color: #dce2e9; padding: 0 10px; border-right: 1px solid #353c46; }
.jsi-network-links a:hover, .jsi-network-actions > a:hover { color: #fff; text-decoration: underline; }
.jsi-network-actions { margin-left: auto; display: flex; align-items: center; }
.jsi-network-actions .jsi-latest-cta { background: var(--jsi-red); border: 0; color: #fff; padding: 5px 12px; margin-left: 10px; font-weight: 900; text-transform: uppercase; border-radius: 2px; }

/* Main Masthead Header */
.site-header { position: relative; z-index: 110; }
.main-header { background: var(--jsi-navy); min-height: var(--header); display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.header-items { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 1rem; }
.flex-left { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.menu-toggle { display: none; background: transparent; border: none; font-size: 1.5rem; color: #fff; cursor: pointer; padding: 0.5rem; }
.main-logo a { display: flex; flex-direction: column; text-decoration: none; }
.main-logo .brand-main { color: #fff; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.5px; text-transform: uppercase; line-height: 1.1; }
.main-logo .brand-sub { color: #cbd8e5; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.8px; margin-top: 3px; }

/* Main Navigation */
.main-menu { flex: 1; }
.main-nav { display: flex; justify-content: flex-end; align-items: center; list-style: none; gap: 0.5rem; }
.main-nav > li { position: relative; }
.main-nav > li > a { display: block; font-size: 0.85rem; color: #ffffff; font-weight: 700; text-transform: uppercase; padding: 1.5rem 0.6rem; transition: color 0.2s ease; }
.main-nav > li:hover > a { color: var(--jsi-gold); }
.main-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 13rem; background: #ffffff; border-top: 3px solid var(--jsi-red); box-shadow: 0 10px 25px rgba(0,0,0,0.15); list-style: none; border-radius: 0 0 4px 4px; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.25s ease; z-index: 500; }
.main-nav li:hover > .sub-menu { opacity: 1; visibility: visible; pointer-events: auto; }
.main-nav .sub-menu a { display: block; padding: 0.6rem 1rem; font-size: 0.825rem; font-weight: 600; color: #1e293b; border-bottom: 1px solid #f1f5f9; }
.main-nav .sub-menu a:hover { background: #f8fafc; color: var(--jsi-red); }

.flex-right { display: flex; align-items: center; gap: 0.5rem; }
.flex-right button { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 2.25rem; height: 2.25rem; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: background 0.2s; }
.flex-right button:hover { background: rgba(255,255,255,0.25); color: var(--jsi-gold); }

/* Hot Topics Strip */
.jsi-topic-strip { background: #ffffff; border-bottom: 1px solid #e2e8f0; position: relative; z-index: 90; }
html.is-dark .jsi-topic-strip { background: #1e293b; border-bottom-color: #334155; }
.jsi-topic-inner { min-height: 42px; display: flex; align-items: center; overflow-x: auto; white-space: nowrap; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.jsi-topic-label { color: var(--jsi-red); padding-right: 12px; margin-right: 8px; border-right: 1px solid #cbd5e1; flex-shrink: 0; }
.jsi-topic-inner a { padding: 0 10px; color: #0284c7; border-right: 1px solid #f1f5f9; flex-shrink: 0; }
.jsi-topic-inner a:nth-of-type(even) { color: var(--jsi-red); }
.jsi-topic-inner a:hover { text-decoration: underline; }
.jsi-topic-all { margin-left: auto; border-right: none !important; color: var(--title-color) !important; font-weight: 900; }

/* Ads Containers */
.pbt-ad-container { padding: 1.25rem 0; display: flex; justify-content: center; background: rgba(0,0,0,0.02); }
.pbt-ad-container img { max-width: 100%; height: auto; }

/* Layout & Grid */
.content-wrap { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: var(--gap); padding: 2rem 0; }
.main-wrap { min-width: 0; }
.sidebar-wrap { min-width: 0; }

/* Featured Hero Section */
.site-featured { background: var(--jsi-navy-deep); padding: 2rem 0; color: #fff; margin-bottom: 1rem; }
.featured-items { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.featured-items .first { position: relative; min-height: 24rem; border-radius: var(--radius); overflow: hidden; display: flex; align-items: flex-end; background: #000; }
.featured-items .first .hero-img-wrap { position: absolute; inset: 0; width: 100%; height: 100%; }
.featured-items .first .hero-img-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: transform 0.4s ease; }
.featured-items .first:hover .hero-img-wrap img { transform: scale(1.03); }
.featured-items .first .hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%); }
.featured-items .first .entry-header { position: relative; z-index: 3; padding: 1.75rem; width: 100%; }
.featured-items .first .entry-title { font-size: 1.85rem; color: #fff; line-height: 1.25; margin-bottom: 0.5rem; font-weight: 700; }
.featured-items .first .entry-title a { color: #fff; }
.featured-items .first .entry-title a:hover { color: var(--jsi-gold); }

.grid-side { display: flex; flex-direction: column; gap: 1rem; }
.grid-side .post { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.85rem; align-items: center; background: rgba(255,255,255,0.06); padding: 0.75rem; border-radius: var(--radius); }
.grid-side .entry-thumbnail { height: 4.5rem; border-radius: 4px; overflow: hidden; }
.grid-side .entry-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.grid-side .entry-title { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.grid-side .entry-title a { color: #f8fafc; }
.grid-side .entry-title a:hover { color: var(--jsi-gold); }
.grid-side .entry-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }

/* Posts Grid Modules */
.widget-title { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.6rem; margin-bottom: 1.5rem; }
html.is-dark .widget-title { border-bottom-color: #334155; }
.widget-title .title { font-size: 1.25rem; font-weight: 800; color: var(--title-color); text-transform: uppercase; letter-spacing: -0.3px; }
.entry-tag { display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--jsi-red); margin-bottom: 0.4rem; }
.grid-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
.post-card { display: flex; flex-direction: column; background: var(--outer-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.04); }
.post-card .entry-thumbnail { width: 100%; aspect-ratio: var(--aspect-ratio); overflow: hidden; background: #e2e8f0; }
.post-card .entry-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.post-card:hover .entry-thumbnail img { transform: scale(1.04); }
.post-card .entry-header { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.post-card .entry-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; color: var(--title-color); }
.post-card .entry-title a { color: var(--title-color); }
.post-card .entry-title a:hover { color: var(--accent-color); }
.post-card .entry-meta { font-size: 0.78rem; color: var(--meta-color); margin-bottom: 0.6rem; display: flex; gap: 0.5rem; }
.post-card .excerpt { font-size: 0.88rem; color: var(--summary-color); line-height: 1.5; margin-top: auto; }

/* Single Article */
.blog-post { background: var(--outer-bg); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
#breadcrumb { font-size: 0.82rem; color: var(--meta-color); margin-bottom: 1rem; }
#breadcrumb a { color: inherit; }
.post-header .entry-title { font-size: 2.25rem; font-weight: 800; color: var(--title-color); line-height: 1.2; margin-bottom: 1rem; }
.post-meta-single { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1.5rem; }
.post-meta-single .entry-avatar img { width: 44px; height: 44px; border-radius: 50%; }
.post-meta-single .author-name { font-weight: 700; color: var(--title-color); }
.post-meta-single .entry-time { font-size: 0.8rem; color: var(--meta-color); }
.single-featured-image { margin-bottom: 1.75rem; border-radius: var(--radius); overflow: hidden; }
.post-body { font-size: 1.05rem; line-height: 1.8; color: var(--text-color); }
.post-body p { margin-bottom: 1.4rem; }
.post-body h2, .post-body h3 { color: var(--title-color); margin: 1.5rem 0 0.8rem; }
.post-body blockquote { border-left: 4px solid var(--jsi-red); padding-left: 1.25rem; font-style: italic; margin: 1.5rem 0; color: var(--title-color); }
.post-share { display: flex; gap: 0.5rem; margin: 2rem 0; flex-wrap: wrap; }
.post-share a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 4px; color: #fff; font-size: 0.85rem; font-weight: 700; }
.post-share .facebook { background: #1877f2; }
.post-share .twitter { background: #000000; }
.post-share .whatsapp { background: #25d366; }
.post-share .telegram { background: #0088cc; }
.entry-labels { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.entry-labels a { background: rgba(0,0,0,0.06); padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.78rem; font-weight: 700; color: var(--title-color); }

.about-author { display: flex; gap: 1.25rem; padding: 1.5rem; border-radius: var(--radius); background: rgba(0,0,0,0.03); margin-top: 2rem; border: 1px solid #e2e8f0; }
.about-author .author-avatar img { width: 64px; height: 64px; border-radius: 50%; }
.about-author .author-title { font-size: 1.15rem; font-weight: 700; color: var(--title-color); margin-bottom: 0.4rem; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.75rem; }
.sidebar .widget { background: var(--outer-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.04); }
.social-widget-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.social-widget-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.75rem 0.25rem; border-radius: 4px; color: #fff; font-weight: 700; font-size: 0.75rem; }
.social-widget-grid .facebook { background: #1877f2; }
.social-widget-grid .twitter { background: #000000; }
.social-widget-grid .youtube { background: #ff0000; }
.social-widget-grid .instagram { background: #e4405f; }

/* Comments */
#comments { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid #e2e8f0; }
.comment-list { list-style: none; margin: 1.5rem 0; }
.comment-list li { border-bottom: 1px solid #e2e8f0; padding: 1rem 0; }
.comment-author { font-weight: 700; color: var(--title-color); margin-bottom: 0.3rem; }
.comment-meta { font-size: 0.78rem; color: var(--meta-color); margin-bottom: 0.6rem; }
.comment-form { display: flex; flex-direction: column; gap: 1rem; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid #cbd5e1; padding: 0.75rem 1rem; border-radius: 4px; background: var(--outer-bg); color: var(--text-color); }
.comment-form .submit { align-self: flex-start; background: var(--accent-color); color: #fff; border: none; padding: 0.75rem 1.75rem; border-radius: 4px; font-weight: 700; cursor: pointer; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text-color); margin-top: 3rem; }
.footer-sections { padding: 3.5rem 0 2rem; }
.jsi-footer-directory-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.75rem; }
.jsi-footer-group h3 { color: #fff; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.8px; text-transform: uppercase; padding-bottom: 8px; border-bottom: 2px solid var(--jsi-red); margin-bottom: 12px; }
.jsi-footer-group a { display: block; color: var(--footer-text-color); font-size: 0.82rem; margin: 6px 0; }
.jsi-footer-group a:hover { color: #fff; text-decoration: underline; }
.footer-bar { background: var(--footerbar-bg); padding: 1.25rem 0; font-size: 0.82rem; color: var(--footerbar-color); border-top: 1px solid rgba(255,255,255,0.08); }
.footer-bar a { color: inherit; }
.footer-bar a:hover { color: #fff; }

/* Slide Drawer Mobile Menu */
.slide-menu { position: fixed; top: 0; left: 0; bottom: 0; width: min(100vw, 380px); background: #ffffff; z-index: 1020; transform: translateX(-100%); transition: transform 0.3s ease; box-shadow: 10px 0 30px rgba(0,0,0,0.25); display: flex; flex-direction: column; }
body.menu-on .slide-menu { transform: translateX(0); }
.slide-menu-header { background: linear-gradient(120deg, var(--jsi-navy), #07518b); padding: 1.25rem; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.slide-menu-header .mobile-logo span { font-size: 1.35rem; font-weight: 900; }
.hide-mobile-menu { background: transparent; border: none; color: #fff; font-size: 1.8rem; cursor: pointer; line-height: 1; }
.slide-menu-flex { flex: 1; overflow-y: auto; padding: 1.25rem; }
.jsi-mobile-search { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.jsi-mobile-search input { flex: 1; border: 1px solid #cbd5e1; padding: 0.6rem 0.85rem; border-radius: 6px; }
.jsi-mobile-search button { background: var(--jsi-red); color: #fff; border: none; padding: 0 1rem; border-radius: 6px; font-weight: 700; cursor: pointer; }
.mobile-nav { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.mobile-nav li a { display: flex; align-items: center; padding: 0.85rem 1rem; border-radius: 8px; background: #f1f5f9; color: #0f172a; font-weight: 700; }
.overlay-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.25s ease; }
body.menu-on .overlay-bg, body.search-on .overlay-bg { opacity: 1; visibility: visible; }

/* Search Modal */
.main-search-modal { position: fixed; top: 2rem; left: 50%; transform: translateX(-50%) translateY(-20px); width: min(90vw, 36rem); background: var(--modal-bg); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,0.3); z-index: 1010; opacity: 0; visibility: hidden; transition: all 0.25s ease; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); }
body.search-on .main-search-modal { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.main-search-form { display: flex; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; }
.main-search-form input { flex: 1; border: none; font-size: 1.1rem; color: var(--title-color); background: transparent; }
.main-search-form .close-search { background: none; border: 1px solid #cbd5e1; border-radius: 4px; padding: 0.25rem 0.6rem; font-size: 0.75rem; cursor: pointer; color: var(--meta-color); }
.ajax-search-results { max-height: 22rem; overflow-y: auto; padding: 1rem 1.25rem; }

/* Back to Top */
.to-top { position: fixed; right: 1.5rem; bottom: 1.5rem; width: 2.75rem; height: 2.75rem; background: var(--accent-color); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; z-index: 99; opacity: 0; visibility: hidden; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.to-top.show { opacity: 1; visibility: visible; }

@media (max-width: 992px) {
  .main-menu { display: none; }
  .menu-toggle { display: block; }
  .content-wrap { grid-template-columns: 1fr; }
  .featured-items { grid-template-columns: 1fr; }
  .jsi-footer-directory-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-items { grid-template-columns: 1fr; }
  .jsi-footer-directory-grid { grid-template-columns: 1fr; }
  .main-logo .brand-main { font-size: 1.3rem; }
  .featured-items .first { min-height: 18rem; }
  .featured-items .first .entry-title { font-size: 1.35rem; }
}