/*
Theme Name: PressNest
Theme URI: https://pressnest.in
Author: Connect EdTech
Description: A vibrant, colorful English news theme with per-category color coding, built for PressNest.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: pressnest
*/

/* ===========================
   Design tokens - vibrant multi-color
=========================== */
:root {
  --color-purple: #7C3AED;
  --color-pink: #EC4899;
  --color-orange: #F97316;
  --color-blue: #2563EB;
  --color-green: #16A34A;
  --color-teal: #0D9488;
  --color-red: #EF4444;
  --color-yellow: #F5B700;
  --color-text: #17181A;
  --color-text-light: #62666E;
  --color-bg: #ffffff;
  --color-bg-alt: #F7F7FA;
  --color-border: #ebebf0;
  --font-heading: 'Baloo 2', -apple-system, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, Arial, sans-serif;
  --max-width: 1200px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--color-text);
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===========================
   Top bar - gradient
=========================== */
.top-bar {
  background: linear-gradient(90deg, var(--color-purple), var(--color-pink) 50%, var(--color-orange));
  color: #fff; font-size: 12.5px; padding: 8px 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }

/* ===========================
   Header
=========================== */
.site-header { background: #fff; padding: 20px 0 0; }
.site-branding { display: flex; align-items: center; justify-content: center; padding-bottom: 14px; }
.site-title {
  font-family: var(--font-heading); font-size: 42px; font-weight: 800; margin: 0;
  background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-title a { -webkit-text-fill-color: transparent; text-decoration: none; }
.custom-logo-link img { max-height: 70px; width: auto; }

.primary-nav { background: var(--color-text); }
.primary-nav .container { display: flex; justify-content: center; }
.primary-nav ul { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.primary-nav a {
  display: block; color: #e6e6ea; padding: 8px 18px; font-size: 14px; font-weight: 700;
  text-decoration: none; border-radius: 20px; transition: background 0.15s, color 0.15s;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--color-pink); color: #fff; }

.nav-toggle {
  display: none; background: var(--color-text); color: #fff; border: none;
  padding: 13px 20px; width: 100%; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer;
}
@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .primary-nav ul { display: none; flex-direction: column; width: 100%; padding: 8px 16px 14px; }
  .primary-nav ul.is-open { display: flex; }
  .primary-nav a { border-radius: 8px; }
  .site-title { font-size: 28px; }
  .container { padding: 0 16px; }
}

/* ===========================
   Layout
=========================== */
.content-area { padding: 30px 0 55px; }
.layout-with-sidebar { display: grid; grid-template-columns: 2.3fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 960px) { .layout-with-sidebar { grid-template-columns: 1fr; } }

/* ===========================
   Featured post
=========================== */
.featured-post {
  position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 32px;
  aspect-ratio: 21/9; background: var(--color-bg-alt); display: block;
  box-shadow: 0 12px 30px rgba(124,58,237,0.15);
}
.featured-post img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .overlay-gradient { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,24,26,0) 25%, rgba(23,24,26,0.92) 100%); }
.featured-post .overlay-content { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px; color: #fff; }
.featured-post .overlay-content h2 { color: #fff; font-size: 30px; margin-bottom: 8px; }
.featured-post .overlay-meta { font-size: 13px; color: #d8d5e0; }
@media (max-width: 700px) {
  .featured-post { aspect-ratio: 4/3; }
  .featured-post .overlay-content h2 { font-size: 22px; }
}

/* ===========================
   Category badges - color per category
=========================== */
.category-badge {
  display: inline-block; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 13px;
  border-radius: 20px; margin-bottom: 8px; text-decoration: none; text-transform: uppercase; letter-spacing: 0.4px;
}
.category-badge:hover { opacity: 0.88; text-decoration: none; }
/* Default fallback */
.category-badge { background: var(--color-purple); }
/* Per-category colors, matched by cat-{slug} class added in PHP */
.cat-state { background: var(--color-blue); }
.cat-national { background: var(--color-red); }
.cat-international { background: var(--color-purple); }
.cat-sports { background: var(--color-green); }
.cat-entertainment { background: var(--color-pink); }
.cat-business { background: var(--color-orange); }
.cat-health { background: var(--color-teal); }

/* ===========================
   Section heading
=========================== */
.section-heading {
  font-family: var(--font-heading); font-size: 22px; color: var(--color-text);
  display: flex; align-items: center; gap: 10px; margin: 36px 0 20px;
}
.section-heading .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--color-purple), var(--color-pink)); display: inline-block; flex-shrink: 0; }
.section-heading::after { content: ""; flex: 1; height: 3px; background: var(--color-bg-alt); border-radius: 2px; }

/* ===========================
   Post grid
=========================== */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 700px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--color-border);
  transition: box-shadow 0.15s, transform 0.15s;
}
.post-card:hover { box-shadow: 0 14px 30px rgba(23,24,26,0.1); transform: translateY(-3px); }
.post-card .thumb { display: block; aspect-ratio: 16/10; background: var(--color-bg-alt); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .card-body { padding: 14px 16px 18px; }
.post-card h3 { font-size: 17px; margin-bottom: 6px; font-weight: 700; }
.post-card h3 a { color: var(--color-text); }
.post-card h3 a:hover { color: var(--color-pink); text-decoration: none; }
.post-card .meta { font-size: 12px; color: var(--color-text-light); }

/* ===========================
   Sidebar
=========================== */
.sidebar-widget { background: var(--color-bg-alt); border-radius: 16px; padding: 22px; margin-bottom: 22px; }
.sidebar-widget h3 {
  font-family: var(--font-heading); font-size: 16px; color: var(--color-text); margin-bottom: 16px;
  padding-bottom: 12px; position: relative;
}
.sidebar-widget h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--color-purple), var(--color-pink)); }
.trending-item { display: flex; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--color-border); }
.trending-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.trending-num {
  font-family: var(--font-heading); font-size: 14px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--color-purple), var(--color-pink));
  min-width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trending-item h4 { font-size: 14px; margin: 0; line-height: 1.5; font-weight: 700; }
