/*
Theme Name: NicheForge Theme
Theme URI: https://nicheforge.ai
Author: NicheForge Team
Author URI: https://nicheforge.ai
Description: The official high-performance, modular companion theme for the NicheForge AI directory platform. Engineered with native color token synchronization, deep SEO mega-footer, rich microdata schema, and pitch-black luxury SaaS aesthetics.
Version: 1.7.2
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nicheforge-theme
Tags: custom-colors, custom-menu, custom-logo, full-width-template, theme-options, translation-ready, block-styles, grid-layout, dark-mode
*/

/* --------------------------------------------------------------------------
   CSS Reset & Base Foundations
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--nf-font-body, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--nf-bg, #ffffff);
  color: var(--nf-text, #334155);
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main#main-content {
  flex: 1 0 auto;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--nf-primary, #2563eb);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover, a:focus-visible {
  color: var(--nf-primary-hover, #1d4ed8);
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nf-font-headings, var(--nf-font-body, 'Inter', sans-serif));
  color: var(--nf-heading, #0f172a);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

ul, ol {
  list-style-position: inside;
}

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--nf-card-bg, #ffffff);
  clip: auto !important;
  clip-path: none;
  color: var(--nf-primary, #2563eb);
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 1rem;
  line-height: normal;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  top: 1rem;
  width: auto;
  z-index: 100000;
  border-radius: 6px;
  border: 1px solid var(--nf-primary, #2563eb);
}

/* Container Utility */
.nf-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.nf-container-narrow {
  max-width: 860px;
}

.nf-container-fluid {
  max-width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* --------------------------------------------------------------------------
   Site Branding & Header Identity
   -------------------------------------------------------------------------- */
.site-branding,
.nf-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.site-logo,
.nf-brand-logo-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img,
.custom-logo-link img,
.nf-brand-logo-wrap img {
  height: 40px;
  width: auto;
  max-height: 48px;
  display: block;
}

.site-identity,
.nf-site-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-title,
.nf-site-title {
  display: block;
  font-family: var(--nf-font-logo, var(--nf-font-headings, sans-serif));
  font-size: 1.35rem;
  font-weight: var(--nf-logo-weight, 800);
  letter-spacing: var(--nf-logo-spacing, -0.02em);
  text-transform: var(--nf-logo-transform, none);
  line-height: 1.2;
  margin: 0;
  color: var(--nf-heading, #0f172a);
}

.site-title a,
.nf-site-title a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.site-description,
.nf-site-description {
  display: block;
  font-size: 0.8rem;
  color: var(--nf-text-muted, #64748b);
  margin: 0.15rem 0 0 0;
  line-height: 1.3;
  font-weight: 400;
}

/* Guard: Ensure site title & description are NEVER hidden when custom logo exists */
.has-custom-logo .site-title,
.has-custom-logo .nf-site-title,
.wp-custom-logo .site-title,
.wp-custom-logo .nf-site-title,
.has-custom-logo .site-description,
.has-custom-logo .nf-site-description,
.wp-custom-logo .site-description,
.wp-custom-logo .nf-site-description {
  display: block !important;
}
