/* ========================================
   BASE.CSS — Perustyylit, typografia, animaatiot
   Ladataan <link> jälkeen
   ======================================== */

/* ---------- TYPOGRAFIA ---------- */
body {
  font-family: var(--ff-inter);
}

/* Otsikot */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-oxanium);
  font-weight: var(--fw-800);
  line-height: 1.1;
  color: var(--text-primary);
}

/* Leipäteksti */
p {
  margin-block-end: 1em;
}

/* Linkit */
a {
  color: var(--teal);
  transition: color var(--transition);
}

a:hover {
  color: var(--gold);
}

/* ---------- VALINTA ---------- */
::selection {
  background-color: var(--gold);
  color: var(--bg-deep);
}

/* ---------- OSAIOT ---------- */
.section {
  padding-block: var(--section-padding);
}

.section-warm {
  background:
    radial-gradient(ellipse at 50% 0%, transparent 40%, rgba(13, 10, 15, 0.15) 100%),
    linear-gradient(180deg, #2e1e2a 0%, #281e28 25%, #221a24 50%, #1c141e 100%);
  position: relative;
  animation: warmGlow 12s ease-in-out infinite alternate;
  scroll-margin-top: 80px;
}

/* Section-warm tarvitsee ylimääräistä paddingia, jotta fixed header ei peitä sisältöä */
.section-warm .container {
  padding-top: 20px;
}

/* Hienovarainen lämpöaalto — tausta hengittää hitaasti */
@keyframes warmGlow {
  0%   { background-position-y: 0%, 0%; }
  50%  { background-position-y: 5%, 5%; }
  100% { background-position-y: 0%, 0%; }
}

/* Hienovarainen lämpöerotin — pehmeä valoreuna section-warmin yläreunassa, hengittää */
.section-warm::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.08), transparent);
  pointer-events: none;
  animation: warmBorderBreathe 6s ease-in-out infinite;
}

@keyframes warmBorderBreathe {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%      { opacity: 1; transform: scaleY(1.5); }
}

.section-title {
  text-align: center;
  text-transform: uppercase;
  margin-block-end: 40px;
}

@media (max-width: 576px) {
  .section-title {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    margin-block-end: 24px;
  }
}

.section-title .span {
  color: var(--gold);
  animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 15px rgba(212, 168, 67, 0.3); }
  50%      { text-shadow: 0 0 35px rgba(212, 168, 67, 0.5); }
}

/* ---------- ANIMAATIOT ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- APULUOKAT ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* h2-luokka — varmistaa että .h2-luokka toimii myös ilman h2-elementtiä */
.h2 {
  font-family: var(--ff-oxanium);
  font-weight: var(--fw-800);
  line-height: 1.1;
  color: var(--text-primary);
  font-size: var(--fs-h2);
}

.fs-tiny { font-size: var(--fs-tiny); }

.mt-1 { margin-block-start: 8px; }
.mt-2 { margin-block-start: 16px; }
.mt-3 { margin-block-start: 24px; }
.mt-4 { margin-block-start: 32px; }
.mt-5 { margin-block-start: 40px; }

.mb-1 { margin-block-end: 8px; }
.mb-2 { margin-block-end: 16px; }
.mb-3 { margin-block-end: 24px; }
.mb-4 { margin-block-end: 32px; }
.mb-5 { margin-block-end: 40px; }

/* ---------- SKROLLAUSPALKIT ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

/* ---------- VIEW TRANSITIONS ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 0.4s ease-out both tavernaViewOut;
}

::view-transition-new(root) {
  animation: 0.4s ease-in both tavernaViewIn;
}

@keyframes tavernaViewOut {
  to { opacity: 0; transform: scale(0.93); filter: brightness(0.8); }
}

@keyframes tavernaViewIn {
  from { opacity: 0; transform: scale(0.93); filter: brightness(0.8); }
  to   { opacity: 1; transform: scale(1); filter: brightness(1); }
}

/* ---------- SIIRTYMÄT ---------- */
/* .fade-in ja .fade-in-up poistettu — ei käytössä HTML:ssä */

