/*!
Theme Name: Blocksy
Theme URI: https://www.clhome.net/
Author: CLHOME
Description: Rediseño visual en borrador para CLHOME.net, conservando el motor y las plantillas de Blocksy.
Version: 1.0.0
Update URI: false
Text Domain: blocksy
*/

/* CLHOME — sistema visual limpio */
:root {
  --cl-bg: #070708;
  --cl-surface: #101012;
  --cl-surface-raised: #151518;
  --cl-line: rgba(255,255,255,.10);
  --cl-line-strong: rgba(255,255,255,.18);
  --cl-accent: #4da3ff;
  --cl-accent-wash: rgba(77,163,255,.12);
  --cl-text: #f4f4f5;
  --cl-muted: #a1a1aa;
  --cl-radius: 18px;
  --cl-content-width: 1120px;
}
html { background: var(--cl-bg); scroll-behavior: smooth; }
body {
  background: var(--cl-bg) !important;
  color: var(--cl-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  line-height: 1.75;
  overflow-x: clip;
}
body:before,
body:after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: block !important;
}

/* Neon atmosphere: unmistakably cyber, but the text remains readable */
body:before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 8% 12%, rgba(77,163,255,.25) 0, transparent 30%),
    radial-gradient(ellipse at 92% 18%, rgba(28,104,255,.24) 0, transparent 32%),
    radial-gradient(ellipse at 78% 78%, rgba(0,140,255,.12) 0, transparent 28%),
    radial-gradient(ellipse at 35% 100%, rgba(77,163,255,.12) 0, transparent 38%);
  background-size: 160% 160%;
  animation: clhome-aurora 18s ease-in-out infinite alternate;
}

/* Blue starfield: scattered points at different depths, drifting slowly like space */
body:after {
  z-index: 0;
  opacity: .76;
  background-image:
    radial-gradient(circle, rgba(151,211,255,.95) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(77,163,255,.85) 0 1.4px, transparent 2.2px),
    radial-gradient(circle, rgba(77,163,255,.55) 0 .8px, transparent 1.7px),
    radial-gradient(circle at 18% 24%, rgba(116,190,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 71% 63%, rgba(116,190,255,.8) 0 1.5px, transparent 3px),
    radial-gradient(ellipse at 50% 45%, rgba(0,140,255,.09), transparent 62%);
  background-size: 97px 113px, 173px 157px, 61px 73px, 100% 100%, 100% 100%, 100% 100%;
  background-position: 0 0, 35px 48px, 14px 21px, 0 0, 0 0, 0 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.94), rgba(0,0,0,.72) 72%, transparent);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.94), rgba(0,0,0,.72) 72%, transparent);
  animation: clhome-star-drift 48s linear infinite, clhome-star-glow 6s ease-in-out infinite alternate;
}

@keyframes clhome-star-drift {
  0% { background-position: 0 0, 35px 48px, 14px 21px, 0 0, 0 0, 0 0; }
  100% { background-position: 97px 113px, -138px 205px, 75px -52px, 0 0, 0 0, 0 0; }
}

@keyframes clhome-star-glow {
  0% { opacity: .48; }
  50% { opacity: .82; }
  100% { opacity: .62; }
}

@keyframes clhome-aurora {
  0% { background-position: 0% 0%; filter: hue-rotate(0deg); }
  50% { background-position: 70% 35%; }
  100% { background-position: 25% 100%; filter: hue-rotate(18deg); }
}
@keyframes clhome-grid-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 -280px; }
  to { background-position: 56px 56px, 0 56px, 56px 0, 0 -280px; }
}
@keyframes clhome-scan {
  0% { background-position: 0 0, 0 0, 0 0, 0 -280px; }
  100% { background-position: 0 0, 0 0, 0 0, 0 calc(100vh + 280px); }
}

/* Keep content clear above the animated backdrop */
#main, .site-main, main, .ct-main-content, .site-content, .content-area,
.ct-container, .ct-container-full, .site-content > .ct-container {
  position: relative;
  z-index: 2;
}
.ct-header, .site-header, .ct-footer, .site-footer { position: relative; z-index: 5; }
#main, .site-main, main, .ct-main-content, .site-content, .content-area {
  position: relative;
  z-index: 2 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.ct-container, .ct-container-full, .site-content > .ct-container { position: relative; z-index: 1; }
