/* ============================================================
   Ciphers Post Editor — Frontend Styles v1.2
   Design changes:
   - heading font-weight: 800
   - body text-size: 18px
   - border-radius: max 10px
   - scroll-triggered animations on all blocks
   - content-cta removed (footer handles it)
   - related posts grid appended automatically
============================================================ */

.cpe-post-content,
.cpe-block-content {
  --cpe-white:      #ffffff;
  --cpe-dark:       #1a2a14;
  --cpe-body:       #3a4a32;
  --cpe-muted:      rgba(58,74,50,0.58);
  --cpe-primary:    #2D6A1F;
  --cpe-primary-dk: #1a2a14;
  --cpe-accent:     #D96A10;
  --cpe-accent-dim: rgba(217,106,16,0.11);
  --cpe-border:     rgba(26,42,20,0.1);
  --cpe-shadow:     0 2px 16px rgba(26,42,20,0.07);
  --cpe-shadow-lg:  0 8px 40px rgba(26,42,20,0.13);
  --cpe-r:          10px;   /* max radius 10px */
  --cpe-r-sm:       6px;
  --cpe-display:    'Cormorant Garamond', Georgia, serif;
  --cpe-font:       'DM Sans', system-ui, sans-serif;
  --cpe-stamp:      'Bebas Neue', Impact, sans-serif;
}

/* ════════════════════════════════════════════
   SCROLL ANIMATIONS
   All direct block children of .cpe-block-content
   fade + slide in as they enter the viewport.
════════════════════════════════════════════ */
.cpe-block-content > *,
.cpe-wp-content > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.cpe-block-content > *.cpe-visible,
.cpe-wp-content > *.cpe-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger siblings */
.cpe-block-content > *:nth-child(2) { transition-delay: 0.05s; }
.cpe-block-content > *:nth-child(3) { transition-delay: 0.10s; }
.cpe-block-content > *:nth-child(4) { transition-delay: 0.15s; }
.cpe-block-content > *:nth-child(5) { transition-delay: 0.20s; }
.cpe-block-content > *:nth-child(n+6) { transition-delay: 0.25s; }

/* Steps animate individually */
.cpe-step-item {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1),
              transform 0.5s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s,
              transform 0.25s;
}
.cpe-step-item.cpe-visible {
  opacity: 1;
  transform: translateX(0);
}
.cpe-step-item:hover { box-shadow: var(--cpe-shadow-lg); transform: translateX(5px) !important; }

/* ════════════════════════════════════════════
   SECTION LABEL
════════════════════════════════════════════ */
.cpe-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--cpe-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cpe-accent);
  margin: 28px 0 10px;
}
.cpe-section-label::before {
  content: '';
  display: inline-block;
  width: 28px; height: 2px;
  background: var(--cpe-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   STEPS
════════════════════════════════════════════ */
.cpe-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 32px 0;
}
.cpe-step-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--cpe-white);
  border: 1px solid var(--cpe-border);
  border-radius: var(--cpe-r);
  padding: 20px 22px;
  box-shadow: var(--cpe-shadow);
}
.cpe-step-num {
  font-family: var(--cpe-stamp);
  font-size: 34px; line-height: 1;
  color: var(--cpe-accent); opacity: 0.4;
  flex-shrink: 0; min-width: 38px; padding-top: 2px;
}
.cpe-step-body { flex: 1; min-width: 0; }
.cpe-step-title {
  font-family: var(--cpe-font);
  font-size: 18px; font-weight: 800;
  color: var(--cpe-dark); margin: 0 0 6px; line-height: 1.2;
}
.cpe-step-desc {
  font-size: 18px; color: var(--cpe-body);
  line-height: 1.7; margin: 0; font-weight: 300;
}

