/* assets/css/blog.css - styles EVERY class used by blog.php.
   Variables come from index.css; the :where(:root) block below is only a zero-specificity fallback. */

:where(:root) {
  --primary-color: #b94a1a;
  --primary-hover: #d05a22;
  --primary-light: #fdf0eb;
  --primary-border: #f5cfc0;
  --dark-color: #2c2c2c;
  --text-light: #555;
  --text-muted: #6f6f6f;
  --white: #fff;
  --border-color: #ebebeb;
  --bg-light: #fdf8f6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --font-primary: 'Nunito', sans-serif;
  --font-heading: 'Playfair Display', serif;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* keyboard focus ring on everything clickable in the blog */
.blog-intro a:focus-visible, .hero a:focus-visible, .blog-main a:focus-visible,
.search-wrap input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── ENTRANCE + SCROLL REVEAL (content is never hidden if unsupported) ── */
@keyframes bl-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes bl-fade { from { opacity: 0; } to { opacity: 1; } }

.blog-intro { animation: bl-rise 0.6s ease both; }
.hero       { animation: bl-fade 0.8s ease 0.1s both; }
.hero-content > * { animation: bl-rise 0.6s ease both; }
.hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.45s; }
.hero-content > *:nth-child(5) { animation-delay: 0.55s; }

@supports (animation-timeline: view()) {
  .post-card, .sidebar-block, .seo-text, .blog-sources, .pagination {
    animation: bl-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

/* ── PAGE INTRO (H1) ── */
.blog-intro { max-width: 1300px; margin: 0 auto; padding: 2rem 24px 1.75rem; }
.blog-intro h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700; line-height: 1.2; color: var(--dark-color);
  margin: 0.5rem 0 0.75rem;
}
.blog-intro p { font-size: 15px; color: var(--text-light); line-height: 1.75; max-width: 760px; margin: 0; }

.breadcrumbs ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 13px; color: var(--text-muted);
}
.breadcrumbs li + li::before { content: "›"; margin-right: 0.4rem; }
.breadcrumbs a { color: var(--text-light); text-decoration: none; transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--primary-color); text-decoration: underline; }

/* ── HERO ── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 520px;
  border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}
.hero-img { position: relative; display: block; overflow: hidden; background: #f9f5f2; }
.hero-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero:hover .hero-img img { transform: scale(1.05); }
.hero-img::after {              /* soft gradient so the badge always reads */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 35%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), transparent); pointer-events: none;
}
.featured-badge {
  position: absolute; top: 1.5rem; left: 1.5rem; z-index: 2;
  background: var(--primary-color); color: var(--white);
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.hero-content { display: flex; flex-direction: column; justify-content: center; padding: 4rem 3.5rem; background: var(--bg-light); }
.hero-content .category {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary-color); text-decoration: none; margin-bottom: 1rem; width: fit-content;
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.hero-content .category:hover { border-color: var(--primary-color); }
.hero-title {
  font-family: var(--font-heading); font-size: clamp(1.9rem, 3vw, 2.8rem);
  font-weight: 700; line-height: 1.2; color: var(--dark-color); margin: 0 0 1rem;
}
.hero-title a {
  color: inherit; text-decoration: none;
  background: linear-gradient(var(--primary-color), var(--primary-color)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s ease, color 0.2s;
}
.hero-title a:hover { background-size: 100% 2px; color: var(--primary-color); }
.hero-content p { font-size: 15px; color: var(--text-light); line-height: 1.8; margin: 0 0 2rem; max-width: 450px; }
.read-more-btn {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-size: 13px; font-weight: 700; color: var(--primary-color); text-decoration: none;
  border: 1.5px solid var(--primary-color); border-radius: 30px; padding: 0.6rem 1.2rem; margin-bottom: 1.75rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.read-more-btn svg { transition: transform 0.2s; }
.read-more-btn:hover { background: var(--primary-color); color: #fff; box-shadow: 0 6px 16px rgba(185,74,26,0.3); }
.read-more-btn:hover svg { transform: translateX(4px); }
.hero-meta {
  display: flex; align-items: center; gap: 1rem; font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border-color); padding-top: 1.5rem;
}
.hero-author { font-size: 13px; color: var(--dark-color); }
.hero-date { font-size: 12px; color: var(--text-muted); }
.author-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #d4956a, var(--primary-color));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700;
}

/* ── MAIN LAYOUT (two children: .blog-content + .sidebar) ── */
.blog-main {
  max-width: 1300px; margin: 0 auto; padding: 3rem 24px 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 5rem; align-items: start;
}
.section-heading {
  font-family: var(--font-primary); font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border-color);
}
.blog-content > .section-heading { margin-bottom: 1.5rem; }

/* ── POST CARDS ── */
.posts-grid { display: flex; flex-direction: column; gap: 0.25rem; }
.post-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem;
  padding: 1.5rem 1rem; margin: 0 -1rem;
  border-radius: 14px; border-bottom: 1px solid var(--border-color);
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.post-card:hover, .post-card:focus-within {
  background: #fff; transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.09); border-color: transparent;
}
.post-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #f9f5f2; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.post-card:hover .post-thumb img { transform: scale(1.07); }
.post-card-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.post-category {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary-color); text-decoration: none; margin-bottom: 0.5rem; width: fit-content;
}
.post-category:hover { text-decoration: underline; }
.post-card-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin: 0 0 0.6rem; }
.post-card-title a { color: var(--dark-color); text-decoration: none; transition: color 0.2s; }
.post-card-title a::after {      /* arrow that slides in on hover */
  content: " →"; display: inline-block; opacity: 0; transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s; color: var(--primary-color);
}
.post-card:hover .post-card-title a, .post-card-title a:focus-visible { color: var(--primary-color); }
.post-card:hover .post-card-title a::after, .post-card-title a:focus-visible::after { opacity: 1; transform: none; }
.post-excerpt {
  font-size: 14px; color: var(--text-light); line-height: 1.75; margin: 0 0 1rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; font-size: 12px; color: var(--text-muted); }
