/* =============================================================
   LIENZO — Revista de arte y cultura de El Salvador
   Hoja de estilos única, organizada por secciones.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f7f3ec;   /* papel cálido */
  --bg-2:      #ede4d3;   /* papel sombreado */
  --bg-card:   #fffdf8;
  --ink:       #1c1a16;   /* casi negro cálido */
  --ink-soft:  #3c372f;
  --ink-mute:  #786c5c;
  --accent:    #d24e2a;   /* coral-terracota, más vívido */
  --accent-soft: #f0a06a;
  --accent-2:  #1f8f72;   /* verde esmeralda */
  --accent-3:  #e0a526;   /* mango */
  --gold:      #d6a020;
  --line:      #1c1a16;
  --line-soft: rgba(28,26,22,0.12);

  --serif:  "Playfair Display", "Times New Roman", serif;
  --serif-body: "Source Serif 4", Georgia, serif;
  --sans:   "Work Sans", "Helvetica Neue", Arial, sans-serif;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --maxw: 1280px;
  --maxw-text: 720px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--serif); }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 4px; font-weight: 600; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms var(--ease-soft) both fadeOutUp; }
::view-transition-new(root) { animation: 320ms var(--ease-soft) both fadeInUp; }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kicker {
  font-family: var(--sans); font-weight: 700; font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.kicker.is-jade { color: var(--accent-2); }
.hairline { border: 0; border-top: 1px solid var(--line); opacity: .9; }
.hairline-soft { border: 0; border-top: 1px solid var(--line-soft); }

/* =============================================================
   4. Typography
   ============================================================= */
.huge-serif { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 600; }
.display-serif { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 600; }
.deck {
  font-family: var(--serif-body); font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft); max-width: 46ch; font-style: italic;
}
.byline { font-family: var(--sans); font-size: .85rem; color: var(--ink-mute); letter-spacing: .02em; }

.prose {
  font-family: var(--serif-body);
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: var(--maxw-text);
}
.prose p { margin-bottom: 1.2em; }
.prose p:first-of-type .dropcap {
  float: left; font-family: var(--serif); font-size: 4.4rem; line-height: .82;
  margin: .1rem .5rem -.2rem 0; color: var(--accent); font-style: italic; font-weight: 700;
}
.pullquote {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--ink); border-left: 3px solid var(--accent); padding-left: 1.2rem;
  margin: 2rem 0; max-width: 38ch;
}
.pullquote span { color: var(--accent); font-size: 1.4em; }

