/* =============================================================================
   Palacio Estate — Blog module (listing + post)
   Reusable: .blog-*, BEM. Loaded after styles.css
   ============================================================================= */

/* ----- Blog listing page header ----- */
.blog-page-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: calc(var(--header-h) + clamp(40px, 6vw, 72px));
  padding-bottom: clamp(2.75rem, 5vw, 3.75rem);
  min-height: min(56vh, 520px);
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, var(--page-bg) 0%, var(--white) 100%);
  border-bottom: 1px solid rgba(11, 60, 93, 0.08);
}

.blog-page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/images/dholera-hero-slider-2.jpeg");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  .blog-page-hero__bg {
    animation: pe-hero-zoom 34s var(--ease-out) forwards;
  }
}

.blog-page-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(4, 18, 28, 0.75) 0%, rgba(4, 18, 28, 0.55) 45%, rgba(4, 18, 28, 0.28) 100%),
    linear-gradient(90deg, rgba(7, 42, 66, 0.85) 0%, rgba(7, 42, 66, 0.35) 55%, rgba(7, 42, 66, 0.0) 100%);
}

.blog-page-hero__inner {
  position: relative;
  z-index: 2;
}

.blog-page-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.35);
}

.blog-page-hero__lead {
  margin: 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.25);
}

/* ----- Listing grid (3 / 2 / 1) ----- */
.blog-listing {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.blog-listing__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 600px) {
  .blog-listing__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .blog-listing__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----- Blog card ----- */
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(11, 60, 93, 0.08);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .blog-card {
    transition: none;
  }
}

.blog-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
}

@media (prefers-reduced-motion: reduce) {
  .blog-card:hover {
    transform: none;
  }
}

.blog-card--muted {
  opacity: 0.92;
  border-style: dashed;
}

.blog-card--muted:hover {
  opacity: 1;
}

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--muted-bg);
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .blog-card:hover .blog-card__media img {
    transform: none;
  }
}

.blog-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(11, 60, 93, 0.88);
  color: var(--white);
  backdrop-filter: blur(6px);
}

.blog-card__badge--guide {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.95) 0%, rgba(180, 140, 40, 0.95) 100%);
  color: var(--primary-deep);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.35rem 1.4rem 1.5rem;
  gap: 0.5rem;
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -0.01em;
}

.blog-card__excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 60, 93, 0.07);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-card__readtime {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-card__readtime i {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-top: 0.25rem;
  transition: gap 0.25s var(--ease-out), color 0.2s ease;
}

.blog-card__link::after {
  content: "→";
  transition: transform 0.25s var(--ease-out);
  font-size: 1rem;
  line-height: 1;
}

.blog-card__link:hover,
.blog-card__link:focus-visible {
  color: var(--accent-gold);
  gap: 0.5rem;
}

.blog-card__link:hover::after,
.blog-card__link:focus-visible::after {
  transform: translateX(3px);
}

a.blog-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.blog-card:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Stretched link: card is anchor — optional pattern; we use explicit link instead */

/* ----- Post: full-bleed hero ----- */
.blog-hero {
  position: relative;
  min-height: clamp(280px, 38vh, 420px);
  display: flex;
  align-items: flex-end;
  color: var(--white);
  margin: 0;
  padding: 0;
  border: none;
}

.blog-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.blog-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(7, 42, 66, 0.45) 0%,
    rgba(7, 42, 66, 0.78) 70%,
    rgba(4, 28, 48, 0.92) 100%
  );
}

.blog-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 920px;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 calc(clamp(1.5rem, 4vw, 2.5rem) + 1rem);
}

.blog-hero__back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 0.1rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-hero__back:hover,
.blog-hero__back:focus-visible {
  color: var(--white);
  border-color: var(--accent-gold);
}

.blog-hero__label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.blog-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.2vw, 2.45rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  letter-spacing: -0.02em;
}

.blog-hero__subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 40rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
}

.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.blog-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ----- Post layout: sidebar + main ----- */
.blog-post {
  background: var(--page-bg);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.blog-post__container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.blog-post__grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 1024px) {
  .blog-post__grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 2.5rem 2.5rem;
    align-items: start;
  }

  .blog-post__main {
    grid-column: 2;
  }

  .blog-post__sidebar {
    grid-column: 1;
    grid-row: 1;
  }
}

/* mobile: main first */
.blog-post__main {
  order: 1;
}

.blog-post__sidebar {
  order: 2;
}

@media (min-width: 1024px) {
  .blog-post__main {
    order: unset;
  }

  .blog-post__sidebar {
    order: unset;
  }
}

/* ----- Sticky sidebar ----- */
.blog-post__sidebar {
  position: static;
}

@media (min-width: 1024px) {
  .blog-post__sidebar {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    align-self: start;
  }
}

.blog-toc {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem 1.1rem;
  border: 1px solid rgba(11, 60, 93, 0.08);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}

