/* Copyright Pedro Antonio Pelaez Jimenez. All Rights Reserved. */

/* Colours taken from the game's captures (dusk over the dehesa) and the parchment look of its windows
   (Source/ElRetiro/UI/ParchmentStyle.h in the game: Ink, FadedInk, Paper, LightPaper, ShadedPaper, Vermilion, Gold).
   Font: Gelasio, the game's own (SIL Open Font License, assets/fonts/Gelasio-OFL.txt). */

@font-face { font-family: "Gelasio"; src: url("../fonts/Gelasio-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("../fonts/Gelasio-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gelasio"; src: url("../fonts/Gelasio-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* the dusk */
  --night: #141b2c;
  --dusk: #1e2943;
  --dusk-soft: #2d3c5e;
  --cloud: #e8b98d;
  --sun: #f6cf78;
  /* the dehesa */
  --oak: #161c12;
  --olive: #1f2717;
  --olive-soft: #2c3620;
  --grass: #b89a4c;
  /* text on the dark */
  --light: #ece1c6;
  --light-soft: #c9bc9c;
  /* the game's parchment */
  --ink: #3a2618;
  --faded-ink: #70563e;
  --paper: #f0e5c8;
  --light-paper: #faf4e2;
  --shaded-paper: #decda8;
  --vermilion: #b82a1c;
  --gold: #cea03a;
  --shadow: rgba(0, 0, 0, .45);

  --serif: "Gelasio", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--olive);
  color: var(--light);
  font: 1.0625rem/1.65 var(--serif);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--cloud); text-underline-offset: .15em; }
a:hover { color: var(--sun); }
:focus-visible { outline: 3px solid var(--vermilion); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); margin: 0 0 1.25rem; color: var(--cloud); }
h3 { font-size: 1.2rem; margin: 0 0 .4rem; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(780px, 100% - 2rem); }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--paper); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* --- The parchment sheet, as the game's windows draw it: ink 2, paper 3, ink 1, then the paper; a shadow 4 down
       and right ---------------------------------------------------------------------------------------------- */
.sheet {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink), 4px 4px 0 var(--shadow);
  padding: 1.4rem 1.5rem 1.2rem;
}
.sheet a { color: var(--vermilion); }
.sheet a:hover { color: var(--ink); }
.sheet h1, .sheet h2, .sheet h3 { color: var(--ink); }
/* the double rule under a title */
.ruled { position: relative; padding-bottom: .55rem; margin-bottom: .8rem; }
.ruled::before, .ruled::after { content: ""; position: absolute; left: 0; right: 0; background: var(--ink); }
.ruled::before { bottom: 4px; height: 2px; }
.ruled::after { bottom: 0; left: 12%; right: 12%; height: 1px; }
.centered { text-align: center; }

/* --- Header ------------------------------------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(20, 27, 44, .96);
  border-bottom: 1px solid var(--dusk-soft);
  box-shadow: 0 2px 0 rgba(232, 185, 141, .18);
}
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 3.75rem; flex-wrap: wrap; padding-block: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--sun); text-decoration: none; font: 700 1.35rem var(--serif); }
.brand:hover { color: var(--light-paper); }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.topbar nav { flex: 1; }
.topbar a:not(.brand) { color: var(--light); text-decoration: none; font-size: 1rem; }
.topbar a:not(.brand):hover, .topbar a[aria-current="page"] { color: var(--cloud); text-decoration: underline; }
.langs a { padding: .1rem .55rem; border: 1px solid transparent; }
.langs a[aria-current="true"] { border-color: var(--cloud); color: var(--cloud); }

@media (max-width: 760px) {
  .topbar { position: static; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .topbar-inner { justify-content: space-between; }
}

/* --- Hero: a capture of the game, dusk over the dehesa ------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(82vh, 760px);
  display: flex; align-items: flex-end;
  padding: 6rem 0 3.5rem;
  background:
    linear-gradient(180deg, rgba(20, 27, 44, .55) 0%, rgba(20, 27, 44, .05) 35%, rgba(22, 28, 18, .35) 65%, var(--olive) 100%),
    url("../img/hero.jpg") center 40% / cover no-repeat var(--dusk);
  color: var(--light-paper);
}
.hero-inner { max-width: 720px; margin-left: max(1rem, (100% - 1120px) / 2); text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.badge {
  display: inline-block; margin: 0 0 1rem; padding: .15rem .8rem;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--ink), 3px 3px 0 var(--shadow);
  font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; text-shadow: none;
}
.hero h1 { font-size: clamp(3rem, 2rem + 6vw, 5.5rem); margin: 0; color: var(--light-paper); }
.tagline { font: italic clamp(1.2rem, 1rem + 1vw, 1.6rem)/1.35 var(--serif); margin: .4rem 0 1rem; color: var(--cloud); }
.lead { font-size: 1.15rem; max-width: 60ch; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; text-shadow: none; }

/* buttons as the game's: boxed in ink on light paper; inked for the main action */
.button {
  display: inline-block; padding: .6rem 1.4rem;
  font: 700 1rem var(--serif); text-decoration: none;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow);
  background: var(--ink); color: var(--light-paper);
}
.button:hover { background: #24170e; color: var(--sun); }
.button.paper { background: var(--light-paper); color: var(--ink); }
.button.paper:hover { background: var(--shaded-paper); color: var(--ink); }
.sheet .button { color: var(--light-paper); }
.sheet .button:hover { color: var(--sun); }

/* --- Sections ---------------------------------------------------------------------------------------------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section.dusk { background: linear-gradient(180deg, var(--dusk) 0%, var(--night) 100%); }
.section.oak { background: var(--oak); }
.section p { margin: 0 0 1rem; }
.game-text p { font-size: 1.12rem; color: var(--light); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card p { margin: 0; color: var(--ink); font-size: 1rem; }
.card h3 { font-size: 1.15rem; }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gallery a { display: block; border: 2px solid var(--ink); box-shadow: inset 0 0 0 3px var(--paper), 4px 4px 0 var(--shadow); padding: 6px; background: var(--paper); }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ink); }

.split { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 3fr 2fr; align-items: start; } }
.ticks { padding-left: 1.2rem; margin: 0; }
.ticks li { margin: .4rem 0; }
.ticks li::marker { color: var(--cloud); }
.facts dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--faded-ink); }
@media (max-width: 420px) { .facts dl { grid-template-columns: 1fr; } .facts dd { margin-bottom: .5rem; } }

.faq { border-bottom: 1px solid var(--shaded-paper); padding: .7rem 0; }
.faq:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq summary::marker { color: var(--vermilion); }
.faq p { margin: .5rem 0 .2rem; color: var(--faded-ink); }

/* --- Privacy policy: one long sheet -------------------------------------------------------------------------- */
.legal .sheet { padding: clamp(1.4rem, 4vw, 2.6rem); }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.7rem); margin: 0 0 .2rem; }
.legal h2 { font-size: 1.35rem; margin: 2rem 0 .5rem; color: var(--ink); }
.legal li { margin: .35rem 0; }
.updated { color: var(--faded-ink); margin-top: 0; font-style: italic; }
.summary { background: var(--light-paper); border: 1px solid var(--ink); border-left: 4px solid var(--ink); padding: .9rem 1.2rem; }

.notfound .sheet { text-align: center; }

/* --- Footer ------------------------------------------------------------------------------------------------ */
.footer { background: var(--night); color: var(--light-soft); padding: 2rem 0; font-size: .95rem; border-top: 1px solid var(--dusk-soft); }
.footer a { color: var(--cloud); }
.footer p { margin: .4rem 0; }
.footer .small { font-size: .82rem; opacity: .85; }
