/* Visits and guestbook page: the look of the home page (EGA scene behind, light rounded panels with black
   bold text, Cinzel headings) with the numbers in gothic digits. */
:root {
  color-scheme: dark;
  --panel: rgba(224, 224, 224, .94);
  --ink: #000;
  --muted: #3c3a35;
  --rule: #9b9384;
  --gold: #e0bb6e;
  --outline:
    -1.5px -1.5px 0 #000, 0 -1.5px 0 #000, 1.5px -1.5px 0 #000,
    -1.5px 0 0 #000, 1.5px 0 0 #000,
    -1.5px 1.5px 0 #000, 0 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 0 5px #000;
}
* { box-sizing: border-box; }
html { background: #000; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  overflow-x: hidden;
}
.visits-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000 url('/assets/pc-ega-inicio.png') center / cover no-repeat;
  image-rendering: pixelated;
}
html[lang="en"] .visits-backdrop { transform: scaleX(-1); }
.gothic { font-family: 'UnifrakturCook', 'UnifrakturMaguntia', Georgia, serif; font-weight: 700; letter-spacing: .03em; }

/* Bar: language and the way back, like the home page's corner controls. */
.visits-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 3px;
  border-radius: .5rem;
  background: var(--panel);
  color: #000;
  text-decoration: none;
}
.pill a { color: #000; padding: 9px 7px; font-size: 13px; text-decoration: none; }
.pill a[aria-current="true"], .pill a:hover, .pill a:focus-visible { text-decoration: underline; }
a.pill.back { padding: 9px 12px; font-size: 13px; }
a.pill.back:hover, a.pill.back:focus-visible { background: #fff; text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #ffdf9c; outline-offset: 2px; }

main.visits {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}
.visits-title {
  margin: 4px 0 26px;
  text-align: center;
  color: #fff;
  text-shadow: var(--outline);
}
.eyebrow { margin: 0 0 7px; font-size: 10px; letter-spacing: .22em; color: #e3d7bf; }
h1 { margin: 0; font: 700 clamp(30px, 4.4vw, 48px)/1.15 Cinzel, Georgia, serif; }
h1 em { font-style: normal; color: #f0e0c5; }

.panel {
  margin: 0 0 22px;
  padding: 26px clamp(18px, 4vw, 42px);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 2px 12px #0006;
}
.panel h2 { margin: 0 0 14px; font: 700 clamp(22px, 2.6vw, 30px)/1.2 Cinzel, Georgia, serif; }
.panel p { margin: 0; line-height: 1.6; }

/* The count */
.count { text-align: center; }
.total { margin: 0; font-size: clamp(64px, 13vw, 118px); line-height: 1.05; }
.since { margin-top: 4px !important; font-size: 13px; color: var(--muted); }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}
.tiles div { display: flex; flex-direction: column; justify-content: space-between; padding: 12px 8px 10px; border-top: 1px solid var(--rule); }
.tiles dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tiles dd { margin: 6px 0 0; font-size: 34px; line-height: 1; }

/* Visitors per day */
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: #000; }
.chart .bar.today { fill: #7a5317; }
.chart .axis { stroke: #000; stroke-width: 1; }
.chart text { font: 700 10px 'DM Sans', sans-serif; fill: var(--muted); }
.chart text.peak { font-family: 'UnifrakturCook', Georgia, serif; font-size: 15px; fill: #000; }
.hint { margin-top: 8px !important; font-size: 12px; color: var(--muted); }

/* Shares */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; }
.split .wide { grid-column: 1 / -1; }
.bars { list-style: none; margin: 0 0 8px; padding: 0; }
.bars li {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr 4.5em;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.bars .track { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .12); overflow: hidden; }
.bars .fill { display: block; height: 100%; border-radius: 5px; background: #000; }
.bars .value { text-align: right; font-size: 22px; line-height: 1; }

/* Guestbook */
.lead { margin-bottom: 18px !important; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.sign label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.sign label span { font-weight: 400; letter-spacing: .04em; text-transform: none; }
.sign .wide { grid-column: 1 / -1; }
.sign input, .sign textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #77705f;
  border-radius: .5rem;
  background: #f6f4ee;
  color: #000;
  font: 400 16px/1.45 'DM Sans', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.sign textarea { resize: vertical; min-height: 104px; }
.sign .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sign-row { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.sign button, .pager button, .entry .withdraw {
  border: 0;
  border-radius: .65rem;
  background: #000;
  color: #f0e9da;
  font: 800 13px 'DM Sans', sans-serif;
  letter-spacing: .12em;
  cursor: pointer;
}
.sign button { padding: 13px 26px; }
.sign button:hover, .sign button:focus-visible, .pager button:hover, .pager button:focus-visible { background: #2c2416; color: #ffdf9c; }
.sign button[disabled] { opacity: .55; cursor: wait; }
.status { font-size: 14px; }
.status.ok { color: #1f4d12; }
.status.error { color: #7a1010; }
.privacy { grid-column: 1 / -1; font-size: 12px; font-weight: 400; color: var(--muted); }

.entries { list-style: none; margin: 26px 0 0; padding: 0; }
.entry { padding: 16px 0; border-top: 1px solid var(--rule); }
.entry header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.entry .who { font: 700 18px Cinzel, Georgia, serif; }
.entry .where { font-size: 13px; color: var(--muted); }
.entry time { margin-left: auto; font-size: 12px; color: var(--muted); }
.entry .text { font-weight: 400; white-space: pre-line; overflow-wrap: anywhere; }
.entry .withdraw { margin-top: 10px; padding: 7px 12px; font-size: 11px; background: transparent; color: #7a1010; border: 1px solid #7a1010; }
.entry .withdraw:hover, .entry .withdraw:focus-visible { background: #7a1010; color: #fff; }
.entries .empty { padding: 16px 0; border-top: 1px solid var(--rule); color: var(--muted); font-weight: 400; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 10px; }
.pager:empty { display: none; }
.pager button { padding: 9px 16px; font-size: 12px; }
.pager .where { font-size: 20px; }

.method {
  margin: 4px 4px 0;
  color: #f0e9da;
  font-size: 12px;
  line-height: 1.6;
  text-shadow: var(--outline);
}
.visits-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 16px 30px;
  color: #f0e9da;
  font-size: 9px;
  letter-spacing: .15em;
  text-shadow: var(--outline);
}
.visits-footer b { padding: 0 8px; color: var(--gold); }

@media (max-width: 640px) {
  .split, .sign { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tiles div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .bars li { grid-template-columns: minmax(84px, 38%) 1fr 3.6em; }
  .visits-footer { flex-direction: column; gap: 6px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
