/*
Theme Name:   Alejandro Blog
Theme URI:    https://alejandrobarahona.com/blog
Description:  Custom standalone blog theme for Alejandro Barahona
Author:       Alejandro Barahona
Author URI:   https://alejandrobarahona.com
Version:      1.0.0
Text Domain:  alejandro-blog
Tags:         blog, custom, responsive
*/

/* ══════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════ */
:root {
  --ink:    #0f0e0d;
  --ink2:   #3d3a35;
  --ink3:   #7a756e;
  --paper:  #f8f5f0;
  --paper2: #efeae2;
  --paper3: #e4ddd2;
  --gold:   #b8924a;
  --gold2:  #d4a95a;
  --blue:   #1a3a5c;
  --blue2:  #2a5a8c;
  --serif:  'Fraunces', Georgia, serif;
  --sans:   'DM Sans', system-ui, sans-serif;
  --max:    720px;
  --wide:   1100px;
}

/* ══════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .4;
}

* { position: relative; z-index: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

/* ══════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,245,240,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--paper3);
}

.nav-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-logo-dot { color: var(--gold); }

.nav-logo-sub {
  font-size: .72rem;
  font-weight: 400;
  color: var(--ink3);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-left: 1px solid var(--paper3);
  padding-left: .5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink2);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--gold); }
.nav-links a.active { color: var(--blue); border-bottom: 1.5px solid var(--gold); padding-bottom: 1px; }

.nav-hire {
  background: var(--blue);
  color: #fff !important;
  padding: .35rem .9rem;
  border-radius: 3px;
  font-size: .78rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: .02em !important;
}

.nav-hire:hover { background: var(--blue2); color: #fff !important; }

/* ══════════════════════════════════════════════════
   BLOG INDEX HERO
══════════════════════════════════════════════════ */
.blog-hero {
  background: linear-gradient(160deg, var(--paper) 55%, var(--paper2) 100%);
  padding: 5rem 2rem 3rem;
  border-bottom: 1px solid var(--paper3);
}

.blog-hero-inner { max-width: var(--wide); margin: 0 auto; }

.blog-hero-tag {
  display: inline-block;
  font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold2);
  padding: .3rem .9rem; border-radius: 2rem;
  margin-bottom: 1.25rem;
}

.blog-hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: .75rem;
}

.blog-hero h1 em { font-style: italic; color: var(--blue); }

.blog-hero-desc {
  font-size: .97rem; color: var(--ink3);
  max-width: 520px; line-height: 1.7;
}

/* ══════════════════════════════════════════════════
   BLOG MAIN LAYOUT
══════════════════════════════════════════════════ */
.blog-main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: start;
}

/* ══════════════════════════════════════════════════
   POST CARDS
══════════════════════════════════════════════════ */
.posts-list { display: flex; flex-direction: column; }

.post-card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--paper3);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.post-card:first-child { padding-top: 0; }
.post-card:last-child { border-bottom: none; }

.post-meta {
  display: flex; align-items: center;
  gap: .75rem; margin-bottom: .6rem; flex-wrap: wrap;
}

.post-category {
  font-size: .7rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold2);
  padding: .2rem .65rem; border-radius: 2rem;
}

.post-date, .post-read-time {
  font-size: .78rem; color: var(--ink3);
}

.post-read-time::before { content: '·'; margin-right: .5rem; }

.post-title {
  font-family: var(--serif);
  font-size: 1.35rem; font-weight: 400;
  line-height: 1.3; color: var(--ink);
  margin-bottom: .6rem;
  transition: color .2s;
}

.post-card:hover .post-title { color: var(--blue); }

.post-excerpt {
  font-size: .9rem; color: var(--ink3);
  line-height: 1.7; margin-bottom: .9rem;
}

.post-read-link {
  font-size: .82rem; font-weight: 500;
  color: var(--blue);
  display: inline-flex; align-items: center; gap: .35rem;
  transition: gap .2s, color .2s;
}

