/* =========================================================
   STYLE-BASIS.CSS
   Gemeenschappelijke basis voor de MTG-website.
   Wedstrijdspecifieke kleuren en onderdelen staan in:
   - style-onk.css
   - style-mtg.css
   ========================================================= */

/* 1. KLEUREN EN ONTWERPVARIABELEN */
:root {
  /* Algemene MTG-huisstijl: geel met rood als accent */
  --page-primary: #FFDF00;
  --page-primary-light: #FCDD09;
  --page-soft: #FFF5CC;
  --page-accent: #AE1C28;

  /* Neutrale kleuren */
  --bg-paper: #FAF7F0;
  --ink: #1A1A1A;
  --muted: #6B6B6B;
  --panel: #FFFFFF;

  /* Kleuren van de Oss-vlag */
  --oss-green: #008000;
  --oss-blue: #21468B;
  --oss-yellow: #FFDF00;
  --oss-red: #AE1C28;
  --oss-flag-blue: #21468B;

  /* Tijdelijke MTG-variabelen; worden bij style-mtg.css verder uitgewerkt */
  --mtg-primary: #008000;
  --mtg-primary-light: #009900;
  --mtg-soft: #E6F2E6;
  --mtg-accent: #FFDF00;

  /* Afmetingen en vormgeving */
  --container: 1200px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);

  /* Ruimteschaal */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

/* 2. BASIS EN ALGEMENE ELEMENTEN */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg-paper);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--page-accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.skip-link {
  position: absolute;
  top: auto;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  top: var(--space-4);
  left: var(--space-4);
  z-index: 9999;
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  color: #000;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* 3. NAVIGATIE EN LOGO */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.navbar__inner {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  height: 110px;
  align-items: center;
  font-weight: 800;
  letter-spacing: .2px;
}

.brand__logo {
  display: block;
  width: auto;
  height: 100px;
  max-width: 300px;
  object-fit: contain;
}

