:root {
  --bg-sand: #f4efe4;
  --bg-soft: #ece6d8;
  --surface: #fffdf8;
  --surface-2: #f8f3e8;
  --line: #ddd2bb;
  --text: #1f2a1f;
  --muted: #5d685d;
  --brand: #2f6f48;
  --brand-hover: #275b3b;
  --accent: #a55e2d;
  --accent-soft: #f8e5d8;
  --danger: #a12f2f;
  --success: #2f8a5d;
  --shadow: 0 16px 36px rgba(59, 45, 24, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(165, 94, 45, 0.2), transparent 70%),
    radial-gradient(900px 500px at 110% -10%, rgba(47, 111, 72, 0.24), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg-sand));
}

h1,
h2,
h3,
h4 {
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.55rem, 2.7vw, 2.25rem);
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
  margin: 0 0 10px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1ead9;
  color: #4d4126;
  font-size: 0.86rem;
}

.container {
  width: min(1120px, 95%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(64, 52, 31, 0.18);
  background: rgba(255, 252, 245, 0.86);
  backdrop-filter: blur(8px);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  transition: padding 0.2s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.12rem;
  color: #233122;
  transition: font-size 0.2s ease;
}

.brand-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(66, 41, 19, 0.18);
  background: rgba(255, 255, 255, 0.7);
  padding: 4px;
  transition: width 0.2s ease, height 0.2s ease, padding 0.2s ease;
}

.brand span {
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-toggle {
  display: none;
  border: 1px solid #d8ccb4;
  border-radius: 10px;
  width: 44px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: linear-gradient(180deg, #fffefb, #f8f2e7);
  cursor: pointer;
  position: relative;
  z-index: 70;
}

.menu-toggle-checkbox {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.menu-icon-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #37452f;
  border-radius: 2px;
}

.nav a {
  border: 1px solid #d8ccb4;
  border-radius: 999px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #fffefb, #f8f2e7);
  color: #283425;
  font-size: 0.92rem;
  transition: all 0.18s ease;
}

.nav a:hover {
  text-decoration: none;
  border-color: #bea97d;
  background: #fff;
  transform: translateY(-1px);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 46px;
  min-height: 42px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav-count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #c73333;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 1px solid #fff;
  vertical-align: middle;
}

.icon-nav .nav-text {
  display: block;
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.01em;
  margin-top: 2px;
}

.icon-nav .nav-link {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 9px;
}

.topbar.is-compact .topbar-row {
  padding: 6px 0;
}

.topbar.is-compact .brand {
  font-size: 0.98rem;
}

.topbar.is-compact .brand-logo {
  width: 72px;
  height: 72px;
  padding: 3px;
}

.topbar.is-compact .nav a {
  padding: 5px 10px;
  font-size: 0.86rem;
}

.topbar.is-compact .nav-link {
  min-width: 40px;
  min-height: 36px;
}

.topbar.is-compact .icon-nav .nav-link {
  gap: 0;
}

.topbar.is-compact .nav-icon,
.topbar.is-compact .nav-icon svg {
  width: 18px;
  height: 18px;
}

.topbar.is-compact .icon-nav .nav-text {
  display: none;
}

.topbar.is-compact .nav-count {
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.62rem;
}

main.container {
  padding: 20px 0 30px;
}

.panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-color: #ceb58a;
}

.hero::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 111, 72, 0.2), transparent 70%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.flash {
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 12px;
  border: 1px solid;
}

.flash-error {
  background: #fff0ef;
  border-color: #e7b8b6;
  color: #7f2421;
}

.flash-ok {
  background: #effaf3;
  border-color: #b8dfc7;
  color: #1f673f;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.muted {
  color: var(--muted);
}

.stack > * + * {
  margin-top: 9px;
}

.otr-accordion-item summary {
  cursor: pointer;
  list-style: none;
}

.otr-accordion-item summary::-webkit-details-marker {
  display: none;
}

.otr-accordion-item summary::after {
  content: "+";
  float: right;
  font-weight: 700;
}

.otr-accordion-item[open] summary::after {
  content: "-";
}

.otr-accordion-content {
  margin-top: 10px;
}

.event-flyer-image {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: min(100%, 460px);
  max-height: 560px;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}

.event-flyer-link {
  display: block;
  cursor: zoom-in;
}

.event-detail-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.event-detail-top > .panel,
.event-detail-top > .event-top-main-col,
.event-detail-top > .event-top-side {
  margin-bottom: 0;
}

.event-detail-masonry {
  display: block;
  column-count: 2;
  column-gap: 12px;
}