/* =============================================================
   5. Masthead & navigation
   ============================================================= */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  transition: box-shadow .3s var(--ease-out);
}
.masthead.is-scrolled { box-shadow: 0 6px 18px rgba(28,26,22,.1); }
.masthead-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: .55rem; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-mute);
}
.masthead-main {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: .6rem 1rem; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name {
  font-family: var(--serif); font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: .01em;
}
.brand-tagline { font-size: .78rem; color: var(--ink-mute); font-style: italic; font-family: var(--serif-body); display: none; }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: 1.6rem; }
.nav-link {
  position: relative; padding: .25rem 0; font-size: .92rem; font-weight: 600;
  letter-spacing: .01em;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-soft);
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-link[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px; padding: .4rem;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 0;
  border-top: 1px solid var(--line);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: .9rem var(--gutter); border-bottom: 1px solid var(--line-soft);
  font-weight: 600; font-size: 1.05rem;
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 200; background: rgba(0,0,0,0.06); pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: 0 0; transform: scaleX(0); transition: transform .08s linear;
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--bg) 0%, var(--bg) 40%, #f3e6da 70%, var(--bg) 100%);
}
.hero-grid {
  display: grid; gap: 2.5rem; align-items: end;
}
.hero-art {
  width: 100%; aspect-ratio: 4/3; border-radius: 18px;
  background:
    radial-gradient(circle at 28% 24%, rgba(210,78,42,.6), transparent 55%),
    radial-gradient(circle at 78% 72%, rgba(31,143,114,.5), transparent 55%),
    radial-gradient(circle at 55% 100%, rgba(224,165,38,.4), transparent 60%),
    linear-gradient(160deg, #efe6d2, #e3d8bf);
  background-size: 180% 180%, 180% 180%, 180% 180%, 100% 100%;
  animation: heroDrift 16s ease-in-out infinite alternate;
  position: relative;
  box-shadow: 0 24px 50px rgba(28,26,22,.16);
}
@keyframes heroDrift {
  0%   { background-position: 0% 0%, 100% 100%, 50% 100%, 0 0; }
  100% { background-position: 30% 20%, 70% 80%, 60% 90%, 0 0; }
}
.hero-art::before {
  content: ""; position: absolute; inset: 0; border-radius: 18px;
  background-image:
    repeating-linear-gradient(115deg, rgba(28,26,22,.05) 0 2px, transparent 2px 18px);
  mix-blend-mode: multiply;
}
.hero-eyebrow { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.dept-strip { padding-block: 1.6rem 0; }
.dept-strip .container { display: flex; gap: .7rem; flex-wrap: wrap; }
.dept-item {
  padding: .7rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--line-soft);
  display: inline-flex; align-items: center; gap: .5rem;
  transition: transform .3s var(--ease-bounce), background .3s, border-color .3s, color .3s;
  background: var(--bg-card);
}
.dept-item:nth-child(1):hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.dept-item:nth-child(2):hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.dept-item:nth-child(3):hover { background: var(--accent-3); border-color: var(--accent-3); color: var(--ink); }
.dept-item:hover { transform: translateY(-3px) scale(1.03); }
.dept-item .num { font-family: var(--sans); font-size: .72rem; opacity: .6; }
.dept-item h3 { font-size: 1rem; font-weight: 700; font-family: var(--sans); letter-spacing: -.01em; }
.dept-item .arrow { transition: transform .3s var(--ease-bounce); }
.dept-item:hover .arrow { transform: translateX(4px); }

/* ---- Ticker en vivo ---- */
.ticker {
  overflow: hidden; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  background: var(--ink); color: var(--bg); padding-block: .55rem;
}
.ticker-track {
  display: flex; gap: 3rem; white-space: nowrap; width: max-content;
  animation: tickerScroll 32s linear infinite;
}
.ticker-track span { font-size: .8rem; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .5rem; }
.ticker-track .sep { color: var(--accent-soft); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation-duration: 90s; } }

/* =============================================================
   7. Cards: eventos / exposiciones / obras
   ============================================================= */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.see-all { font-size: .85rem; font-weight: 700; letter-spacing: .02em; border-bottom: 1px solid currentColor; }

.grid-cards { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }

.card {
  background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  transition: transform .4s var(--ease-bounce), box-shadow .4s var(--ease-soft), border-color .35s;
}
.card:hover { transform: translateY(-6px) rotate(-0.3deg); box-shadow: 0 22px 40px rgba(210,78,42,.18); border-color: transparent; }
.card-art {
  aspect-ratio: 16/10; position: relative; overflow: hidden;
}
.card-art--curtain {
  background: repeating-linear-gradient(100deg, var(--accent) 0 26px, #a8391f 26px 30px);
}
.card-art--curtain::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,26,22,0) 50%, rgba(28,26,22,.55));
}
.card-art--frame {
  background: linear-gradient(135deg, var(--bg-2), #d9cbab);
}
.card-art--frame::before {
  content: ""; position: absolute; inset: 14%;
  border: 2px solid rgba(28,26,22,.3);
}
.card-art--frame::after {
  content: ""; position: absolute; inset: 22%;
  background: radial-gradient(circle at 35% 35%, rgba(31,143,114,.6), transparent 60%),
              radial-gradient(circle at 70% 65%, rgba(224,165,38,.55), transparent 55%);
  filter: blur(1px);
}
.card-tag {
  position: absolute; top: .8rem; left: .8rem; z-index: 2;
  background: var(--ink); color: var(--bg); font-size: .68rem; font-weight: 700; border-radius: 999px;
  letter-spacing: .08em; text-transform: uppercase; padding: .3rem .7rem;
}
.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-meta { font-size: .78rem; color: var(--ink-mute); letter-spacing: .01em; }
.card-title { font-size: 1.25rem; line-height: 1.15; }
.card-desc { font-family: var(--serif-body); color: var(--ink-soft); font-size: .96rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--line-soft); }
.card-link { font-size: .85rem; font-weight: 700; position: relative; }
.card-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-soft);
}
.card-link:hover::after { transform: scaleX(1); transform-origin: left; }

