/* Ostfriesland Nordsee – global component system v1.5.4 */
:root {
  --ofn-control-h: 48px;
  --ofn-control-h-sm: 42px;
  --ofn-control-h-lg: 48px;
  --ofn-control-radius: 12px;
  --ofn-control-radius-sm: 10px;
  --ofn-control-gap: 10px;
  --ofn-icon-control: 44px;
  --ofn-close-control: 48px;
  --ofn-selection-h: 54px;
  --ofn-selection-radius: 14px;
  --ofn-selection-gap: 12px;
  --ofn-layer-radius: 22px;
  --ofn-layer-header-h: 92px;
  --ofn-layer-x: 28px;
  --ofn-layer-y: 24px;
}

/* Generic controls */
.icon-button,
.header-search-button {
  width: var(--ofn-icon-control);
  height: var(--ofn-icon-control);
  min-width: var(--ofn-icon-control);
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.icon-button:hover,
.header-search-button:hover { background: rgba(0,45,94,.06); }
.icon-button:active,
.header-search-button:active { transform: scale(.96); }
.icon-button .icon,
.header-search-button .icon { font-size: 22px; }

.primary-button,
.secondary-button {
  min-height: var(--ofn-control-h);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ofn-control-gap);
  border-radius: var(--ofn-control-radius);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, filter .18s ease;
}
a.primary-button,
a.secondary-button { text-decoration: none; }
.primary-button { border: 1px solid var(--yellow); background: var(--yellow); color: var(--blue); }
.primary-button:hover { filter: brightness(.97); }
.secondary-button { border: 1px solid #cfd9e3; background: #fff; color: var(--blue); }
.secondary-button:hover { border-color: var(--blue); background: #f8fbfd; }
.primary-button:active,
.secondary-button:active { transform: translateY(1px); }
.primary-button .icon,
.secondary-button .icon { font-size: 18px; }
.compact-button { min-height: var(--ofn-control-h-sm); padding-inline: 14px; }
.full-button { width: 100%; }

.profile-logout,
.results-map-trigger {
  min-height: var(--ofn-control-h);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ofn-control-gap);
  border: 1px solid #cfd9e3;
  border-radius: var(--ofn-control-radius);
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.profile-logout:hover,
.results-map-trigger:hover { border-color: var(--blue); background: #f7fafc; }
.profile-logout { width: 100%; margin-top: 24px; }
.results-map-trigger { display: none; }

.field input,
.field select,
.field textarea,
.review-sort select,
.newsletter-section input {
  border-radius: var(--ofn-control-radius);
}
.field input,
.field select { min-height: var(--ofn-control-h); }
.review-sort select { min-height: var(--ofn-control-h-sm); }

.date-filter-row button,
.magazine-categories button,
.magazine-categories a,
.submission-tabs button,
.wishlist-tabs button,
.review-filter-buttons button {
  min-height: var(--ofn-control-h-sm);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d4dde6;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.date-filter-row button:hover,
.magazine-categories button:hover,
.magazine-categories a:hover,
.submission-tabs button:hover,
.wishlist-tabs button:hover,
.review-filter-buttons button:hover { border-color: var(--yellow); }
.date-filter-row button.is-active,
.magazine-categories button.is-active,
.magazine-categories a.is-active,
.submission-tabs button.is-active,
.wishlist-tabs button.is-active,
.review-filter-buttons button.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }

.discover-controls button {
  position: relative;
  min-height: var(--ofn-control-h);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ofn-control-gap);
  border: 1px solid #d6dee6;
  border-radius: var(--ofn-control-radius);
  background: #fff;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.discover-controls button:hover { border-color: var(--yellow); background: #fffaf0; }
.discover-controls .icon { font-size: 22px; }
.sort-glyph { font-size: 26px; line-height: 1; font-weight: 500; }

.event-detail-actions button,
.article-byline button,
.submission-list article > button {
  min-height: var(--ofn-control-h-sm);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d5dee6;
  border-radius: var(--ofn-control-radius-sm);
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.event-detail-actions button:hover,
.article-byline button:hover,
.submission-list article > button:hover { border-color: var(--yellow); background: #fffaf0; }
.event-detail-actions button.is-active,
.article-byline button.is-active { border-color: var(--yellow); background: #fff7d8; color: var(--blue); }


/* Remaining page actions reuse the same control geometry. */
.event-submit-cta,
.page-hero-actions a,
.page-hero-actions button,
.entry-actions button,
.profile-form-actions button,
.form-actions button,
.reviews-toolbar-actions button {
  min-height: var(--ofn-control-h);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ofn-control-gap);
  border-radius: var(--ofn-control-radius);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

/* Header action row */
@media (min-width: 1180px) {
  .desktop-header-actions { margin-left: auto; gap: 12px; }
  .header-icon-link,
  .profile-link,
  .header-search-button {
    width: var(--ofn-icon-control);
    height: var(--ofn-icon-control);
    min-width: var(--ofn-icon-control);
  }
  .header-icon-link { border-radius: 999px; }
  .header-cta { min-height: var(--ofn-control-h); border-radius: var(--ofn-control-radius); }
}

/* Shared layer header and close button */
.overlay {
  background: rgba(8,25,43,.62);
  backdrop-filter: blur(4px);
}
.layer-dialog,
.layer-panel { overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.layer-header {
  height: var(--ofn-layer-header-h);
  min-height: var(--ofn-layer-header-h);
  padding: 20px var(--ofn-layer-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.layer-heading { min-width: 0; }
.layer-heading .eyebrow { margin: 0 0 5px; color: #9a7100; font-size: 10px; line-height: 1; }
.layer-heading h2,
.layer-heading strong {
  margin: 0;
  display: block;
  overflow: hidden;
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-body { padding: var(--ofn-layer-y) var(--ofn-layer-x); }
.layer-footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.layer-close {
  position: static !important;
  flex: 0 0 var(--ofn-close-control);
  width: var(--ofn-close-control) !important;
  height: var(--ofn-close-control) !important;
  min-width: var(--ofn-close-control);
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d6dee6;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
}
.layer-close:hover { border-color: var(--yellow); background: #fff9e8; }
.layer-close .icon { width: 20px; height: 20px; font-size: 20px; }


.share-dialog-head.layer-header,
.media-lightbox-toolbar.layer-header {
  height: var(--ofn-layer-header-h);
  min-height: var(--ofn-layer-header-h);
  padding: 20px var(--ofn-layer-x);
}
.share-close.layer-close,
.media-lightbox-close.layer-close {
  width: var(--ofn-close-control) !important;
  height: var(--ofn-close-control) !important;
  min-width: var(--ofn-close-control);
}

/* Drawers */
.drawer {
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
}
.drawer-body {
  min-height: 0;
  padding: var(--ofn-layer-y) var(--ofn-layer-x) 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer nav a { padding: 16px 0; font-size: 18px; }
.profile-drawer { padding: 0; }
.profile-drawer .drawer-body { display: flex; flex-direction: column; }
.profile-drawer .profile-logout { width: 100%; margin-top: 24px; }

/* Search, filter, sorting and map */
.search-overlay {
  width: min(calc(100% - 40px),820px);
  padding: 0;
  border-radius: var(--ofn-layer-radius);
}
.sheet {
  top: 50%;
  bottom: auto;
  width: min(calc(100% - 40px),660px);
  max-height: min(86dvh,760px);
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
  border-radius: var(--ofn-layer-radius);
  transform: translate(-50%,-46%) scale(.985);
}
.sheet.is-open { transform: translate(-50%,-50%) scale(1); }
.sheet-small { width: min(calc(100% - 40px),520px); }
.sheet > .layer-form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  overflow: hidden;
}
.sheet .layer-body {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.sheet .layer-footer {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 18px var(--ofn-layer-x) calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}
.sheet-fieldset { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
.sheet-fieldset legend { margin-bottom: 11px; color: var(--blue); font-size: 15px; font-weight: 800; }
.sheet-actions { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: var(--ofn-control-gap); }
.sheet-actions .primary-button,
.sheet-actions .secondary-button,
.sheet-submit { width: 100%; }
.sheet-submit { margin-top: 0; }
.map-panel {
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
  background: var(--bg);
}
.map-panel .layer-header { position: relative; z-index: 20; }
.map-panel-body { position: relative; min-height: 0; overflow: hidden; }
.map-panel-body > .ofn-map,
.map-panel-body > .fake-map { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; z-index: 1; }
.map-panel-body > .map-caption { z-index: 4; }
.map-panel .gm-style { font-family: var(--font-ui); }

/* RunnerX-style toggle selection cards */
.choice-grid,
.choice-grid-wide,
.profile-choice-grid { display: flex !important; flex-wrap: wrap; gap: var(--ofn-selection-gap); }
.sheet-options { display: grid !important; gap: var(--ofn-selection-gap); margin-bottom: 20px; }
.choice-grid label,
.choice-grid-wide label,
.profile-choice-grid label { position: relative; flex: 1 1 220px; min-width: min(220px,100%); cursor: pointer; }
.choice-grid-wide label { flex-basis: 240px; }
.choice-grid input,
.sheet-options input,
.check-field input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; }
.choice-grid label > span,
.sheet-options label,
.check-field {
  position: relative;
  min-height: var(--ofn-selection-h);
  width: 100%;
  padding: 12px 16px 12px 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid #d5dee6;
  border-radius: var(--ofn-selection-radius);
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.sheet-options label { margin: 0; }
.choice-grid label > span::before,
.sheet-options label::before,
.check-field::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 32px;
  height: 15px;
  border-radius: 999px;
  background: #b7c5d4;
  transform: translateY(-50%);
  transition: background .18s ease;
}
.choice-grid label > span::after,
.sheet-options label::after,
.check-field::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 25px;
  height: 25px;
  border: 1px solid #d7dee5;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  transition: transform .18s ease, border-color .18s ease;
}
.choice-grid label > span > .icon,
.sheet-options label > span,
.check-field > span { position: relative; z-index: 1; }
.sheet-options label > span { display: inline-flex; align-items: center; gap: 8px; }
.check-field > span { display: block; line-height: 1.45; }
.choice-grid input:checked + span,
.sheet-options label:has(input:checked),
.check-field:has(input:checked) { border-color: #65d663; background: #ecfaeb; }
.choice-grid input:checked + span::before,
.sheet-options label:has(input:checked)::before,
.check-field:has(input:checked)::before { background: #16e01a; }
.choice-grid input:checked + span::after,
.sheet-options label:has(input:checked)::after,
.check-field:has(input:checked)::after { border-color: #fff; transform: translate(15px,-50%); }
.choice-grid input:focus-visible + span,
.sheet-options label:has(input:focus-visible),
.check-field:has(input:focus-visible) { outline: 3px solid rgba(250,185,0,.45); outline-offset: 2px; }
.choice-grid label:hover > span,
.sheet-options label:hover,
.check-field:hover { border-color: #9dc4a1; }
.check-field.has-error { border-color: #b42318; background: #fff7f6; }
.check-field a { color: inherit; text-decoration: underline; }
.check-field + .primary-button,
.check-field + .secondary-button,
.check-field + .full-button { margin-top: 20px; }

/* Lightbox uses the same layer header */
.media-lightbox-dialog { border-radius: var(--ofn-layer-radius); }
.media-lightbox-toolbar { height: var(--ofn-layer-header-h); min-height: var(--ofn-layer-header-h); padding: 20px var(--ofn-layer-x); }
.media-lightbox-brand .eyebrow { margin: 0 0 5px; font-size: 10px; }
.media-lightbox-brand strong { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.05; }
.media-lightbox-button {
  width: var(--ofn-icon-control);
  height: var(--ofn-icon-control);
  border-radius: 999px;
  background: #fff;
}
.media-lightbox-close { width: var(--ofn-close-control); height: var(--ofn-close-control); }
.media-lightbox-button .icon-shrink { fill: currentColor; stroke: none; }
.media-lightbox-close .icon { fill: currentColor; stroke: none; }

/* Share modal uses the same header/body dimensions */
.share-dialog { padding: 0; overflow: hidden; border-radius: var(--ofn-layer-radius); }
.share-dialog-body { padding: var(--ofn-layer-y) var(--ofn-layer-x); }
.share-preview { margin-top: 0; }

/* Helpful action */
.helpful-button {
  width: 146px;
  height: var(--ofn-control-h-sm);
  min-width: 146px;
  min-height: var(--ofn-control-h-sm);
  padding: 0 8px !important;
  box-sizing: border-box;
  display: inline-grid !important;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  justify-content: center;
  column-gap: 5px !important;
  border: 1px solid #cfd8e1 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--blue) !important;
  font-size: 12px;
  font-weight: 800 !important;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.helpful-button:hover { border-color: var(--yellow) !important; background: #fff9e8 !important; }
.helpful-button .icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  box-sizing: border-box;
  justify-self: center;
  border-radius: 50%;
  background: #edf3f8;
  fill: currentColor;
}
.helpful-label {
  min-width: 0;
  display: block;
  text-align: center;
  white-space: nowrap;
}
.helpful-count {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: #edf3f8;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
}
.helpful-button.is-active,
.helpful-button[aria-pressed="true"] { border-color: var(--yellow) !important; background: var(--yellow) !important; color: var(--blue) !important; }
.helpful-button.is-active .icon,
.helpful-button[aria-pressed="true"] .icon { background: var(--blue); color: #fff; }
.helpful-button.is-active .helpful-count,
.helpful-button[aria-pressed="true"] .helpful-count { background: #fff; }
.review-actions { margin-top: 16px; padding-top: 12px; display: flex; align-items: center; gap: 12px; border-top: 1px solid #e8ecef; }

@media (max-width: 700px) {
  .layer-header { height: 78px; min-height: 78px; padding: 15px 16px; gap: 14px; }
  .layer-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
  .layer-heading h2,
  .layer-heading strong { font-size: 25px; }
  .layer-body { padding: 20px 16px; }
  .layer-close { flex-basis: 44px; width: 44px !important; height: 44px !important; min-width: 44px; }

  .share-dialog-head.layer-header,
  .media-lightbox-toolbar.layer-header { height: 78px; min-height: 78px; padding: 15px 16px; }
  .share-close.layer-close,
  .media-lightbox-close.layer-close { width: 44px !important; height: 44px !important; min-width: 44px; }
  .drawer { width: min(92vw,430px); }
  .drawer-body { padding: 20px 22px calc(26px + env(safe-area-inset-bottom)); }
  .drawer nav a { padding: 15px 0; font-size: 17px; }
  .search-overlay { width: calc(100% - 28px); border-radius: 18px; }
  .sheet {
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 92dvh;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
    transform: translate(-50%,100%);
  }
  .sheet.is-open { transform: translate(-50%,0); }
  .sheet .layer-body { max-height: none; padding: 20px 16px; }
  .sheet .layer-footer { margin: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .sheet-actions { grid-template-columns: 1fr; }
  .media-lightbox-toolbar { height: 78px; min-height: 78px; padding: 15px 16px; }
  .media-lightbox-actions { gap: 4px; }
  .media-lightbox-button { width: 40px; height: 40px; }
  .media-lightbox-close { width: 44px; height: 44px; }
  .media-lightbox-actions [data-lb-reset] { display: inline-grid; }
  .share-dialog { padding: 0; }
  .choice-grid label,
  .choice-grid-wide label,
  .profile-choice-grid label { flex-basis: 100%; min-width: 100%; }
}
