/* ==========================================================================
   Mobile-first styles. Base rules target phones; wider screens are layered
   on with min-width media queries (768px = md, 992px = lg).
   Change the brand look by editing the variables below.
   ========================================================================== */

:root {
  --brand: #701012;          /* the red, same as the doors artwork */
  --brand-dark: #4a0a0c;
  --brand-soft: #f1dedb;
  --accent: #b7862c;         /* antique gold */
  --ink: #2e2622;
  --muted: #6b6259;
  --bg: #f4eee3;             /* beige / dirty white page background */
  --surface: #fbf8f2;        /* cards */
  --surface-soft: #ebe3d3;   /* alternate sections */
  --line: #ddd2bd;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(60, 40, 20, .09);
  --shadow-lg: 0 14px 34px rgba(60, 40, 20, .18);
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
  --header-h: 64px;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; overflow-wrap: break-word; font-family: var(--font-body); color: var(--ink); line-height: 1.7; background: var(--bg); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--ink); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; top: .5rem; left: .5rem; z-index: 1040;
  background: var(--brand); color: #fff; padding: .6rem 1.1rem;
  border-radius: var(--radius); font-family: var(--font-head); font-weight: 600;
  text-decoration: none;
}

.section { padding-block: 3rem; }
.section-soft { background: var(--surface-soft); }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto 2rem; }
.section-head h2 { font-size: 1.6rem; margin-bottom: .75rem; }
.section-head h2::after {
  content: ""; display: block; width: 48px; height: 4px; margin: .6rem auto 0;
  background: var(--brand); border-radius: 2px;
}
.section-head.text-start { margin-left: 0; }
.section-head.text-start h2::after { margin-left: 0; }
.section-head p { color: var(--muted); margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn-light { background: var(--surface); border-color: var(--surface); color: var(--brand-dark); }
.btn-light:hover { background: #fff; border-color: #fff; color: var(--brand-dark); }
.btn { font-family: var(--font-head); font-weight: 600; border-radius: 999px; padding: .65rem 1.5rem; }
.btn-brand { background: var(--brand); border: 2px solid var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border: 2px solid var(--brand); color: var(--brand); background: transparent; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---------- Header ---------- */
.site-header { background: rgba(244, 238, 227, .96); backdrop-filter: blur(6px); box-shadow: 0 1px 0 var(--line); z-index: 1030; }
.site-header .navbar { min-height: var(--header-h); padding: .35rem 0; }
.navbar-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--brand) !important; }
.navbar-toggler { border: 0; padding: .25rem; color: var(--ink); }
.navbar-toggler:focus { box-shadow: none; }
.site-header .nav-link {
  font-family: var(--font-head); font-weight: 600; color: var(--ink); padding: .75rem 0;
  border-top: 1px solid var(--line);
}
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand); }

