/*
Theme Name: NerdBoss Base
Theme URI: https://nerdboss.ca/
Author: Quincy Lawrence / NerdBoss
Author URI: https://nerdboss.ca/
Description: A minimal, lightweight WordPress foundation for Elementor and other page builders, created by NerdBoss.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nerdboss-base
Tags: custom-logo, custom-menu, featured-images, full-width-template, translation-ready, accessibility-ready
*/

:root {
  --nb-color-text: #18222b;
  --nb-color-muted: #5d6a73;
  --nb-color-border: #dfe5e8;
  --nb-color-background: #ffffff;
  --nb-color-surface: #f6f8f9;
  --nb-color-accent: #1c9acd;
  --nb-content-width: 760px;
  --nb-wide-width: 1200px;
  --nb-radius: 8px;
  --nb-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--nb-color-text);
  background: var(--nb-color-background);
  font-family: var(--nb-font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.admin-bar {
  --nb-admin-bar-offset: 32px;
}

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

iframe {
  max-width: 100%;
}

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

button,
[type="button"],
[type="reset"],
[type="submit"] {
  cursor: pointer;
}

a {
  color: var(--nb-color-accent);
  text-decoration-thickness: .08em;
  text-underline-offset: .15em;
}

a:hover,
a:focus-visible {
  text-decoration-thickness: .12em;
}

:focus-visible {
  outline: 3px solid #5ac9f4;
  outline: 3px solid color-mix(in srgb, var(--nb-color-accent) 70%, white);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0 1rem;
  line-height: 1.2;
  text-wrap: balance;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin-block: 0 1.25rem;
}

blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--nb-color-accent);
  color: var(--nb-color-muted);
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border-radius: var(--nb-radius);
  background: #101820;
  color: #f4f7f8;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: .75rem;
  border: 1px solid var(--nb-color-border);
  text-align: left;
}

.screen-reader-text {
  position: absolute !important;
  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;
  margin: 0;
  padding: .75rem 1rem;
  clip: auto;
  overflow: visible;
  color: #fff;
  background: #071521;
  border-radius: 6px;
  font-weight: 700;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 10;
  background: #fff;
}

.site-header {
  border-bottom: 1px solid var(--nb-color-border);
}

.site-footer {
  border-top: 1px solid var(--nb-color-border);
}

.site-header__inner,
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--nb-wide-width));
  min-height: 70px;
  margin-inline: auto;
  gap: 1.5rem;
}

.site-footer__inner {
  min-height: 90px;
  color: var(--nb-color-muted);
  font-size: .875rem;
}

.site-footer__inner p {
  margin: 0;
}

.footer-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-navigation a {
  color: inherit;
  text-decoration: none;
}

.site-branding {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .75rem;
}

.custom-logo-link,
.custom-logo {
  display: block;
}

