/*
Theme Name: Moisés Morao
Theme URI: https://moisesmorao.com
Author: Moisés Morao
Description: El blog de Moisés Morao, con el mismo diseño que moisesmorao.com: fondo oscuro con luz roja, Basramle para los títulos, Glimmer para los subtítulos y Avenir Next Condensed para los textos.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: moisesmorao
*/

/* =========================================================
   Fuentes y colores: los mismos que en moisesmorao.com
   ========================================================= */
@font-face { font-family: "Basramle"; src: url("assets/fonts/basramle.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Glimmer"; src: url("assets/fonts/glimmer.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Avenir Cn"; src: url("assets/fonts/avenir-ultralight.woff2") format("woff2"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Avenir Cn"; src: url("assets/fonts/avenir-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Avenir Cn"; src: url("assets/fonts/avenir-light-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Avenir Cn"; src: url("assets/fonts/avenir-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --negro: #050303;
  --rojo: #c4101c;
  --luz: #ff2a36;
  --blanco: #f2e9df;
  --blanco-2: rgba(242, 233, 223, .66);
  --blanco-3: rgba(242, 233, 223, .3);
  --f-display: "Basramle", "Didot", "Bodoni 72", serif;
  --f-sub: "Glimmer", "Didot", serif;
  --f-text: "Avenir Cn", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--negro); color-scheme: dark; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip; color: var(--blanco);
  font-family: var(--f-text); font-weight: 300; font-size: clamp(17px, 1.15vw, 20px); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  /* la misma luz roja en los dos bordes que en la página del autor */
  background-color: var(--negro);
  background-image: linear-gradient(90deg, rgba(255, 42, 54, .24), rgba(255, 42, 54, .07) 46px, rgba(255, 42, 54, 0) 120px), linear-gradient(270deg, rgba(255, 42, 54, .24), rgba(255, 42, 54, .07) 46px, rgba(255, 42, 54, 0) 120px);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--rojo); color: var(--blanco); }
:focus-visible { outline: 1px solid var(--luz); outline-offset: 6px; }
.sr-only, .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* el grano de la web */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -2%); } 80% { transform: translate(3%, 3%); } }

/* =========================================================
   Cabecera: volver a la web · nombre · la web
   ========================================================= */
.b-top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(20px + env(safe-area-inset-top)) var(--gutter) 28px; background: linear-gradient(var(--negro) 55%, rgba(5, 3, 3, 0)); }
.b-top a { font-family: var(--f-sub); font-size: 1.2rem; line-height: .9; color: var(--blanco-2); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; transition: color .4s; }
.b-top a:hover { color: var(--blanco); }
.b-top__name { position: absolute; left: 50%; translate: -50% 0; }
.back { display: inline-flex; align-items: center; gap: .7rem; padding: 6px 0; }
.back-arrow { width: 40px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
.back:hover .back-arrow { transform: translateX(-4px); }

/* =========================================================
   Portada del blog
   ========================================================= */
.b-main { width: min(100%, 1180px); margin: 0 auto; padding: 18vh var(--gutter) 10vh; }
.b-head { text-align: center; margin-bottom: 9vh; }
.b-title { margin: 0; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(3.4rem, 8vw, 9rem); line-height: .95; }
.b-line { width: 1px; height: 12vh; margin: 3.5vh auto 3vh; background: rgba(255, 42, 54, .9); box-shadow: 0 0 18px rgba(255, 42, 54, .8), 0 0 60px rgba(255, 42, 54, .35); transform-origin: 50% 0; }
.b-sub { margin: 0 auto; max-width: 30ch; font-family: var(--f-sub); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: clamp(1.3rem, 2vw, 2.2rem); line-height: 1.2; color: var(--blanco); text-shadow: 0 0 40px rgba(255, 42, 54, .4); }

/* cada artículo de la lista */
.b-list { display: grid; gap: 0; }
.b-item { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 5vw; align-items: center; padding: 7vh 0; border-top: 1px solid rgba(242, 233, 223, .12); }
.b-item:first-child { border-top: 0; padding-top: 0; }
.b-item--sin-imagen { grid-template-columns: 1fr; text-align: center; }
.b-item__img { position: relative; margin: 0; isolation: isolate; }
.b-item__img::before { content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: 130%; translate: -50% -50%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(196, 16, 28, .38), rgba(5, 3, 3, 0)); }
.b-item__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 1.2s var(--ease);
  -webkit-mask-image: radial-gradient(ellipse 80% 82% at 50% 48%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 80% 82% at 50% 48%, #000 62%, transparent 100%); }
.b-item:hover .b-item__img img { transform: scale(1.03); }
.b-date { display: block; font-weight: 300; font-size: clamp(1.15rem, 1.25vw, 1.35rem); letter-spacing: .02em; color: var(--blanco-2); }
.b-item__title { margin: .7rem 0 0; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.2rem, 4.2vw, 4.6rem); line-height: 1; text-wrap: balance; transition: color .5s var(--ease), text-shadow .5s var(--ease); }
.b-item:hover .b-item__title { color: #ffd3d3; text-shadow: 0 0 40px rgba(255, 42, 54, .7); }
.b-item__excerpt { margin: 1.3rem 0 0; font-weight: 200; font-size: calc(clamp(1rem, 1.1vw, 1.2rem) + 3px); line-height: 1.6; color: var(--blanco-2); -webkit-text-stroke: .45px var(--blanco); paint-order: stroke fill; text-wrap: pretty; }
.b-item--sin-imagen .b-item__excerpt { margin-left: auto; margin-right: auto; max-width: 52ch; }
.b-more { display: inline-block; margin-top: 1.8rem; font-family: var(--f-sub); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: clamp(1.1rem, 1.3vw, 1.4rem); color: var(--blanco-2); position: relative; padding: .3em 0; transition: color .5s; }
.b-more::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--luz); box-shadow: 0 0 10px var(--luz); transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease); }
.b-item:hover .b-more, .b-more:hover { color: var(--blanco); }
.b-item:hover .b-more::after, .b-more:hover::after { transform: scaleX(1); transform-origin: left; }
.b-empty { text-align: center; font-size: 1.3rem; color: var(--blanco-2); }

