/* Cards editoriais da Palavra: usados na página inicial e no blog.
   Cada cor é um conjunto de 4 tons; o resto do card é igual para todos. */
/* família do logo: vermelho, vinho, dourado e neutros quentes */
.cor-rubi      { --c1: #5f0e12; --c2: #a8161b; --c3: #d9564f; --c4: #f2bdb0; --tinta: #b3141a; }
.cor-violeta   { --c1: #3a1216; --c2: #6f1f28; --c3: #b0616a; --c4: #e6bfc0; --tinta: #7c2430; }
.cor-oceano    { --c1: #1f1b1c; --c2: #463f40; --c3: #8b8283; --c4: #d6cfcf; --tinta: #463f40; }
.cor-grafite   { --c1: #332d2a; --c2: #5c534e; --c3: #a1968f; --c4: #ddd5ce; --tinta: #5c534e; }
.cor-ambar     { --c1: #453610; --c2: #80651a; --c3: #cfae4a; --c4: #efdfa8; --tinta: #775d15; }
.cor-esmeralda { --c1: #4a2a1c; --c2: #875038; --c3: #c98f73; --c4: #eccdb9; --tinta: #824b33; }
.cor-rosa      { --c1: #52212a; --c2: #95424f; --c3: #d58b90; --c4: #f3d2cf; --tinta: #93404d; }

.ec {
  --mx: 70%; --my: 15%;
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  height: 100%; min-height: 420px; padding: 28px; border-radius: 28px; color: #fff; text-decoration: none; background: var(--c2);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s cubic-bezier(.22, 1, .36, 1), box-shadow .6s cubic-bezier(.22, 1, .36, 1);
}
.ec:hover { text-decoration: none; box-shadow: 0 30px 60px -22px color-mix(in srgb, var(--c2) 70%, transparent); }
.ec:focus-visible { outline: 3px solid var(--c3); outline-offset: 4px; border-radius: 28px; }
/* malha de cor, que respira devagar */
.ec::before {
  content: ""; position: absolute; inset: -30%; z-index: -4;
  background:
    radial-gradient(38% 42% at 72% 24%, var(--c4), transparent 70%),
    radial-gradient(48% 46% at 30% 32%, var(--c3), transparent 72%),
    radial-gradient(60% 60% at 78% 78%, var(--c2), transparent 75%),
    linear-gradient(160deg, var(--c2), var(--c1));
  animation: ec-malha 16s ease-in-out infinite alternate;
}
@keyframes ec-malha { from { transform: translate3d(-4%, -2%, 0) rotate(0); } to { transform: translate3d(5%, 4%, 0) rotate(14deg); } }
/* base escura para o texto ter contraste em qualquer cor */
.ec::after { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 88%, transparent) 0, transparent 34%, color-mix(in srgb, var(--c1) 84%, transparent) 74%, var(--c1)); }
/* foto em duotom; ganha a cor real ao passar o mouse */
.ec__foto { position: absolute; inset: 0; z-index: -3; }
.ec__foto img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: luminosity; opacity: .72; transition: opacity .6s, transform 1.4s cubic-bezier(.22, 1, .36, 1); }
.ec:hover .ec__foto img { transform: scale(1.05); mix-blend-mode: normal; opacity: 1; }
/* luz que segue o ponteiro */
.ec__luz { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(340px circle at var(--mx) var(--my), rgba(255, 255, 255, .3), transparent 70%); pointer-events: none; }
.ec:hover .ec__luz { opacity: 1; }
.ec__topo { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.ec__topo span + span { font-weight: 500; opacity: .85; white-space: nowrap; }
.ec__corpo { display: grid; gap: 12px; }
.ec__titulo { font-family: var(--font-display); font-weight: 600; font-size: clamp(25px, 2.2vw, 31px); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.ec__resumo { font-size: 16px; line-height: 1.42; color: rgba(255, 255, 255, .88); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ec__pe { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.ec__seta { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); color: #fff; transition: background-color .3s, color .3s; }
.ec__seta svg { transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
.ec:hover .ec__seta { background: #fff; color: var(--c1); }
.ec:hover .ec__seta svg { transform: translateX(2px); }
.ec--g .ec__titulo { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -.035em; max-width: 16ch; }
.ec--g .ec__resumo { font-size: 19px; max-width: 46ch; }
.ec--g { padding: clamp(28px, 3.4vw, 44px); }
@media (max-width: 600px) { .ec { min-height: 400px; padding: 24px; } }
@media (hover: none) { .ec { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ec, .ec__foto img { transform: none !important; transition: none; } .ec::before { animation: none; } }

/* versão clara: cor só como luz, texto escuro */
.ec { color: #211a1b; background: #fff; border-radius: 26px; box-shadow: 0 0 0 1px rgba(45, 22, 22, .07); }
.ec:hover { box-shadow: 0 0 0 1px rgba(45, 22, 22, .05), 0 26px 60px -18px color-mix(in srgb, var(--c2) 32%, transparent); }
.ec::before { background: radial-gradient(38% 34% at 72% 26%, color-mix(in srgb, var(--c4) 85%, #fff), transparent 72%), radial-gradient(44% 38% at 34% 30%, color-mix(in srgb, var(--c3) 48%, #fff), transparent 74%), #fff; }
.ec::after { background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 24%, rgba(255, 255, 255, .9) 58%, #fff 72%); }
.ec__foto { bottom: 42%; } .ec__foto img { mix-blend-mode: normal; opacity: 1; filter: saturate(.85); } .ec:hover .ec__foto img { filter: none; }
.ec:has(.ec__foto)::after { background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0) 38%, #fff 58%); }
.ec__topo span:first-child { color: var(--tinta); } .ec__topo span + span { opacity: 1; }
.ec__titulo { font-weight: 600; } .ec__resumo, .ec__pe { color: #675d5e; }
.ec__seta { background: color-mix(in srgb, var(--c4) 45%, #fff); color: var(--tinta); } .ec:hover .ec__seta { background: var(--tinta); color: #fff; }
.ec__luz { background: radial-gradient(320px circle at var(--mx) var(--my), rgba(255, 255, 255, .7), transparent 70%); }
.ec:has(.ec__foto) .ec__topo span { padding: 7px 13px; border-radius: 99px; background: rgba(255, 255, 255, .92); }
.ec:has(.ec__foto)::after { background: linear-gradient(180deg, transparent 38%, #fff 58%); }
