/**
 * Inkwell — Editorial Hero
 * A self-contained, uniquely styled hero for the inkwell reading blog.
 * All rules are scoped under .iw-hero-editorial so nothing leaks into the theme.
 */

.iw-hero-editorial {
  --iw-ink: #1b1b2b;
  --iw-ink-soft: #55566b;
  --iw-paper: #f7f4ee;
  --iw-paper-2: #efe9df;
  --iw-accent: #c8452f;
  --iw-accent-2: #d98b2b;
  --iw-line: rgba(27, 27, 43, 0.12);
  --iw-card: #ffffff;
  --iw-shadow: 0 30px 60px -25px rgba(27, 27, 43, 0.35);
  --iw-radius: 22px;

  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 120px) 0;
  color: var(--iw-ink);
  background:
    radial-gradient(120% 120% at 100% 0%, var(--iw-paper-2) 0%, var(--iw-paper) 45%, var(--iw-paper) 100%);
  font-family: inherit;
}

.iw-hero-editorial * { box-sizing: border-box; }

/* ---- decorative background ---- */
.iw-hero-editorial .iw-hero-quotemark {
  position: absolute;
  top: -3rem;
  left: -1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16rem, 34vw, 34rem);
  line-height: 1;
  color: var(--iw-ink);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.iw-hero-editorial .iw-hero-rules {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--iw-line) 1px, transparent 1px);
  background-size: 100% 2.4rem;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
  z-index: 0;
}

.iw-hero-editorial .iw-ink-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--iw-accent), #7d2013);
  opacity: 0.18;
  filter: blur(0.4px);
  animation: iw-drift 14s ease-in-out infinite;
  z-index: 0;
}
.iw-hero-editorial .iw-ink-dot:nth-child(1){ width: 14px; height: 14px; top: 18%; left: 42%; animation-delay: 0s; }
.iw-hero-editorial .iw-ink-dot:nth-child(2){ width: 9px;  height: 9px;  top: 62%; left: 30%; animation-delay: -3s; background: radial-gradient(circle at 30% 30%, var(--iw-accent-2), #8a520f); }
.iw-hero-editorial .iw-ink-dot:nth-child(3){ width: 6px;  height: 6px;  top: 34%; left: 8%;  animation-delay: -6s; }
.iw-hero-editorial .iw-ink-dot:nth-child(4){ width: 11px; height: 11px; top: 78%; left: 60%; animation-delay: -9s; background: radial-gradient(circle at 30% 30%, var(--iw-accent-2), #8a520f); }

@keyframes iw-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(0, -22px) scale(1.12); }
}

/* ---- layout ---- */
.iw-hero-editorial .iw-hero-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

/* ---- copy column ---- */
.iw-hero-editorial .iw-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--iw-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--iw-ink-soft);
}
.iw-hero-editorial .iw-hero-badge .iw-nib {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--iw-accent);
  box-shadow: 0 0 0 4px rgba(200, 69, 47, 0.16);
}

.iw-hero-editorial .iw-hero-title {
  margin: 1.3rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--iw-ink);
}

.iw-hero-editorial .iw-rotator {
  position: relative;
  display: inline-grid;
  vertical-align: bottom;
  color: var(--iw-accent);
  font-style: italic;
}
.iw-hero-editorial .iw-rotator > span {
  grid-area: 1 / 1;
  opacity: 0;                       /* hidden by default; stagger reveals one at a time */
  transform: translateY(0.35em) rotate(-2deg);
  white-space: nowrap;
  will-change: opacity, transform;
  background: linear-gradient(120deg, var(--iw-accent), var(--iw-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Fallback so exactly one word shows even if the per-instance keyframes are absent */
.iw-hero-editorial .iw-rotator > span:first-child {
  opacity: 1;
  transform: none;
}
.iw-hero-editorial .iw-rotator > span::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.09em;
  background: currentColor;
  opacity: 0.25;
  border-radius: 2px;
}

.iw-hero-editorial .iw-hero-desc {
  margin: 1.3rem 0 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.7;
  color: var(--iw-ink-soft);
}

.iw-hero-editorial .iw-hero-actions {
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.iw-hero-editorial .iw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.iw-hero-editorial .iw-btn-primary {
  background: var(--iw-ink);
  color: var(--iw-paper);
  box-shadow: 0 14px 30px -12px rgba(27, 27, 43, 0.6);
}
.iw-hero-editorial .iw-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 38px -12px rgba(27, 27, 43, 0.7); }
.iw-hero-editorial .iw-btn-primary svg { transition: transform 0.25s ease; }
.iw-hero-editorial .iw-btn-primary:hover svg { transform: translateX(4px); }
.iw-hero-editorial .iw-btn-ghost {
  background: transparent;
  color: var(--iw-ink);
  border: 1px solid var(--iw-line);
}
.iw-hero-editorial .iw-btn-ghost:hover { transform: translateY(-3px); background: rgba(255,255,255,0.7); }

/* ---- stats strip ---- */
.iw-hero-editorial .iw-hero-stats {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--iw-line);
}
.iw-hero-editorial .iw-stat-num {
  font-family: Georgia, serif;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 700;
  color: var(--iw-ink);
  line-height: 1;
}
.iw-hero-editorial .iw-stat-label {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--iw-ink-soft);
}

