/* ══════════════════════════════════════════════
   NOTAS.CSS — Página de publicaciones personales
══════════════════════════════════════════════ */

/* ── Hero ── */

.notas-hero {
  background:
    linear-gradient(135deg, rgba(16, 32, 39, 0.96) 0%, rgba(97, 114, 79, 0.72) 100%),
    url("../img/hero-bg.jpg") center / cover;
  color: var(--white);
  padding: 92px clamp(18px, 7vw, 88px) 72px;
}

.notas-hero-inner {
  width: min(860px, 100%);
}

.notas-hero h1 {
  margin: 16px 0 18px;
  color: var(--white);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.02;
}

.notas-hero > .notas-hero-inner > p {
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.1rem;
}

/* ── Main layout ── */

.notas-main {
  padding: 52px clamp(18px, 6vw, 76px) 86px;
}

.notas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  column-gap: 40px;
  row-gap: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
  align-items: start; /* evita que las filas se estiren verticalmente */
}

/* ── Search bar ── */

.notas-search {
  grid-column: 1;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 4px 12px 4px 18px;
  margin-bottom: 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.notas-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 111, 104, 0.10);
}

.notas-search-icon {
  color: var(--muted);
  font-size: 1.05rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.notas-search:focus-within .notas-search-icon {
  color: var(--teal);
}

.notas-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 0;
  outline: none;
  min-width: 0;
}

.notas-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Quitar el botón "x" nativo del input type="search" */
.notas-search-input::-webkit-search-decoration,
.notas-search-input::-webkit-search-cancel-button,
.notas-search-input::-webkit-search-results-button {
  display: none;
}

.notas-search-shortcut {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-2);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 6px;
  transition: opacity 180ms ease;
}

.notas-search:focus-within .notas-search-shortcut {
  opacity: 0;
  pointer-events: none;
}

.notas-search-clear {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  margin-left: 8px;
  transition: background 160ms ease, color 160ms ease;
}

.notas-search-clear:hover {
  background: var(--paper-2);
  color: var(--ink);
}

/* ── Results count & empty state ── */

.notas-results-count {
  grid-column: 1;
  display: none;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.notas-empty {
  grid-column: 1;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.notas-empty:not([hidden]) {
  display: flex;
}

.notas-empty > i {
  font-size: 2.2rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.notas-empty h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.1rem;
}

.notas-empty p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.notas-empty .button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.notas-empty .button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

/* ── Filters ── */

.notas-filters {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.notas-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 7px 15px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.notas-filter i {
  font-size: 0.9rem;
  color: var(--teal);
}

.notas-filter:hover:not(.is-active) {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.notas-filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.notas-filter.is-active i {
  color: var(--gold);
}

/* Dark mode: el truco --ink/--white invertido hace que el activo se vea
   "claro con texto oscuro" en vez de "oscuro con texto claro". Forzamos
   colores explícitos para mantener la coherencia visual. */
[data-theme="dark"] .notas-filter.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

[data-theme="dark"] .notas-filter.is-active i {
  color: var(--gold);
}

[data-theme="dark"] .notas-filter:hover:not(.is-active) {
  border-color: var(--teal);
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

/* ── Cards grid ── */

.notas-grid {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

/* ── Single note card ── */

.nota-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.nota-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.nota-card-featured {
  grid-column: span 2;
  background: var(--ink);
}

.nota-card-featured .nota-meta time {
  color: rgba(255, 255, 255, 0.5);
}

.nota-card-featured h2 a {
  color: var(--white);
}

.nota-card-featured p {
  color: rgba(255, 255, 255, 0.72);
}

.nota-card-featured .nota-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.nota-card-featured .nota-link {
  color: var(--gold);
  border-bottom-color: rgba(196, 134, 60, 0.4);
}

.nota-card-featured .nota-footer > span {
  color: rgba(255, 255, 255, 0.45);
}

.nota-card-external .nota-card-featured {
  background: var(--ink);
}

/* ── Card internals ── */

.nota-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nota-meta time {
  color: var(--muted);
  font-size: 0.8rem;
}

.nota-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.nota-card h2 a {
  color: var(--ink);
  transition: color 160ms ease;
}

.nota-card h2 a:hover {
  color: var(--teal-dark);
}

.nota-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  flex: 1;
}

.nota-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.nota-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid rgba(196, 134, 60, 0.55);
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 800;
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}

.nota-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nota-footer > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.nota-ext-icon {
  font-size: 0.75em;
  vertical-align: super;
}

/* ── Tags ── */

.nota-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 9px;
  text-transform: uppercase;
}

.nota-tag-economia  { background: rgba(31, 111, 104, 0.1);  color: var(--teal-dark); }
.nota-tag-tecnologia { background: rgba(16, 32, 39, 0.08);  color: var(--ink); }
.nota-tag-crecimiento { background: rgba(97, 114, 79, 0.12); color: var(--olive); }
.nota-tag-hobbies   { background: rgba(196, 134, 60, 0.12); color: #8a5c1e; }
.nota-tag-recursos  { background: rgba(191, 91, 69, 0.1);   color: var(--clay); }

/* ── Sidebar ── */

.notas-sidebar {
  grid-column: 2;
  grid-row: 1 / span 100;  /* abarca todas las filas (sin grid-template-rows explícito) */
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: calc(var(--header) + 18px);
  align-self: start;
}

.notas-widget {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.notas-widget .eyebrow {
  margin-bottom: 12px;
}

.notas-widget > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ── Newsletter widget ── */

.notas-widget-newsletter {
  background: linear-gradient(135deg, var(--ink) 0%, var(--teal-dark) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

.notas-widget-newsletter .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
}

.notas-widget-newsletter > p {
  color: rgba(255, 255, 255, 0.78);
}

.newsletter-input-group {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease;
}

.newsletter-input-group:focus-within {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
}

.newsletter-input-group input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}

.newsletter-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.newsletter-submit {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--gold);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  margin: 3px;
  border-radius: 6px;
  transition: background 160ms ease;
}

.newsletter-submit:hover:not(:disabled) {
  background: #d49e58;
}

.newsletter-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.newsletter-feedback {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.newsletter-feedback.is-ok  { color: var(--gold); }
.newsletter-feedback.is-err { color: #f4a98c; }

.newsletter-fine-print {
  margin: 12px 0 0 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.72rem !important;
  line-height: 1.5;
}

.newsletter-fine-print a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notas-cat-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.notas-cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px 12px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.notas-cat-btn i {
  color: var(--teal);
}

.notas-cat-btn:hover,
.notas-cat-btn.is-active {
  border-color: var(--teal);
  background: rgba(31, 111, 104, 0.06);
}

.notas-tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  transition: background 160ms ease;
}

.notas-tool-link i {
  color: var(--teal);
  font-size: 1.05rem;
}

.notas-tool-link:hover {
  background: var(--paper-2);
}

/* ── Breadcrumbs del artículo ── */

.nota-breadcrumb {
  margin: 0 0 22px;
}

.nota-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.nota-breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
}

.nota-breadcrumb li + li::before {
  content: "/";
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.32);
  font-weight: 400;
}

.nota-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}

.nota-breadcrumb a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nota-breadcrumb li[aria-current="page"] {
  color: var(--white);
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .nota-breadcrumb ol {
    font-size: 0.78rem;
  }

  .nota-breadcrumb li[aria-current="page"] {
    max-width: 100%;
  }
}

/* ── Article page (notas/*.html) ── */

.nota-article-hero {
  background:
    linear-gradient(135deg, rgba(16, 32, 39, 0.96) 0%, rgba(31, 111, 104, 0.72) 100%),
    url("../assets/img/hero-bg.jpg") center / cover;
  color: var(--white);
  padding: 86px clamp(18px, 7vw, 88px) 68px;
}

.nota-article-hero-inner {
  width: min(800px, 100%);
}

.nota-article-hero .nota-meta {
  margin-bottom: 16px;
}

.nota-article-hero h1 {
  margin: 0 0 18px;
  color: var(--white);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.nota-article-hero > .nota-article-hero-inner > p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.12rem;
  margin: 0;
}

.nota-article-body {
  padding: 64px clamp(18px, 6vw, 76px) 86px;
}

.nota-article-content {
  width: min(740px, 100%);
  margin: 0 auto;
}

.nota-article-content h2 {
  margin: 40px 0 14px;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.8rem;
}

.nota-article-content h3 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 1.15rem;
}

.nota-article-content p {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 1.8;
}

.nota-article-content ul,
.nota-article-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 1.8;
}