.trending-item h4 a { color: var(--color-text); }
.trending-item h4 a:hover { color: var(--color-pink); }

.newsletter-box { background: linear-gradient(135deg, var(--color-purple), var(--color-pink)); color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 22px; }
.newsletter-box h3 { font-family: var(--font-heading); color: #fff; font-size: 18px; margin-bottom: 8px; }
.newsletter-box h3::after { display: none; }
.newsletter-box p { font-size: 13px; color: #f3e0ee; margin-bottom: 14px; }
.newsletter-box input[type="email"] { width: 100%; padding: 10px 12px; border-radius: 10px; border: none; margin-bottom: 10px; font-family: var(--font-body); }
.newsletter-box button {
  width: 100%; background: var(--color-yellow); color: var(--color-text); border: none; padding: 11px;
  border-radius: 10px; font-weight: 800; cursor: pointer; text-transform: uppercase; font-size: 12.5px; letter-spacing: 0.4px;
}

/* ===========================
   Single article
=========================== */
.single-article .article-header { margin-bottom: 22px; }
.single-article h1 { font-size: 34px; color: var(--color-text); margin-bottom: 12px; line-height: 1.2; }
.article-deck { font-size: 19px; color: var(--color-text-light); line-height: 1.6; margin: 0 0 22px; font-weight: 500; }
.single-article .article-meta {
  font-size: 13px; color: var(--color-text-light); border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border); padding: 12px 0; margin-bottom: 22px;
}
.single-article .featured-image { margin-bottom: 24px; border-radius: 18px; overflow: hidden; aspect-ratio: 16/9; }
.single-article .featured-image img { width: 100%; height: 100%; object-fit: cover; }
.single-article .entry-content { font-size: 18px; line-height: 1.85; }
.single-article .entry-content p { margin: 0 0 1.3em; }
.single-article .entry-content h2 { font-size: 25px; margin-top: 1.6em; }
.single-article .entry-content blockquote {
  border-left: 5px solid var(--color-pink); margin: 1.6em 0; padding: 12px 22px;
  background: var(--color-bg-alt); border-radius: 0 14px 14px 0; font-style: italic; font-size: 19px;
}
.tags-list { margin-top: 28px; }
.tags-list a {
  display: inline-block; background: var(--color-bg-alt); color: var(--color-text);
  font-size: 12.5px; padding: 5px 14px; border-radius: 20px; margin: 0 6px 6px 0;
}

.related-posts { margin-top: 44px; padding-top: 26px; border-top: 3px solid var(--color-bg-alt); }
.related-posts h3 { font-family: var(--font-heading); font-size: 19px; color: var(--color-text); margin-bottom: 18px; }

/* ===========================
   Page header
=========================== */
.page-header { margin-bottom: 24px; padding-bottom: 14px; border-bottom: 3px solid var(--color-bg-alt); }
.page-header h1 { font-size: 27px; color: var(--color-text); margin-bottom: 4px; }
.page-header .archive-description { color: var(--color-text-light); font-size: 15px; }

/* ===========================
   Pagination
=========================== */
.pagination-wrap { margin-top: 38px; text-align: center; }
.pagination-wrap a, .pagination-wrap span {
  display: inline-block; padding: 9px 16px; margin: 0 4px; border: 1px solid var(--color-border);
  border-radius: 20px; font-size: 14px; color: var(--color-text);
}
.pagination-wrap .current { background: linear-gradient(135deg, var(--color-purple), var(--color-pink)); color: #fff; border-color: transparent; }
.pagination-wrap a:hover { background: var(--color-bg-alt); text-decoration: none; }

/* ===========================
   Footer
=========================== */
.site-footer { background: var(--color-text); color: #b7b8bd; margin-top: 44px; padding: 44px 0 20px; font-size: 14px; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 30px; }
@media (max-width: 700px) { .footer-widgets { grid-template-columns: 1fr; } }
.footer-widgets h4 { font-family: var(--font-heading); color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-widgets a { color: #9c9ea4; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: 8px; }
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 18px; text-align: center; font-size: 12.5px; color: #75767b;
}

/* ===========================
   Misc
=========================== */
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form input[type="search"] {
  flex: 1; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 15px;
}
.search-form button {
  background: linear-gradient(135deg, var(--color-purple), var(--color-pink)); color: #fff; border: none; padding: 10px 22px;
  border-radius: 10px; font-weight: 700; cursor: pointer;
}
.no-results { padding: 40px 0; text-align: center; color: var(--color-text-light); }
.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus { left: 10px; top: 10px; background: #fff; padding: 10px; z-index: 999; }
