/* OSN Custom Color Overrides - FORCED DARK MODE */

/* Alfphabet IV webfont (local files: /fonts/alfphabet-iv/) */
@font-face {
  font-family: "Alfphabet IV";
  src: url("/fonts/alfphabet-iv/alfphabet-iv-webfont.woff2") format("woff2"),
       url("/fonts/alfphabet-iv/alfphabet-iv-webfont.woff") format("woff"),
       url("/fonts/alfphabet-iv/Alfphabet-IV.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Neutral, comfortable dark/grey palette (forced) */
  --osn-primary: #4A9FD1;
  --osn-secondary: #C85FA0;
  --osn-tertiary: #FFA726;
  --osn-text: #D8DEE9;    /* primary page text (light on dark) */
  --osn-text-dark: #ECEFF1; /* headings / stronger text */
  --osn-text-light: #5eb4ff; /* subdued text / placeholders */
  --osn-bg: #2b2b2b;       /* neutral grey background requested */
  --osn-gray: #32353a;     /* slightly lighter gray for surfaces */
  --osn-dark-gray: #3B4252; /* darker accents */
  --osn-light-blue: #4C566A;
}

/* Force browsers and form controls to dark rendering */
html { color-scheme: dark; }
/* FORCED DARK MODE - apply immediately (removed prefers-color-scheme wrapper) */

/* Universal dark mode base styles - Comfortable neutral grey background */
html,
body,
body.dark-mode,
.page,
.site {
  background-color: var(--osn-bg) !important;
  color: var(--osn-text) !important;
}

/* Main content areas - Prevent white backgrounds */
main,
.main,
.content,
section,
article {
  background-color: var(--osn-bg) !important;
  color: var(--osn-text) !important;
}

/* All headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--osn-text-dark) !important;
}

/* All paragraphs and text elements */
p, div, span, li, td, th {
  color: var(--osn-text) !important;
}

/* Navigation */
.site-navigation,
.navbar,
nav {
  background-color: #342C64 !important;
  opacity: 1 !important;
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.45) !important;
}

/* When the theme adds .nav-bg on scroll, ensure it stays solid and opaque */
.site-navigation.nav-bg,
.navbar.nav-bg,
nav.nav-bg,
.site-navigation.nav-bg.scrolled,
.site-navigation.nav-bg.is-sticky {
  background-color: #342C64 !important;
  background-image: none !important;
  opacity: 1 !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.45) !important;
}

/* Ensure nav links remain readable when .nav-bg is present */
.site-navigation.nav-bg .nav-link,
.site-navigation.nav-bg .navbar-brand,
.site-navigation.nav-bg a {
  color: var(--osn-text-dark) !important;
}

/* Fallback: if JS sets inline background-color, ensure it's applied and links contrast */
.site-navigation[style*="#342C64"],
.site-navigation[style*="342C64"] {
  background-color: #342C64 !important;
  background-image: none !important;
  opacity: 1 !important;
}
.site-navigation[style*="#342C64"] a,
.site-navigation[style*="#342C64"] .nav-link,
.site-navigation[style*="#342C64"] .navbar-brand {
  color: #ECEFF1 !important;
}


/* Navigation links */
.navbar-nav .nav-link,
.nav-link,
nav a {
  color: var(--osn-text-dark) !important;
}

.navbar-nav .nav-link:hover,
.nav-link:hover,
nav a:hover {
  color: var(--osn-primary) !important;
}

/* Cards and containers - Comfortable dark backgrounds */
.card,
.widget,
.box,
.panel {
  background-color: #323335 !important; /* slightly lighter than page bg */
  border-color: #404040 !important;
  color: var(--osn-text) !important;
}

.bg-light,
.bg-white,
.section {
  background-color: var(--osn-bg) !important;
}

/* Containers and wrappers */
.container,
.container-fluid,
.row,
.col,
.col-12,
.col-lg-12,
.wrapper {
  background-color: transparent !important;
}

/* Forms - Comfortable dark backgrounds */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea,
select {
  background-color: #323335 !important;
  border-color: #404040 !important;
  color: var(--osn-text) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--osn-text-light) !important;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--osn-primary) 0%, #2196F3 100%) !important;
  border-color: rgba(0, 0, 0, 0.4) !important;
  color: white !important;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--osn-secondary) 0%, #E91E63 100%) !important;
  border-color: rgba(0, 0, 0, 0.35) !important;
  color: white !important;
}

/* Hero and CTA sections */
.site-hero::before {
  background: rgba(0, 0, 0, 0.6) !important;
}

.site-cta::before {
  background: rgba(0, 0, 0, 0.7) !important;
}

/* Footer - Enhanced readability in dark mode */
.site-footer,
.footer,
footer {
  background-color: #232427 !important;
  color: #FFFFFF !important;
  border-top: 2px solid #3B4252 !important;
}

.site-footer *,
.footer *,
footer * {
  color: #FFFFFF !important;
}

