/* ============================================================================
   Que Hay Panamá — hoja de estilo
   Dirección: editorial limpio · periódico moderno · papel cálido
   Colores tomados del logo: guinda (#8A1E2D) y mostaza (#E3B21E) sobre negro.
   ========================================================================== */

:root {
  --paper: #fbf7ee;
  --paper-2: #f3ecdb;
  --card: #ffffff;
  --ink: #191512;
  --ink-soft: #443c34;
  --muted: #6b6055;
  --rule: #e2d8c3;
  --rule-strong: #cdbfa2;
  --maroon: #8a1e2d;
  --maroon-deep: #6d1622;
  --gold: #e3b21e;
  --gold-deep: #b98a08;
  --link: #8a1e2d;
  --link-hover: #6d1622;
  --focus: #8a1e2d;

  --measure: 44rem;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14100b;
    --paper-2: #1c1710;
    --card: #1c1710;
    --ink: #f1e8d7;
    --ink-soft: #d6c9b4;
    --muted: #9d8f7b;
    --rule: #352a1c;
    --rule-strong: #4a3b27;
    --maroon: #ec7d8d;
    --maroon-deep: #f3919f;
    --gold: #eac244;
    --gold-deep: #d7a92c;
    --link: #f0a6b1;
    --link-hover: #f6c0c8;
    --focus: #ec7d8d;
  }
}

/* --------------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
}

/* --------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------ */
body {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  font-feature-settings: "kern", "liga", "onum", "pnum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grano de papel muy sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  body::before {
    opacity: 0.05;
    mix-blend-mode: screen;
  }
}

.page {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--gold);
  color: #191512;
}

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Banda superior + cabecera
   ------------------------------------------------------------------------ */
.topband {
  height: 4px;
  background: linear-gradient(90deg, var(--maroon) 0 62%, var(--gold) 62% 100%);
}

.masthead {
  padding-top: clamp(1.6rem, 5vw, 2.8rem);
  padding-bottom: 1.1rem;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1rem);
  color: var(--ink);
}
.brand:hover {
  color: var(--ink);
}
.brand__logo {
  width: clamp(40px, 9vw, 54px);
  height: clamp(40px, 9vw, 54px);
  flex: none;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.08));
}
.brand__name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 3.15rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.brand__name em {
  font-style: normal;
  color: var(--maroon);
}

.dateline {
  margin-top: 1.15rem;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.dateline > * {
  flex: 1;
}
.dateline__mid {
  text-align: center;
  color: var(--muted);
}
.dateline__right {
  text-align: right;
}
@media (max-width: 34rem) {
  .dateline {
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
  .dateline > *,
  .dateline__right {
    text-align: center;
  }
}

.tagline {
  margin-top: 0.95rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  color: var(--ink-soft);
}

.updated {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
}
.updated .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 0 0 rgba(227, 178, 30, 0.6);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(227, 178, 30, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(227, 178, 30, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(227, 178, 30, 0);
  }
}

/* --------------------------------------------------------------------------
   Secciones
   ------------------------------------------------------------------------ */
main {
  padding-block: clamp(1.8rem, 5vw, 3rem) clamp(3rem, 8vw, 5rem);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: 0.8ch;
  margin-bottom: 0.4rem;
}
.kicker::after {
  content: "";
  height: 2px;
  flex: 1;
  background: var(--rule);
}
.section + .section {
  margin-top: clamp(2.6rem, 7vw, 4rem);
}

/* --------------------------------------------------------------------------
   Lista de noticias
   ------------------------------------------------------------------------ */
.stories {
  list-style: none;
  padding: 0;
}
.story {
  padding-block: clamp(1.4rem, 4vw, 1.9rem);
  border-top: 1px solid var(--rule);
}
.story:first-child {
  border-top: none;
  padding-top: 1.1rem;
}

/* fila: texto + miniatura opcional a la derecha */
.story__row {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.4rem);
  align-items: flex-start;
}
.story__body {
  flex: 1 1 auto;
  min-width: 0;
}
.story__thumb {
  flex: none;
  width: clamp(88px, 24vw, 120px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  filter: saturate(0.96);
}

/* foto grande de la nota principal */
.story__figure {
  position: relative;
  margin: 0 0 1.1rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.story__figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.97) contrast(1.02);
}
@media (prefers-color-scheme: dark) {
  .story__thumb,
  .story__figure img {
    filter: saturate(0.9) brightness(0.9);
  }
}

.story__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  color: var(--maroon);
  font-weight: 500;
}
.badge::before {
  content: "";
  width: 3px;
  height: 0.95em;
  background: var(--maroon);
  display: inline-block;
}
.story__meta .via {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.04em;
}

