/*
Theme Name: Bits & Canvas
Theme URI: https://blog.redouan.net
Author: Redouan Kacimi
Author URI: https://redouan.net
Description: A modern, tech-focused WordPress theme with terminal aesthetics and code-inspired design. Perfect for tech blogs, developer portfolios, and creative problem-solvers.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bits-canvas
Tags: blog, custom-colors, custom-menu, dark, featured-images, flexible-header, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready
*/

/* ================================
   ROOT VARIABLES
   ================================ */
:root {
  --black: #191919;
  --prime: #0AC999;
  --darkgreen: #117C88;
  --gray: #8B8B8B;
  --white: #f0f8ff;
  --red: #FF5F5E;
  --accent: #f66eff;
  --blue: #0092DA;
  --container-width: 1200px;
  --spacing-unit: 1rem;
}

/* ================================
   FONT IMPORTS
   ================================ */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

/* ================================
   GLOBAL STYLES
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--black);
  color: var(--white);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  color: var(--white);
  background: var(--darkgreen);
}

/* ================================
   TYPOGRAPHY
   ================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  color: var(--white);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.5rem;
  color: var(--gray);
}

a {
  color: var(--prime);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--prime);
  text-decoration: underline wavy var(--accent);
}

strong, b {
  font-weight: 400;
  color: var(--darkgreen);
}

em, i {
  font-style: italic;
}

code {
  font-family: 'Courier New', monospace;
  background: rgba(10, 201, 153, 0.1);
  color: var(--prime);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background: rgba(25, 25, 25, 0.8);
  border: 1px solid var(--darkgreen);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

blockquote {
  border-left: 3px solid var(--prime);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--gray);
}

/* ================================
   LAYOUT
   ================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  padding: 4rem 0;
}

/* ================================
   HEADER
   ================================ */
.site-header {
  background: var(--black);
  border-bottom: 1px solid rgba(139, 139, 139, 0.2);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(25, 25, 25, 0.95);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
}

.site-title a {
  color: var(--prime);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
}

.site-title a:hover {
  color: var(--white);
  text-decoration: none;
  text-shadow: 0 0 10px rgba(10, 201, 153, 0.5);
}

.site-title a::before {
  content: '// ';
  color: var(--darkgreen);
}

.site-description {
  display: none;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  color: #abb8c3;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a::before {
  content: '>';
  color: var(--prime);
  opacity: 0;
  margin-right: 0;
  transition: all 0.3s ease;
}

.main-navigation a:hover::before,
.main-navigation .current-menu-item a::before {
  opacity: 1;
  margin-right: 0.5rem;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--white);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: var(--prime);
  color: var(--black);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: var(--white);
  transform: translateY(-2px);
}

/* ================================
   POSTS & ENTRIES
   ================================ */
.posts-container {
  display: grid;
  gap: 3rem;
}

.post-card,
.page-content {
  background: rgba(25, 25, 25, 0.5);
  border: 1px solid rgba(139, 139, 139, 0.2);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--prime);
  box-shadow: 0 15px 40px rgba(10, 201, 153, 0.1);
}

.entry-header {
  margin-bottom: 1.5rem;
}

.entry-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.entry-title::before {
  content: '// ';
  color: var(--prime);
}

.entry-title a {
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
}