/* ---------- Page header (inner pages) ---------- */
.page-header {
  background: var(--brand);
  color: #fff; padding: 2.25rem 0;
}
.page-header-title { color: #fff; font-size: 1.9rem; margin-bottom: .25rem; }
.page-header .breadcrumb { margin: 0; font-size: .9rem; --bs-breadcrumb-divider-color: rgba(255, 255, 255, .6); }
.page-header .breadcrumb a { color: #fff; text-decoration: none; opacity: .9; }
.page-header .breadcrumb a:hover { text-decoration: underline; }
.page-header .breadcrumb-item.active { color: rgba(255, 255, 255, .8); }

/* ---------- Hero ---------- */
.hero {
  --hero-image: none;   /* set inline from hero.image in _config.yml */
  --hero-tint: none;    /* red tint, only used together with a hero photo */
  position: relative; overflow: hidden; color: #fff; text-align: center;
  display: flex; align-items: center; min-height: 72vh; padding: 4rem 0;
  background:
    var(--hero-tint),
    var(--hero-image),
    var(--brand);
  background-size: cover; background-position: center;
}
.hero h1 { color: #fff; font-size: 2.1rem; font-weight: 800; margin-bottom: 1rem; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .15em; font-weight: 600; font-size: .8rem; opacity: .85; margin-bottom: .75rem; }
.hero .lead { max-width: 30rem; margin: 0 auto 1.75rem; font-size: 1.1rem; opacity: .95; }
.hero .btn-brand { background: var(--surface); border-color: var(--surface); color: var(--brand); }   /* red button would vanish on the red hero */
.hero .btn-brand:hover, .hero .btn-brand:focus { background: #fff; border-color: #fff; color: var(--brand-dark); }
.hero-actions { display: grid; gap: .75rem; max-width: 20rem; margin: 0 auto; }

/* ---------- Hero intro: the doors open on page load ----------
   Two door leaves (with the logo on the seam) cover the hero, swing open and
   fade away. The script in index.html adds `.play` once the images are ready;
   without JavaScript the overlay is hidden so the hero is never blocked. */
.hero-doors {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  perspective: 1400px; overflow: hidden;
}
.hero-doors .door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: #701012; backface-visibility: hidden; will-change: transform, opacity;
}
.hero-doors .door img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; }
.hero-doors .door-left  { left: 0;  transform-origin: left center; }
.hero-doors .door-right { right: 0; transform-origin: right center; }
.hero-doors .door-left img  { object-position: right 55%; }   /* keep the seam edge in view */
.hero-doors .door-right img { object-position: left 55%; }

.hero-doors-logo {
  position: absolute; z-index: 2; top: 50%; left: 50%;
  width: clamp(120px, 28vw, 200px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--bg); box-shadow: 0 0 0 6px rgba(244, 238, 227, .35), var(--shadow-lg);
}
.hero-doors-logo img { position: absolute; inset: 11%; width: 78%; height: 78%; object-fit: contain; }
.hero-doors:not(.play) .hero-doors-logo { opacity: 0; }

.hero-doors.play .door-left  { animation: door-open-left  1.7s cubic-bezier(.6, 0, .3, 1) 1.1s forwards; }
.hero-doors.play .door-right { animation: door-open-right 1.7s cubic-bezier(.6, 0, .3, 1) 1.1s forwards; }
.hero-doors.play .hero-doors-logo { animation: doors-logo 1.5s ease forwards; }
.hero-doors.play { animation: doors-gone .01s linear 2.9s forwards; }
.hero-doors.play ~ .container { animation: hero-rise .9s ease 1.7s both; }

@keyframes door-open-left {
  0%   { transform: rotateY(0);      opacity: 1; }
  55%  { opacity: 1; }
  100% { transform: rotateY(72deg);  opacity: 0; }
}
@keyframes door-open-right {
  0%   { transform: rotateY(0);      opacity: 1; }
  55%  { opacity: 1; }
  100% { transform: rotateY(-72deg); opacity: 0; }
}
@keyframes doors-logo {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.85); }
  28%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes doors-gone { to { visibility: hidden; } }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-doors { display: none; }
}

/* ---------- Next event strip ---------- */
.next-event { background: var(--ink); color: #fff; padding: 1rem 0; }
.next-event-inner { display: grid; grid-template-columns: auto 1fr; gap: .75rem 1rem; align-items: center; }
.next-event .date-badge { position: static; }
.next-event .label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.next-event strong { font-family: var(--font-head); display: block; line-height: 1.3; }
.next-event .where { font-size: .9rem; opacity: .8; }
.next-event .btn { grid-column: 1 / -1; }

/* ---------- Features ---------- */
.about-photo { max-width: 40rem; margin: 0 auto 2rem; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.feature { text-align: center; padding: 1.75rem 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); height: 100%; }
.feature h3 { font-size: 1.15rem; margin: 1rem 0 .5rem; }
.feature p { color: var(--muted); margin: 0; }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 1.7rem;
}