.custom-logo {
  width: auto;
  max-height: 48px;
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.2;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-description {
  margin: .15rem 0 0;
  color: var(--nb-color-muted);
  font-size: .75rem;
}

.primary-navigation {
  margin-left: auto;
}

.primary-navigation ul {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-navigation a {
  color: inherit;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-navigation .sub-menu {
  position: absolute;
  z-index: 20;
  display: none;
  min-width: 220px;
  padding: .5rem;
  background: #fff;
  border: 1px solid var(--nb-color-border);
  border-radius: var(--nb-radius);
  box-shadow: 0 18px 45px rgba(20, 35, 45, .12);
}

.primary-navigation li {
  position: relative;
}

.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu {
  display: grid;
  gap: .25rem;
}

.primary-navigation .sub-menu a {
  display: block;
  padding: .55rem .7rem;
  border-radius: 5px;
}

.primary-navigation .sub-menu a:hover,
.primary-navigation .sub-menu a:focus-visible {
  background: var(--nb-color-surface);
}

.menu-toggle {
  display: none;
  min-height: 42px;
  padding: .55rem .8rem;
  color: inherit;
  background: transparent;
  border: 1px solid var(--nb-color-border);
  border-radius: 6px;
  font-weight: 700;
}

.site-main {
  width: min(calc(100% - 2rem), var(--nb-wide-width));
  min-height: 55vh;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.site-main > article,
.site-main > .page-header,
.site-main > .posts-navigation,
.site-main > .comments-area,
.site-main > .no-results,
.site-main > .error-404 {
  width: min(100%, var(--nb-content-width));
  margin-inline: auto;
}

.site-main > .post-list,
.site-main > .archive-grid {
  width: min(100%, var(--nb-wide-width));
  margin-inline: auto;
}

.entry-header,
.page-header {
  margin-bottom: 2rem;
}

.entry-title,
.page-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.entry-meta {
  color: var(--nb-color-muted);
  font-size: .875rem;
}

.entry-content::after {
  display: table;
  clear: both;
  content: "";
}

.entry-content > .alignwide {
  width: min(100vw - 2rem, var(--nb-wide-width));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.entry-content > .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-card {
  padding: 1.25rem;
  border: 1px solid var(--nb-color-border);
  border-radius: var(--nb-radius);
  background: #fff;
}

.post-card .entry-title {
  font-size: 1.35rem;
}

.post-card .entry-title a {
  color: inherit;
  text-decoration: none;
}

.post-thumbnail {
  display: block;
  margin-bottom: 1.25rem;
}

.post-thumbnail img {
  width: 100%;
  border-radius: var(--nb-radius);
}

.navigation.pagination,
.post-navigation {
  margin-top: 2.5rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-numbers,
.post-navigation a {
  display: inline-flex;
  padding: .5rem .75rem;
  border: 1px solid var(--nb-color-border);
  border-radius: 5px;
  text-decoration: none;
}

.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--nb-color-border);
}

.comment-list {
  padding: 0;
  list-style: none;
}

.comment-body {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--nb-color-border);
  border-radius: var(--nb-radius);
}

.search-form {
  display: flex;
  gap: .5rem;
  max-width: 560px;
}

.search-field,
.comment-form input:not([type="submit"]),
.comment-form textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid var(--nb-color-border);
  border-radius: 5px;
}

.search-submit,
.comment-form input[type="submit"] {
  padding: .7rem 1rem;
  color: #fff;
  background: var(--nb-color-accent);
  border: 1px solid var(--nb-color-accent);
  border-radius: 5px;
  font-weight: 700;
}

/* Remove theme layout constraints from visual page builders. */
.elementor-page .site-main,
.fl-builder .site-main,
.bricks-is-frontend .site-main,
.nerdboss-canvas .site-main,
.page-template-template-full-width .site-main {
  width: 100%;
  max-width: none;
  padding: 0;
}

.elementor-page .site-main > article,
.fl-builder .site-main > article,
.bricks-is-frontend .site-main > article,
.nerdboss-canvas .site-main > article,
.page-template-template-full-width .site-main > article {
  width: 100%;
  max-width: none;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .primary-navigation {
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    display: none;
    padding: .75rem;
    background: #fff;
    border: 1px solid var(--nb-color-border);
    border-radius: var(--nb-radius);
    box-shadow: 0 18px 45px rgba(20, 35, 45, .12);
  }

  .primary-navigation.is-open {
    display: block;
  }

  .primary-navigation ul {
    display: grid;
    gap: .25rem;
  }

  .primary-navigation a {
    display: block;
    padding: .65rem .75rem;
  }

  .primary-navigation .sub-menu {
    position: static;
    display: grid;
    margin-left: .75rem;
    padding: .25rem 0 .25rem .75rem;
    border: 0;
    border-left: 1px solid var(--nb-color-border);
    border-radius: 0;
    box-shadow: none;
  }

  .post-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  body.admin-bar {
    --nb-admin-bar-offset: 46px;
  }

  .site-description {
    display: none;
  }

  .post-list {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
