/*
Theme Name: Nisab Modern
Theme URI: https://gold-zakatcalculator.com/
Author: Gold Zakat Calculator
Description: A fast, minimalist Islamic WordPress theme built for calculators, educational Zakat content, SEO, accessibility and responsible advertising.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: nisab-modern
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --nm-emerald-950: #082d26;
  --nm-emerald-900: #0b3d33;
  --nm-emerald-700: #14614e;
  --nm-emerald-600: #1a765e;
  --nm-gold: #c59b46;
  --nm-gold-soft: #ead9ad;
  --nm-ivory: #fbfaf5;
  --nm-sand: #f3efe3;
  --nm-ink: #18302a;
  --nm-muted: #60706b;
  --nm-line: #dfe5df;
  --nm-white: #fff;
  --nm-radius: 18px;
  --nm-shadow: 0 18px 55px rgba(8, 45, 38, .09);
  --nm-container: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--nm-ink);
  background: var(--nm-ivory);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0 0 auto;
  height: 380px;
  content: "";
  pointer-events: none;
  opacity: .26;
  background-image:
    linear-gradient(30deg, rgba(197,155,70,.12) 12%, transparent 12.5%, transparent 87%, rgba(197,155,70,.12) 87.5%),
    linear-gradient(150deg, rgba(197,155,70,.12) 12%, transparent 12.5%, transparent 87%, rgba(197,155,70,.12) 87.5%);
  background-size: 48px 84px;
}

a { color: var(--nm-emerald-700); text-underline-offset: 3px; }
a:hover { color: var(--nm-emerald-900); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  color: var(--nm-white);
  background: var(--nm-emerald-900);
  border-radius: 8px;
}

.nm-container {
  width: min(var(--nm-container), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  background: rgba(251, 250, 245, .92);
  border-bottom: 1px solid rgba(11, 61, 51, .1);
  backdrop-filter: blur(16px);
}

.admin-bar .site-header { top: 32px; }

.nm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 28px;
}

.site-branding { display: flex; align-items: center; min-width: 0; }
.custom-logo-link { display: inline-flex; margin-right: 12px; }
.custom-logo { width: auto; max-height: 48px; }

.site-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.48rem);
  font-weight: 700;
  line-height: 1.15;
}

.site-title a { color: var(--nm-emerald-950); text-decoration: none; }
.site-description { margin: 4px 0 0; color: var(--nm-muted); font-size: .75rem; line-height: 1.3; }

.nm-nav-wrap { display: flex; align-items: center; gap: 20px; }
.primary-menu { display: flex; align-items: center; gap: 4px; padding: 0; margin: 0; list-style: none; }
.primary-menu li { position: relative; }
.primary-menu a {
  display: block;
  padding: 11px 13px;
  color: var(--nm-ink);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
  border-radius: 10px;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a { color: var(--nm-emerald-700); background: rgba(20, 97, 78, .07); }
.primary-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  width: 250px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: var(--nm-white);
  border: 1px solid var(--nm-line);
  border-radius: 14px;
  box-shadow: var(--nm-shadow);
}
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu { display: block; }

.nm-header-cta,
.wp-block-button__link,
.nm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  color: var(--nm-white);
  font-weight: 750;
  text-decoration: none;
  background: var(--nm-emerald-700);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(20, 97, 78, .18);
}
.nm-header-cta:hover,
.wp-block-button__link:hover,
.nm-button:hover { color: var(--nm-white); background: var(--nm-emerald-900); transform: translateY(-1px); }

.nm-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--nm-emerald-950);
  background: transparent;
  border: 1px solid var(--nm-line);
  border-radius: 12px;
}

.site-main { min-height: 60vh; }
.nm-page-main { padding: 40px 0 72px; }
.home .nm-page-main { padding-top: 26px; }

.nm-content-shell {
  padding: clamp(24px, 4vw, 52px);
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(11,61,51,.09);
  border-radius: 24px;
  box-shadow: var(--nm-shadow);
}

.page-template-template-full-width .nm-content-shell,
.home .nm-content-shell {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.entry-header { margin-bottom: 30px; }
.entry-title,
.archive-title {
  max-width: 900px;
  margin: 0;
  color: var(--nm-emerald-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1.07;
  letter-spacing: -.035em;
}

.single .entry-title,
.page:not(.home) .entry-title { font-size: clamp(2rem, 4vw, 3.55rem); }
.entry-meta { margin-top: 14px; color: var(--nm-muted); font-size: .88rem; }
.entry-meta a { color: inherit; }
.entry-content > * { max-width: 780px; margin-right: auto; margin-left: auto; }
.entry-content > .alignwide { max-width: 1060px; }
.entry-content > .alignfull { max-width: none; margin-right: calc(50% - 50vw); margin-left: calc(50% - 50vw); }
.home .entry-content > *,
.page-template-template-full-width .entry-content > * { max-width: none; }
.entry-content h2,
.entry-content h3,
.entry-content h4 { color: var(--nm-emerald-950); font-family: Georgia, "Times New Roman", serif; line-height: 1.2; }
.entry-content h2 { margin-top: 2.2em; font-size: clamp(1.65rem, 3vw, 2.3rem); }
.entry-content h3 { margin-top: 1.8em; font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.entry-content blockquote {
  padding: 22px 26px;
  color: var(--nm-emerald-900);
  background: var(--nm-sand);
  border-left: 4px solid var(--nm-gold);
  border-radius: 0 14px 14px 0;
}
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th,
.entry-content td { padding: 13px; text-align: left; border: 1px solid var(--nm-line); }
.entry-content th { background: var(--nm-sand); }

.nm-blog-hero { padding: 62px 0 42px; text-align: center; }
.nm-eyebrow { color: var(--nm-gold); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.nm-blog-hero p { max-width: 680px; margin: 16px auto 0; color: var(--nm-muted); }
.nm-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 70px; }
.nm-post-card {
  overflow: hidden;
  background: var(--nm-white);
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  box-shadow: 0 12px 35px rgba(8,45,38,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nm-post-card:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow); }
.nm-card-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--nm-sand); }
.nm-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.nm-post-card:hover .nm-card-image img { transform: scale(1.035); }
.nm-card-content { padding: 23px; }
.nm-card-category { color: var(--nm-gold); font-size: .74rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.nm-card-title { margin: 9px 0 11px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; line-height: 1.25; }
.nm-card-title a { color: var(--nm-emerald-950); text-decoration: none; }
.nm-card-excerpt { margin: 0; color: var(--nm-muted); font-size: .93rem; line-height: 1.65; }

.nm-pagination { grid-column: 1 / -1; margin-top: 20px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers { padding: 8px 13px; text-decoration: none; background: var(--nm-white); border: 1px solid var(--nm-line); border-radius: 9px; }
.page-numbers.current { color: var(--nm-white); background: var(--nm-emerald-700); border-color: var(--nm-emerald-700); }

.nm-ad-slot { width: 100%; margin: 30px auto; text-align: center; overflow: hidden; }
.nm-ad-slot:empty { display: none; }
.nm-ad-label { display: block; margin-bottom: 6px; color: #89948f; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }

.nm-related { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--nm-line); }
.nm-related h2 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; }
.nm-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.site-footer { color: rgba(255,255,255,.76); background: var(--nm-emerald-950); }
.nm-footer-main { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 42px; padding: 60px 0 44px; }
.nm-footer-title { margin: 0 0 12px; color: var(--nm-white); font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.nm-footer-main h2 { margin: 0 0 14px; color: var(--nm-gold-soft); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.nm-footer-main ul { padding: 0; margin: 0; list-style: none; }
.nm-footer-main li { margin-bottom: 8px; }
.nm-footer-main a { color: rgba(255,255,255,.76); text-decoration: none; }
.nm-footer-main a:hover { color: var(--nm-white); }
.nm-footer-bottom { padding: 20px 0; font-size: .78rem; border-top: 1px solid rgba(255,255,255,.1); }
.nm-footer-bottom-inner { display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 960px) {
  .nm-menu-toggle { display: inline-flex; }
  .nm-header-cta { display: none; }
  .primary-navigation {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 14px 20px 22px;
    background: var(--nm-ivory);
    border-bottom: 1px solid var(--nm-line);
    box-shadow: 0 18px 30px rgba(8,45,38,.08);
  }
  .primary-navigation.is-open { display: block; }
  .primary-menu { align-items: stretch; flex-direction: column; }
  .primary-menu a { padding: 12px; }
  .primary-menu .sub-menu { position: static; display: block; width: auto; padding: 0 0 0 18px; background: transparent; border: 0; box-shadow: none; }
  .nm-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nm-footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nm-container { width: min(100% - 24px, var(--nm-container)); }
  .nm-header-inner { min-height: 66px; }
  .site-description { display: none; }
  .custom-logo { max-height: 40px; }
  .nm-page-main { padding: 24px 0 50px; }
  .nm-content-shell { padding: 24px 18px; border-radius: 17px; }
  .nm-post-grid,
  .nm-related-grid,
  .nm-footer-main { grid-template-columns: 1fr; }
  .nm-blog-hero { padding: 40px 0 30px; text-align: left; }
  .nm-footer-main { gap: 30px; padding: 44px 0 34px; }
  .nm-footer-bottom-inner { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
