/* Atás · Fiestas Celtas — sistema visual compartido */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IM+Fell+English:ital@0;1&family=MedievalSharp&display=swap');

:root {
  --bg-deep: #0a1612;
  --bg: #0f1f1a;
  --surface: #15291f;
  --surface-2: #1a3329;
  --stone: #4a5650;
  --stone-light: #6b7368;
  --moss: #3d5a44;
  --gold: #c9a55c;
  --gold-bright: #e0bd6e;
  --gold-dark: #8a7548;
  --cream: #e8e0c8;
  --cream-dim: #b8ad8f;
  --druid-red: #8b3a3a;
  --rune-glow: #d9b96a;

  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-head: 'Cinzel', serif;
  --font-rune: 'MedievalSharp', serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --font-data: 'IM Fell English', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* Textura de piedra/musgo de fondo */
body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(61, 90, 68, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(74, 86, 80, 0.25), transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(20, 35, 28, 0.6), transparent 70%),
    repeating-linear-gradient(
      37deg,
      transparent 0 7px,
      rgba(255,255,255,0.012) 7px 8px
    ),
    var(--bg-deep);
  background-attachment: fixed;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

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

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ─── HEADER · NAVEGACIÓN ─────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(10,22,18,0.97), rgba(10,22,18,0.85));
  border-bottom: 1px solid var(--gold-dark);
  backdrop-filter: blur(8px);
}
.site-header::after {
  content: ''; display: block; height: 4px;
  background:
    linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-dark) 50%, var(--gold) 80%, transparent),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(0,0,0,0.4) 18px 20px);
  background-blend-mode: multiply;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 32px; gap: 12px 24px;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.32em;
  color: var(--gold-bright);
  display: flex; align-items: center; gap: 14px;
  text-shadow: 0 0 18px rgba(201, 165, 92, 0.35);
}
.nav-brand .triquetra {
  width: 28px; height: 28px;
  display: inline-block;
}
.nav-links {
  display: flex; gap: 4px; align-items: center;
  flex-wrap: nowrap;
  list-style: none;
  font-family: var(--font-head);
}
.nav-links a {
  display: inline-block;
  padding: 8px 13px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cream-dim);
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.nav-links a:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dark);
  background: rgba(201, 165, 92, 0.05);
}
.nav-links a.active {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(201, 165, 92, 0.08);
}

/* ─── LAYOUT ─────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 56px 32px 96px; }

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.6), 0 0 32px rgba(201,165,92,0.2);
  margin-bottom: 8px;
}
.page-subtitle {
  text-align: center;
  font-family: var(--font-rune);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-size: 14px;
  margin-bottom: 48px;
}
.page-subtitle::before, .page-subtitle::after {
  content: '✦'; margin: 0 18px; color: var(--gold);
}

/* ─── BANDAS ORNAMENTALES ─────────────────── */
.knot-divider {
  display: flex; align-items: center; gap: 18px;
  margin: 56px auto;
  max-width: 720px;
  color: var(--gold-dark);
}
.knot-divider::before, .knot-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}
.knot-divider svg { flex-shrink: 0; }

/* ─── BOTONES ────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  padding: 14px 28px;
  color: var(--gold-bright);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.btn::before, .btn::after {
  content: ''; position: absolute;
  width: 8px; height: 8px;
  border: 1px solid var(--gold);
}
.btn::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.btn::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.btn:hover {
  color: var(--bg-deep);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold-bright);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { color: var(--gold-bright); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }

.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
}

/* ─── FORMULARIOS ─────────────────────────── */
.form-field { margin-bottom: 22px; }
.form-field label {
  display: block;
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
  width: 100%;
  background: rgba(10, 22, 18, 0.6);
  border: 1px solid var(--gold-dark);
  border-left: 3px solid var(--gold);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--gold-bright);
  background: rgba(10, 22, 18, 0.85);
}

