/*
Theme Name: PakNotes
Theme URI: https://paknotes.com
Author: AlphaGen Tutors
Author URI: https://paknotes.com
Description: A clean, modern educational theme for PakNotes.com - Pakistan's study companion.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: paknotes
Tags: education, blog, custom-menu, featured-images, responsive-layout
*/

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  --green: #1a7a4a;
  --green-light: #22a05e;
  --green-pale: #e8f5ee;
  --gold: #f0a500;
  --dark: #0f1f17;
  --gray: #6b7c75;
  --white: #ffffff;
  --card-bg: #f7fbf8;
  --border: #d4e8dc;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #f4f9f6;
  color: var(--dark);
  overflow-x: hidden;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* =============================================
   HEADER / NAVIGATION
   ============================================= */
#site-header {
  background: var(--dark);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-branding .site-title a {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.site-branding .site-title a span {
  color: var(--gold);
}

#primary-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

#primary-menu li a {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item a {
  color: var(--gold);
}

#primary-menu li.menu-cta a {
  background: var(--green-light);
  color: white;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-weight: 600;
}

/* ── Dropdown Menus ── */
#primary-menu li {
  position: relative;
}

/* Arrow indicator for parent items */
#primary-menu li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Hidden by default */
#primary-menu .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #1a3d2a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  flex-direction: column;
  gap: 0;
  list-style: none;
}

/* Show on hover */
#primary-menu li:hover > .sub-menu,
#primary-menu li.is-open > .sub-menu {
  display: flex;
}

#primary-menu .sub-menu li {
  width: 100%;
}

#primary-menu .sub-menu li a {
  display: block;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

#primary-menu .sub-menu li:last-child a {
  border-bottom: none;
}

#primary-menu .sub-menu li a:hover {
  background: rgba(240,165,0,0.12);
  color: var(--gold);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  transition: all 0.3s;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, #1a3d2a 60%, #0f2d1e 100%);
  padding: 70px 5% 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(240,165,0,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(34,160,94,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-badge {
  display: inline-block;
  background: rgba(240,165,0,0.15);
  border: 1px solid rgba(240,165,0,0.4);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

.hero-section h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-section h1 em {
  color: var(--gold);
  font-style: normal;
}

.hero-section p {
  color: rgba(255,255,255,0.65);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.hero-search {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.hero-search input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--dark);
}

.hero-search button {
  background: var(--green);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-body);
}

.hero-search button:hover { background: var(--green-light); }

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar {
  background: var(--green);
  padding: 1rem 5%;
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat { text-align: center; color: white; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  display: block;
}
.stat-label { font-size: 0.75rem; opacity: 0.8; letter-spacing: 0.5px; }

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 5%;
}

/* =============================================
   BOARD SECTIONS
   ============================================= */
.board-section {
  margin-bottom: 3rem;
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.section-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: var(--green-pale);
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
}

.section-title h2 span {
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 400;
  margin-left: 0.3rem;
  font-family: var(--font-body);
}

.see-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.2s;
}

.see-all:hover { gap: 0.6rem; color: var(--green-light); }

/* =============================================
   SUBJECT CARDS
   ============================================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}

.subject-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.22s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.subject-card:hover {
  border-color: var(--green-light);
  box-shadow: 0 6px 24px rgba(26,122,74,0.12);
  transform: translateY(-3px);
}

.subject-card:hover::before { transform: scaleX(1); }

.card-emoji {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}

.card-class {
  font-size: 0.72rem;
  color: var(--gray);
  background: var(--green-pale);
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  font-weight: 500;
}

/* =============================================
   BLOG / POSTS AREA
   ============================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.22s ease;
}

.post-card:hover {
  box-shadow: 0 6px 24px rgba(26,122,74,0.12);
  transform: translateY(-3px);
}

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

.post-card-body { padding: 1.2rem; }

.post-card-cat {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  display: block;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.55;
}

/* =============================================
   SINGLE POST
   ============================================= */
.entry-header { margin-bottom: 2rem; }

.entry-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

.entry-meta {
  font-size: 0.82rem;
  color: var(--gray);
}

.entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #2a3d33;
}

.entry-content h2, .entry-content h3 {
  font-family: var(--font-display);
  color: var(--dark);
  margin: 1.5rem 0 0.7rem;
}

.entry-content p { margin-bottom: 1.2rem; }

.entry-content ul, .entry-content ol {
  margin: 1rem 0 1rem 1.5rem;
}

.entry-content li { margin-bottom: 0.4rem; }

/* =============================================
   SIDEBAR
   ============================================= */
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border);
}

/* =============================================
   FOOTER
   ============================================= */
#site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2rem 5%;
  font-size: 0.82rem;
}

#site-footer a { color: var(--gold); }
#site-footer a:hover { text-decoration: underline; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  #primary-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 1.5rem 5%;
    gap: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  #primary-menu.is-open { display: flex; }

  /* Mobile dropdowns */
  #primary-menu .sub-menu {
    position: static;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0 1rem;
    margin-top: 0.3rem;
  }

  #primary-menu li.menu-item-has-children > a::after {
    content: ' ▾';
  }

  #primary-menu li.is-open > .sub-menu {
    display: flex;
  }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .stats-bar { gap: 1.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