.post-footer .dot { color: #ccc; }

/* ── PAGINATION ── */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; }
.page-link {
  min-width: 42px; height: 42px; padding: 0 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color); border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--dark-color); text-decoration: none; background: #fff;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
a.page-link:hover { border-color: var(--primary-color); color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.08); }
.page-link.is-current { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.page-gap { color: var(--text-muted); padding: 0 0.25rem; }

/* ── EMPTY / ERROR ── */
.blog-empty { padding: 2.5rem 1.5rem; text-align: center; border: 1px dashed var(--border-color); border-radius: 12px; }
.blog-empty h2, .blog-empty h3 { font-family: var(--font-heading); font-size: 1.3rem; color: var(--dark-color); margin: 0 0 0.5rem; }
.blog-empty p { color: var(--text-light); margin: 0; }
.blog-empty a { color: var(--primary-color); }

/* ── CONTEXT TEXT + SOURCES ── */
.seo-text { background: var(--bg-light); padding: 2.5rem; border-radius: 14px; margin-top: 3rem; border: 1px solid var(--border-color); }
.seo-text h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--dark-color); margin: 0 0 14px; }
.seo-text p { font-size: 14.5px; color: var(--text-light); line-height: 1.8; margin: 0 0 14px; }
.seo-text p:last-child { margin-bottom: 0; }
.seo-text sup a { color: var(--primary-color); text-decoration: none; font-weight: 700; padding: 0 2px; border-radius: 3px; transition: background 0.2s; }
.seo-text sup a:hover { background: var(--primary-light); text-decoration: underline; }

.blog-sources { margin-top: 2rem; padding: 0 0.25rem; }
.blog-sources h2 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--dark-color); margin: 0 0 0.75rem; }
.sources-note { font-size: 13.5px; color: var(--text-light); line-height: 1.7; margin: 0 0 1rem; }
.blog-sources ol { margin: 0; padding-left: 1.25rem; font-size: 14px; color: var(--text-light); line-height: 1.7; }
.blog-sources li { margin-bottom: 0.6rem; scroll-margin-top: 110px; padding: 2px 6px; margin-left: -6px; border-radius: 6px; }
.blog-sources li:target { background: var(--primary-light); }      /* highlights the source you jumped to */
.blog-sources cite { font-style: normal; font-weight: 700; }
.blog-sources a { color: var(--primary-color); text-decoration: underline; text-underline-offset: 2px; }
.source-note { display: block; font-size: 13px; color: var(--text-muted); }

/* ── SIDEBAR ── */
.sidebar {
  position: sticky; top: 90px; align-self: start;
  max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px;
}
.sidebar-block { margin-bottom: 2.5rem; }