/* ---- featured card column ---- */
.iw-hero-editorial .iw-hero-feature {
  position: relative;
  perspective: 1200px;
}
.iw-hero-editorial .iw-feature-card {
  position: relative;
  z-index: 2;
  background: var(--iw-card);
  border-radius: var(--iw-radius);
  box-shadow: var(--iw-shadow);
  overflow: hidden;
  transform: rotateY(-6deg) rotateX(3deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.6);
}
.iw-hero-editorial .iw-hero-feature:hover .iw-feature-card { transform: rotateY(0deg) rotateX(0deg) translateY(-6px); }
.iw-hero-editorial .iw-feature-cover {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: linear-gradient(135deg, var(--iw-paper-2), #e2dccf);
}
.iw-hero-editorial .iw-feature-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.iw-hero-editorial .iw-hero-feature:hover .iw-feature-cover img { transform: scale(1.05); }
.iw-hero-editorial .iw-feature-tag {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(27, 27, 43, 0.85);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.iw-hero-editorial .iw-feature-body { padding: 1.3rem 1.4rem 1.5rem; }
.iw-hero-editorial .iw-feature-title {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.28;
  color: var(--iw-ink);
}
.iw-hero-editorial .iw-feature-title a { color: inherit; text-decoration: none; }
.iw-hero-editorial .iw-feature-title a:hover { color: var(--iw-accent); }
.iw-hero-editorial .iw-feature-meta {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--iw-ink-soft);
}
.iw-hero-editorial .iw-feature-meta svg { flex: none; }

/* ---- floating quote chips ---- */
.iw-hero-editorial .iw-quote-chip {
  position: absolute;
  z-index: 3;
  max-width: 190px;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px -20px rgba(27, 27, 43, 0.5);
  border: 1px solid var(--iw-line);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--iw-ink);
  animation: iw-float 6s ease-in-out infinite;
}
.iw-hero-editorial .iw-quote-chip::before {
  content: "\201C";
  position: absolute;
  top: -0.6rem; left: 0.5rem;
  font-size: 2rem;
  color: var(--iw-accent);
  opacity: 0.6;
}
.iw-hero-editorial .iw-quote-chip-1 { top: -1.4rem; right: -1rem; animation-delay: 0s; }
.iw-hero-editorial .iw-quote-chip-2 { bottom: -1.6rem; left: -1.6rem; animation-delay: -3s; }
@keyframes iw-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .iw-hero-editorial .iw-hero-inner { grid-template-columns: 1fr; }
  .iw-hero-editorial .iw-hero-feature { order: -1; max-width: 460px; margin: 0 auto; }
  .iw-hero-editorial .iw-feature-card { transform: none; }
  .iw-hero-editorial .iw-quote-chip-2 { left: 0; }
}
@media (max-width: 480px) {
  .iw-hero-editorial .iw-quote-chip { display: none; }
  .iw-hero-editorial .iw-hero-stats { gap: 1.2rem; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .iw-hero-editorial .iw-ink-dot,
  .iw-hero-editorial .iw-quote-chip,
  .iw-hero-editorial .iw-rotator > span { animation: none !important; }
  .iw-hero-editorial .iw-rotator > span { opacity: 0; }
  .iw-hero-editorial .iw-rotator > span:first-child { opacity: 1; transform: none; }
}

/* ---- dark mode ---- */
@media (prefers-color-scheme: dark) {
  .iw-hero-editorial:not(.iw-force-light) {
    --iw-ink: #f3efe6;
    --iw-ink-soft: #b3b1c2;
    --iw-paper: #16161f;
    --iw-paper-2: #1e1e2b;
    --iw-line: rgba(243, 239, 230, 0.14);
    --iw-card: #21212e;
    --iw-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.6);
  }
  .iw-hero-editorial:not(.iw-force-light) .iw-hero-badge,
  .iw-hero-editorial:not(.iw-force-light) .iw-quote-chip { background: rgba(33, 33, 46, 0.9); }
  .iw-hero-editorial:not(.iw-force-light) .iw-btn-primary { background: var(--iw-accent); color: #fff; }
}