/* paginación */
.b-pages { display: flex; justify-content: center; gap: 2.4rem; margin-top: 8vh; font-family: var(--f-sub); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: 1.25rem; color: var(--blanco-2); }
.b-pages a:hover { color: var(--blanco); }
.b-pages .current { color: var(--luz); }

/* =========================================================
   El artículo
   ========================================================= */
.b-post { width: min(100%, 860px); margin: 0 auto; padding: 18vh var(--gutter) 8vh; }
.b-post__head { text-align: center; }
.b-post__title { margin: 1rem 0 0; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(3rem, 7vw, 7.6rem); line-height: 1; text-wrap: balance; }
.b-post__sub { margin: 0 auto; max-width: 32ch; font-family: var(--f-sub); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: clamp(1.3rem, 2vw, 2.2rem); line-height: 1.2; color: var(--blanco); text-shadow: 0 0 40px rgba(255, 42, 54, .4); }
.b-post__img { position: relative; margin: 7vh auto 0; isolation: isolate; width: fit-content; max-width: 100%; }
.b-post__img::before { content: ""; position: absolute; left: 50%; top: 50%; width: 150%; height: 130%; translate: -50% -50%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(196, 16, 28, .42), rgba(5, 3, 3, 0)); }
.b-post__img img { max-height: 80vh; width: auto;
  -webkit-mask-image: radial-gradient(ellipse 82% 84% at 50% 48%, #000 64%, transparent 100%); mask-image: radial-gradient(ellipse 82% 84% at 50% 48%, #000 64%, transparent 100%); }

/* el texto que escribes en WordPress */
.b-content { margin-top: 7vh; }
.b-content > * + * { margin-top: 1.5rem; }
.b-content p, .b-content li { font-weight: 200; font-size: calc(clamp(1rem, 1.1vw, 1.2rem) + 4px); line-height: 1.65; color: var(--blanco-2); -webkit-text-stroke: .45px var(--blanco); paint-order: stroke fill; text-wrap: pretty; }
.b-content strong, .b-content b { font-weight: 300; color: var(--blanco); -webkit-text-stroke: .6px var(--blanco); }
.b-content em, .b-content i { font-style: italic; font-weight: 300; color: var(--blanco); -webkit-text-stroke: 0; }
.b-content a { color: var(--blanco); background-image: linear-gradient(var(--luz), var(--luz)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; transition: text-shadow .4s; }
.b-content a:hover { text-shadow: 0 0 18px rgba(255, 42, 54, .9); }
.b-content h2 { margin-top: 3.4rem; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2rem, 3.6vw, 3.6rem); line-height: 1; }
.b-content h3 { margin-top: 2.6rem; font-family: var(--f-sub); font-weight: 400; text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: clamp(1.4rem, 2vw, 2rem); line-height: 1.2; color: var(--blanco); }
.b-content h4 { margin-top: 2rem; font-weight: 300; font-size: 1.3rem; color: var(--blanco); }
.b-content ul, .b-content ol { padding-left: 1.3em; }
.b-content li + li { margin-top: .5rem; }
.b-content li::marker { color: var(--luz); }
/* las citas: como las frases finales de la web, grandes y en cursiva, con la línea roja */
.b-content blockquote { position: relative; margin: 3rem 0; padding: .2rem 0 .2rem 1.8rem; }
.b-content blockquote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--luz); box-shadow: 0 0 12px rgba(255, 42, 54, .9); }
.b-content blockquote p { font-style: italic; font-weight: 400; font-size: calc(clamp(1.35rem, 1.7vw, 1.95rem) + 3px); line-height: 1.4; color: var(--blanco); -webkit-text-stroke: 0; text-wrap: balance; }
.b-content blockquote cite { display: block; margin-top: .8rem; font-style: normal; font-size: 1rem; color: var(--blanco-2); }
.b-content figure { margin: 3rem 0; }
.b-content figure img, .b-content > img { margin: 0 auto; }
.b-content figcaption { margin-top: .8rem; text-align: center; font-size: 1rem; color: var(--blanco-2); }
.b-content hr { width: 1px; height: 9vh; margin: 4rem auto; border: 0; background: rgba(255, 42, 54, .9); box-shadow: 0 0 18px rgba(255, 42, 54, .8); }
.b-content .alignwide { width: min(100vw - 2 * var(--gutter), 1180px); margin-left: 50%; translate: -50% 0; }
.b-content .alignfull { width: 100vw; margin-left: 50%; translate: -50% 0; }
.b-content .aligncenter { margin-left: auto; margin-right: auto; }
.b-content .wp-block-image img { height: auto; }
.b-content .has-text-align-center { text-align: center; }

