/*
Theme Name: Órbita Sur
Theme URI: https://orbitasur.cl
Author: Órbita Sur
Description: Tema a medida del blog de Órbita Sur — identidad cosmos/coral/jade del Manual de Marca v2.0. Diseñado para lectura editorial y captación de newsletter.
Version: 1.0.0
Requires PHP: 7.4
License: Proprietary
Text Domain: orbitasur
*/

:root {
  --cosmos: #161B33;
  --cosmos-deep: #0D0F1F;
  --coral: #FF6B5B;
  --jade: #7FB8A4;
  --hueso: #F2EDE4;
  --dorado: #B89968;

  --bg: var(--cosmos);
  --text: var(--hueso);
  --text-mute: rgba(242, 237, 228, 0.6);
  --text-soft: rgba(242, 237, 228, 0.85);
  --line: rgba(242, 237, 228, 0.12);
  --line-strong: rgba(242, 237, 228, 0.28);
  --glass: rgba(242, 237, 228, 0.04);

  --font-sans: 'Nunito Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Textura cosmos sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 107, 91, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 15% 90%, rgba(127, 184, 164, 0.03) 0%, transparent 50%);
}

a { color: var(--coral); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--hueso); }
img { max-width: 100%; height: auto; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 40px;
  background: rgba(13, 15, 31, 0.85);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .mark {
  font-size: 21px;
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand .mark .l { font-weight: 200; }
.brand .mark .b { font-weight: 600; }
.brand .sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--jade);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--coral); border-bottom-color: var(--coral); }
.site-nav .nav-cta {
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  color: var(--text);
  border-radius: 0;
  transition: all 0.3s;
}
.site-nav .nav-cta:hover { border-color: var(--coral); color: var(--coral); }

/* ============ Layout ============ */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}
.wrap--narrow { max-width: 760px; }

/* ============ Hero del blog ============ */
.blog-hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--coral);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 42px; height: 1px; background: var(--coral); }
.blog-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.blog-hero h1 em { font-style: normal; font-weight: 500; color: var(--coral); }
.blog-hero p {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-soft);
  max-width: 60ch;
}

/* ============ Grid de posts ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  padding-bottom: 80px;
}
.post-card {
  border: 1px solid var(--line);
  background: var(--glass);
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s, transform 0.4s, background 0.4s;
}
.post-card::before {
  content: '';
  position: absolute; top: -1px; left: -1px;
  width: 26px; height: 1px; background: var(--coral);
}
.post-card::after {
  content: '';
  position: absolute; top: -1px; left: -1px;
  width: 1px; height: 26px; background: var(--coral);
}
.post-card:hover {
  border-color: var(--line-strong);
  background: rgba(242, 237, 228, 0.06);
  transform: translateY(-3px);
}
.post-card .thumb {
  margin: -28px -28px 22px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.post-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.02);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.post-card:hover .thumb img { transform: scale(1.04); }
.post-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 12px;
}
.post-meta .cat { color: var(--dorado); }
.post-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 12px;
}
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--coral); }
.post-card .excerpt {
  font-size: 14px;
  color: var(--text-soft);
  flex: 1;
}
.post-card .more {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ============ Entrada individual ============ */
.entry-header { padding: 72px 0 40px; }
.entry-header h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 14px;
}
.entry-thumb {
  margin: 8px 0 40px;
  border: 1px solid var(--line);
}
.entry-thumb img { display: block; width: 100%; }

.entry-content {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-soft);
  padding-bottom: 56px;
}
.entry-content > * + * { margin-top: 1.4em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2em;
}
.entry-content h2 { font-size: 27px; font-weight: 600; }
.entry-content h2::before {
  content: '// ';
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 0.65em;
  vertical-align: middle;
  letter-spacing: 0.1em;
}
.entry-content h3 { font-size: 21px; font-weight: 600; }
.entry-content strong { color: var(--text); }
.entry-content blockquote {
  border-left: 2px solid var(--coral);
  background: var(--glass);
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 300;
  color: var(--text);
}
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-top: 0.5em; }
.entry-content li::marker { color: var(--coral); }
.entry-content a { border-bottom: 1px solid rgba(255, 107, 91, 0.4); }
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--cosmos-deep);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 3px;
}
.entry-content pre {
  background: var(--cosmos-deep);
  border: 1px solid var(--line);
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content img { border: 1px solid var(--line); }
.entry-content figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-top: 10px;
}
.entry-content table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.entry-content th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--jade); }

