/* ============================================================
   IN — inpresencia.com
   Ghost Theme — editorial system v1
   Brandbook v2.1
   ============================================================ */

/* ---- Fuentes locales ------------------------------------- */

@font-face {
  font-family: 'Lovan';
  src: url('../fonts/Lovan.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable-Italic.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---- Reset & base ---------------------------------------- */

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

:root {
  --power:     #171717;
  --soul:      #F3F3F3;
  --gray-mid:  #9C9C9C;
  --gray-dark: #2a2a2a;
  --gray-deep: #1e1e1e;

  --bg:        var(--power);
  --bg-mid:    var(--gray-deep);
  --text:      var(--soul);
  --muted:     var(--gray-mid);
  --border:    var(--gray-dark);

  --font-brand: 'Lovan', Georgia, serif;
  --font-head:  'Inter', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;

  --px:    clamp(28px, 6vw, 80px);
  --nav-h: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Animaciones ----------------------------------------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-slow {
  opacity: 0;
  transition: opacity 1.4s ease;
}

.reveal-slow.visible {
  opacity: 1;
}

/* ---- Layout base ----------------------------------------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--px);
}

.gh-main {
  padding-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
}

/* ---- NAVEGACIÓN ------------------------------------------ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

.site-nav.scrolled {
  background: rgba(23, 23, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Lovan', serif;
  font-style: italic;
  font-size: 2rem;
  color: var(--soul);
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.3s ease;
}

.nav-logo:hover {
  opacity: 0.6;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--soul);
}

/* ---- LÍNEA DIVISORA -------------------------------------- */

.divider {
  width: 40px;
  height: 1px;
  background: var(--gray-dark);
  margin: 0 auto;
}

/* ---- HOMEPAGE — feed de posts ---------------------------- */

.feed-section {
  padding: 80px 0 120px;
}

.feed-header {
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.feed-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.feed-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 100;
  color: var(--soul);
  text-transform: lowercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.post-feed {
  display: flex;
  flex-direction: column;
}

.post-card {
  border-bottom: 1px solid var(--border);
  list-style: none;
}

.post-card-link {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 40px 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.post-card:has(.post-card-image) .post-card-link {
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.post-card-link:hover {
  opacity: 0.75;
}

.post-card-image {
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
  transition: filter 0.4s ease;
}

.post-card-link:hover .post-card-image img {
  filter: brightness(1);
}

.post-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-card-title {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 100;
  color: var(--soul);
  line-height: 1.3;
  text-transform: lowercase;
  letter-spacing: -0.01em;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
}

.no-posts {
  padding: 80px 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* ---- PAGINACIÓN ------------------------------------------ */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0 0;
  border-top: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pagination a {
  color: var(--soul);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.pagination a:hover {
  opacity: 0.6;
}

/* ---- SINGLE POST ----------------------------------------- */

.post-article {
  padding-bottom: 120px;
}

.post-header {
  padding: 80px 0 48px;
  max-width: 760px;
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.post-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 100;
  color: var(--soul);
  text-transform: lowercase;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.post-excerpt {
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 100;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
}

.post-feature-image {
  margin-bottom: 64px;
}

.post-feature-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  display: block;
  filter: brightness(0.88);
}

.post-content {
  max-width: 720px;
}

.post-footer {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.post-back {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-back:hover {
  color: var(--soul);
}

/* ---- CONTENIDO GHOST (.gh-content) ----------------------- */

.gh-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

.gh-content > * + * {
  margin-top: 1.5em;
}

.gh-content h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 100;
  color: var(--soul);
  text-transform: lowercase;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 2.5em;
  margin-bottom: 0.5em;
}

.gh-content h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.gh-content p {
  color: var(--muted);
}

.gh-content strong {
  font-weight: 400;
  color: var(--soul);
}

.gh-content em {
  font-style: italic;
  color: var(--soul);
}

.gh-content a {
  color: var(--soul);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.gh-content a:hover {
  opacity: 1;
}

.gh-content blockquote {
  border-left: 1px solid var(--gray-dark);
  padding-left: 28px;
  margin-left: 0;
  font-style: italic;
  font-weight: 100;
  font-size: 1.1rem;
  color: var(--soul);
  line-height: 1.6;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--gray-dark);
  margin: 3em auto;
  width: 40px;
}

.gh-content img {
  max-width: 100%;
  display: block;
  filter: brightness(0.88);
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
  color: var(--muted);
}

.gh-content li {
  margin-bottom: 0.4em;
}

.gh-content pre {
  background: var(--gray-deep);
  border: 1px solid var(--border);
  padding: 24px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.gh-content code {
  font-size: 0.875em;
  background: var(--gray-deep);
  padding: 2px 6px;
  color: var(--soul);
}

.gh-content pre code {
  background: none;
  padding: 0;
}

/* Botones de Ghost (suscripción, etc.) */
.gh-content .kg-button-card a {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soul);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: 100px;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.gh-content .kg-button-card a:hover {
  background: var(--soul);
  color: var(--power);
  border-color: var(--soul);
  opacity: 1;
}

/* Cards de Ghost */
.gh-content .kg-card {
  margin: 2em 0;
}

/* Anchos wide y full requeridos por Ghost */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 2em auto;
  left: 50%;
  right: 50%;
  transform: translateX(-50%);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  display: block;
  filter: brightness(0.88);
}

.gh-content .kg-image-card img {
  margin: 0 auto;
}

.gh-content .kg-caption {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 10px;
}

.gh-content .kg-embed-card {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.gh-content .kg-embed-card iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---- PÁGINA ESTÁTICA (About, etc.) ----------------------- */

.page-article {
  padding: 80px 0 120px;
  max-width: 760px;
}

.page-header {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 100;
  color: var(--soul);
  text-transform: lowercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-feature-image {
  margin-top: 40px;
}

.page-feature-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  filter: brightness(0.88);
}

.page-content {
  color: var(--muted);
}

/* ---- ERROR PAGE ------------------------------------------ */

.error-content {
  min-height: calc(100vh - var(--nav-h) - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
}

.error-code {
  font-family: var(--font-head);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 100;
  color: var(--gray-dark);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.error-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 100;
  color: var(--soul);
  text-transform: lowercase;
  margin-bottom: 16px;
}

.error-body {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.error-link {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soul);
  text-decoration: none;
  border-bottom: 1px solid rgba(243,243,243,0.2);
  padding-bottom: 4px;
  transition: border-color 0.3s ease;
  opacity: 0.65;
}

.error-link:hover {
  opacity: 1;
  border-color: rgba(243,243,243,0.6);
}

/* ---- PAYWALL -------------------------------------------- */

.post-paywall {
  border-top: 1px solid var(--border);
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.paywall-message {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 100;
  font-style: italic;
  color: var(--muted);
}

.paywall-link {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soul);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: 100px;
  width: fit-content;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.paywall-link:hover {
  background: var(--soul);
  color: var(--power);
  border-color: var(--soul);
}

/* ---- FOOTER --------------------------------------------- */

footer {
  padding: 64px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .footer-logo {
  display: block;
  font-family: 'Lovan', serif;
  font-style: italic;
  font-size: 1.8rem;
  color: var(--soul);
  text-decoration: none;
  margin-bottom: 12px;
  opacity: 0.4;
  line-height: 1;
  transition: opacity 0.4s ease;
}

.footer-brand .footer-logo:hover {
  opacity: 0.85;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
  align-items: center;
}

.footer-links a {
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--gray-dark);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---- Responsive ----------------------------------------- */

@media (max-width: 768px) {
  .post-card:has(.post-card-image) .post-card-link {
    grid-template-columns: 1fr;
  }

  .post-card-image img {
    height: 220px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .post-header {
    max-width: 100%;
  }

  .post-content {
    max-width: 100%;
  }

  .post-footer {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .nav-links a:not(:last-child) {
    display: none;
  }
}
