/*
Theme Name: Decuba Console for Blocksy
Theme URI: https://decuba.tech
Author: Decuba Tech
Description: A Blocksy child theme for decuba.tech with a console-style posts homepage, category pages, and featured-image post lists.
Version: 1.0.5
Template: blocksy
Requires at least: 6.0
Text Domain: decuba-console-blocksy-child
*/

:root {
  --decuba-bg: #080c14;
  --decuba-surface: #0f1726;
  --decuba-soft-surface: #162033;
  --decuba-text: #f8fafc;
  --decuba-muted: #aab8ca;
  --decuba-border: rgba(148, 163, 184, 0.24);
  --decuba-shadow-card: 0 8px 22px rgba(0, 0, 0, 0.26);
}

.decuba-console-page {
  background: var(--decuba-bg);
  color: var(--decuba-text);
  padding: 3rem 0 4rem;
}

.decuba-console-container {
  margin-inline: auto;
  max-width: 1120px;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.decuba-console-top {
  background: linear-gradient(90deg, rgba(0, 120, 212, 0.16), transparent 38%), var(--decuba-surface);
  border: 1px solid var(--decuba-border);
  border-radius: 8px;
  display: block;
  margin-bottom: 2rem;
  padding: clamp(0.85rem, 2vw, 1.2rem);
}

.decuba-terminal {
  background: #030712;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  width: 100%;
}

.decuba-terminal-bar {
  align-items: center;
  background: #0b1020;
  border-bottom: 1px solid rgba(148, 163, 184, 0.20);
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
}

.decuba-dot {
  border-radius: 999px;
  display: inline-block;
  height: 0.72rem;
  width: 0.72rem;
}

.decuba-dot.red {
  background: #ff5f57;
}

.decuba-dot.amber {
  background: #ffbd2e;
}

.decuba-dot.green {
  background: #28c840;
}

.decuba-terminal-title {
  color: #aab8ca;
  font-family: Consolas, "SFMono-Regular", "Cascadia Mono", monospace;
  font-size: 0.82rem;
  margin-left: 0.35rem;
}

.decuba-terminal-code {
  color: #dbeafe;
  font-family: Consolas, "SFMono-Regular", "Cascadia Mono", monospace;
  font-size: clamp(0.78rem, 1.3vw, 0.95rem);
  line-height: 1.62;
  margin: 0;
  max-height: 28rem;
  overflow: auto;
  padding: 1rem;
  tab-size: 4;
  white-space: pre-wrap;
}

.decuba-live-code {
  min-height: clamp(24rem, 52vh, 34rem);
}

.decuba-live-code-lines {
  min-height: clamp(22rem, 50vh, 32rem);
}

.decuba-live-line {
  min-height: 1.45em;
}

.decuba-live-cursor {
  animation: decubaCursor 900ms steps(1) infinite;
  color: #f8fafc;
  display: inline-block;
}

.tok-prompt {
  color: #4fc1ff !important;
  font-weight: 700;
}

.tok-keyword,
.tok-decorator {
  color: #569cd6 !important;
  font-weight: 700;
}

.tok-class,
.tok-module {
  color: #4ec9b0 !important;
}

.tok-function {
  color: #dcdcaa !important;
}

.tok-string {
  color: #ce9178 !important;
}

.tok-number {
  color: #b5cea8 !important;
}

.tok-variable,
.tok-plain {
  color: #9cdcfe !important;
}

.tok-operator,
.tok-punctuation {
  color: #d4d4d4 !important;
}

.tok-flag {
  color: #c586c0 !important;
  font-weight: 700;
}

.tok-comment {
  color: #6a9955 !important;
  font-style: italic;
}

.tok-output {
  color: #86efac !important;
  font-weight: 700;
}

@keyframes decubaCursor {
  50% {
    opacity: 0;
  }
}

.decuba-console-layout {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 20rem;
}

.decuba-console-sidebar {
  align-self: start;
  background: var(--decuba-surface);
  border: 1px solid var(--decuba-border);
  border-radius: 8px;
  padding: 1rem;
  position: sticky;
  top: 6rem;
}

.decuba-sidebar-widget {
  border-top: 1px solid var(--decuba-border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.decuba-sidebar-widget-title,
.decuba-sidebar-widget h2,
.decuba-sidebar-widget h3 {
  color: var(--decuba-text);
  font-size: 1rem;
  line-height: 1.25;
  margin: 0 0 0.85rem;
}

.decuba-sidebar-widget ul {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.decuba-sidebar-widget li {
  color: var(--decuba-muted);
  margin: 0;
}

.decuba-sidebar-widget a {
  color: var(--decuba-text);
  font-weight: 700;
  text-decoration: none;
}

.decuba-sidebar-widget a:hover {
  color: #4fc1ff;
}

.decuba-console-sidebar .widget_recent_entries,
.decuba-console-sidebar .wp-block-latest-posts,
.decuba-console-sidebar .wp-block-query,
.decuba-console-sidebar .ct-posts-widget,
.decuba-console-sidebar .wp-block-post-featured-image,
.decuba-console-sidebar .wp-block-latest-posts__featured-image,
.decuba-sidebar-widget:has(.wp-block-latest-posts),
.decuba-sidebar-widget:has(.wp-block-query),
.decuba-sidebar-widget:has(.wp-block-post-featured-image),
.decuba-sidebar-widget:has(.wp-block-latest-posts__featured-image),
.decuba-sidebar-widget:has(.wp-post-image),
.decuba-sidebar-widget:has(.ct-posts-widget),
.decuba-sidebar-widget:has(.ct-media-container) {
  display: none;
}

.decuba-console-sidebar .widget_categories,
.decuba-console-sidebar .wp-block-categories,
.decuba-console-sidebar .wp-block-categories-list,
.decuba-sidebar-widget:has(.wp-block-categories),
.decuba-sidebar-widget:has(.wp-block-categories-list) {
  display: none;
}

.decuba-post-list {
  align-content: start;
  display: grid;
  gap: 0.75rem;
}

.decuba-console-row,
.decuba-archive-row {
  background: var(--decuba-surface);
  border: 1px solid var(--decuba-border);
  border-left: 4px solid #0078d4;
  border-radius: 8px;
  box-sizing: border-box;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(7.5rem, 9.25rem) minmax(0, 1fr) minmax(12rem, 17rem);
  padding: 0.85rem 0.95rem;
  align-items: start;
  min-height: 0;
}

.decuba-post-meta {
  color: var(--decuba-muted);
  font-family: Consolas, "SFMono-Regular", "Cascadia Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.decuba-post-meta a {
  color: var(--decuba-muted);
  text-decoration: none;
}

.decuba-post-body {
  min-width: 0;
}

.decuba-post-body h2 {
  font-size: clamp(1.15rem, 1.8vw, 1.58rem);
  line-height: 1.16;
  margin: 0 0 0.45rem;
}

.decuba-post-body h2 a {
  color: var(--decuba-text);
  text-decoration: none;
}

.decuba-post-body p {
  color: var(--decuba-muted);
  display: -webkit-box;
  font-size: 0.96rem;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-height: 1.55;
  margin: 0;
  overflow: hidden;
}

.decuba-read-more {
  color: #4fc1ff;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 0.75rem;
  text-decoration: none;
}

.decuba-read-more:hover {
  color: var(--decuba-text);
}

.decuba-post-image {
  justify-self: end;
  max-width: 17rem;
  width: 100%;
}

.decuba-post-image img {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  display: block;
  height: auto;
  max-height: 10.75rem;
  object-fit: cover;
  width: 100%;
}

.decuba-page-title {
  border-bottom: 1px solid var(--decuba-border);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

.decuba-page-title h1 {
  color: var(--decuba-text);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.02;
  margin: 0;
}

.decuba-page-title p {
  color: var(--decuba-muted);
  max-width: 48rem;
}

.decuba-pagination {
  margin-top: 2rem;
}

.decuba-pagination a,
.decuba-pagination span {
  color: var(--decuba-text);
}

.decuba-single {
  margin-inline: auto;
  max-width: 860px;
}

.decuba-single-header {
  border-bottom: 1px solid var(--decuba-border);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

.decuba-single-header h1 {
  color: var(--decuba-text);
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.02;
  margin: 0.75rem 0 0;
}

.decuba-single-excerpt {
  color: var(--decuba-muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 46rem;
}

.decuba-single-image {
  margin: 0 0 2rem;
}

.decuba-single-image img {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.decuba-content-card {
  background: #0f1726;
  border: 1px solid var(--decuba-border);
  border-radius: 8px;
  color: var(--decuba-text);
  font-size: 1.06rem;
  line-height: 1.78;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.decuba-content-card > *:first-child {
  margin-top: 0;
}

.decuba-content-card > *:last-child {
  margin-bottom: 0;
}

.decuba-content-card h2,
.decuba-content-card h3,
.decuba-content-card h4 {
  color: var(--decuba-text);
  line-height: 1.16;
  margin-top: 2rem;
}

.decuba-content-card p,
.decuba-content-card li {
  color: #dbeafe;
}

.decuba-content-card a {
  color: #4fc1ff;
}

.decuba-content-card pre,
.decuba-content-card code {
  background: #030712;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #d4d4d4;
}

.decuba-content-card code {
  padding: 0.12rem 0.28rem;
}

.decuba-content-card pre {
  overflow: auto;
  padding: 1rem;
}

.decuba-content-card blockquote {
  border-left: 4px solid #0078d4;
  color: var(--decuba-muted);
  margin-left: 0;
  padding-left: 1rem;
}

.decuba-single-footer {
  margin-top: 1.5rem;
}

.decuba-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.decuba-tags a {
  background: var(--decuba-soft-surface);
  border: 1px solid var(--decuba-border);
  border-radius: 999px;
  color: var(--decuba-text);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
}

.decuba-post-nav {
  border-top: 1px solid var(--decuba-border);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.decuba-post-nav div:last-child {
  text-align: right;
}

.decuba-post-nav a {
  color: var(--decuba-text);
  font-weight: 700;
  text-decoration: none;
}

.decuba-search-form {
  display: flex;
  gap: 0.5rem;
}

.decuba-search-form input[type="search"] {
  background: #030712;
  border: 1px solid var(--decuba-border);
  border-radius: 8px;
  color: var(--decuba-text);
  min-height: 2.75rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

.decuba-search-form button {
  background: #0078d4;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .decuba-console-page {
    padding: 1.25rem 0 2.5rem;
  }

  .decuba-console-top {
    margin-bottom: 1rem;
    padding: 0.65rem;
  }

  .decuba-terminal-code {
    max-height: none;
    overflow: hidden;
    padding: 0.75rem;
  }

  .decuba-live-code {
    min-height: 18rem;
  }

  .decuba-live-code-lines {
    min-height: 16rem;
  }

  .decuba-console-layout,
  .decuba-console-row,
  .decuba-archive-row {
    grid-template-columns: 1fr;
  }

  .decuba-console-sidebar {
    position: static;
  }

  .decuba-sidebar-widget {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .decuba-post-image {
    justify-self: stretch;
    max-width: 100%;
  }

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

  .decuba-post-nav div:last-child {
    text-align: left;
  }

  .decuba-search-form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .decuba-live-cursor {
    animation: none;
  }
}