/* ════════════════════════════════════════════
   PULL QUOTE
════════════════════════════════════════════ */
.cpe-pull-quote {
  position: relative;
  margin: 40px 0;
  padding: 32px 40px 32px 48px;
  background: var(--cpe-primary-dk);
  border-radius: var(--cpe-r);
  overflow: hidden;
}
.cpe-pull-quote::before {
  content: '\201C';
  font-family: var(--cpe-display);
  font-size: 120px; line-height: 0.75;
  color: var(--cpe-accent); opacity: 0.3;
  position: absolute; top: 18px; left: 20px;
  pointer-events: none; user-select: none;
}
.cpe-pull-quote__text {
  font-family: var(--cpe-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-style: italic; font-weight: 300;
  line-height: 1.6; color: rgba(255,255,255,0.92);
  margin: 0 0 14px;
}
.cpe-pull-quote__cite {
  display: block;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); font-style: normal;
}

/* ════════════════════════════════════════════
   PRO TIP
════════════════════════════════════════════ */
.cpe-pro-tip {
  margin: 32px 0;
  background: rgba(45,106,31,0.07);
  border: 1px solid rgba(45,106,31,0.22);
  border-left: 4px solid var(--cpe-primary);
  border-radius: 0 var(--cpe-r) var(--cpe-r) 0;
  padding: 22px 24px;
}
.cpe-pro-tip__label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cpe-primary); margin-bottom: 8px;
}
.cpe-pro-tip__content {
  font-size: 18px; color: var(--cpe-body);
  line-height: 1.75; margin: 0; font-weight: 300;
}