.search-wrap { position: relative; margin-bottom: 2.5rem; }
.search-wrap input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 30px;
  padding: 0.8rem 1rem 0.8rem 2.9rem; font-family: var(--font-primary); font-size: 14px; color: var(--dark-color);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.search-wrap input:focus { background: #fff; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(185,74,26,0.12); outline: none; }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-wrap:focus-within .search-icon circle, .search-wrap:focus-within .search-icon path { stroke: var(--primary-color); }

.category-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.category-list li { border-bottom: 1px solid var(--border-color); }
.category-list li:last-child { border-bottom: none; }
.category-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 0.5rem; margin: 0 -0.5rem; border-radius: 8px;
  font-size: 14px; color: var(--dark-color); text-decoration: none;
  transition: background 0.2s, color 0.2s, padding 0.2s;
}
.category-list a:hover { background: var(--primary-light); color: var(--primary-color); padding-left: 0.85rem; }
.category-list a[aria-current="page"] { color: var(--primary-color); font-weight: 700; background: var(--primary-light); }
.category-list .count {
  font-size: 12px; color: var(--text-muted); background: var(--primary-light);
  padding: 2px 9px; border-radius: 20px; transition: background 0.2s, color 0.2s;
}
.category-list a:hover .count, .category-list a[aria-current="page"] .count { background: var(--primary-color); color: #fff; }

.recent-list { display: flex; flex-direction: column; gap: 0.25rem; counter-reset: recent; }
.recent-list li { counter-increment: recent; display: flex; gap: 0.75rem; align-items: baseline; }
.recent-list li::before {
  content: counter(recent, decimal-leading-zero); font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 700; color: var(--primary-border); transition: color 0.2s;
}
.recent-list li:hover::before { color: var(--primary-color); }
.recent-list a { color: var(--dark-color); text-decoration: none; font-size: 13.5px; line-height: 1.45; padding: 0.35rem 0; transition: color 0.2s; }
.recent-list a:hover { color: var(--primary-color); text-decoration: underline; }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; padding: 6px 13px; background: var(--bg-light); color: var(--text-light);
  border-radius: 20px; border: 1px solid var(--border-color); text-decoration: none; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.tag:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: translateY(-2px); }

/* ── WHATSAPP WIDGET (was inline). Delete this block if wp-widget.php's own CSS already styles it. ── */
.whatsapp-container { position: fixed; bottom: 24px; left: 24px; z-index: 1000; font-family: var(--font-primary); }
.whatsapp-float { width: 60px; height: 60px; background-color: #25d366; color: #FFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; transition: transform 0.3s ease, background-color 0.3s ease; animation: pulse-wa 2s infinite; }
.whatsapp-float:hover { transform: translateY(-4px); background-color: #20b858; }
.whatsapp-popup { position: absolute; bottom: 75px; left: 0; width: 290px; background: #fff; border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; }
.whatsapp-popup.active { opacity: 1; visibility: visible; transform: translateY(0); }
.wa-header { background: #075e54; color: #fff; padding: 16px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.wa-header i { font-size: 20px; margin-right: 8px; }
.wa-close { cursor: pointer; font-size: 24px; line-height: 1; opacity: 0.8; transition: opacity 0.2s; }
.wa-close:hover { opacity: 1; }
.wa-body { padding: 20px; background: #ece5dd; }
.wa-message { background: #fff; padding: 12px 16px; border-radius: 0 12px 12px 12px; font-size: 13px; color: #2c2c2c; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); position: relative; line-height: 1.5; }
.wa-message::before { content: ''; position: absolute; top: 0; left: -8px; border-top: 10px solid #fff; border-left: 10px solid transparent; }
.wa-btn { display: block; text-align: center; background: #25d366; color: #fff; text-decoration: none; padding: 12px; border-radius: 24px; font-weight: 700; font-size: 14px; transition: background 0.2s; }
.wa-btn:hover { background: #20b858; color: #fff; }
@keyframes pulse-wa { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); } 70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-img { min-height: 300px; }
  .hero-content { padding: 2.5rem 1.5rem; }
  .blog-intro { padding: 1.5rem 1.25rem 1.25rem; }
  .blog-main { grid-template-columns: minmax(0, 1fr); gap: 3rem; padding: 2rem 1.25rem 3rem; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .post-card { grid-template-columns: 140px 1fr; gap: 1.25rem; margin: 0; padding: 1.25rem 0.75rem; }
  .seo-text { padding: 1.75rem 1.25rem; }
}
@media (max-width: 560px) {
  .post-card { grid-template-columns: 1fr; }
  .post-thumb { aspect-ratio: 16 / 9; }
}

/* ── RESPECT "REDUCE MOTION" ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .post-card:hover, .post-card:focus-within, a.page-link:hover, .tag:hover { transform: none; }
}