/*
Theme Name: Geeks Guru Custom
Theme URI: https://thegeeksguru.com
Author: The Geeks Guru
Author URI: https://thegeeksguru.com
Description: A clean, GeeksforGeeks-style custom theme hand-built for The Geeks Guru — white layout, green accents, category navigation, a card-grid homepage and a right sidebar on article pages. v1.2 adds a light scroll-reveal + hover animation layer (no libraries). v1.3 adds a homepage-hero-only advanced technology animation layer (canvas particle/circuit network, animated gradient glow, subtitle typing effect) — no libraries, no video, respects prefers-reduced-motion.
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: geeksguru-custom
*/

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: #27313a;
  background: #f6f8f6;
}
a { color: #2f8d46; text-decoration: none; }
a:hover { color: #257539; text-decoration: underline; }
img { max-width: 100%; height: auto; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------- Header ---------- */
.top-strip { height: 4px; background: #2f8d46; }
.site-header { background: #ffffff; border-bottom: 1px solid #e3eae4; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.branding { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.branding .custom-logo-link img { max-height: 46px; width: auto; }
.site-title { font-size: 27px; font-weight: 800; color: #1f2a22; letter-spacing: -0.3px; }
.site-title:hover { color: #2f8d46; text-decoration: none; }
.site-tagline { color: #6b7a6e; font-size: 13.5px; }
.header-search .search-form { display: flex; }
.header-search .search-field { border: 1px solid #cfdccf; border-radius: 6px 0 0 6px; padding: 8px 12px; font-size: 14.5px; min-width: 210px; outline: none; }
.header-search .search-field:focus { border-color: #2f8d46; }
.header-search .search-submit { border: 1px solid #2f8d46; background: #2f8d46; color: #fff; border-radius: 0 6px 6px 0; padding: 8px 16px; font-size: 14.5px; cursor: pointer; }
.header-search .search-submit:hover { background: #257539; }

/* ---------- Header search suggestions ---------- */
.gg-search { position: relative; }
.gg-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid #e3eae4; border-radius: 10px; box-shadow: 0 10px 26px rgba(20, 40, 25, 0.12); padding: 6px 0; z-index: 60; overflow: hidden; }
.gg-suggest[hidden] { display: none; }
.gg-suggest-item { display: block; padding: 9px 14px; color: #243128; font-size: 14.5px; line-height: 1.4; }
.gg-suggest-item:hover, .gg-suggest-item.is-active { background: #f0f7f1; color: #2f8d46; text-decoration: none; }
.gg-suggest-status { padding: 9px 14px; color: #6b7a6e; font-size: 14px; }

.main-nav { background: #ffffff; border-top: 1px solid #eef2ee; }
.primary-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.primary-menu > li > a { display: block; padding: 11px 15px; color: #243128; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; }
.primary-menu > li > a:hover, .primary-menu > li.current-menu-item > a, .primary-menu > li.current-category-ancestor > a { color: #2f8d46; border-bottom-color: #2f8d46; text-decoration: none; }
.primary-menu ul { list-style: none; margin: 0; padding: 6px 0; display: none; position: absolute; background: #fff; border: 1px solid #e3eae4; border-radius: 8px; box-shadow: 0 10px 26px rgba(20, 40, 25, 0.12); min-width: 210px; z-index: 50; }
.primary-menu li { position: relative; }
.primary-menu li:hover > ul { display: block; }
.primary-menu ul a { display: block; padding: 8px 16px; color: #243128; font-size: 14.5px; }
.primary-menu ul a:hover { background: #f0f7f1; color: #2f8d46; text-decoration: none; }

/* ---------- Hero ---------- */
/* v1.3: hero is a positioned, overflow-hidden layer cake so the canvas
   network and gradient glow sit BEHIND the text without shifting layout.
   The gradient, padding, font sizes and colours are unchanged from v1.2. */
.hero { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(135deg, #2f8d46 0%, #1f6b34 100%); color: #fff; padding: 42px 0 38px; text-align: center; }
.hero .container { position: relative; z-index: 2; }
.hero-title { margin: 0 0 8px; font-size: 33px; font-weight: 800; }
.hero-sub { margin: 0 auto 10px; max-width: 640px; font-size: 17px; opacity: 0.95; min-height: 3.3em; }
.hero-motto { margin: 0; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; font-size: 13px; opacity: 0.9; }

/* ---------- Layout ---------- */
.site-main { padding: 30px 0 44px; }
.layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; align-items: start; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card-grid--two { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid #e3eae4; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.18s ease, transform 0.18s ease; }
.card:hover { box-shadow: 0 12px 28px rgba(20, 40, 25, 0.12); transform: translateY(-3px); }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #eaf4ec; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb--placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #39a657, #257539); }
.card-thumb--placeholder span { font-size: 58px; font-weight: 800; color: rgba(255, 255, 255, 0.92); }
.card-thumb--placeholder:hover { text-decoration: none; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.badge { display: inline-block; align-self: flex-start; background: #2f8d46; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge:hover { background: #257539; color: #fff; text-decoration: none; }
.card-title { margin: 0; font-size: 19px; line-height: 1.35; }
.card-title a { color: #1f2a22; }
.card-title a:hover { color: #2f8d46; text-decoration: none; }
.card-meta, .post-meta { margin: 0; color: #71806f; font-size: 13.5px; }
.card-excerpt { color: #45534a; font-size: 15px; flex: 1; }
.card-excerpt p { margin: 0; }
.read-more { font-weight: 700; font-size: 14.5px; }

/* ---------- Single post ---------- */
.post-full { background: #fff; border: 1px solid #e3eae4; border-radius: 12px; padding: 30px 34px; }
.post-title { font-size: 31px; line-height: 1.25; margin: 12px 0 8px; color: #1c261e; }
.post-thumb { margin: 18px 0; }
.post-thumb img { border-radius: 10px; }
.post-content { font-size: 17px; }
.post-content h2 { font-size: 24px; margin: 30px 0 10px; color: #1c261e; border-left: 4px solid #2f8d46; padding-left: 12px; }
.post-content h3 { font-size: 20px; margin: 24px 0 8px; color: #22301f; }
.post-content p { margin: 0 0 16px; }
.post-content ul, .post-content ol { margin: 0 0 16px; padding-left: 24px; }
.post-content li { margin-bottom: 6px; }
.post-content pre { background: #17251b; color: #d9f2e0; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.post-content code { background: #edf5ee; color: #1f6b34; padding: 2px 6px; border-radius: 5px; font-size: 0.92em; }
.post-content pre code { background: transparent; color: inherit; padding: 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 0 0 20px; font-size: 14.5px; overflow-x: auto; display: block; }
.post-content th, .post-content td { border: 1px solid #d8e2d8; padding: 8px 12px; text-align: left; white-space: nowrap; }
.post-content th { background: #eef6ef; }
.post-content blockquote { border-left: 4px solid #2f8d46; margin: 0 0 16px; padding: 6px 16px; background: #f2f8f3; color: #3c4a3f; }
.post-content a { font-weight: 600; }
.post-tags { font-size: 14px; color: #5c6d5e; }
.post-nav { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid #e7eee7; margin-top: 26px; padding-top: 16px; font-size: 14.5px; }
.post-nav-next { text-align: right; }

/* ---------- Sidebar ---------- */
.sidebar .widget { background: #fff; border: 1px solid #e3eae4; border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; }
.widget-title { margin: 0 0 12px; font-size: 16.5px; color: #1c261e; border-bottom: 2px solid #2f8d46; padding-bottom: 7px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget-latest li { padding: 9px 0; border-bottom: 1px dashed #e0e8e0; }
.widget-latest li:last-child { border-bottom: none; }
.widget-latest a { font-weight: 600; color: #243128; font-size: 15px; }
.widget-latest a:hover { color: #2f8d46; text-decoration: none; }
.widget-date { display: block; font-size: 12.5px; color: #84937f; margin-top: 2px; }
.widget-cats li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #e0e8e0; font-size: 15px; }
.widget-cats li:last-child { border-bottom: none; }

/* ---------- Archive / misc ---------- */
.archive-head { margin-bottom: 22px; }
.archive-title { font-size: 28px; margin: 0 0 6px; color: #1c261e; }
.archive-desc { color: #5c6d5e; }
.pagination-wrap { margin-top: 30px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { background: #fff; border: 1px solid #dbe5db; padding: 7px 13px; border-radius: 7px; color: #243128; font-size: 14.5px; }
.pagination .page-numbers.current { background: #2f8d46; border-color: #2f8d46; color: #fff; font-weight: 700; }
.pagination .page-numbers:hover { border-color: #2f8d46; text-decoration: none; }
.empty-state { background: #fff; border: 1px solid #e3eae4; border-radius: 12px; padding: 34px; text-align: center; }
.empty-state .search-form { display: flex; justify-content: center; gap: 0; margin-top: 12px; }
.empty-state .search-field { border: 1px solid #cfdccf; border-radius: 6px 0 0 6px; padding: 9px 12px; min-width: 230px; }
.empty-state .search-submit { border: 1px solid #2f8d46; background: #2f8d46; color: #fff; border-radius: 0 6px 6px 0; padding: 9px 16px; cursor: pointer; }
.search-form .screen-reader-text, .screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 30px; border-top: 1px solid #e7eee7; padding-top: 20px; }
.comment-list { list-style: none; padding: 0; }
.comment-list li { border-bottom: 1px dashed #e0e8e0; padding: 12px 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; border: 1px solid #cfdccf; border-radius: 7px; padding: 9px 12px; font: inherit; }
.comment-form .submit { background: #2f8d46; color: #fff; border: none; border-radius: 7px; padding: 10px 20px; font-weight: 700; cursor: pointer; }
.comment-form .submit:hover { background: #257539; }

/* ---------- Footer ---------- */
.site-footer { background: #1d2b21; color: #cfe0d2; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 30px; padding-top: 36px; padding-bottom: 28px; }
.footer-brand { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 4px; }
.footer-tagline { color: #7fc78f; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; font-size: 12px; margin: 0 0 10px; }
.footer-about { font-size: 14.5px; margin: 0; color: #a9bfa9; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 16px; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: 5px 0; font-size: 14.5px; }
.footer-list a { color: #cfe0d2; }
.footer-list a:hover { color: #7fc78f; }
.footer-bottom { border-top: 1px solid #2c4031; padding: 14px 0; font-size: 13.5px; color: #93a894; }
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .card-grid, .card-grid--two { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-full { padding: 22px 18px; }
  .post-title { font-size: 25px; }
  .hero-title { font-size: 25px; }
  .header-search .search-field { min-width: 140px; }
  .header-search { width: 100%; }
  .header-search .search-field { flex: 1; min-width: 0; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