/* ════════════════════════════════════════════
   GALLERY
════════════════════════════════════════════ */
.cpe-gallery { margin: 36px 0; }
.cpe-gallery__grid { display: grid; gap: 10px; }
.cpe-gallery--cols-2 { grid-template-columns: repeat(2,1fr); }
.cpe-gallery--cols-3 { grid-template-columns: repeat(3,1fr); }
.cpe-gallery--cols-4 { grid-template-columns: repeat(4,1fr); }
.cpe-gallery__item {
  border-radius: var(--cpe-r);
  overflow: hidden;
  box-shadow: var(--cpe-shadow);
  aspect-ratio: 4/3;
}
.cpe-gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: brightness(0.92);
  transition: transform 0.5s, filter 0.3s;
}
.cpe-gallery__item:hover img { transform: scale(1.05); filter: brightness(1); }
.cpe-gallery__caption { margin-top: 10px; font-size: 13px; color: var(--cpe-muted); font-style: italic; text-align: center; }
@media (max-width: 640px) { .cpe-gallery--cols-3, .cpe-gallery--cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 400px) { .cpe-gallery--cols-2,.cpe-gallery--cols-3,.cpe-gallery--cols-4 { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════
   CONTENT CTA  (kept for any manually added blocks,
   but no longer appended auto from PHP)
════════════════════════════════════════════ */
.cpe-content-cta {
  margin: 40px 0;
  background: var(--cpe-accent);
  border-radius: var(--cpe-r);
  padding: 28px 32px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.cpe-content-cta__text {
  font-family: var(--cpe-display);
  font-size: clamp(17px,2vw,20px); font-weight: 500;
  color: #fff; margin: 0; line-height: 1.4; flex: 1; min-width: 200px;
}
.cpe-content-cta__btn {
  background: #fff; color: var(--cpe-accent);
  padding: 12px 24px; border-radius: var(--cpe-r-sm);
  font-family: var(--cpe-font);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; display: inline-block;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cpe-content-cta__btn:hover { background: var(--cpe-primary-dk); color: #fff; transform: translateY(-2px); }

/* ════════════════════════════════════════════
   AUTHOR CARD
════════════════════════════════════════════ */
.cpe-author-card {
  margin: 40px 0;
  padding: 24px;
  background: var(--cpe-white);
  border: 1px solid var(--cpe-border);
  border-radius: var(--cpe-r);
  box-shadow: var(--cpe-shadow);
  display: flex; gap: 20px; align-items: flex-start;
}
.cpe-author-card__avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--cpe-primary-dk);
  border: 3px solid var(--cpe-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--cpe-stamp); font-size: 20px;
  color: #fff; flex-shrink: 0;
}
.cpe-author-card__name {
  font-family: var(--cpe-display);
  font-size: 20px; font-weight: 800;
  color: var(--cpe-dark); margin: 0 0 4px;
}
.cpe-author-card__role {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cpe-accent); margin-bottom: 8px;
}
.cpe-author-card__bio {
  font-size: 18px; color: var(--cpe-body);
  line-height: 1.7; margin: 0; font-weight: 300;
}

/* ════════════════════════════════════════════
   IMAGE PAIR
════════════════════════════════════════════ */
.cpe-image-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 36px 0; }
.cpe-image-pair__item {
  border-radius: var(--cpe-r);
  overflow: hidden; box-shadow: var(--cpe-shadow); aspect-ratio: 4/3;
}
.cpe-image-pair__item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: brightness(0.9); transition: transform 0.5s;
}
.cpe-image-pair__item:hover img { transform: scale(1.05); }
@media (max-width: 560px) { .cpe-image-pair { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════
   TEXT CONTENT BLOCK
════════════════════════════════════════════ */
.cpe-text-content {
  margin: 0 0 24px;
  font-family: var(--cpe-font);
  color: var(--cpe-body);
}
.cpe-text-content p {
  font-size: 18px;
  line-height: 1.85;
  font-weight: 300;
  margin: 0 0 20px;
  color: var(--cpe-body);
}
.cpe-text-content p:last-child { margin-bottom: 0; }
.cpe-text-content h2 {
  font-family: var(--cpe-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  color: var(--cpe-dark);
  line-height: 1.15;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.cpe-text-content h3 {
  font-family: var(--cpe-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  color: var(--cpe-dark);
  margin: 32px 0 12px;
}
.cpe-text-content h4 {
  font-family: var(--cpe-display);
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 800;
  color: var(--cpe-dark);
  margin: 24px 0 10px;
}
.cpe-text-content strong { font-weight: 700; color: var(--cpe-dark); }
.cpe-text-content em     { font-style: italic; }
.cpe-text-content a      { color: var(--cpe-primary); text-decoration: underline; text-underline-offset: 3px; }
.cpe-text-content a:hover { color: var(--cpe-accent); }
.cpe-text-content ul, .cpe-text-content ol {
  margin: 0 0 20px 22px;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 300;
  color: var(--cpe-body);
}
.cpe-text-content ul li { list-style: disc; }
.cpe-text-content ol li { list-style: decimal; }
.cpe-text-content li { margin-bottom: 6px; }

/* ════════════════════════════════════════════
   STANDALONE HEADING BLOCK
════════════════════════════════════════════ */
.cpe-heading {
  font-family: var(--cpe-display);
  color: var(--cpe-dark);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.cpe-heading--h2 { font-size: clamp(26px, 3.5vw, 40px); margin-top: 48px; }
.cpe-heading--h3 { font-size: clamp(20px, 2.5vw, 28px); margin-top: 36px; }
.cpe-heading--h4 { font-size: clamp(18px, 2vw, 22px);   margin-top: 28px; }

/* ════════════════════════════════════════════
   RELATED POSTS GRID
════════════════════════════════════════════ */
.cpe-related {
  margin: 64px 0 0;
  padding-top: 48px;
  border-top: 1px solid var(--cpe-border);
}
.cpe-related__heading {
  font-family: var(--cpe-display);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  color: var(--cpe-dark);
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cpe-related__heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cpe-border);
}
.cpe-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cpe-related__card {
  background: var(--cpe-white);
  border: 1px solid var(--cpe-border);
  border-radius: var(--cpe-r);
  overflow: hidden;
  box-shadow: var(--cpe-shadow);
  text-decoration: none;
  display: block;
  transition: box-shadow 0.25s, transform 0.25s;

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1),
              transform 0.5s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s;
}
.cpe-related__card.cpe-visible {
  opacity: 1;
  transform: translateY(0);
}
.cpe-related__card:nth-child(2) { transition-delay: 0.1s; }
.cpe-related__card:nth-child(3) { transition-delay: 0.2s; }
.cpe-related__card:hover { box-shadow: var(--cpe-shadow-lg); transform: translateY(-4px); }
.cpe-related__thumb {
  height: 180px;
  overflow: hidden;
  background: var(--cpe-border);
  position: relative;
}
.cpe-related__thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: brightness(0.9) saturate(1.05);
  transition: transform 0.5s ease;
}
.cpe-related__card:hover .cpe-related__thumb img { transform: scale(1.06); }
.cpe-related__thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #2D6A1F22, #D96A1022);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.cpe-related__body { padding: 18px 18px 22px; }
.cpe-related__cat {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cpe-accent); display: block; margin-bottom: 7px;
}
.cpe-related__title {
  font-family: var(--cpe-font);
  font-size: 18px; font-weight: 800;
  color: var(--cpe-dark);
  line-height: 1.25; margin: 0 0 8px;
}
.cpe-related__excerpt {
  font-size: 13px; color: var(--cpe-muted);
  line-height: 1.55; margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .cpe-related__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cpe-related__grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 560px) {
  .cpe-step-item  { flex-direction: column; gap: 8px; }
  .cpe-pull-quote { padding: 24px 20px 20px 24px; }
  .cpe-content-cta { flex-direction: column; }
  .cpe-author-card { flex-direction: column; }
}

/* ── Mobile: body text 16px ── */
@media (max-width: 640px) {
  .cpe-text-content p,
  .cpe-text-content ul,
  .cpe-text-content ol,
  .cpe-step-desc,
  .cpe-pro-tip__content,
  .cpe-author-card__bio { font-size: 16px; }
}

/* ════════════════════════════════════════════
   BLURB GRID
════════════════════════════════════════════ */
.cpe-blurb {
  display: grid;
  gap: 24px;
  margin: 36px 0;
}
.cpe-blurb--cols-1 { grid-template-columns: 1fr; }
.cpe-blurb--cols-2 { grid-template-columns: repeat(2, 1fr); }
.cpe-blurb--cols-3 { grid-template-columns: repeat(3, 1fr); }
.cpe-blurb--cols-4 { grid-template-columns: repeat(4, 1fr); }

.cpe-blurb__item {
  background: var(--cpe-white);
  border: 1px solid var(--cpe-border);
  border-radius: var(--cpe-r);
  overflow: hidden;
  box-shadow: var(--cpe-shadow);
  transition: box-shadow 0.25s, transform 0.25s;
}
.cpe-blurb__item:hover {
  box-shadow: var(--cpe-shadow-lg);
  transform: translateY(-3px);
}

.cpe-blurb__img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: rgba(45,106,31,0.06);
}
.cpe-blurb__img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: brightness(0.92) saturate(1.05);
  transition: transform 0.5s ease;
}
.cpe-blurb__item:hover .cpe-blurb__img img { transform: scale(1.05); }

.cpe-blurb__img--empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; opacity: 0.4;
}

.cpe-blurb__body { padding: 18px 18px 20px; }

.cpe-blurb__title {
  font-family: var(--cpe-font);
  font-size: 16px; font-weight: 800;
  color: var(--cpe-dark);
  margin: 0 0 8px; line-height: 1.3;
}

.cpe-blurb__desc {
  font-size: 15px; color: var(--cpe-body);
  line-height: 1.65; margin: 0; font-weight: 300;
}

@media (max-width: 768px) {
  .cpe-blurb--cols-3,
  .cpe-blurb--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cpe-blurb--cols-2,
  .cpe-blurb--cols-3,
  .cpe-blurb--cols-4 { grid-template-columns: 1fr; }
}