.blog-toc__title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}

.blog-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(50vh, 360px);
  overflow-y: auto;
}

.blog-toc__list::-webkit-scrollbar {
  width: 4px;
}

.blog-toc__list::-webkit-scrollbar-thumb {
  background: rgba(11, 60, 93, 0.2);
  border-radius: 4px;
}

.blog-toc__list > li {
  margin-bottom: 0.4rem;
}

.blog-toc__list a {
  display: block;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.35rem 0.4rem 0.35rem 0.6rem;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.blog-toc__list a:hover,
.blog-toc__list a:focus-visible {
  background: rgba(11, 60, 93, 0.05);
  color: var(--primary);
  border-left-color: var(--accent-gold);
}

.blog-toc__item--h3 a {
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.blog-sidebar-cta {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-deep) 100%);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  color: var(--white);
  box-shadow: 0 16px 40px rgba(7, 42, 66, 0.25);
}

.blog-sidebar-cta__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.blog-sidebar-cta__text {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.9;
}

.blog-sidebar-cta__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn--wa-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #25d366;
  background: var(--white);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

.btn--wa-outline:hover,
.btn--wa-outline:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* ----- Prose in post (max 700px) ----- */
.blog-prose {
  max-width: 700px;
  margin-inline: 0;
}

.blog-prose > p {
  margin: 0 0 1.15rem;
  line-height: 1.85;
  font-size: 1.01rem;
  color: var(--text-dark);
}

.blog-prose .blog-highlight p,
.blog-prose .blog-inline-cta__text {
  line-height: 1.7;
  font-size: 0.98rem;
  color: var(--text-dark);
}

.blog-prose > h2,
.blog-prose h2 {
  margin: 2.35rem 0 0.85rem;
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.blog-prose > h2:first-of-type {
  margin-top: 0;
}

.blog-prose > h3,
.blog-prose h3 {
  margin: 1.65rem 0 0.55rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.blog-prose a:not(.btn):not(.btn--wa-outline) {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-prose a:not(.btn):not(.btn--wa-outline):hover,
.blog-prose a:not(.btn):not(.btn--wa-outline):focus-visible {
  color: var(--primary-soft);
}

.blog-prose a.btn,
.blog-prose a.btn--wa-outline {
  text-decoration: none;
}

/* Bullet sections */
.blog-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.blog-list li {
  position: relative;
  margin-bottom: 0.6rem;
  padding-left: 1.5rem;
  line-height: 1.7;
  font-size: 1.01rem;
  color: var(--text-dark);
}

.blog-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8962e 100%);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

/* Quote */
.blog-quote {
  margin: 1.75rem 0;
  padding: 1.35rem 1.25rem 1.35rem 1.5rem;
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(11, 60, 93, 0.04) 100%);
  box-shadow: 0 8px 28px rgba(11, 60, 93, 0.06);
}

.blog-quote p {
  margin: 0;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-dark);
  font-family: var(--font-heading);
}

.blog-quote p::before {
  content: "“";
  color: var(--accent-gold);
  font-size: 1.4em;
  line-height: 0;
  margin-right: 0.1em;
  vertical-align: -0.1em;
}

/* Highlight box */
.blog-highlight {
  margin: 1.75rem 0;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 8px 30px rgba(11, 60, 93, 0.07);
}

.blog-highlight__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.blog-highlight p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-dark);
}

/* In-article CTA (conversion) */
.blog-inline-cta {
  margin: 2.5rem 0;
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--white) 0%, var(--muted-bg) 100%);
  border: 1px solid rgba(11, 60, 93, 0.1);
  box-shadow: 0 20px 50px rgba(11, 60, 93, 0.1);
  text-align: center;
}

.blog-inline-cta__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.blog-inline-cta__text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.blog-inline-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 22rem;
  margin-inline: auto;
}

@media (min-width: 500px) {
  .blog-inline-cta__actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
  }

  .blog-inline-cta__actions .btn {
    min-width: 200px;
  }
}

/* Ensure CTA buttons keep button colors (avoid link styles) */
.blog-inline-cta__actions .btn {
  text-decoration: none;
}

.blog-inline-cta__actions .btn.btn--dark {
  color: var(--white);
}

/* Related posts */
.blog-related {
  max-width: 1000px;
  margin: 0 auto;
  margin-top: 2.5rem;
  padding: clamp(2rem, 4vw, 2.5rem) 0 0;
  border-top: 1px solid rgba(11, 60, 93, 0.1);
}

.blog-related__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.5rem;
  color: var(--text-dark);
}

.blog-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .blog-related__grid--split {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Listing bottom strip */
.blog-listing__footer-note {
  max-width: 32rem;
  margin: 0 auto 1.25rem;
}

.blog-listing__footer-cta {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(11, 60, 93, 0.08);
}

.blog-listing__footer-cta .cta-inline {
  margin-top: 0;
}