.menu {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.menu-group {
  position: relative;
}

.menu-group summary {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

.menu-group summary::-webkit-details-marker {
  display: none;
}

.menu-group summary:focus-visible,
.menu-dropdown a:focus-visible,
.menu-link:focus-visible {
  outline: 3px solid var(--page-accent);
  outline-offset: 3px;
}

.menu-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

.menu-group summary:hover,
.menu-group summary:focus-visible,
.menu-link:hover,
.menu-link:focus-visible {
  color: var(--ink);
  background: var(--page-primary);
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 1100;
  display: grid;
  min-width: 220px;
  gap: 2px;
  padding: 12px 8px 8px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: var(--shadow);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transform-origin: top;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

/* Submenu tonen wanneer het menu is aangeklikt */
.menu-group:has(> details[open]) > .menu-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Submenu openen bij hover met een muis */
@media (hover: hover) and (pointer: fine) {
  .menu-group:hover > .menu-dropdown {
    display: grid;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

/* Verberg andere submenu's wanneer je over een menu beweegt */
@media (hover: hover) and (pointer: fine) {
  .menu:hover .menu-group:not(:hover) > .menu-dropdown {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
  }
}

/* Submenu toegankelijk maken via toetsenbord */
.menu-group:has(:focus-visible) > .menu-dropdown {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

.menu-dropdown a:hover,
.menu-dropdown a:focus-visible {
  color: var(--page-accent);
  background: var(--page-soft);
}

.cta {
  display: inline-block;
  padding: .65rem 1rem;
  color: var(--ink);
  background: var(--page-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* De vlaglijn bestaat uit vier horizontale kleurbanen. */
.flagline {
  display: grid;
  height: 8px;
  grid-template-rows: repeat(4, 2px);
  line-height: 0;
}

.flagline__r { background: var(--oss-red); }
.flagline__y { background: var(--oss-yellow); }
.flagline__w { background: #fff; }
.flagline__b { background: var(--oss-flag-blue); }

/* 4. HERO EN KNOPPEN */
.hero {
  padding-block: var(--space-6);
}

.hero__panel {
  position: relative;
  overflow: hidden;
  padding: var(--space-7) var(--space-6);
  color: var(--ink);
  background: linear-gradient(
    180deg,
    var(--page-primary) 0%,
    var(--page-primary-light) 100%
  );
  border-radius: var(--radius-lg);
}

.hero h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(1.75rem, 2.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.lead {
  max-width: 70ch;
  font-size: 1.125rem;
  opacity: .95;
}

.badge {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: .4rem .75rem;
  color: var(--ink);
  background: var(--page-primary);
  border-radius: 10px;
  font-weight: 700;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.btn {
  display: inline-block;
  padding: .9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.btn--primary {
  color: var(--ink);
  background: var(--page-primary);
}

.btn--ghost {
  color: var(--ink);
  background: #fff;
}

.hero__extra-cta {
  margin-top: 2rem;
}

.text-link {
  text-decoration: underline;
}

/* 5. KAARTEN, PANELEN EN SECTIES */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-block: var(--space-6);
}

.card,
.news-card {
  padding: var(--space-5);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.card {
  padding: var(--space-6);
}

.card h3 {
  margin: 0 0 var(--space-3);
}

.panel {
  padding: var(--space-6);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.callout__bar {
  display: flex;
  height: 42px;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-inline: var(--space-4);
  color: var(--ink);
  background: var(--page-primary);
  border-radius: 10px;
  font-weight: 800;
}

.section {
  margin-bottom: var(--space-6);
}

.section .panel {
  padding: var(--space-6);
}

.section h2 {
  margin-top: 0;
}

/* 6. NIEUWS EN FLYER */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.news-thumb {
  height: 160px;
  overflow: hidden;
  margin-bottom: var(--space-3);
  background: #fff;
  border-radius: 10px;
}

.news-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.news-card--flyer {
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.news-card--flyer a {
  display: block;
  width: 100%;
  height: 100%;
  text-align: center;
}

.news-card--flyer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform .2s ease;
}

.news-card--flyer a:hover img {
  transform: scale(1.02);
}

/* 7. SPONSORS */
.sponsors {
  display: grid;
  width: 100%;
  align-items: stretch;
  gap: 12px;
}

.sponsor {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 110px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background: transparent;
  border-radius: 10px;
}

.sponsor img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sponsors-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sponsors-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sponsors-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sponsors-9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }

/* 8. LOCATIE EN KAART */
.location-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-block: 1.5rem;
}

.location-info h3 {
  color: var(--page-accent);
}

.map-embed {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.map-embed__frame {
  border: 0;
}

/* 9. SOCIALE MEDIA */
.social-header {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--page-primary);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.2rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  transition: transform .2s ease, opacity .2s ease;
}

.social-link:hover {
  opacity: .9;
  transform: translateX(4px);
}

.social-icon {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .2);
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 800;
}

.facebook { background: #1877F2; }
.instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.forum { background: var(--oss-blue); }

.social-arrow {
  margin-left: auto;
  font-size: 1.2rem;
}

/* 10. WEDSTRIJDINDELING (gedeelde structuur) */
.competition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.competition-panel {
  min-width: 0;
  height: 100%;
}

.competition-panel h2 {
  margin-top: 0;
  color: var(--page-accent);
}

.competition-panel h3 {
  margin-bottom: .5rem;
}

.competition-important {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff9df;
  border-left: 5px solid var(--page-accent);
  border-radius: 10px;
}

.competition-important h3 {
  margin-top: 0;
}

.competition-important p:last-of-type {
  margin-bottom: .75rem;
}

/* Tijdelijke compatibiliteit voor de bestaande MTG-knop.
   De definitieve MTG-opmaak komt in style-mtg.css. */
.btn--mtg {
  display: inline-block;
  margin-top: 1rem;
  padding: 1.1rem 1.8rem;
  color: var(--mtg-accent);
  background: var(--mtg-primary);
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .25);
  font-size: 1.15rem;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn--mtg:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}

/* 11. FOOTER */
footer {
  margin-top: var(--space-6);
  background: #fff;
  border-top: 1px solid #eee;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-6);
}

/* 12. RESPONSIVE */
@media (max-width: 992px) {
  .cards,
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }

  .navbar__inner {
    gap: var(--space-3);
  }

  .menu {
    gap: var(--space-3);
  }

  .menu-dropdown {
    min-width: 205px;
  }

  .sponsors-9 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sponsors-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .competition-grid,
  .location-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .sponsors-3,
  .sponsors-5,
  .sponsors-7,
  .sponsors-9 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .navbar__inner {
    justify-content: space-between;
    padding-block: 8px;
  }

  .brand {
    height: 76px;
  }

  .brand__logo {
    height: 70px;
    max-width: 210px;
  }

  .menu {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
  }

  .menu-group summary,
  .menu-link {
    font-size: .9rem;
  }

  .menu-dropdown {
    left: 0;
    min-width: min(260px, calc(100vw - 40px));
  }

  .menu-group:nth-child(2) .menu-dropdown {
    right: 0;
    left: auto;
  }

  .menu-link {
    padding-inline: 4px;
  }

  .navbar__inner > .cta {
    padding: .55rem .75rem;
  }

  .hero__ctas .btn {
    width: 100%;
    text-align: center;
  }

  .cards,
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* Toegankelijkheid: respecteer de voorkeur voor minder beweging. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