.event-detail-masonry > .panel {
  display: inline-block;
  width: 100%;
  margin-bottom: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.event-detail-masonry.is-balanced {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.event-masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-detail-masonry.is-balanced > .event-masonry-col > .panel {
  margin-bottom: 0;
}

.event-map-wrap {
  border: 1px solid #d9ceb8;
  border-radius: 10px;
  overflow: hidden;
  background: #fffefb;
}

.event-map-frame {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}

.federation-logo {
  height: 18px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
}

.news-masonry {
  column-count: 3;
  column-gap: 12px;
}

.news-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 12px;
  padding: 14px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.news-card h3 {
  margin-bottom: 6px;
}

.news-card p {
  margin-bottom: 8px;
}

.media-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.media-thumb {
  position: relative;
  border: 1px solid #d9ceb8;
  border-radius: 10px;
  padding: 0;
  background: #fffefb;
  overflow: hidden;
  cursor: pointer;
}

.media-thumb-el {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.media-thumb-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.74rem;
  border-radius: 999px;
  padding: 2px 8px;
}

.media-lightbox[hidden] {
  display: none !important;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.media-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.media-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  margin: 4vh auto;
  background: #151515;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox-close {
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 10px;
  background: #222;
  color: #fff;
  cursor: pointer;
}

.media-lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-lightbox-nav {
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 10px;
  background: #222;
  color: #fff;
  cursor: pointer;
}

.media-lightbox-index {
  margin-left: auto;
  margin-right: 4px;
  color: #d6d6d6;
  font-size: 0.9rem;
}

.media-lightbox-body {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-lightbox-media {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
}

.media-lightbox-caption {
  margin-top: 8px;
  color: #d6d6d6;
}

.media-upload-progress {
  margin-top: 8px;
}

.media-progress-row {
  margin-bottom: 8px;
}

.media-progress-bar {
  width: 100%;
  height: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8ccb4;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: #4f422d;
  background: #fbf5ea;
}

.badge.urgent {
  background: #fff7f7;
  border-color: #c73333;
  color: #8a1d1d;
}

.badge.status-cancelled {
  background: #fff7f7;
  border-color: #c73333;
  color: #8a1d1d;
}

.btn {
  border: 1px solid #ccb999;
  border-radius: 10px;
  padding: 9px 13px;
  background: linear-gradient(180deg, #fffefb, #f8f0e2);
  color: #2b3327;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #bba06f;
  box-shadow: 0 8px 20px rgba(74, 54, 27, 0.12);
}

.btn.primary {
  border-color: var(--brand);
  background: linear-gradient(180deg, #3d815a, var(--brand));
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(180deg, #3a7a55, var(--brand-hover));
}

.btn.success {
  border-color: var(--success);
  background: linear-gradient(180deg, #39a06b, var(--success));
  color: #fff;
}

.btn.danger {
  border-color: var(--danger);
  background: linear-gradient(180deg, #b84242, var(--danger));
  color: #fff;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #30402c;
}

.field {
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9ceb8;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fffefb;
  color: #293426;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #8d7347;
  box-shadow: 0 0 0 4px rgba(165, 94, 45, 0.12);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #4a563f;
  cursor: pointer;
}

.password-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ece3d2;
  margin-top: 8px;
  overflow: hidden;
}

.password-meter-fill {
  height: 100%;
  width: 8%;
  background: #c7b59a;
  transition: width 0.2s ease, background 0.2s ease;
}

.password-meter-fill.weak {
  background: #b44242;
}

.password-meter-fill.medium {
  background: #b9841f;
}

.password-meter-fill.strong {
  background: #2f8a5d;
}

.press-reveal-inline {
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: #4a563f;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.press-reveal-box {
  width: 16px;
  height: 16px;
  border: 1px solid #8d7347;
  border-radius: 3px;
  background: #fffefb;
  display: inline-block;
  position: relative;
}

.press-reveal-inline:active .press-reveal-box,
.press-reveal-inline:focus .press-reveal-box {
  background: #dbeed8;
  border-color: #2f6f48;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d8cdb7;
  border-radius: 12px;
  overflow: hidden;
  background: #fffefb;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid #e8decb;
  vertical-align: top;
  text-align: left;
}

th {
  background: #f6efdf;
  color: #514227;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: #fcf8ef;
}

tr:last-child td {
  border-bottom: none;
}

.footer {
  border-top: 1px solid #d8ccb4;
  background: rgba(255, 252, 245, 0.92);
  padding: 12px 0;
}

.footer p {
  margin: 0;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 1050px) {
  .news-masonry {
    column-count: 2;
  }
}

@media (max-width: 940px) {
  .topbar-row {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 92px;
    height: 92px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    width: 100%;
    display: none !important;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px solid #d8ccb4;
    padding-top: 8px;
  }

  .menu-toggle-checkbox:checked ~ .nav {
    display: flex !important;
  }

  .nav a {
    width: 100%;
    text-align: left;
  }

  .icon-nav .nav-link {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }

  .icon-nav .nav-text {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .icon-nav .nav-count {
    position: static;
    margin-left: 6px;
    border-color: transparent;
  }

  .event-flyer-image {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .federation-logo {
    height: 14px;
    max-width: 64px;
  }

  .event-map-frame {
    height: 240px;
  }

  .news-masonry {
    column-count: 1;
  }

  .media-thumb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .media-thumb-el {
    aspect-ratio: 1 / 1;
  }

  .media-thumb-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
  }

  .media-lightbox-toolbar {
    flex-wrap: wrap;
  }

  .media-lightbox-index {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .event-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .event-card {
    margin-bottom: 0;
  }

  .event-card h3 {
    margin-bottom: 4px;
  }

  .event-card p {
    margin-bottom: 6px;
  }
}

@media (max-width: 760px) {
  .event-detail-top,
  .event-detail-masonry,
  .event-detail-masonry.is-balanced {
    display: block;
    grid-template-columns: none;
  }

  .event-detail-top > .panel,
  .event-detail-top > .event-top-main-col,
  .event-detail-top > .event-top-side,
  .event-detail-masonry > .panel,
  .event-detail-masonry .event-masonry-col > .panel {
    margin-bottom: 12px;
  }

  .event-detail-masonry {
    column-count: 1;
    column-gap: 0;
  }
}