.story__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.25rem, 4.2vw, 1.55rem);
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.story__title a {
  color: var(--ink);
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s ease;
  padding-bottom: 0.06em;
}
.story__title a:hover,
.story__title a:focus-visible {
  color: var(--maroon);
  background-size: 100% 2px;
}

.story__dek {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 38rem;
}

.story__foot {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.story__foot a {
  color: var(--maroon);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.story__foot a:hover {
  border-color: currentColor;
}
.story__foot a .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.story__foot a:hover .arrow {
  transform: translate(2px, -2px);
}

/* nota destacada (primera) */
.story--lead .story__title {
  font-weight: 600;
  font-size: clamp(1.7rem, 6.4vw, 2.35rem);
  line-height: 1.1;
}
.story--lead .story__dek {
  font-size: 1.06rem;
}

/* --------------------------------------------------------------------------
   Ediciones anteriores / archivo
   ------------------------------------------------------------------------ */
.editions {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.editions li {
  border-bottom: 1px solid var(--rule);
}
.editions a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.editions a:hover {
  color: var(--maroon);
}
.editions .date {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.editions .count {
  color: var(--muted);
  white-space: nowrap;
}
.editions a:hover .count {
  color: var(--maroon);
}

.more-link {
  display: inline-block;
  margin-top: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* índice de archivo por meses */
.archive-year {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 2.4rem 0 0.4rem;
  color: var(--ink);
}
.archive-month {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.4rem 0 0.5rem;
}

/* --------------------------------------------------------------------------
   Navegación entre días
   ------------------------------------------------------------------------ */
.daynav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.daynav a {
  color: var(--maroon);
}
.daynav span {
  color: var(--muted);
}
.daynav .n {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Prosa (página "sobre")
   ------------------------------------------------------------------------ */
.prose {
  max-width: 38rem;
}
.prose h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
}
.prose p {
  margin-bottom: 1rem;
  color: var(--ink-soft);
}
.prose a {
  border-bottom: 1px solid var(--rule);
}
.prose a:hover {
  border-color: currentColor;
}
.prose ul {
  margin: 0 0 1rem 1.1rem;
  color: var(--ink-soft);
}
.prose li {
  margin-bottom: 0.35rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  margin: 1.6rem 0 0.4rem;
}
.prose blockquote {
  margin: 1.2rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.1em 0.35em;
  border: 1px solid var(--rule);
}

/* --------------------------------------------------------------------------
   Nota propia
   ------------------------------------------------------------------------ */
.badge--own {
  color: var(--gold-deep);
}
.badge--own::before {
  background: var(--gold-deep);
}
.note__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.note__figure {
  margin: 0 0 1.4rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.note__figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.note__lead {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 1.3rem !important;
}
.note__body > :first-child {
  margin-top: 0;
}
.note__source {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.note__source a {
  color: var(--maroon);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.note .daynav a {
  color: var(--maroon);
}

/* --------------------------------------------------------------------------
   Pie
   ------------------------------------------------------------------------ */
.site-foot {
  background: var(--paper-2);
  border-top: 2px solid var(--maroon);
  padding-block: clamp(2.2rem, 6vw, 3.4rem);
  margin-top: auto;
}
.site-foot .brand__name {
  font-size: 1.4rem;
}
.foot-lead {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.foot-lead .brand__logo {
  width: 34px;
  height: 34px;
}
.foot-note {
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.6;
}
.foot-links {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.foot-links a {
  color: var(--ink);
}
.foot-links a:hover {
  color: var(--maroon);
}

.foot-social {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.foot-social > span {
  color: var(--muted);
}
.foot-social a {
  color: var(--maroon);
}
.foot-social a:hover {
  color: var(--maroon-deep);
}
.foot-legal {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   404
   ------------------------------------------------------------------------ */
.notfound {
  text-align: center;
  padding-block: clamp(3rem, 12vw, 7rem);
}
.notfound .code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4rem, 20vw, 8rem);
  line-height: 1;
  color: var(--maroon);
}


/* --------------------------------------------------------------------------
   Impresión
   ------------------------------------------------------------------------ */
@media print {
  .topband,
  .updated,
  .site-foot,
  .daynav,
  body::before {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .story__title a {
    color: #000;
  }
}