.post-read-link:hover { color: var(--gold); gap: .6rem; }

.post-thumb {
  width: 120px; height: 90px;
  border-radius: 4px; object-fit: cover;
  border: 1px solid var(--paper3);
}

.post-thumb-placeholder {
  width: 120px; height: 90px;
  border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}

/* ══════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════ */
.blog-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.sidebar-widget {
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.sidebar-widget-title {
  font-size: .7rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--paper3);
}

.author-widget { text-align: center; }

.author-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  margin: 0 auto .7rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.3rem;
  color: rgba(255,255,255,.85);
  overflow: hidden;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-name { font-family: var(--serif); font-size: .95rem; color: var(--ink); margin-bottom: .2rem; }
.author-role { font-size: .75rem; color: var(--ink3); margin-bottom: .65rem; }
.author-bio { font-size: .8rem; color: var(--ink2); line-height: 1.6; margin-bottom: .9rem; }

.author-cta {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--blue); color: #fff;
  font-size: .78rem; font-weight: 500;
  padding: .45rem 1rem; border-radius: 3px;
  transition: background .2s;
}

.author-cta:hover { background: var(--blue2); color: #fff; }

.category-list { list-style: none; display: flex; flex-direction: column; gap: .35rem; }

.category-list li {
  display: flex; align-items: center;
  justify-content: space-between;
}

.category-list a {
  font-size: .85rem; color: var(--ink2);
  display: flex; align-items: center; gap: .5rem;
}

.category-list a::before {
  content: ''; width: 4px; height: 4px;
  border-radius: 50%; background: var(--gold);
}

.category-count {
  font-size: .72rem; color: var(--ink3);
  background: var(--paper); padding: 1px 7px; border-radius: 2rem;
}

.wa-sidebar { background: var(--blue); border: none; }
.wa-sidebar .sidebar-widget-title { color: rgba(255,255,255,.5); border-bottom-color: rgba(255,255,255,.12); }
.wa-sidebar-text { font-size: .85rem; color: rgba(255,255,255,.7); line-height: 1.6; margin-bottom: .9rem; }

.btn-wa-small {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #25D366; color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: .55rem 1.1rem; border-radius: 3px;
  transition: all .2s;
}

.btn-wa-small:hover { background: #20bc5a; color: #fff; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════
   SINGLE POST
══════════════════════════════════════════════════ */
.single-hero {
  background: linear-gradient(160deg, var(--paper) 55%, var(--paper2) 100%);
  padding: 5rem 2rem 3rem;
  border-bottom: 1px solid var(--paper3);
}

.single-hero-inner { max-width: var(--max); margin: 0 auto; }

.single-meta {
  display: flex; align-items: center;
  gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}

.single-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.15; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 1.1rem;
}

.single-excerpt {
  font-size: 1.05rem; color: var(--ink3);
  line-height: 1.7; font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 1rem; margin-bottom: 1.5rem;
}

.single-author-row { display: flex; align-items: center; gap: .75rem; }

.single-author-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: .88rem;
  color: rgba(255,255,255,.85); overflow: hidden; flex-shrink: 0;
}

.single-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.single-author-name { font-size: .88rem; font-weight: 500; color: var(--ink); }
.single-author-role { font-size: .75rem; color: var(--ink3); }

.single-featured { max-width: var(--max); margin: 2rem auto; padding: 0 2rem; }
.single-featured img { width: 100%; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.1); }

.single-content-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 5rem; align-items: start;
}

.single-content { font-size: 1.03rem; line-height: 1.85; color: var(--ink2); }

.single-content h2 {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 400;
  color: var(--ink); margin: 2.5rem 0 .75rem; line-height: 1.2;
}

.single-content h3 {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 400;
  color: var(--ink); margin: 2rem 0 .6rem;
}

.single-content p { margin-bottom: 1.4rem; }

.single-content a { color: var(--blue); border-bottom: 1px solid var(--paper3); }
.single-content a:hover { color: var(--gold); border-bottom-color: var(--gold2); }

