/*
Theme Name: WriteNepali
Theme URI: https://writenepali.com/
Author: WriteNepali Team
Description: Professional, responsive WordPress theme with 4-column tool grids (7 tools per category, 2 rows of 4), full card clickability, View More Tools buttons, 6-item guides grid with 400x225 thumbnails, 3-column footer widgets, and functioning footer menu.
Version: 3.4.0
License: GNU General Public License v2 or later
Text Domain: writenepali
*/

:root {
  --wn-primary: #1e40af;
  --wn-primary-dark: #1e3a8a;
  --wn-primary-light: #3b82f6;
  --wn-accent-green: #10b981;
  --wn-bg-light: #f8fafc;
  --wn-card-bg: #ffffff;
  --wn-text-main: #0f172a;
  --wn-text-muted: #64748b;
  --wn-border-color: #e2e8f0;
  --wn-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06);
  --wn-shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.08);
  --wn-radius-md: 12px;
  --wn-radius-lg: 16px;
  --wn-max-width: 1240px;
  --wn-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--wn-font-sans);
  background-color: var(--wn-bg-light);
  color: var(--wn-text-main);
  line-height: 1.8;
  font-size: 16.5px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--wn-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--wn-primary-dark);
}

.wn-container {
  width: 100%;
  max-width: var(--wn-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Architecture */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--wn-border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--wn-shadow-sm);
  width: 100%;
}

.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--wn-border-color);
}

.site-branding .site-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--wn-primary);
  letter-spacing: -0.5px;
}

.site-branding .site-title span {
  color: var(--wn-accent-green);
}

.header-nst-widget {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 30px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--wn-primary-dark);
}

.nst-time-display {
  font-family: monospace;
  font-size: 1rem;
  color: #0369a1;
}

.header-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

.main-navigation {
  width: 100%;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
  justify-content: flex-start;
}

.main-navigation a {
  font-weight: 700;
  color: var(--wn-text-main);
  font-size: 15px;
  padding: 12px 0;
  display: block;
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--wn-text-main);
  padding: 5px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  padding: 55px 0 50px;
  text-align: center;
  margin-bottom: 35px;
  border-bottom: 4px solid var(--wn-accent-green);
  width: 100%;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.12rem;
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.hero-search-box {
  max-width: 650px;
  margin: 0 auto 20px;
}

.hero-search-box form {
  display: flex;
  background: #ffffff;
  border-radius: 50px;
  padding: 6px;
  box-shadow: var(--wn-shadow-md);
}

.hero-search-box input[type="search"] {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  outline: none;
  border-radius: 50px;
  color: var(--wn-text-main);
  background: transparent;
}

.hero-search-box button[type="submit"] {
  background: var(--wn-accent-green);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search-box button[type="submit"]:hover {
  background: #059669;
}

.popular-tags {
  font-size: 0.9rem;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.popular-tags strong {
  color: #ffffff;
  margin-right: 4px;
}

.popular-tags a {
  color: #ffffff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s;
}

.popular-tags a:hover {
  background: var(--wn-accent-green);
  border-color: var(--wn-accent-green);
  text-decoration: none;
}

/* Section Main Heading */
.section-main-heading {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--wn-text-main);
  margin: 40px 0 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--wn-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Category Block */
.category-block {
  margin-bottom: 40px;
  background: #ffffff;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-lg);
  padding: 28px;
  box-shadow: var(--wn-shadow-sm);
  width: 100%;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--wn-border-color);
  flex-wrap: wrap;
}

.category-header-icon {
  font-size: 1.6rem;
  background: #f0fdf4;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
}

.category-header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--wn-text-main);
  flex: 1;
  min-width: 200px;
}

.category-header-title a {
  color: var(--wn-text-main);
}

.category-header-title a:hover {
  color: var(--wn-primary);
}

.category-header-badge {
  background: #eff6ff;
  color: var(--wn-primary);
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
}

/* Tool Cards Grid (4 Columns, Exactly 7 tools shown: 2 rows of 4) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.tool-card {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
  cursor: pointer;
  text-decoration: none !important;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wn-shadow-md);
  border-color: var(--wn-primary-light);
  background: #ffffff;
}

.tool-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
  color: var(--wn-text-main);
}

.tool-card:hover .tool-card-title {
  color: var(--wn-primary);
}

.wn-card-stretched-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
}

.tool-card-desc {
  font-size: 0.84rem;
  color: var(--wn-text-muted);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 12px;
}

.tool-card-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wn-primary);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* View More Tools Note & Button */
.view-all-tools-wrapper {
  margin-top: 22px;
  text-align: right;
  border-top: 1px dashed var(--wn-border-color);
  padding-top: 14px;
}

.view-all-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--wn-primary);
  background: #f0f6ff;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  transition: all 0.2s;
}

.view-all-tools-btn:hover {
  background: var(--wn-primary);
  color: #ffffff;
  border-color: var(--wn-primary);
  text-decoration: none;
}