.site-footer h5,
.site-footer .site-footer-widget-title,
.footer h5,
footer h5 {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

.site-footer p,
.site-footer .site-footer-widget-description,
.footer p,
footer p {
  color: #E0E0E0 !important;
}

.site-footer a,
.site-footer-widget-links a,
.footer a,
footer a {
  color: #4A9FD1 !important;
  text-decoration: none !important;
}

.site-footer a:hover,
.site-footer-widget-links a:hover,
.footer a:hover,
footer a:hover {
  color: #FFFFFF !important;
  text-decoration: underline !important;
}

/* Footer copyright section */
.site-footer-copyright,
.footer-copyright {
  background-color: #0F1014 !important;
  color: #B0B0B0 !important;
  border-top: 1px solid #3B4252 !important;
  padding: 20px 0 !important;
}

.site-footer-copyright p,
.site-footer-copyright a,
.footer-copyright p,
.footer-copyright a {
  color: #B0B0B0 !important;
}

.site-footer-copyright a:hover,
.footer-copyright a:hover {
  color: #4A9FD1 !important;
}

/* Additional footer elements for better readability */
.site-footer-widget,
.footer-widget {
  background-color: transparent !important;
}

.site-footer-widget-top,
.footer-widget-top {
  color: #FFFFFF !important;
}

.site-footer-widget-top p,
.footer-widget-top p {
  color: #E0E0E0 !important;
}

.site-footer-widget-links,
.footer-widget-links {
  list-style: none !important;
}

.site-footer-widget-links li,
.footer-widget-links li {
  color: #FFFFFF !important;
}

/* Footer logo and images */
.site-footer-logo img,
.footer-logo img {
  filter: brightness(1.2) !important;
}

/* Fix: ensure footer logo sits in-flow and doesn't overlap other footer content */
.site-footer-logo,
.footer-logo {
  display: block !important;
  position: relative !important; /* prevent absolute positioning from theme or scripts */
  margin: 0 0 15px 0 !important; /* slightly less space below so it aligns better with columns */
  padding: 0 !important;
  text-align: left !important; /* align logo to the left edge of the column */
}

.site-footer-logo img,
.footer-logo img {
  display: inline-block !important; /* keep image inline inside wrapper */
  max-width: 220px !important; /* limit size so it doesn't overflow */
  width: auto !important;
  height: auto !important;
  vertical-align: middle !important;
  margin: 0 !important; /* align to the left by default */
  box-shadow: none !important; /* remove any floating/shadow that might give illusion of overlap */
}

@media (max-width: 575px) {
  .site-footer-logo,
  .footer-logo {
    text-align: center !important; /* keep centered on very small screens */
  }
  .site-footer-logo img,
  .footer-logo img {
    margin: 0 auto !important;
  }
}

/* If the theme used negative margins or transforms, neutralize them */
.site-footer-logo,
.site-footer-logo *,
.footer-logo,
.footer-logo * {
  transform: none !important;
  -webkit-transform: none !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Portfolio and blog items */
.portfolio-item,
.blog-item,
.post,
.project {
  background-color: #3B4252 !important;
  color: var(--osn-text) !important;
}

.portfolio-item:hover,
.blog-item:hover,
.post:hover {
  box-shadow: 0 10px 30px rgba(74, 159, 209, 0.3) !important;
}

/* Comprehensive background override to prevent white backgrounds */
*:not(.btn):not(.btn-primary):not(.btn-secondary) {
  background-color: inherit !important;
}

/* Specific background overrides */
.site-hero-content,
.site-cta-content,
.hero-content,
.banner-content {
  background-color: transparent !important;
}

/* Override any remaining white backgrounds */
div,
span,
p {
  background-color: transparent !important;
}

/* END FORCED DARK MODE */


/* Override primary colors */
.bg-primary,
.text-primary {
  background-color: var(--osn-primary) !important;
  border-color: var(--osn-primary) !important;
  color: var(--osn-primary) !important;
}

/* Primary buttons - High contrast for visibility */
.btn-primary {
  background: linear-gradient(135deg, var(--osn-primary) 0%, #1565C0 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--osn-secondary) 0%, #6A1B9A 100%) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: white !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Secondary buttons - High contrast alternative style */
.bg-secondary,
.text-secondary {
  background-color: var(--osn-secondary) !important;
  border-color: var(--osn-secondary) !important;
  color: var(--osn-secondary) !important;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--osn-secondary) 0%, #7B1FA2 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: linear-gradient(135deg, var(--osn-tertiary) 0%, #F57C00 100%) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: white !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Text colors */
body {
  color: var(--osn-text) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--osn-text-dark) !important;
}

/* Navigation colors and button fixes */
.navbar-nav .nav-link {
  color: var(--osn-text-dark) !important;
}

.navbar-nav .nav-link:hover {
  color: var(--osn-primary) !important;
}

/* Fix navigation action button visibility */
.navbar-nav .nav-item:last-child .nav-link.btn {
  background-color: var(--osn-primary) !important;
  border-color: var(--osn-primary) !important;
  color: white !important;
  border: 2px solid var(--osn-primary) !important;
  font-weight: 600 !important;
  min-width: 120px !important;
  text-align: center !important;
}

.navbar-nav .nav-item:last-child .nav-link.btn:hover {
  background-color: var(--osn-secondary) !important;
  border-color: var(--osn-secondary) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.navbar-nav .nav-item:last-child .nav-link.btn:focus {
  outline: 2px solid var(--osn-tertiary) !important;
  outline-offset: 2px !important;
}

/* Background overrides */
.bg-light {
  background-color: var(--osn-gray) !important;
}

/* Footer styling - Light mode */
.site-footer,
.footer {
  background-color: var(--osn-text-dark) !important;
  color: white !important;
}

.site-footer h5,
.site-footer .site-footer-widget-title,
.footer h5 {
  color: white !important;
  font-weight: 600 !important;
}

.site-footer p,
.site-footer .site-footer-widget-description,
.footer p {
  color: #F0F0F0 !important;
}

.site-footer a,
.site-footer-widget-links a,
.footer a {
  color: var(--osn-light-blue) !important;
  text-decoration: none !important;
}

.site-footer a:hover,
.site-footer-widget-links a:hover,
.footer a:hover {
  color: var(--osn-primary) !important;
  text-decoration: underline !important;
}

/* Hero/Banner section */
.site-hero {
  background: linear-gradient(135deg, var(--osn-primary) 0%, #1A365D 100%) !important;
  position: relative;
}

.site-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.site-hero .container {
  position: relative;
  z-index: 2;
}

.site-hero h1, 
.site-hero .hero-title,
.site-hero-content h1 {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
}

.site-hero h6,
.site-hero p, 
.site-hero .hero-subtitle {
  color: var(--osn-light-blue) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Hero section buttons - Extra visibility */
.site-hero-content-buttons .btn {
  min-width: 180px !important;
  padding: 18px 35px !important;
  font-size: 16px !important;
  letter-spacing: 0.5px !important;
  border-width: 3px !important;
  position: relative !important;
}

.site-hero-content-buttons .btn::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  border-radius: inherit;
  z-index: -1;
}

/* Call-to-action section */
.site-cta {
  position: relative;
}

.site-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.site-cta .container {
  position: relative;
  z-index: 2;
}

.site-cta-title {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
}

/* CTA section buttons - Extra visibility */
.site-cta-buttons .btn {
  min-width: 180px !important;
  padding: 18px 35px !important;
  font-size: 16px !important;
  letter-spacing: 0.5px !important;
  border-width: 3px !important;
}

/* Fallback styling - ensure visibility even without background images */
.site-hero, .site-cta {
  min-height: 400px;
  background-color: var(--osn-primary) !important;
}

/* Ensure button text animation works properly */
.btn .btn-area span::after {
  color: inherit !important;
}

/* Extra mobile responsiveness for buttons */
@media (max-width: 768px) {
  .site-hero-content-buttons .btn,
  .site-cta-buttons .btn {
    min-width: 200px !important;
    padding: 16px 30px !important;
    font-size: 15px !important;
    margin-bottom: 15px !important;
    display: inline-block !important;
    width: auto !important;
  }
  
  .site-hero-content-buttons li,
  .site-cta-buttons li {
    display: block !important;
    margin-bottom: 15px !important;
  }
}

/* Cards and sections */
.card {
  border-color: var(--osn-gray) !important;
}

.section {
  color: var(--osn-text) !important;
}

/* Contact form */
.form-control:focus {
  border-color: var(--osn-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(46, 134, 171, 0.25) !important;
}

/* Portfolio/Services items */
.portfolio-item:hover {
  box-shadow: 0 10px 30px rgba(46, 134, 171, 0.3) !important;
}

/* Gradient overlay behind the project content to improve readability */
.site-project-item{
  position: relative;
  overflow: hidden;
}

.site-project-item-thumb img{
  display:block;
  width:100%;
  height:auto;
}

.site-project-item-content{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  z-index: 2;
  color: var(--osn-text) !important;
}

.site-project-item-content::before{
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.7) 100%);
}

.site-project-item-content h3, .site-project-item-content span, .site-project-item-content .read-more{
  color: var(--osn-text) !important;
}

@media (max-width: 767px){
  .site-project-item-content{ padding: 20px; }
}

/* Manual dark mode class (for browsers without prefers-color-scheme support) */
body.dark-mode {
  background-color: #1e1e1e !important;
  color: #B0BEC5 !important;
}

body.dark-mode .site-navigation {
  background-color: #342C64 !important;
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .card {
  background-color: #3B4252 !important;
  border-color: #4C566A !important;
  color: #B0BEC5 !important;
}

body.dark-mode .bg-light {
  background-color: #3B4252 !important;
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
  color: #ECEFF1 !important;
}

/* Ensure navigation button has excellent contrast in all modes */
.navbar-nav .nav-item:last-child .nav-link.btn {
  /* High contrast colors for accessibility */
  background: linear-gradient(45deg, var(--osn-primary), #1976D2) !important;
  border: 2px solid transparent !important;
  color: white !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
}

.navbar-nav .nav-item:last-child .nav-link.btn:hover,
.navbar-nav .nav-item:last-child .nav-link.btn:focus {
  background: linear-gradient(45deg, var(--osn-secondary), #7B1FA2) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  outline: none !important;
}
