/*
Theme Name: GyanPoints
Theme URI: https://gyanpoints.com/
Author: GyanPoints
Author URI: https://gyanpoints.com/
Description: Full-width educational WordPress theme for NCERT, CBSE, NEET, JEE, CUET and competitive exam resources. Dynamic pages, homepage cards, social sharing.
Version: 1.0.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: gyanpoints
Tags: education, full-width-template, custom-menu, featured-images, theme-options, blog
*/

/* Theme base – layout overrides for WordPress full-width */
.site-content,
.gp-fullwidth,
.entry-content,
.wp-block-group.alignfull {
  width: 100%;
  max-width: 100%;
}

.gp-container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .gp-container { padding-left: 24px; padding-right: 24px; }
}

/* WordPress admin bar offset */
body.admin-bar .header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .header { top: 46px; }
}

/* Align full/wide blocks */
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.alignwide { max-width: 1400px; margin-left: auto; margin-right: auto; }

/* Social share */
.gp-social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 24px 0;
  padding: 16px;
  background: var(--light-gray, #f3f4f6);
  border-radius: 12px;
}
.gp-social-share .gp-share-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 6px;
}
.gp-social-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
}
.gp-social-share a:hover { transform: translateY(-2px); opacity: 0.9; }
.gp-share-facebook { background: #1877f2; }
.gp-share-twitter { background: #000; }
.gp-share-whatsapp { background: #25d366; }
.gp-share-telegram { background: #0088cc; }
.gp-share-linkedin { background: #0a66c2; }
.gp-share-copy { background: #6b7280; }

/* Related cards */
.gp-related-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

/* ========== Professional Header / Menu (matches brand UI) ========== */
.header {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 4px 24px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo img.custom-logo,
.logo .gp-brand-logo {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}
.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #16a34a;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-text span {
  color: #16a34a;
}

/* Desktop nav */
.nav-menu {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.nav-links a,
.nav-menu .nav-links > a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 36px;
}
.nav-links a:hover {
  color: #f97316;
  background: #fff7ed;
}
.nav-links a.active,
.nav-links a.current-menu-item,
.nav-menu a.active {
  color: #f97316 !important;
  background: transparent;
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: #f97316;
  border-radius: 2px;
}

/* Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-actions button,
.search-btn,
.theme-toggle,
.menu-toggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #1e293b;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.nav-actions button:hover,
.search-btn:hover,
.theme-toggle:hover {
  background: #f1f5f9;
  color: #f97316;
}

.nav-close {
  display: none;
}
.nav-overlay {
  display: none;
}

/* Mobile */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 12px;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
  }
  .logo img.custom-logo,
  .logo .gp-brand-logo {
    height: 36px;
  }
  .menu-toggle {
    display: inline-flex !important;
  }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 88vw);
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 30px rgba(0,0,0,0.08);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px 16px;
    transition: right 0.3s ease;
    z-index: 1002;
  }
  .nav-menu.open {
    right: 0;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  .nav-links a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 10px;
  }
  .nav-links a.active::after {
    display: none;
  }
  .nav-links a.active {
    background: #fff7ed;
  }
  .nav-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
  }
  .nav-close button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
  }
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1001;
  }
  .nav-overlay.open {
    display: block;
  }
}

@media (min-width: 1025px) {
  .menu-toggle {
    display: none !important;
  }
}

/* Dark mode header */
body.dark-mode .header {
  background: #0f172a;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
body.dark-mode .nav-links a {
  color: #e2e8f0;
}
body.dark-mode .nav-links a:hover {
  background: #1e293b;
  color: #fb923c;
}
body.dark-mode .nav-links a.active {
  color: #fb923c !important;
}
body.dark-mode .nav-actions button {
  color: #e2e8f0;
}
body.dark-mode .nav-menu {
  background: #0f172a;
}