.file-drop {
  border: 1.5px dashed var(--gold-dark);
  background: rgba(10, 22, 18, 0.5);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--gold-bright);
  background: rgba(201, 165, 92, 0.06);
}
.file-drop .icon {
  font-family: var(--font-rune);
  font-size: 42px;
  color: var(--gold);
  display: block; margin-bottom: 10px;
}
.file-drop p {
  font-family: var(--font-head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--cream-dim);
}
.file-drop small { display: block; margin-top: 6px; color: var(--stone-light); font-size: 13px; letter-spacing: 0.1em; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ─── TARJETAS / BLOQUES ──────────────────── */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold-dark);
  padding: 28px;
  position: relative;
}
.card::before, .card::after,
.card > .corner-tl, .card > .corner-br {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 1.5px solid var(--gold);
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.card > .corner-tl { /* re-used for bottom-left */
  bottom: -1px; left: -1px; top: auto; border-right: none; border-top: none;
}
.card > .corner-br {
  bottom: -1px; right: -1px; top: auto; border-left: none; border-top: none;
}

/* ─── GRID DE GALERÍA ─────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.gallery-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--gold-dark);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.gallery-tile:hover { border-color: var(--gold); }
.gallery-tile::after {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid rgba(201, 165, 92, 0.25);
  pointer-events: none;
}
.gallery-tile img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.gallery-tile:hover img { transform: scale(1.04); }
.gallery-tile .meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(10, 22, 18, 0.95));
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
}

/* Placeholder con bandas */
.placeholder-img {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(135deg,
      rgba(74, 86, 80, 0.4) 0 12px,
      rgba(26, 51, 41, 0.5) 12px 24px);
  display: flex; align-items: center; justify-content: center;
  color: var(--cream-dim);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── FOOTER ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--gold-dark);
  padding: 36px 32px 28px;
  text-align: center;
  color: var(--stone-light);
  font-family: var(--font-data);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.site-footer .runes {
  font-family: var(--font-rune);
  color: var(--gold-dark);
  font-size: 22px;
  letter-spacing: 0.4em;
  margin-bottom: 10px;
  display: block;
}

/* ─── UTIL ───────────────────────────────── */
.runes-row {
  font-family: var(--font-rune);
  color: var(--gold-dark);
  letter-spacing: 0.4em;
  font-size: 18px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  padding: 4px 10px;
  border-top: 1px solid var(--gold-dark);
  border-bottom: 1px solid var(--gold-dark);
}

.flash {
  background: rgba(139, 58, 58, 0.15);
  border: 1px solid var(--druid-red);
  border-left: 3px solid var(--druid-red);
  padding: 12px 16px;
  font-family: var(--font-data);
  color: var(--cream);
  margin-bottom: 20px;
}
.flash.ok {
  background: rgba(61, 90, 68, 0.25);
  border-color: var(--moss);
  border-left-color: var(--gold);
  color: var(--cream);
}

/* ─── ICONOS CELTAS ─────────────────────────── */
.celtic-icon {
  display: inline-block;
  vertical-align: middle;
  color: currentColor;
}

/* Responsive nav */
@media (max-width: 1040px) {
  .nav-links { gap: 2px; }
  .nav-links a { padding: 8px 10px; letter-spacing: 0.1em; }
}
@media (max-width: 880px) {
  .nav-inner { flex-direction: column; gap: 10px; padding: 12px 16px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .nav-links a { padding: 6px 10px; font-size: 11px; }
  main { padding: 36px 18px 64px; }
}
@media (max-width: 480px) {
  html, body { font-size: 17px; }
  .nav-brand { font-size: 22px; letter-spacing: 0.2em; gap: 10px; }
  .nav-brand .triquetra { width: 22px; height: 22px; }
  main { padding: 28px 14px 48px; }
  .page-title { margin-bottom: 4px; }
  .page-subtitle { font-size: 12px; letter-spacing: 0.2em; margin-bottom: 32px; }
  .page-subtitle::before, .page-subtitle::after { margin: 0 8px; }
  .knot-divider { margin: 36px auto; }
  .card, .day, .contest { padding: 20px 18px 16px; }
}

/* Animacións de aparición ao facer scroll */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