/* ---------- Date badge ---------- */
.date-badge {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; padding: .4rem .55rem; border-radius: 10px;
  background: var(--brand); color: #fff; line-height: 1.1; text-align: center; box-shadow: var(--shadow);
}
.date-badge .day { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; }
.date-badge .month { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Event cards ---------- */
.event-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.event-card-media { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.event-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem; }
.event-card-body h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.event-card-body .subtitle { color: var(--brand); font-weight: 600; margin-bottom: .5rem; }
.event-card-body .meta { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.event-card-body .summary { color: var(--muted); flex: 1; }
.read-more { font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--brand); }
.read-more .bi { transition: transform .2s ease; display: inline-block; }
@media (hover: hover) {
  .event-card { transition: transform .2s ease, box-shadow .2s ease; }
  .event-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
  .event-card:hover .read-more .bi { transform: translateX(4px); }
}

/* ---------- Event page ---------- */
.event-head h1 { font-size: 1.7rem; }
.event-head .lead { color: var(--muted); margin-bottom: 1.5rem; }

/* One column on phones: cover, details, then text. Two columns from lg up. */
.event-layout { display: grid; gap: 1.5rem; }
.event-cover img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.event-body { min-width: 0; }
.event-body img { border-radius: 10px; }

.event-details { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.event-details h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.event-details ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.event-details li { display: flex; gap: .75rem; align-items: flex-start; padding: .35rem 0; }
.event-details li .bi { color: var(--brand); font-size: 1.15rem; line-height: 1.6; }
.event-past { margin: 1rem 0 0; color: var(--muted); }

.map-embed { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--line); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-link { display: inline-block; margin-top: .5rem; font-size: .9rem; font-weight: 600; text-decoration: none; }
.gallery-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }

/* ---------- Contacts ---------- */
.contact-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.contact-card h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.contact-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.contact-list li { display: flex; gap: .85rem; align-items: center; padding: .5rem 0; }
.contact-list li > a, .contact-list li > span { min-width: 0; overflow-wrap: anywhere; }
.contact-list .bi { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--brand); color: #fff; text-align: center; padding: 3rem 0; }
.cta-band h2 { color: #fff; font-size: 1.6rem; }
.cta-band p { opacity: .9; margin-bottom: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: #2a1d1a; color: rgba(255, 255, 255, .75); padding: 3rem 0 0; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-title { color: #fff; margin-bottom: 1rem; }
.site-footer li { margin-bottom: .4rem; }
.site-footer .social { display: flex; gap: .6rem; }
.site-footer .social a {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.site-footer .social a:hover { background: var(--brand); text-decoration: none; }
.footer-bottom { margin-top: 2rem; padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9rem; text-align: center; }

/* ==========================================================================
   >= 768px
   ========================================================================== */
@media (min-width: 768px) {
  .section { padding-block: 4.5rem; }
  .section-head { margin-bottom: 2.75rem; }
  .section-head h2 { font-size: 2rem; }
  .page-header { padding: 3rem 0; }
  .page-header-title { font-size: 2.4rem; }
  .hero { min-height: 78vh; }
  .hero h1 { font-size: 3rem; }
  .hero .lead { font-size: 1.25rem; }
  .hero-actions { display: flex; justify-content: center; max-width: none; }
  .next-event-inner { grid-template-columns: auto 1fr auto; }
  .next-event .btn { grid-column: auto; }
  .event-head h1 { font-size: 2.3rem; }
  .cta-band h2 { font-size: 2rem; }
  .footer-bottom { text-align: left; }
}

/* ==========================================================================
   >= 992px
   ========================================================================== */
@media (min-width: 992px) {
  .site-header .nav-link { border: 0; padding: .5rem 1rem; position: relative; }
  .site-header .nav-link.active::after {
    content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 0; height: 3px;
    background: var(--brand); border-radius: 2px;
  }
  .event-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
  .event-cover, .event-body { grid-column: 1; }
  .event-details { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Quote ---------- */
.quote { max-width: 48rem; margin: 0 auto; text-align: center; }
.quote-mark { display: block; font-size: 3rem; line-height: 1; color: var(--brand); opacity: .85; }
.quote blockquote { margin: .5rem 0 1rem; }
.quote blockquote p {
  font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; line-height: 1.6;
  color: var(--ink); margin: 0;
}
.quote figcaption { color: var(--brand); font-family: var(--font-head); font-weight: 700; }
.quote figcaption::before { content: "— "; }
@media (min-width: 768px) {
  .quote-mark { font-size: 4rem; }
  .quote blockquote p { font-size: 1.5rem; }
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: .4rem; margin: .75rem 0 .5rem;
  padding: .3rem .85rem; border: 2px solid var(--brand); border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--brand);
}
.lang-switch:hover { background: var(--brand); color: #fff; }
@media (min-width: 992px) { .lang-switch { margin: 0; } }

/* ---------- Tournament page (event-tournament layout) ---------- */
.tournament-hero {
  padding: 2.25rem 0;
  background-color: var(--surface-soft);
  /* faint chessboard */
  background-image: conic-gradient(rgba(112, 16, 18, .06) 25%, transparent 0 50%, rgba(112, 16, 18, .06) 0 75%, transparent 0);
  background-size: 72px 72px;
}
.tournament-inner { display: grid; gap: 1.25rem; align-items: center; justify-items: start; }
.tournament-date {
  display: inline-flex; flex-direction: column; align-items: center; min-width: 104px; padding: .8rem 1.1rem;
  background: var(--brand); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); line-height: 1.1;
}
.tournament-date .day { font-family: var(--font-head); font-weight: 800; font-size: 2.8rem; }
.tournament-date .month { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.tournament-date .year { opacity: .8; font-size: .85rem; margin-top: .15rem; }
.tournament-copy h1 { font-size: 1.9rem; margin-bottom: .25rem; }
.tournament-copy .lead { color: var(--muted); margin-bottom: 1rem; }
.tournament-facts { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.tournament-facts li { display: flex; gap: .5rem; align-items: center; }
.tournament-facts .bi { color: var(--brand); }
.tournament-actions { display: grid; gap: .75rem; max-width: 22rem; }

/* ---------- Sponsors ---------- */
.section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
.sponsors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; }
.sponsor {
  display: flex; align-items: center; justify-content: center; height: 100px; padding: 1rem;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sponsor img { height: 60px; width: auto; max-width: 100%; object-fit: contain; }
a.sponsor { transition: transform .2s ease, box-shadow .2s ease; }
@media (hover: hover) { a.sponsor:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); } }

@media (min-width: 768px) {
  .tournament-hero { padding: 3rem 0; }
  .tournament-inner { grid-template-columns: auto 1fr; gap: 2.25rem; }
  .tournament-copy h1 { font-size: 2.6rem; }
  .tournament-actions { display: flex; flex-wrap: wrap; max-width: none; }
  .sponsors { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .sponsor { height: 120px; }
  .sponsor img { height: 80px; }
}

/* ---------- History page ---------- */
/* Phones: one photo per row, caption under it, text below. Alternating left/right from xl (1200px). */
.history-list { display: grid; gap: 3rem; }
.history-item { display: grid; gap: 1.25rem; align-items: center; }
.history-figure { margin: 0; }
.history-figure img { display: block; margin-inline: auto; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; }
.history-figure figcaption { margin-top: .6rem; font-size: .9rem; color: var(--muted); }
.history-text h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.history-text p { margin-bottom: 1rem; }
.history-text p:last-child { margin-bottom: 0; }
.history-year {
  display: inline-block; margin-bottom: .5rem; padding: .1rem .75rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-family: var(--font-head); font-weight: 700; font-size: .85rem;
}

/* Uniform photo sizes: landscape photos share one width, portrait photos share one height (aspect ratio kept). */
.history-figure.is-landscape img { width: min(100%, 640px); }
@media (min-width: 576px) {
  .history-figure.is-portrait img { width: auto; max-width: 100%; height: 520px; }
}

@media (min-width: 768px) {
  .history-text h3 { font-size: 1.6rem; }
}
@media (min-width: 1200px) {
  .history-list { gap: 4.5rem; }
  .history-item { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; }
  .history-item:nth-child(even) .history-figure { order: 2; }
  .history-text p { font-size: 1.1rem; }
}

/* ---------- Media page ---------- */
.pill {
  position: absolute; top: .75rem; left: .75rem; max-width: calc(100% - 1.5rem);
  padding: .25rem .7rem; border-radius: 999px; background: var(--surface); color: var(--brand);
  font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.3;
  box-shadow: var(--shadow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-card .event-card-body .summary { margin-bottom: 1rem; }

/* ---------- 404 page ---------- */
.not-found { padding-block: 4rem; }
.not-found-code { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: clamp(5rem, 22vw, 9rem); line-height: 1; margin: 0 0 1rem; color: var(--brand); }

/* ---------- Cookie banner ---------- */
/* Phones: full-width sheet pinned to the bottom. From md up: compact card in the bottom-left corner. */
.cookie-banner {
  position: fixed; z-index: 1050; left: 0; right: 0; bottom: 0;
  padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(60, 40, 20, .16);
}
.cookie-banner[hidden] { display: none; }
.cookie-title { font-size: 1rem; margin: 0 0 .35rem; }
.cookie-text { font-size: .9rem; color: var(--muted); margin: 0 0 .9rem; line-height: 1.5; }
.cookie-actions { display: flex; gap: .6rem; }
.cookie-actions .btn { flex: 1; padding: .5rem 1rem; font-size: .9rem; }
@media (min-width: 768px) {
  .cookie-banner { left: 1.25rem; right: auto; bottom: 1.25rem; width: 24rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
}