/* ---------- TAVERNA-DRIFT (taustasolut) ---------- */
@keyframes tavernaDrift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(20px, -15px) rotate(90deg); }
  50%  { transform: translate(-10px, 25px) rotate(180deg); }
  75%  { transform: translate(15px, -10px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

/* Taustasolujen hengitys — pehmeä syke */
@keyframes tavernaBreathe {
  0%   { opacity: 0.3; transform: scale(1); }
  50%  { opacity: 0.8; transform: scale(1.3); }
  100% { opacity: 0.3; transform: scale(1); }
}

/* Taustasolujen värinmuutos — hidas liuku läpi spektrin */
@keyframes tavernaHueShift {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(30deg); }
  100% { filter: hue-rotate(0deg); }
}

/* ---------- TEKSTIAPULUOKAT ---------- */
.max-width-ch {
  max-width: 60ch;
  margin-inline: auto;
}

.max-width-ch-wide {
  max-width: 70ch;
  margin-inline: auto;
}

.section-desc {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 40px;
  color: var(--text-secondary);
  font-size: var(--fs-body);
  transition: color var(--transition-slow), text-shadow var(--transition-slow);
}

.section-desc:hover {
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(240, 232, 240, 0.04);
}

@media (max-width: 576px) {
  .section-desc {
    font-size: var(--fs-small);
    margin: 0 auto 24px;
  }
}

.section-desc-sm {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 30px;
  color: var(--text-secondary);
  font-size: var(--fs-body);
  transition: color var(--transition-slow), text-shadow var(--transition-slow);
}

.section-desc-sm:hover {
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(240, 232, 240, 0.04);
}

/* ---------- KORTTIEN SISÄLLÖT ---------- */
.card-title-gold {
  color: var(--gold);
  transition: text-shadow var(--transition);
}

.card-title-gold:hover {
  text-shadow: 0 0 25px rgba(212, 168, 67, 0.4), 0 0 50px rgba(212, 168, 67, 0.15);
}

/* ---------- SISÄLTÖALUEET ---------- */
.about-content {
  max-width: 70ch;
  margin: 0 auto;
  margin-top: -30px;
}

.about-content p {
  padding: 4px 8px;
  margin-inline: -8px;
  border-radius: var(--radius);
}

/* Highlight — vuosiluvut ja avainsanat */
.highlight-year {
  color: var(--gold);
  font-weight: var(--fw-700);
  font-family: var(--ff-oxanium);
  transition: text-shadow var(--transition);
}

.highlight-year:hover {
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.4);
}

.highlight-word {
  color: var(--teal);
  font-weight: var(--fw-600);
  transition: text-shadow var(--transition);
}

.highlight-word:hover {
  text-shadow: 0 0 20px rgba(26, 138, 122, 0.4);
}

.hero-text {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- GUIDE-SIVUJEN APULUOKAT ---------- */
.guide-map-link {
  color: var(--teal);
}

.guide-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin-block-start: 12px;
  transition: all var(--transition-slow);
}

.guide-image:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(26, 138, 122, 0.15), 0 0 60px rgba(26, 138, 122, 0.06);
}

.gallery-section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-block-end: 24px;
  transition: color var(--transition-slow), text-shadow var(--transition-slow);
}

.gallery-section-desc:hover {
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(240, 232, 240, 0.04);
}

/* ---------- GRID GAP ---------- */
.grid-gap-24 {
  --grid-gap: 24px;
  gap: var(--grid-gap);
}

/* Scroll-reveal — piilossa ennen JS:n käynnistystä */
.taverna-reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

.section-title.taverna-reveal {
  transform: translateY(15px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

/* Tekstisisällöt — hieman hitaampi, pehmeämpi */
.about-content.taverna-reveal,
.section-desc.taverna-reveal,
.gallery-section-desc.taverna-reveal {
  transform: translateY(25px);
  transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
}

/* Sitaatit — tulevat hieman sivulta */
blockquote.taverna-reveal,
.about-quote.taverna-reveal {
  transform: translateX(-15px);
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

/* Responsive-iframe ja game-collection — hieman viiveellä */
.responsive-iframe.taverna-reveal,
.game-collection.taverna-reveal {
  transform: translateY(30px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

/* Galleria-sectionit — koko kategoria herää hitaasti */
.gallery-section.taverna-reveal {
  transform: translateY(25px);
  transition: opacity 0.7s ease 0.05s, transform 0.7s ease 0.05s;
}

/* Katalogi-kortit — pelikortit heräävät scrollatessa */
.game-card.taverna-reveal {
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}

/* Katalogi-headerit ja reserve-header — hieman hitaampi */
.catalogue-header.taverna-reveal,
.reserve-header.taverna-reveal {
  transform: translateY(15px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

/* 404-sivu: self-contained, oma pieni layout */
.page-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.page-404 h1 {
  font-size: clamp(8rem, 20vw, 15rem);
  font-family: var(--ff-oxanium);
  font-weight: var(--fw-800);
  color: var(--gold);
  line-height: 1;
  margin-block-end: 12px;
  animation: titleGlow 4s ease-in-out infinite;
}

.page-404 h2 {
  font-family: var(--ff-oxanium);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: var(--fw-700);
  color: var(--text-primary);
  margin-block-end: 16px;
}

.page-404 p {
  color: var(--text-muted);
  font-size: var(--fs-body);
  max-width: 50ch;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.taverna-revealed {
  opacity: 1 !important;
  transform: translateY(0) translateX(0) !important;
  filter: blur(0) !important;
}

/* ---------- SITAATIT ---------- */
blockquote {
  border-left: 3px solid var(--gold);
  padding: 16px 24px;
  margin: 24px 0;
  font-family: var(--ff-oxanium);
  font-size: var(--fs-h3);
  color: var(--gold);
  line-height: 1.4;
  background: rgba(212, 168, 67, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.about-quote {
  text-align: center;
  border-left: none;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  margin: 40px 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  background: rgba(212, 168, 67, 0.08);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.08);
  transition: all var(--transition-slow);
  position: relative;
}


.about-quote:hover {
  border-color: var(--gold);
  box-shadow: 0 0 50px rgba(212, 168, 67, 0.25);
  transform: scale(1.02);
  background: rgba(212, 168, 67, 0.12);
}

/* Etusivun sitaatti — hieman hillitympi, osana esittelyosiota */
.entrance-quote {
  margin: 32px auto 0;
  max-width: 50ch;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  padding: 20px 28px;
}