.single-content ul, .single-content ol { margin: 0 0 1.4rem 1.5rem; }
.single-content li { margin-bottom: .4rem; }

.single-content blockquote {
  border-left: 3px solid var(--gold);
  padding: .75rem 1.5rem; margin: 1.5rem 0;
  background: var(--paper2); border-radius: 0 4px 4px 0;
  font-family: var(--serif); font-size: 1.1rem;
  font-style: italic; color: var(--ink);
}

.single-content code {
  font-family: 'Courier New', monospace; font-size: .88em;
  background: var(--paper2); padding: .15em .4em;
  border-radius: 3px; color: var(--blue);
}

.single-content pre {
  background: var(--ink); color: #e8e3dc;
  padding: 1.5rem; border-radius: 6px;
  overflow-x: auto; margin: 1.5rem 0;
  font-size: .88rem; line-height: 1.6;
}

.single-content pre code { background: none; color: inherit; padding: 0; }

.single-content img { border-radius: 6px; margin: 1.5rem 0; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.single-content hr { border: none; border-top: 1px solid var(--paper3); margin: 2.5rem 0; }

.single-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 1.5rem;
}

/* Share */
.post-share {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin: 2rem 0;
  padding: 1.1rem 1.3rem;
  background: var(--paper2); border-radius: 8px;
  border: 1px solid var(--paper3);
}

.post-share-label {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink3); flex-shrink: 0;
}

.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 500;
  padding: .35rem .85rem; border-radius: 3px;
  border: 1px solid var(--paper3);
  color: var(--ink2); background: var(--paper);
  transition: all .2s;
}

.share-btn:hover { border-color: var(--ink3); color: var(--ink); }
.share-btn.wa { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn.wa:hover { background: #20bc5a; color: #fff; border-color: #20bc5a; }
.share-btn.li { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.share-btn.li:hover { background: #0958a8; color: #fff; border-color: #0958a8; }

/* Post nav */
.post-nav {
  max-width: var(--max); margin: 0 auto 4rem;
  padding: 2.5rem 2rem 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  border-top: 1px solid var(--paper3);
}

.post-nav-item { display: flex; flex-direction: column; gap: .3rem; }
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.post-nav-title { font-family: var(--serif); font-size: 1rem; color: var(--ink); line-height: 1.3; transition: color .2s; }
.post-nav-item:hover .post-nav-title { color: var(--blue); }

/* ══════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; gap: .5rem; padding: 2rem 0 0; }

.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 3px;
  font-size: .85rem; font-weight: 500; color: var(--ink2);
  border: 1px solid var(--paper3); background: var(--paper);
  transition: all .2s;
}

.page-numbers:hover, .page-numbers.current {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.45);
  padding: 2rem;
}

.footer-inner {
  max-width: var(--wide); margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.footer-logo { font-family: var(--serif); font-size: .95rem; color: rgba(255,255,255,.65); }
.footer-logo span { color: var(--gold2); }

.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { font-size: .75rem; color: rgba(255,255,255,.4); letter-spacing: .04em; }
.footer-links a:hover { color: var(--gold2); }
.footer-copy { font-size: .75rem; }

/* ══════════════════════════════════════════════════
   FLOATING WA
══════════════════════════════════════════════════ */
.wa-float-blog {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: all .3s;
}

.wa-float-blog:hover { transform: scale(1.1); }

.wa-float-blog::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: #25D366; opacity: .25;
  animation: wa-pulse 2.5s ease-out infinite;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: .25; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .blog-main, .single-content-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
  .blog-sidebar, .single-sidebar { position: static; }
  .post-card { grid-template-columns: 1fr; }
  .post-thumb, .post-thumb-placeholder { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .blog-hero, .single-hero { padding: 4rem 1.25rem 2rem; }
  .blog-main, .single-content-wrap { padding: 2rem 1.25rem 3rem; }
  .post-nav { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
