/*
Theme Name: Code1001
Theme URI: https://code1001.com
Author: Code1001 Team
Author URI: https://code1001.com
Description: A modern, high-performance dark/light landing and business WordPress theme for Code1001.
Version: 1.0.0
Tested up to: 6.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: code1001
Tags: blog, one-column, two-columns, custom-logo, custom-menu, featured-images, full-width-template, responsive-layout, theme-options, translation-ready
*/

html, body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

/* ==========================================================================
   Header & Navbar Centering & Sticky Positioning
   ========================================================================== */
#siteNav,
header.nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(23, 23, 26, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
  box-shadow: none !important;
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* Ensure global layout wrapper preserves sticky positioning on nested navigation */
.site-grid-layout {
  position: relative;
  overflow: visible !important;
  width: 100%;
}

/* Ensure structural vertical grid lines overlay spans the full height across sections */
.site-grid-layout > .layout-grid-lines {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

/* Structural horizontal grid divider lines for all page sections inside .site-grid-layout */
.site-grid-layout section {
  position: relative;
  z-index: 2;
  background: transparent;
  border-top: none;
  border-bottom: 1px solid var(--layout-grid-line, rgba(255, 255, 255, 0.025));
}

html[data-theme="light"] .site-grid-layout section {
  border-bottom-color: var(--layout-grid-line, rgba(0, 0, 0, 0.025));
}

html[data-theme="light"] #siteNav,
html[data-theme="light"] header.nav {
  background: rgba(243, 243, 241, 0.78);
}

#siteNav.scrolled,
header.nav.scrolled {
  background: rgba(23, 23, 26, 0.78);
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

html[data-theme="light"] #siteNav.scrolled,
html[data-theme="light"] header.nav.scrolled {
  background: rgba(243, 243, 241, 0.85);
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

/* Ensure sticky navigation accounts for WordPress Admin Bar when logged in */
.admin-bar #siteNav,
.admin-bar header.nav {
  top: 32px;
}

.scroll-progress {
  z-index: 1001;
}

.admin-bar .scroll-progress {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar #siteNav,
  .admin-bar header.nav {
    top: 46px;
  }
  .admin-bar .scroll-progress {
    top: 46px;
  }
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
}

.logo {
  justify-self: start;
}

.nav-links {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.nav-right .icon-btn,
.nav-right .nav-btn-quote {
  height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
}

.nav-right .icon-btn {
  width: 38px;
  padding: 0;
  flex-shrink: 0;
}

.nav-right .nav-btn-quote {
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* Hide hamburger and mobile menu on desktop screens */
.hamburger,
.nav-right .hamburger,
#hamburgerBtn,
.mobile-menu,
.mobile-menu-backdrop {
  display: none !important;
}

@media (min-width: 992px) {
  .hamburger,
  .nav-right .hamburger,
  #hamburgerBtn,
  .mobile-menu,
  .mobile-menu-backdrop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

header.nav .logo-img,
.site-logo img,
.custom-logo {
  height: 30px;
  width: auto;
  display: block;
}

.logo-gunmetal {
  display: none !important;
}

.logo-silver {
  display: block;
}

html[data-theme="light"] .logo-silver {
  display: none !important;
}

html[data-theme="light"] .logo-gunmetal {
  display: block !important;
}

/* Nav Responsive Mobile & Tablet Rules */
@media (max-width: 991px) {
  .nav-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 24px;
    gap: 12px;
  }
  .logo {
    justify-self: auto;
    flex-shrink: 0;
  }
  .nav-right {
    justify-self: auto;
    margin-left: auto;
  }
  header.nav .logo-img,
  .site-logo img,
  .custom-logo {
    height: 27px;
  }
  .nav-right {
    gap: 10px;
    flex-shrink: 0;
  }
  .nav-btn-quote {
    white-space: nowrap !important;
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    line-height: 1;
    border-radius: 11px;
    box-sizing: border-box;
    flex-shrink: 0;
  }
  .nav-btn-quote .btn-text-short {
    display: none;
  }
  .nav-btn-quote .btn-text-full {
    display: inline;
  }
  .hamburger,
  .nav-right .hamburger,
  #hamburgerBtn {
    display: inline-flex !important;
  }
  .mobile-menu {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 12px 18px;
    gap: 10px;
  }
  header.nav .logo-img,
  .site-logo img,
  .custom-logo {
    height: 25px;
    max-width: 120px;
    object-fit: contain;
  }
  .logo {
    flex-shrink: 0;
    min-width: 0;
  }
  .nav-right {
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .icon-btn svg {
    width: 16px;
    height: 16px;
  }
  .nav-btn-quote {
    white-space: nowrap !important;
    height: 36px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1;
    box-sizing: border-box;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  header.nav .logo-img,
  .site-logo img,
  .custom-logo {
    height: 23px;
    max-width: 105px;
  }
  .nav-right {
    gap: 6px;
  }
  .icon-btn {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    box-sizing: border-box;
    padding: 0;
  }
  .icon-btn svg {
    width: 15px;
    height: 15px;
  }
  .nav-btn-quote {
    height: 33px;
    padding: 0 10px;
    font-size: 11.5px;
    border-radius: 9px;
    line-height: 1;
    gap: 4px;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  .nav-inner {
    padding: 8px 10px;
    gap: 6px;
  }
  header.nav .logo-img,
  .site-logo img,
  .custom-logo {
    height: 21px;
    max-width: 90px;
  }
  .nav-right {
    gap: 5px;
  }
  .icon-btn {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    box-sizing: border-box;
    padding: 0;
  }
  .icon-btn svg {
    width: 14px;
    height: 14px;
  }
  .nav-btn-quote {
    height: 31px;
    padding: 0 9px;
    font-size: 11px;
    border-radius: 8px;
    line-height: 1;
    box-sizing: border-box;
  }
  .nav-btn-quote .btn-text-full {
    display: none !important;
  }
  .nav-btn-quote .btn-text-short {
    display: inline !important;
  }
}

/* ==========================================================================
   WordPress Post & Content Layout (Aligned with Code1001 Design System)
   ========================================================================== */
.site-content {
  padding: 60px 0 80px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 992px) {
  .has-sidebar .content-wrapper {
    grid-template-columns: 2fr 1fr;
  }
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 30px;
  transition: transform .2s ease, border-color .2s ease;
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

html[data-theme="light"] .post-card:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.post-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.post-content-wrap {
  padding: 32px;
}

.entry-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.entry-title a {
  color: var(--text);
}

.entry-title a:hover {
  color: var(--text-dim);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.entry-summary,
.entry-content {
  color: var(--text-dim);
  line-height: 1.7;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.entry-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.post-tags {
  font-size: 13px;
  color: var(--text-dim);
}

.post-tags a {
  color: var(--text);
  background: var(--card-2);
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 6px;
  border: 1px solid var(--border);
}

/* ==========================================================================
   Sidebar & Widget Areas
   ========================================================================== */
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--card);
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.widget-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.widget ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul li a {
  color: var(--text-dim);
}

.widget ul li a:hover {
  color: var(--text);
}

/* ==========================================================================
   Pagination & Forms
   ========================================================================== */
.pagination {
  margin: 40px 0;
  display: flex;
  gap: 8px;
}

.pagination .page-numbers {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text);
}

.pagination .page-numbers.current {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-bg);
}

input[type="text"]:not(.mn-search-input),
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"]:not(.mn-search-input),
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease;
}

input[type="text"]:not(.mn-search-input):focus,
input[type="email"]:focus,
input[type="search"]:not(.mn-search-input):focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] input[type="text"]:not(.mn-search-input):focus,
html[data-theme="light"] input[type="email"]:focus,
html[data-theme="light"] input[type="search"]:not(.mn-search-input):focus,
html[data-theme="light"] textarea:focus {
  border-color: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   WordPress Core Requirements
   ========================================================================== */
.alignleft { float: left; margin: 0.5rem 1.5rem 1.5rem 0; }
.alignright { float: right; margin: 0.5rem 0 1.5rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; text-align: center; }

.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(--card);
  border-radius: 6px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: var(--text);
  display: block;
  font-size: 14px;
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   FEATURED WORK & TESTIMONIALS SECTION HEAD (GLOBAL HIGH SPECIFICITY)
   Guarantees that the action button and arrows are ALWAYS on the far right side.
   ========================================================================== */
body section#work .sec-head,
body section.featured-work-section .sec-head,
body .featured-work-section .fw-sec-head,
body .fw-sec-head,
body section#about .sec-head,
body section.testimonials-section .sec-head,
body .testimonials-section .t-sec-head,
body .t-sec-head {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 32px !important;
  gap: 24px !important;
  text-align: left !important;
}

body .featured-work-section .sec-head-left,
body .testimonials-section .sec-head-left,
body .fw-sec-head .sec-head-left,
body .t-sec-head .sec-head-left {
  flex: 0 1 auto !important;
  max-width: 680px !important;
  margin: 0 !important;
  text-align: left !important;
}

body .featured-work-section .link-arrow,
body .featured-work-section .sec-head .link-arrow,
body .fw-sec-head .link-arrow {
  margin-left: auto !important;
  margin-right: 0 !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-self: flex-end !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

body .testimonials-section .t-nav-controls,
body .testimonials-section .sec-head .t-nav-controls,
body .t-sec-head .t-nav-controls,
body .t-nav-controls {
  margin-left: auto !important;
  margin-right: 0 !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-self: flex-end !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  width: auto !important;
  max-width: none !important;
}

@media (max-width: 768px) {
  body section#work .sec-head,
  body .featured-work-section .sec-head,
  body .fw-sec-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  body .featured-work-section .link-arrow,
  body .fw-sec-head .link-arrow {
    margin-left: 0 !important;
    align-self: flex-start !important;
  }

  body section#about .sec-head,
  body .testimonials-section .sec-head,
  body .t-sec-head {
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
  }
}

/* ==========================================================================
   Breadcrumb Navigation Bar (Sticky Below Header)
   ========================================================================== */
.cs-breadcrumb-bar {
  position: -webkit-sticky;
  position: sticky;
  top: var(--site-nav-height, 67px);
  z-index: 990;
  width: 100%;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 0;
  background: rgba(23, 23, 26, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: visible !important;
}

.cs-breadcrumb-bar.is-stuck {
  background: rgba(23, 23, 26, 0.94);
  box-shadow: none;
  border-bottom-color: var(--border);
}

html[data-theme="light"] .cs-breadcrumb-bar {
  background: rgba(243, 243, 241, 0.88);
}

html[data-theme="light"] .cs-breadcrumb-bar.is-stuck {
  background: rgba(243, 243, 241, 0.96);
  box-shadow: none;
  border-bottom-color: var(--border);
}

/* Responsive Sticky Offsets */
@media (max-width: 991px) {
  .cs-breadcrumb-bar {
    top: var(--site-nav-height, 56px);
  }
}

@media (max-width: 782px) {
  .cs-breadcrumb-bar {
    top: var(--site-nav-height, 52px);
    padding: 10px 0;
  }
}

/* WordPress Admin Bar Offsets */
.admin-bar .cs-breadcrumb-bar {
  top: calc(var(--site-nav-height, 67px) + 32px);
}

@media (max-width: 991px) {
  .admin-bar .cs-breadcrumb-bar {
    top: calc(var(--site-nav-height, 56px) + 32px);
  }
}

@media screen and (max-width: 782px) {
  .admin-bar .cs-breadcrumb-bar {
    top: calc(var(--site-nav-height, 52px) + 46px);
  }
}

.cs-breadcrumb-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: visible !important;
}

.cs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-latin, 'Inter', system-ui, -apple-system, sans-serif);
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
  flex-wrap: wrap;
}

@media (max-width: 899px) {
  .cs-breadcrumb-wrap {
    gap: 12px;
  }

  .cs-breadcrumb {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .cs-breadcrumb::-webkit-scrollbar {
    display: none;
  }
}

.cs-bc-item {
  display: inline-flex;
  align-items: center;
}

.cs-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.cs-breadcrumb a:hover {
  color: var(--text);
}

.cs-bc-sep {
  color: var(--text-faint);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1;
  user-select: none;
  opacity: 0.7;
}

.cs-bc-current {
  color: var(--text);
  font-weight: 600;
}