/* CTA final de artículo */
.entry-cta {
  margin: 24px 0 72px;
  padding: 36px 40px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(255, 107, 91, 0.06), rgba(184, 153, 104, 0.04));
  position: relative;
}
.entry-cta::before { content: ''; position: absolute; top: -1px; left: -1px; width: 36px; height: 1px; background: var(--coral); }
.entry-cta::after  { content: ''; position: absolute; top: -1px; left: -1px; width: 1px; height: 36px; background: var(--coral); }
.entry-cta h3 { font-size: 21px; font-weight: 300; margin-bottom: 10px; }
.entry-cta h3 em { font-style: normal; font-weight: 600; color: var(--coral); }
.entry-cta p { font-size: 14px; color: var(--text-soft); margin-bottom: 20px; max-width: 60ch; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--coral);
  color: var(--cosmos);
  border: 1px solid var(--coral);
  transition: background 0.3s, color 0.3s;
}
.btn:hover { background: var(--hueso); border-color: var(--hueso); color: var(--cosmos); }

/* Navegación entre posts */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 72px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.post-nav a { max-width: 44%; color: var(--text-soft); }
.post-nav a:hover { color: var(--coral); }
.post-nav .lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}

/* Paginación */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0 80px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.pagination .page-numbers {
  padding: 10px 16px;
  border: 1px solid var(--line);
  color: var(--text-mute);
}
.pagination .page-numbers.current { border-color: var(--coral); color: var(--coral); }
.pagination a.page-numbers:hover { border-color: var(--line-strong); color: var(--text); }

/* ============ Newsletter band ============ */
.news-band {
  border-top: 1px solid var(--line);
  background: var(--cosmos-deep);
  position: relative;
  z-index: 1;
}
.news-band .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.news-copy .nb-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 10px;
}
.news-copy h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 300; }
.news-copy h3 em { font-style: normal; font-weight: 600; color: var(--jade); }
.news-copy p { font-size: 12.5px; color: var(--text-mute); margin-top: 6px; }
.news-form { display: flex; flex: 0 1 440px; min-width: 280px; flex-wrap: wrap; }
.news-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 15px 18px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-right: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  border-radius: 0;
}
.news-form input[type="email"]:focus { border-color: var(--coral); }
.news-form button {
  padding: 15px 24px;
  background: var(--coral);
  border: 1px solid var(--coral);
  color: var(--cosmos);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s;
}
.news-form button:hover { background: var(--hueso); border-color: var(--hueso); }
.news-msg {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-top: 10px;
  color: var(--jade);
  display: none;
}
.news-msg.error { color: var(--coral); }
.news-msg.is-visible { display: block; }

/* Caja de newsletter incrustada en entradas — shortcode [newsletter_orbita] */
.news-inline {
  margin: 2.4em 0;
  padding: 32px 36px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(127, 184, 164, 0.07), rgba(255, 107, 91, 0.05));
  position: relative;
}
.news-inline::before { content: ''; position: absolute; top: -1px; left: -1px; width: 32px; height: 1px; background: var(--jade); }
.news-inline::after  { content: ''; position: absolute; top: -1px; left: -1px; width: 1px; height: 32px; background: var(--jade); }
.news-inline .nb-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 12px;
}
.news-inline h3 {
  font-size: 22px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.news-inline h3 em { font-style: normal; font-weight: 600; color: var(--coral); }
.news-inline p { font-size: 14px !important; color: var(--text-soft); margin: 0 0 20px !important; }
.news-inline .news-form { display: flex; flex-wrap: wrap; max-width: 480px; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--cosmos-deep);
  position: relative;
  z-index: 1;
}
.site-footer .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.site-footer .dot { color: var(--jade); }
.site-footer a { color: var(--text-mute); }
.site-footer a:hover { color: var(--coral); }

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .site-header { padding: 16px 20px; }
  .site-nav { gap: 16px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .site-nav a.blog-link,
  .site-nav a.home-link { display: inline-block; }
  .wrap { padding: 0 20px; }
  .blog-hero { padding: 56px 0 40px; margin-bottom: 40px; }
  .news-band .inner, .site-footer .inner { padding-left: 20px; padding-right: 20px; }
  .post-nav a { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* Utilidades WP */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { width: 100%; }