.rating-stars { display: inline-flex; gap: 2px; color: var(--gold); font-size: .95rem; letter-spacing: 1px; }
.rating-line { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--ink-mute); }

/* =============================================================
   8. Buttons & forms
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.5rem; font-weight: 700; font-size: .92rem; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transition: transform .4s var(--ease-bounce), box-shadow .4s var(--ease-soft), background .3s;
}
.btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 34px rgba(210,78,42,.32); background: var(--accent); border-color: var(--accent); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); box-shadow: none; }
.btn-outline:hover { background: var(--ink); color: var(--bg); }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .82rem; font-weight: 700; letter-spacing: .02em; }
.field input, .field textarea {
  font: inherit; padding: .7rem .9rem; border: 1.5px solid var(--line-soft); border-radius: 10px; background: var(--bg-card);
  font-family: var(--sans); transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(210,78,42,.14); outline: none; }
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: .76rem; color: var(--ink-mute); }

.star-input { display: flex; flex-direction: row-reverse; gap: .15rem; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label {
  font-size: 1.7rem; color: var(--line-soft); cursor: pointer; transition: color .15s, transform .15s;
  font-weight: 400;
}
.star-input label:hover, .star-input label:hover ~ label { color: var(--gold); transform: scale(1.08); }
.star-input input:checked ~ label { color: var(--gold); }

.opinion-form {
  background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: 16px;
  padding: clamp(1.4rem, 4vw, 2.2rem); margin-block: 2rem;
}

/* =============================================================
   9. Comentarios / opiniones de la comunidad
   ============================================================= */
.opinion-summary {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.4rem; border-radius: 14px; background: var(--bg-2);
  margin-block: 2rem 1.4rem;
}
.opinion-summary .avg { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.opinion-summary .meta { font-size: .85rem; color: var(--ink-mute); }

.opinion-list { display: flex; flex-direction: column; gap: 1.3rem; }
.opinion-item {
  border-bottom: 1px solid var(--line-soft); padding-bottom: 1.2rem;
}
.opinion-item-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .35rem; flex-wrap: wrap; }
.opinion-author { font-weight: 700; font-size: .95rem; }
.opinion-date { font-size: .76rem; color: var(--ink-mute); }
.opinion-text { font-family: var(--serif-body); color: var(--ink-soft); font-size: 1rem; }
.opinion-item.is-new { animation: popIn .5s var(--ease-bounce); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.opinion-empty { color: var(--ink-mute); font-style: italic; font-family: var(--serif-body); }

/* =============================================================
   10. Footer
   ============================================================= */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem 1.6rem; margin-top: 3.5rem; background: var(--bg-2); }
.footer-grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
.footer-grid h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .8rem; color: var(--ink-mute); }
.footer-grid ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; font-size: .78rem; color: var(--ink-mute); padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }

/* =============================================================
   11. Reveal on scroll
   ============================================================= */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   12. Page hero (eventos / galeria / blog / articulo)
   ============================================================= */
.page-hero { padding-block: clamp(2rem, 6vw, 3.5rem) clamp(1.6rem, 4vw, 2.4rem); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.page-hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-block: .5rem .8rem; }
.breadcrumb { font-size: .8rem; color: var(--ink-mute); margin-bottom: .8rem; }
.breadcrumb a:hover { color: var(--accent); }

.article-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-mute); margin-block: .6rem 1.4rem; }
.article-meta strong { color: var(--ink); }

.related { padding-block: 3rem; margin-top: 3rem; background: linear-gradient(180deg, var(--bg), var(--bg-2)); }

/* =============================================================
   13. Responsive — mobile-first
   ============================================================= */
@media (min-width: 540px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .brand-tagline { display: block; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; }
}

@media (min-width: 960px) {
  .main-nav { display: block; }
  .nav-toggle, .mobile-nav { display: none !important; }
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .dept-item h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
}

@media (min-width: 1280px) {
  .hero-grid { grid-template-columns: 1.3fr 1fr; }
}

/* =============================================================
   14. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .opinion-item.is-new { animation: none; }
}