.entry-title a:hover {
  color: var(--prime);
  text-decoration: none;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.entry-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.entry-meta span::before {
  content: '>';
  color: var(--prime);
}

.entry-meta a {
  color: var(--gray);
}

.entry-meta a:hover {
  color: var(--prime);
  text-decoration: none;
}

.entry-thumbnail {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.entry-thumbnail img {
  height: auto;
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.entry-thumbnail-index img{
  height: 350px;
  object-fit: cover;
}

.post-card:hover .entry-thumbnail img {
  transform: scale(1.05);
}

.entry-content,
.entry-summary {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.read-more {
  display: inline-block;
  color: var(--prime);
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--prime);
  border-radius: 4px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.read-more:hover {
  background: var(--prime);
  color: var(--black);
  text-decoration: none;
}

/* Tags and Categories */
.entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139, 139, 139, 0.2);
  margin-top: 1.5rem;
}

.tags-links,
.cat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tags-links span:first-child,
.cat-links span:first-child {
  color: var(--darkgreen);
  font-weight: 500;
  margin-right: 0.5rem;
}

.tags-links a{
  color: var(--darkgreen);
  font-family: Courier New, monospace;
  background: rgba(139, 139, 139, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.cat-links a {
  background: rgba(10, 201, 153, 0.1);
  color: var(--darkgreen);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid rgba(10, 201, 153, 0.3);
  text-decoration: none;
  transition: all 0.3s ease;
}

.tags-links a:hover,
.cat-links a:hover {
  background: var(--prime);
  color: var(--black);
  text-decoration: none;
}

/* ================================
   PAGINATION
   ================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 4rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--darkgreen);
  border-radius: 4px;
  color: var(--gray);
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .current {
  background: var(--prime);
  color: var(--black);
  border-color: var(--prime);
  text-decoration: none;
}

.pagination .current {
  font-weight: 700;
}

/* ================================
   SIDEBAR
   ================================ */
.sidebar {
  margin-top: 4rem;
}

.widget {
  background: rgba(25, 25, 25, 0.5);
  border: 1px solid rgba(139, 139, 139, 0.2);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.widget-title {
  color: var(--prime);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(139, 139, 139, 0.2);
}

.widget-title::before {
  content: '// ';
  color: var(--darkgreen);
}

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

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(139, 139, 139, 0.1);
}

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

.widget a {
  color: var(--prime);
  transition: all 0.3s ease;
  display: inline-block;
}

.widget a:hover {
  color: var(--prime);
  text-decoration: none;
  transform: translateX(5px);
}

.widget a::before {
  content: '> ';
  color: var(--prime);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.widget a:hover::before {
  opacity: 1;
}

/* Search Widget */
.widget_search form {
  display: flex;
  gap: 0.5rem;
}

.widget_search input[type="search"] {
  flex: 1;
  padding: 0.75rem;
  background: rgba(25, 25, 25, 0.8);
  border: 1px solid var(--darkgreen);
  border-radius: 4px;
  color: var(--white);
  font-family: 'Lato', sans-serif;
}

.widget_search input[type="search"]:focus {
  outline: none;
  border-color: var(--prime);
  box-shadow: 0 0 10px rgba(10, 201, 153, 0.2);
}

.widget_search button {
  padding: 0.75rem 1.5rem;
  background: var(--prime);
  color: var(--black);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.widget_search button:hover {
  background: var(--white);
  transform: translateY(-2px);
}

/* ================================
   COMMENTS
   ================================ */
.comments-area {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 2px solid var(--darkgreen);
}

.comments-title {
  color: var(--prime);
  margin-bottom: 2rem;
}

.comments-title::before {
  content: '// ';
  color: var(--darkgreen);
}

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

.comment {
  background: rgba(25, 25, 25, 0.5);
  border: 1px solid rgba(139, 139, 139, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-author {
  color: var(--prime);
  display: flex;
  font-weight: 700;
  margin-bottom: 0.5rem;
  align-items: center;
}

.comment-meta {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.comment-content {
  color: var(--gray);
}

.reply {
  margin-top: 1rem;
}

.reply a {
  color: var(--prime);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--prime);
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.reply a:hover {
  background: var(--prime);
  color: var(--black);
}

/* Comment Form */
.comment-form {
  background: rgba(25, 25, 25, 0.5);
  border: 1px solid rgba(139, 139, 139, 0.2);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(25, 25, 25, 0.05);
  border: 1px dashed var(--darkgreen);
  border-radius: 8px;
  color: var(--gray);
  font-family: 'Lato', sans-serif;
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--prime);
  box-shadow: 0 0 10px rgba(10, 201, 153, 0.2);
}

.comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

.comment-form input[type="submit"] {
  background: var(--prime);
  color: var(--black);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.comment-form input[type="submit"]:hover {
  background: var(--white);
  transform: translateY(-2px);
}

/* ================================
   FOOTER
   ================================ */
.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(139, 139, 139, 0.2);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--prime);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--white);
  text-decoration: none;
}

.footer-links a::before {
  content: '// ';
  color: var(--darkgreen);
}

.footer-text p {
  color: #abb8c3;
  font-size: 0.9rem;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media screen and (max-width: 992px) {
  .container {
    padding: 0 1.5rem;
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
}

@media screen and (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .main-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(25, 25, 25, 0.98);
    border-top: 1px solid rgba(139, 139, 139, 0.2);
    padding: 1rem;
    display: none;
  }
  
  .main-navigation.toggled {
    display: block;
  }
  
  .main-navigation ul {
    flex-direction: column;
    gap: 0;
  }
  
  .main-navigation li {
    border-bottom: 1px solid rgba(139, 139, 139, 0.1);
  }
  
  .main-navigation a {
    display: block;
    padding: 1rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .post-card,
  .page-content,
  .widget {
    padding: 1.5rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
}

/* ================================
   SCROLLBAR
   ================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--black);
}

::-webkit-scrollbar-thumb {
  background: var(--darkgreen);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--prime);
}

/* ================================
   UTILITY CLASSES
   ================================ */
.highlight{
  color: var(--prime);
  font-family: Courier New, monospace;
  background: #0ac9991a;
  padding: 2px 6px;
  border-radius: 4px;
}

.text-center {
  text-align: center;
}

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


/* ================================
   LIGHT THEME + FOOTER WIDGETS
   ================================ */

/* Light Theme Colors */
:root {
  --light-bg: #ffffff;
  --dark-bg: #32373c;
  --light-text: #2c2c2c;
  --light-border: #e0e0e0;
  --gray: #4a4a4a;
}

/* Light Backgrounds */
body {
  /*background: var(--light-bg);*/
  color: var(--light-text);
}

.site-content {
  background: var(--light-bg);
}

/* Light Header */
/*.site-header {*/
/*  background: rgba(255, 255, 255, 0.98);*/
/*  border-bottom: 1px solid var(--light-border);*/
/*}*/


.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--prime);
}

/* Light Post Cards */
.post-card,
.page-content {
  background: #ffffff;
  border: 1px dashed var(--gray);
  color: var(--light-text);
}

.post-card:hover {
  border-color: var(--prime);
  box-shadow: 0 5px 20px rgba(10, 201, 153, 0.15);
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.entry-title,
.entry-title a {
  color: var(--light-text);
  font-weight: 600;
}

/* Body Text */
p,
.entry-content,
.entry-summary {
  color: var(--gray);
  font-size: 20px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  background: #ffffff;
  border: 1px solid var(--light-border);
  color: var(--light-text);
}

input:focus,
textarea:focus {
  border-color: var(--prime);
  box-shadow: 0 0 0 3px rgba(10, 201, 153, 0.1);
}

/* Comments */
.comment {
  background: #ffffff;
  border: 1px solid var(--light-border);
}

.comment-form {
  background: #ffffff;
  border: 1px solid var(--light-border);
}

/* Code Blocks */
code {
  background: rgba(10, 201, 153, 0.08);
}

pre {
  background: #f8f8f8;
  border: 1px solid var(--light-border);
}

/* Selection */
::selection {
  background: rgba(10, 201, 153, 0.2);
  color: var(--light-text);
}

/* Scrollbar */
::-webkit-scrollbar-track {
  background: #f0f0f0;
}

/* FOOTER - Keep Dark */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: 1px solid rgba(139, 139, 139, 0.2);
}

/* Footer Widgets Layout */
.footer-widgets-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(139, 139, 139, 0.2);
}

.footer-widget {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 139, 139, 0.2);
}

.footer-widget .widget-title {
  color: var(--prime);
  border-bottom: 1px solid rgba(139, 139, 139, 0.2);
}

.footer-widget,
.footer-widget a {
  color: var(--prime);
}

.footer-widget a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-text span{
  color: var(--prime);
}

/* Mobile: Stack Footer Widgets */
@media screen and (max-width: 768px) {
  .footer-widgets-area {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

.comment-reply-title{
  color: var(--prime);
}







/*
========================================================================
WORDPRESS-OVERWRITES
========================================================================
*/

.wp-block-separator {
  border: none;
  border-top: 1px dashed var(--prime);
  margin: 12px 0;
}

.wp-block-list {
  list-style: none;
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.wp-block-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.wp-block-list li::before {
  content: '>';
  color: var(--prime);
  font-weight: 700;
  position: absolute;
  left: 0;
  top: 0;
}

/* Nested lists */
.wp-block-list ul,
.wp-block-list ol {
  margin-top: 0.75rem;
  padding-left: 2rem;
}



/* ================================
   CONTACT FORM 7 STYLING
   ================================ */
.wpcf7 {
  background: #ffffff;
  border: 1px solid var(--light-border);
  border-radius: 12px;
  padding: 2.5rem;
}

.wpcf7 p {
  margin-bottom: 1.5rem;
}

.wpcf7 label {
  display: block;
  color: var(--darkgreen);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
  width: 100%;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--light-border);
  border-radius: 4px;
  color: var(--light-text);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--prime);
  box-shadow: 0 0 0 3px rgba(10, 201, 153, 0.1);
}

.wpcf7 textarea {
  min-height: 150px;
  resize: vertical;
}

.wpcf7 input[type="submit"] {
  background: var(--prime);
  color: var(--black);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.wpcf7 input[type="submit"]:hover {
  background: var(--darkgreen);
  color: var(--white);
  transform: translateY(-2px);
}

.wpcf7-response-output {
  border-radius: 4px;
  padding: 1rem;
  margin-top: 1rem;
}

.wpcf7-validation-errors {
  border: 1px solid var(--red);
  color: var(--red);
}

.wpcf7-mail-sent-ok {
  border: 1px solid var(--prime);
  color: var(--prime);
  background: rgba(10, 201, 153, 0.1);
}