.nota-article-content li {
  margin-bottom: 6px;
}

.nota-article-content blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--gold);
  background: rgba(196, 134, 60, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.7;
}

.nota-article-content a {
  color: var(--teal-dark);
  border-bottom: 1px solid rgba(31, 111, 104, 0.35);
  transition: color 160ms ease, border-color 160ms ease;
}

.nota-article-content a:hover {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.nota-nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: min(740px, 100%);
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.nota-nav-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 0.9rem;
  border-bottom: 2px solid rgba(196, 134, 60, 0.5);
  padding-bottom: 2px;
  transition: color 160ms ease;
}

.nota-nav-bottom a:hover {
  color: var(--gold);
}

/* ── Reading progress bar ── */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1100;
  background: rgba(16, 32, 39, 0.1);
  pointer-events: none;
}

.reading-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 100ms linear;
}

/* ── Back to top ── */

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 800;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 1.15rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* ── Share bar ── */

.share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(740px, 100%);
  margin: 0 auto 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.share-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 12px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.share-wa:hover  { border-color: #25d366; color: #128c4e; }
.share-x:hover   { border-color: var(--ink); background: var(--ink); color: var(--white); }
.share-li:hover  { border-color: #0a66c2; color: #0a66c2; }
.share-copy:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ── Print styles ── */

@media print {
  .site-header,
  .nota-article-hero,
  .nota-nav-bottom,
  .share-bar,
  .reading-progress,
  .back-to-top,
  .notas-sidebar,
  .site-footer {
    display: none !important;
  }

  body {
    background: white;
    color: #000;
    font-size: 12pt;
  }

  .nota-article-body {
    padding: 0;
  }

  .nota-article-content {
    width: 100%;
    max-width: 100%;
  }

  .nota-article-content a {
    color: #000;
    text-decoration: underline;
  }

  .nota-article-content a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }

  .nota-article-content a[href^="#"]::after,
  .nota-article-content a[href^="javascript"]::after {
    content: "";
  }

  blockquote {
    border-left: 3pt solid #999;
    background: #f5f5f5 !important;
    padding: 8pt 12pt;
  }

  h1, h2, h3 { page-break-after: avoid; }
  p, li       { orphans: 3; widows: 3; }
}

/* ── Responsive ── */

@media (max-width: 1000px) {
  .notas-layout {
    grid-template-columns: 1fr;
  }

  .notas-sidebar {
    grid-column: 1;
    grid-row: auto;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 700px) {
  .notas-grid {
    grid-template-columns: 1fr;
  }

  .nota-card-featured {
    grid-column: span 1;
  }

  .notas-sidebar {
    grid-template-columns: 1fr;
  }
}
