/* ==========================================================================
   Wonderstory — blog.css
   Blog post (single) + blog archive (listing).
   Requires: main.css (@font-face: Marcellus, soleilLight, soleilRegular)
   ========================================================================== */

/* --- Custom properties --------------------------------------------------- */
:root {
  --blog-accent:    #976338;
  --blog-text:      #292929;
  --blog-muted:     #7A7A7A;
  --blog-bg:        #F8F6F4;
  --blog-border:    #E0DAD3;
  --blog-max-width: 700px;
}

/* --- Wrapper -------------------------------------------------------------- */
.blog-post {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  background: #fff;
}

/* --- Breadcrumbs ---------------------------------------------------------- */
.blog-post__breadcrumbs {
  font-family: 'soleilLight', sans-serif;
  font-size: 13px;
  color: var(--blog-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.blog-post__breadcrumbs a { color: var(--blog-muted); text-decoration: none; }
.blog-post__breadcrumbs a:hover { color: var(--blog-accent); }
.blog-post__breadcrumbs span + span::before { content: ' > '; margin: 0 4px; }
.blog-post__breadcrumbs { display: none; }

/* --- Header --------------------------------------------------------------- */
.blog-post__header { margin-bottom: 32px; text-align: center; }

.blog-post__category {
  display: inline-block;
  font-family: 'soleilRegular', sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-accent);
  margin-bottom: 16px;
}

.blog-post__title {
  font-family: 'Marcellus', serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 50px;
  color: var(--blog-text);
  margin-bottom: 20px;
  border: none;
}

.blog-post__meta {
  font-family: 'soleilLight', sans-serif;
  font-size: 14px;
  color: var(--blog-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.blog-post__meta span + span::before { content: '·'; margin-right: 16px; }
.blog-post__meta { display: none; }

/* --- Hero image ----------------------------------------------------------- */
.blog-post__hero { margin: 0 -24px 48px; overflow: hidden; }
.blog-post__hero img { width: 100%; height: auto; display: block; aspect-ratio: 4/5; object-fit: cover; }

/* --- Table of Contents (Contenido) ---------------------------------------- */
.blog-toc {
  margin: 0 -24px 48px;
  background: #F8F6F4;
  border-radius: 4px;
  overflow: hidden;
}

.blog-toc__header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  padding: 12px 24px;
  cursor: pointer;
  gap: 10px;
  user-select: none;
}

.blog-toc__title {
  flex-grow: 1;
  font-family: 'soleilLight', sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #976338;
  margin: 0;
}

.blog-toc__chevron {
  width: 20px;
  height: 20px;
  fill: #976338;
  transition: transform 0.3s ease;
}

.blog-toc.is-collapsed .blog-toc__chevron {
  transform: rotate(180deg);
}

.blog-toc__body {
  padding: 0;
  list-style: none;
  margin: 0;
}

.blog-toc.is-collapsed .blog-toc__body {
  display: none;
}

.blog-toc__item {
  margin: 0;
}

.blog-toc__item a {
  display: block;
  border-left: 2px solid #EFEBE5;
  padding: 8px 24px;
  font-family: 'soleilLight', sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #292929;
  opacity: 0.7;
  text-decoration: none;
  transition: border-color 0.2s, opacity 0.2s;
}

.blog-toc__item a:hover {
  border-left-color: #976338;
  opacity: 1;
}

.blog-toc__item.is-active a {
  border-left-color: #976338;
  color: #976338;
  opacity: 1;
  font-weight: 700;
}

/* --- Content wrapper ------------------------------------------------------ */
.blog-post__content {
  font-family: 'soleilLight', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--blog-text);
}

/* Paragraphs */
.blog-post__content p { margin-bottom: 1.5em; }

/* Headings */
.blog-post__content h2,
.blog-post__content h2.wp-block-heading {
  font-family: 'Marcellus', serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--blog-text);
  margin: 2.5em 0 0.8em;
}
.blog-post__content h3,
.blog-post__content h3.wp-block-heading {
  font-family: 'Marcellus', serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--blog-text);
  margin: 2em 0 0.6em;
}
.blog-post__content h4 {
  font-family: 'soleilRegular', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blog-text);
  margin: 1.8em 0 0.5em;
}