a { color: var(--cl-accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: #9bd0ff; }
p, li, dd { color: var(--cl-muted); }
strong, b { color: var(--cl-text); }
::selection { background: var(--cl-accent); color: #07111d; }

/* Header and navigation */
.ct-header, .ct-header [data-row], .site-header {
  background: rgba(7,7,8,.88) !important;
  border-bottom: 1px solid var(--cl-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.ct-header, .site-header { position: sticky !important; top: 0; z-index: 100; }
.ct-header [data-row] { min-height: 68px !important; height: auto !important; padding-block: 8px !important; }
.ct-header a, .site-header a, .ct-header .ct-header-text { color: var(--cl-text) !important; }
.ct-header a:hover, .site-header a:hover { color: var(--cl-accent) !important; }
.ct-header nav a { font-size: 12px; font-weight: 600; letter-spacing: .045em; }
.ct-header .current-menu-item > a, .ct-header .current_page_item > a { color: var(--cl-accent) !important; }
.ct-header .sub-menu, #offcanvas {
  background: #111113 !important;
  border: 1px solid var(--cl-line) !important;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.42) !important;
}
#offcanvas a { color: var(--cl-text) !important; }
#offcanvas a:hover { color: var(--cl-accent) !important; background: var(--cl-accent-wash) !important; }

/* Main content and editorial hierarchy */
.entry-header, .hero-section, .ct-hero-section { margin-bottom: 28px; }
.entry-title, .page-title, .entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .wp-block-heading {
  color: var(--cl-text);
  letter-spacing: -.035em;
  line-height: 1.2;
  text-shadow: none;
}
.entry-title, .entry-content h1 { font-weight: 750; letter-spacing: -.045em; }
.entry-title { font-size: clamp(2rem, 4vw, 3.4rem); }
.entry-content h2 { margin-top: 2.2em; padding-top: .25em; font-size: clamp(1.45rem, 2.5vw, 2rem); }
.entry-content h3 { margin-top: 1.6em; font-size: clamp(1.15rem, 2vw, 1.4rem); }
.entry-content p, .entry-content li { line-height: 1.8; }
.entry-content > * { max-width: 100%; }
.entry-content > p, .entry-content > ul, .entry-content > ol { margin-block: 1.15em; }
.entry-content img, .wp-block-image img { border-radius: 14px; }
.entry-content figure { margin-block: 1.6em; }
.entry-content blockquote, blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-left: 3px solid var(--cl-accent);
  border-radius: 0 12px 12px 0;
  background: var(--cl-surface);
  color: var(--cl-muted);
}

/* Bento-like panels for existing Gutenberg content */
.entry-content .wp-block-group,
.entry-content .wp-block-column,
.entry-content .wp-block-media-text,
.entry-content .wp-block-cover,
.entry-content .wp-block-table,
.entry-content .wp-block-quote {
  border-radius: var(--cl-radius);
}
.entry-content .wp-block-group:not(.is-layout-flow):not(.is-layout-constrained) { gap: 18px; }
.entry-content .wp-block-group.has-background,
.entry-content .wp-block-column.has-background,
.entry-content .wp-block-media-text,
.entry-content .wp-block-cover {
  border: 1px solid var(--cl-line);
  overflow: hidden;
}
.entry-content .wp-block-group.has-background,
.entry-content .wp-block-column.has-background { padding: clamp(18px, 3vw, 30px); }
.entry-content .wp-block-separator { border-color: var(--cl-line); opacity: 1; }
.entry-content .wp-block-table { overflow-x: auto; border: 1px solid var(--cl-line); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th { color: var(--cl-text); background: var(--cl-surface-raised); text-align: left; }
.entry-content th, .entry-content td { padding: 12px 14px; border: 1px solid var(--cl-line); }
.entry-content tr:nth-child(even) td { background: rgba(255,255,255,.018); }

/* Code, terminal output, YAML and configuration examples */
.entry-content code, .entry-content kbd, .entry-content samp {
  padding: .15em .4em;
  border: 1px solid rgba(77,163,255,.25);
  border-radius: 5px;
  background: rgba(77,163,255,.10);
  color: #c3e4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
  overflow-wrap: anywhere;
}
.entry-content pre, .entry-content .wp-block-code, .entry-content .wp-block-preformatted {
  max-width: 100%;
  margin: 1.5em 0;
  padding: 18px;
  overflow-x: auto !important;
  border: 1px solid var(--cl-line-strong);
  border-radius: 12px;
  border-left: 3px solid var(--cl-accent);
  background: #0d0d0f !important;
  color: #e4e4e7 !important;
  box-shadow: none;
  line-height: 1.65;
  tab-size: 2;
}
.entry-content pre code, .entry-content .wp-block-code code {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: inherit !important;
  white-space: pre;
  overflow-wrap: normal;
  font-size: 13px;
}

/* Buttons and forms */
button, input[type="button"], input[type="submit"], .wp-block-button__link, .button {
  border: 1px solid var(--cl-accent) !important;
  border-radius: 999px !important;
  background: var(--cl-accent) !important;
  color: #11120e !important;
  font-weight: 700;
  box-shadow: none !important;
  transition: transform .18s ease, background .18s ease;
}
button:hover, input[type="button"]:hover, input[type="submit"]:hover, .wp-block-button__link:hover, .button:hover {
  background: #9bd0ff !important;
  color: #11120e !important;
  transform: translateY(-1px);
}
input, textarea, select {
  max-width: 100%;
  border: 1px solid var(--cl-line-strong) !important;
  border-radius: 10px !important;
  background: var(--cl-surface) !important;
  color: var(--cl-text) !important;
}

/* Article lists, cards, metadata and footer */
article, .ct-related-posts, .ct-posts-container article, .entries article {
  border-color: var(--cl-line);
}
.ct-featured-image img, .post-thumbnail img { border-radius: 14px; }
.entry-meta, .ct-meta-element, .ct-post-meta { color: var(--cl-muted) !important; }
.ct-footer, .site-footer {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  border-top: 1px solid var(--cl-line) !important;
  background: #0b0b0c !important;
  color: var(--cl-muted) !important;
}
.ct-footer a, .site-footer a { color: var(--cl-text) !important; }
.ct-footer a:hover, .site-footer a:hover { color: var(--cl-accent) !important; }
.ct-footer-copyright { font-size: inherit; }

/* Accessibility, responsiveness and reduced motion */
:focus-visible { outline: 2px solid var(--cl-accent) !important; outline-offset: 3px; }
@media (max-width: 999px) {
  .ct-header [data-row] { min-height: 58px !important; padding-block: 5px !important; }
  .entry-content pre, .entry-content .wp-block-code { padding: 14px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .entry-title { font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .entry-content th, .entry-content td { padding: 9px 10px; }
  .entry-content pre, .entry-content .wp-block-code { margin-inline: 0; font-size: 12px; }
  .ct-footer, .site-footer { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Compact, more legible desktop navigation */
@media (min-width: 1000px) {
  .ct-header [data-row="middle"] { min-height: 58px !important; padding-block: 3px !important; }
  .ct-header .ct-container { min-height: 0 !important; }
  .ct-header nav a.ct-menu-link { font-size: 14px !important; line-height: 1.2 !important; letter-spacing: .01em !important; padding: 10px 9px !important; }
  .ct-header .site-title { font-size: 19px !important; line-height: 1.15 !important; }
  .ct-header .menu { gap: 2px !important; }
}
@media (max-width: 999px) {
  .ct-header [data-row="middle"] { min-height: 54px !important; padding-block: 3px !important; }
  .ct-header .site-title { font-size: 17px !important; }
}

/* CLHOME — menú móvil: panel lateral ancho, legible y cómodo al tacto */
@media (max-width: 999px) {
  #offcanvas.ct-panel[data-behaviour="right-side"],
  #offcanvas.ct-panel[data-behaviour="left-side"] {
    width: min(92vw, 420px) !important;
    max-width: 92vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background: #0d1118 !important;
    border-left: 1px solid rgba(77,163,255,.32) !important;
    border-right: 1px solid rgba(77,163,255,.32) !important;
  }
  #offcanvas .ct-panel-inner {
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 14px 12px 20px !important;
    overflow: hidden;
  }
  #offcanvas .ct-panel-actions {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 4px 8px;
  }
  #offcanvas .ct-panel-content[data-device="mobile"] {
    display: block !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 4px 2px 18px !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #offcanvas .ct-panel-content-inner,
  #offcanvas nav,
  #offcanvas .menu,
  #offcanvas .menu-item {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }
  #offcanvas nav.mobile-menu > ul > li {
    margin: 3px 0 !important;
  }
  #offcanvas a.ct-menu-link {
    display: flex !important;
    align-items: center;
    min-height: 54px !important;
    padding: 14px 14px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.4 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    border-radius: 10px !important;
  }
  #offcanvas .ct-sub-menu-parent {
    display: flex;
    align-items: stretch;
    width: 100%;
  }
  #offcanvas .ct-sub-menu-parent > a {
    flex: 1 1 auto;
    min-width: 0;
  }
  #offcanvas .ct-toggle-dropdown-mobile {
    flex: 0 0 48px;
    min-width: 48px !important;
    min-height: 48px !important;
    align-self: center;
    border-radius: 10px !important;
  }
  #offcanvas .sub-menu {
    margin: 4px 0 12px 12px !important;
    padding: 4px 0 4px 10px !important;
    border-left: 2px solid rgba(77,163,255,.42) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #offcanvas .sub-menu a.ct-menu-link {
    min-height: 50px !important;
    padding: 12px 12px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
  }
  #offcanvas .current-menu-item > a,
  #offcanvas .current_page_item > a {
    background: rgba(77,163,255,.16) !important;
    color: #9bd0ff !important;
  }
}
@media (max-width: 380px) {
  #offcanvas.ct-panel[data-behaviour="right-side"],
  #offcanvas.ct-panel[data-behaviour="left-side"] {
    width: 94vw !important;
    max-width: 94vw !important;
  }
  #offcanvas .ct-panel-inner { padding: 10px 8px 16px !important; }
  #offcanvas a.ct-menu-link { font-size: 16px !important; }
}