/* anterior · siguiente */
.b-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 10vh; padding-top: 5vh; border-top: 1px solid rgba(242, 233, 223, .12); }
.b-nav a { display: block; }
.b-nav__label { display: block; font-family: var(--f-sub); text-transform: lowercase; -webkit-text-stroke: .6px currentColor; font-size: 1.15rem; color: var(--blanco-2); }
.b-nav__title { display: block; margin-top: .5rem; font-family: var(--f-display); text-transform: uppercase; font-size: clamp(1.4rem, 2.2vw, 2.2rem); line-height: 1.05; transition: color .5s, text-shadow .5s; }
.b-nav a:hover .b-nav__title { color: #ffd3d3; text-shadow: 0 0 30px rgba(255, 42, 54, .7); }
.b-nav__next { text-align: right; }
.b-back { display: block; width: fit-content; margin: 8vh auto 0; }

/* =========================================================
   Pie
   ========================================================= */
.b-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 4vh var(--gutter) calc(3vh + env(safe-area-inset-bottom)); font-weight: 300; font-size: .95rem; color: var(--blanco-3); }
.b-foot a { color: var(--blanco-3); transition: color .4s; }
.b-foot a:hover { color: var(--blanco); }

/* entrada suave de cada bloque */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.b-line.reveal { transform: scaleY(0); }
.b-line.reveal.is-in { transform: scaleY(1); }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* =========================================================
   Móvil: los textos nunca por debajo de 21px
   ========================================================= */
@media (max-width: 860px) {
  .b-top__name { display: none; }
  .b-main, .b-post { padding-top: 14vh; }
  .b-item { grid-template-columns: 1fr; gap: 3vh; text-align: center; padding: 6vh 0; }
  .b-item__img { width: min(100%, 420px); margin: 0 auto; }
  .b-item__excerpt, .b-content p, .b-content li { font-size: 21px; }
  .b-date { font-size: 21px; }
  .b-content blockquote p { font-size: 24px; }
  .b-nav { grid-template-columns: 1fr; text-align: center; }
  .b-nav__next { text-align: center; }
  .b-foot { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .grain { animation: none; }
}