/* Links */
.blog-post__content a {
  color: var(--blog-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.blog-post__content a:hover { border-bottom-color: var(--blog-accent); }

/* Images */
.blog-post__content figure.wp-block-image {
  margin: 2.5em 0;
  border-radius: 4px;
  overflow: hidden;
}
.blog-post__content figure.wp-block-image img {
  width: 100%; height: auto; display: block; border-radius: 4px;
}
.blog-post__content figcaption {
  font-family: 'soleilLight', sans-serif;
  font-size: 13px;
  font-style: italic;
  color: var(--blog-muted);
  text-align: center;
  margin-top: 10px;
}

/* Blockquote */
.blog-post__content blockquote.wp-block-quote {
  border-left: 3px solid var(--blog-accent);
  margin: 2em 0;
  padding: 1em 1.5em;
  font-style: italic;
  color: #555;
  background: var(--blog-bg);
}
.blog-post__content blockquote.wp-block-quote p { margin-bottom: 0.5em; }
.blog-post__content cite {
  font-family: 'soleilRegular', sans-serif;
  font-size: 14px;
  font-style: normal;
  color: var(--blog-muted);
}

/* Lists */
.blog-post__content ul,
.blog-post__content ol { margin: 1em 0 1.5em 1.5em; list-style: revert; }
.blog-post__content li { margin-bottom: 0.5em; }

/* Tables */
.blog-post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 15px;
}
.blog-post__content th {
  font-family: 'soleilRegular', sans-serif;
  font-weight: 400;
  text-align: left;
  padding: 10px 14px;
  background: var(--blog-bg);
  border-bottom: 2px solid var(--blog-border);
  color: var(--blog-text);
}
.blog-post__content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--blog-border);
  vertical-align: top;
}

/* Gallery */
.blog-post__content .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 2em 0;
}
.blog-post__content .wp-block-gallery figure { margin: 0; border-radius: 4px; overflow: hidden; }
.blog-post__content .wp-block-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* Embeds (YouTube, iframe) — 16:9 */
.blog-post__content .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 2em 0;
}
.blog-post__content .wp-block-embed__wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* Separator */
.blog-post__content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--blog-border);
  margin: 3em 0;
}

/* Buttons */
.blog-post__content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 2em 0; }
.blog-post__content .wp-block-button__link {
  display: inline-block;
  background: var(--blog-accent);
  color: #fff;
  font-family: 'soleilRegular', sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.2s;
}
.blog-post__content .wp-block-button__link:hover { opacity: 0.85; border-bottom: none; }

/* --- Blog archive --------------------------------------------------------- */
.blog-archive {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.blog-card { display: flex; flex-direction: column; background: #fff; }

.blog-card__image { overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 20px; }
.blog-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.blog-card:hover .blog-card__image img { transform: scale(1.03); }

.blog-card__category {
  font-family: 'soleilRegular', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-accent);
  margin-bottom: 8px;
}

.blog-card__title {
  font-family: 'Marcellus', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--blog-text);
  margin-bottom: 12px;
}
.blog-card__title a { color: inherit; text-decoration: none; }
.blog-card__title a:hover { color: var(--blog-accent); }

.blog-card__excerpt {
  font-family: 'soleilLight', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--blog-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 16px;
}

.blog-card__meta { font-family: 'soleilLight', sans-serif; font-size: 13px; color: var(--blog-muted); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .blog-post { padding: 32px 32px 60px; }
  .blog-archive { grid-template-columns: repeat(2, 1fr); padding: 40px 32px; }
}

@media (max-width: 767px) {
  .blog-post { padding: 24px 20px 48px; }
  .blog-post__hero { margin: 0 -20px 36px; }
  .blog-post__title { font-size: 30px; }
  .blog-post__content { font-size: 16px; }
  .blog-post__content h2,
  .blog-post__content h2.wp-block-heading { font-size: 24px; margin-top: 2em; }
  .blog-post__content h3,
  .blog-post__content h3.wp-block-heading { font-size: 20px; }
  .blog-post__content table { font-size: 14px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .blog-post__content .wp-block-gallery { grid-template-columns: 1fr; }
  .blog-archive { grid-template-columns: 1fr; padding: 32px 20px; gap: 32px; }
  .blog-toc { margin: 0 -20px 36px; }
  .blog-toc.is-collapsed .blog-toc__body { display: none; }
}