/* Posts / Guides Grid (3 Columns with 400x225 Widescreen Thumbnails) */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.post-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
  cursor: pointer;
  text-decoration: none !important;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wn-shadow-md);
  border-color: var(--wn-primary-light);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
  display: block;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.05);
}

.post-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--wn-text-main);
}

.post-card:hover .post-card-title {
  color: var(--wn-primary);
}

.post-card-excerpt {
  font-size: 0.86rem;
  color: var(--wn-text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.post-card-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: auto;
}

/* Inner Page Layout & Sidebar */
.page-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  margin-top: 30px;
  margin-bottom: 50px;
  align-items: start;
  width: 100%;
}

.page-layout-grid.no-sidebar {
  grid-template-columns: 1fr;
}

.main-content-column {
  min-width: 0;
  width: 100%;
}

.tool-page-wrapper {
  background: #ffffff;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-lg);
  padding: 36px;
  box-shadow: var(--wn-shadow-sm);
  width: 100%;
}

/* Typography & Justification */
.tool-content-area p, .entry-content p {
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 22px;
  line-height: 1.85;
}

.tool-content-area h2, .entry-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--wn-text-main);
  margin-top: 38px;
  margin-bottom: 18px;
  padding: 10px 16px;
  background: #f8fafc;
  border-left: 5px solid var(--wn-primary);
  border-radius: 0 10px 10px 0;
}

.tool-content-area h3, .entry-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--wn-text-main);
  margin-top: 30px;
  margin-bottom: 14px;
}

/* Related Grid Sizing (400x225 16:9 Aspect Ratio) */
.wn-related-section {
  margin-top: 45px;
  padding-top: 30px;
  border-top: 1px solid var(--wn-border-color);
  width: 100%;
}

.wn-related-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--wn-text-main);
  margin-bottom: 20px;
}

.wn-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.wn-related-card {
  background: var(--wn-bg-light);
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
}

.wn-related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wn-shadow-md);
  border-color: var(--wn-primary-light);
  background: #ffffff;
}

.wn-related-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
  display: block;
}

.wn-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.wn-related-card:hover .wn-related-thumb img {
  transform: scale(1.05);
}

.wn-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 1.5rem;
  background: #f1f5f9;
}

.wn-related-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.wn-related-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--wn-text-main);
}

.wn-related-card:hover .wn-related-card-title {
  color: var(--wn-primary);
}

/* Sidebar */
.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-md);
  padding: 24px;
  box-shadow: var(--wn-shadow-sm);
}

.widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--wn-text-main);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--wn-border-color);
  position: relative;
}

.widget-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 40px;
  height: 2px;
  background: var(--wn-primary);
}

/* Social Share */
.wn-social-share-box {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--wn-border-color);
}

.share-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wn-text-main);
  margin-bottom: 14px;
}

.share-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  color: #ffffff;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
  color: #ffffff;
}

.share-fb { background: #1877f2; }
.share-messenger { background: #0084ff; }
.share-wa { background: #25d366; }
.share-pin { background: #e60023; }
.share-tw { background: #0f172a; }
.share-copy { background: #64748b; }

/* Ad Slots */
.wn-ad-slot {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  text-align: center;
  padding: 20px;
  margin: 30px 0;
  border-radius: 10px;
  color: var(--wn-text-muted);
  font-size: 0.9rem;
  width: 100%;
}

.wn-ad-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}

/* Comments */
.comment-list .comment {
  background: #f8fafc;
  border: 1px solid var(--wn-border-color);
  border-radius: var(--wn-radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.comment-list .children {
  list-style: none;
  padding-left: 20px;
  margin-top: 16px;
  border-left: 2px solid var(--wn-border-color);
}

.comment-meta .fn {
  font-weight: 700;
  color: var(--wn-text-main);
  font-style: normal;
}

.comment-meta .comment-metadata a {
  color: var(--wn-text-muted);
  font-size: 0.85rem;
}

.comment-content {
  margin: 12px 0;
  color: var(--wn-text-main);
  font-size: 0.98rem;
  text-align: justify;
}

.reply a {
  background: #e2e8f0;
  color: var(--wn-text-main);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-block;
}

.reply a:hover {
  background: var(--wn-primary);
  color: #ffffff;
}

/* 3-Column Footer Area */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 50px 0 30px;
  margin-top: auto;
  width: 100%;
}

.footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  margin-bottom: 20px;
}

.footer-widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #334155;
}

.footer-default-links, .footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-default-links li, .footer-widget ul li {
  margin-bottom: 10px;
}

.footer-default-links a, .footer-widget ul a {
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
}

.footer-default-links a:hover, .footer-widget ul a:hover {
  color: var(--wn-accent-green);
  text-decoration: underline;
}

.footer-nav-menu {
  margin-bottom: 20px;
  text-align: center;
}

.footer-menu-ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu-ul a {
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 700;
}

.footer-menu-ul a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
}

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .page-layout-grid, .footer-widgets-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .posts-grid, .wn-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .tools-grid, .posts-grid, .wn-related-grid {
    grid-template-columns: 1fr;
  }
}