/*
Theme Name: Quizdesk
Theme URI: https://quizdesk.in
Author: Vihan
Author URI: https://quizdesk.in
Description: Custom magazine-style theme for Quizdesk - Government Exam MCQs with Leaderboard. Inspired by modern news layouts.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: quizdesk
Tags: magazine, news, responsive, quiz, education
*/

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

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

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

/* Header */
html, body {
  margin: 0 !important;
  padding: 0 !important;
}
body {
  padding-bottom: 60px !important;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #e11d48;
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0 !important;
  animation: headerGlow 2s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% { box-shadow: 0 1px 5px rgba(225, 29, 72, 0.18); }
  50% { box-shadow: 0 1px 8px rgba(225, 29, 72, 0.3); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  position: relative;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  color: #0a2540;
}

.logo span {
  color: #e11d48;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #0a2540;
  margin: 5px 0;
  transition: 0.3s;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

.main-nav a {
  font-weight: 500;
  font-size: 15px;
}

.main-nav a:hover {
  color: #e11d48;
}

/* Share Buttons */
.share-buttons {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.share-buttons a {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.share-fb { background: #1877f2; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }
.share-li { background: #0a66c2; }

/* Also Read / Quiz Navigation */
.also-read-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.also-read-box {
  border: 2px dashed #e11d48;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaf9;
  position: relative;
}

.also-read-label {
  position: absolute;
  top: -9px;
  left: 12px;
  background: #fff;
  color: #e11d48;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

/* Also Read / Quiz Navigation */
.also-read-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.also-read-box {
  border: 2px dashed #e11d48;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffaf9;
  position: relative;
}

.also-read-label {
  position: absolute;
  top: -9px;
  left: 12px;
  background: #fff;
  color: #e11d48;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

.also-read-box .also-read-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0e0e0;
}
.also-read-box .also-read-content:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.also-read-thumb {
  width: 110px !important;
  height: 62px !important;
  min-width: 110px !important;
  flex-shrink: 0 !important;
  border-radius: 4px;
  overflow: hidden !important;
  background: #f0f0f0 !important;
  line-height: 0 !important;
}
.also-read-thumb img {
  width: 110px !important;
  height: 62px !important;
  object-fit: cover !important;
  object-position: center 20% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.also-read-title {
  flex: 1;
  font-size: 16px !important;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.animated-btn {
  margin-left: auto !important;
  background: #0a2540 !important;
  color: #fff !important;
  padding: 8px 14px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  border: 2px solid #0a2540 !important;
  flex-shrink: 0 !important;
  text-align: center;
  width: auto !important;
}

.also-read-thumb {
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}
.also-read-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.no-thumb {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e11d48, #be123c);
}

.also-read-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.also-read-title a:hover {
  color: #e11d48;
}

.animated-btn {
  background: #111;
  color: #fff;
  padding: 5px 9px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  border: 2px solid #111;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.animated-btn:hover {
  background: #e11d48;
  border-color: #e11d48;
  transform: scale(1.04);
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

@media (max-width: 600px) {
  .also-read-content {
    flex-wrap: nowrap;
  }
  .animated-btn {
    width: auto !important;
    margin-left: auto !important;
    text-align: center;
    margin-top: 0 !important;
  }
}

/* WhatsApp Sticky Bar */
.wa-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #25d366;
  z-index: 998;
  animation: barGlow 2s ease-in-out infinite;
}
.wa-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  text-decoration: none;
  color: #111;
}
.wa-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.wa-icon { font-size: 22px; color: #25d366; }
.wa-btn {
  background: #25d366;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  animation: btnGlow 1.8s ease-in-out infinite;
}
.wa-btn:hover {
  background: #20ba5a;
}

@keyframes barGlow {
  0%, 100% { box-shadow: 0 -2px 8px rgba(37, 211, 102, 0.25); }
  50% { box-shadow: 0 -2px 14px rgba(37, 211, 102, 0.45); }
}
@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); }
}

body { 
  margin: 0;
  padding: 0;
  padding-bottom: 60px;
}

/* Responsive */
@media (max-width: 992px) {
  .featured-hero {
    grid-template-columns: 1fr;
  }
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .menu-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 12px;
  }
}

/* Hero / Featured */
.featured-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

.hero-main, .post-thumb-wrap {
  position: relative;
  overflow: hidden;
}
.post-thumb-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.card-start-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #0a2540;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  z-index: 10;
  animation: pulse 2s infinite;
  text-decoration: none;
}
.card-start-btn:hover {
  background: #e11d48;
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-content .cat {
  background: #e11d48;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.hero-content h2 {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.side-post {
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.side-post img {
  height: 120px;
  object-fit: cover;
}

.side-post .content {
  padding: 12px;
}

.side-post h3 {
  font-size: 15px;
  line-height: 1.4;
}

/* Posts Grid */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 20px;
  border-bottom: 2px solid #e11d48;
  display: inline-block;
  padding-bottom: 5px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.post-card, .side-post {
  position: relative;
}
.card-start-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #0a2540;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
  animation: pulse 2s infinite;
}
.card-start-btn:hover {
  background: #e11d48;
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card img {
  height: 180px;
  object-fit: cover;
  width: 100%;
}

.post-card .content {
  padding: 15px;
}

.post-card .cat {
  color: #e11d48;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.post-card h3 {
  font-size: 17px;
  margin: 8px 0;
  line-height: 1.4;
}

.post-card .meta {
  font-size: 13px;
  color: #666;
}

/* Single Post */
.single-post {
  max-width: 800px;
  margin: 40px auto;
}

.single-post h1 {
  font-size: 36px;
  line-height: 1.3;
  margin-bottom: 15px;
}

.single-post .meta {
  color: #666;
  margin-bottom: 25px;
  font-size: 14px;
}

.single-post .post-content {
  font-size: 17px;
  line-height: 1.8;
}

.single-post .post-content p {
  margin-bottom: 18px;
}

.single-post img {
  border-radius: 10px;
  margin: 20px 0;
}

/* Footer */
.site-footer {
  background: #0a2540;
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-col h4 {
  margin-bottom: 15px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.copyright {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 992px) {
  .featured-hero {
    grid-template-columns: 1fr;
  }
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-nav {
    display: none;
  }
}

@media (max-width: 600px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .hero-content h2 {
    font-size: 22px;
  }
  .single-post h1 {
    font-size: 28px;
  }
  .logo {
    font-size: 22px;
  }
  .quiz-nav {
    flex-direction: column;
  }
  .quiz-nav-right {
    text-align: left;
  }
}
