/**
 * SUBES Galeria Forum – board styles (works with UIkit / YOOtheme Pro, degrades without it).
 * Colours use currentColor / inherited values where possible so the template theme applies.
 */
.sb-board {
  --sb-radius: 10px;
  --sb-gap: 1rem;
  --sb-focus: #3b82f6;
  /* Derived from the template text colour → readable on light and dark YOOtheme styles */
  --sb-muted: #5c5c5c;
  --sb-muted: color-mix(in srgb, currentColor 72%, transparent);
  --sb-line: rgba(127, 127, 127, 0.3);
  --sb-badge-bg: rgba(0, 0, 0, 0.72);
  --sb-badge-fg: #fff;
}

/* Visible focus (WCAG 2.4.7 / 2.4.11) */
.sb-board a:focus-visible,
.sb-board button:focus-visible,
.sb-board summary:focus-visible,
.sb-board input:focus-visible,
.sb-board select:focus-visible,
.sb-board textarea:focus-visible,
.sb-card:focus-visible,
.sb-card:focus {
  outline: 3px solid var(--sb-focus);
  outline-offset: 2px;
}
.sb-card:focus:not(:focus-visible) { outline-width: 2px; }

.sb-grid { list-style: none; padding: 0; }


.sb-card {
  /* Pinterest style: photo first, no box – inherits light/dark template colours */
  background: transparent;
}
.sb-card-media { position: relative; border-radius: var(--sb-radius); overflow: hidden; }
.sb-card-link { display: block; line-height: 0; }
.sb-card-link img {
  display: block;
  width: 100%;
  height: auto;
  background: rgba(127, 127, 127, 0.15);
  transition: transform 0.25s ease;
}
.sb-card-link:hover img { transform: scale(1.02); }
/* Very tall photos cropped to 2:3 */
.sb-card-link.sb-tall { aspect-ratio: 2 / 3; overflow: hidden; }
.sb-card-link.sb-tall img { height: 100%; object-fit: cover; object-position: center top; }

.sb-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: var(--sb-badge-bg);
  color: var(--sb-badge-fg);
}
.sb-badge-count { left: auto; right: 0.5rem; }
.sb-badge-warning { background: #8a5a00; }
.sb-badge-danger { background: #a3121b; }

/* Compact caption area */
.sb-card-body { padding: 0.35rem 0.15rem 0; font-size: 0.8125rem; line-height: 1.35; }
.sb-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--sb-muted);
}
.sb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2b3a55;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  flex: none;
}
.sb-author { font-weight: 600; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-date { white-space: nowrap; }
.sb-author + .sb-date::before { content: "·"; margin-right: 0.35rem; }
.sb-likes { margin-left: auto; white-space: nowrap; flex: none; }
.sb-caption {
  margin: 0.15rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-heart { color: #e0245e; }
/* Minimum target size 24×24 (WCAG 2.5.8) */
.sb-manage,
.sb-board .uk-subnav > * > a,
.sb-remove,
.sb-board .uk-button {
  min-height: 24px;
  min-width: 24px;
}
.sb-manage { display: inline-flex; align-items: center; padding: 0.1rem 0; font-size: 0.75rem; }

.sb-more.sb-busy { opacity: 0.6; cursor: progress; }

/* Upload form */
.sb-drop {
  display: none;
  border: 2px dashed #8a8a8a;
  border-radius: var(--sb-radius);
  padding: 1rem;
  text-align: center;
  margin: 1rem 0 0.5rem;
}
.sb-drop.sb-drop-active { display: block; }
.sb-drop.sb-drag { border-color: var(--sb-focus); background: rgba(30, 95, 216, 0.06); }
.sb-photo { border: 1px solid var(--sb-line); border-radius: var(--sb-radius); padding: 0.75rem; margin: 0.75rem 0; }
.sb-legend { font-size: 1.05rem; font-weight: 600; }
.sb-file { display: block; max-width: 100%; padding: 0.4rem 0; min-height: 24px; }
.sb-preview { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.sb-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; }
.sb-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.sb-consent input { margin-top: 0.25rem; flex: none; width: 20px; height: 20px; }
.sb-field-error { font-size: 0.9rem; margin-top: 0.25rem !important; }
.sb-board [aria-invalid="true"] { border-color: #e5484d !important; }
.sb-status:not(:empty) { margin: 0.75rem 0; font-weight: 600; }
.sb-form-wrap { max-width: 720px; }

/* My entries / moderation */
.sb-my-thumb { display: inline-block; margin: 0 0.4rem 0.4rem 0; }
.sb-my-thumb img { max-width: 160px; height: auto; border-radius: 6px; }
.sb-status-label strong { padding: 0 0.4rem; border-radius: 4px; color: #fff; }
.sb-status-warning strong { background: #8a5a00; }
.sb-status-danger strong { background: #a3121b; }
.sb-status-success strong { background: #1f6b32; }
.sb-edit > summary,
.sb-reject > summary { list-style: none; display: inline-flex; align-items: center; }
.sb-edit > summary::-webkit-details-marker,
.sb-reject > summary::-webkit-details-marker { display: none; }

.sb-empty { padding: 2rem 1rem; }

@media (prefers-reduced-motion: reduce) {
  .sb-board *,
  .sb-board *::before,
  .sb-board *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fallback when UIkit is not present (e.g. non-YOOtheme template) */
.sb-board .uk-hidden-visually:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Contrast ≥ 4.5:1 (WCAG 1.4.3) on light and dark styles – UIkit #999 / #f0506e are too light on white */
.sb-board .uk-text-muted,
.sb-board .uk-text-meta { color: var(--sb-muted) !important; }
.sb-board .sb-field-error {
  color: inherit !important;
  font-weight: 600;
  border-left: 3px solid #e5484d;
  padding-left: 0.5rem;
}
.sb-board .sb-field-error::before { content: "⚠ "; color: #e5484d; }
.sb-board .uk-alert-danger { background: rgba(229, 72, 77, 0.12); color: inherit; border-left: 3px solid #e5484d; }
.sb-board .uk-alert-danger a { color: inherit; text-decoration: underline; }
.sb-board .sb-guest-cta {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sb-line);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--sb-muted);
}
.sb-board .sb-guest-cta p { margin: 0; }
.sb-board .sb-guest-cta a { color: inherit; text-decoration: underline; font-weight: 600; }
/* UIkit inactive subnav (#999) → AA contrast */
.sb-board .uk-subnav > :not(.uk-active) > a { color: var(--sb-muted); }

/* Gallery lightbox – always black, independent of the YOOtheme style (scoped, other lightboxes untouched) */
.uk-lightbox.subesboard-lightbox,
.uk-lightbox.subesboard-lightbox .uk-lightbox-items > * { background: #000 !important; }
.subesboard-lightbox .uk-lightbox-toolbar,
.subesboard-lightbox .uk-lightbox-caption {
  background: rgba(0, 0, 0, 0.85) !important;
  color: #fff !important;
}
.subesboard-lightbox .uk-lightbox-caption { font-size: 0.875rem; padding: 0.6rem 1rem; }
.subesboard-lightbox .uk-lightbox-toolbar-icon,
.subesboard-lightbox .uk-lightbox-button,
.subesboard-lightbox .uk-close {
  color: #fff !important;
  background: rgba(0, 0, 0, 0.6);
}
.subesboard-lightbox .uk-lightbox-button:hover,
.subesboard-lightbox .uk-lightbox-toolbar-icon:hover,
.subesboard-lightbox .uk-close:hover { color: #fff !important; background: rgba(255, 255, 255, 0.18); }
.subesboard-lightbox :focus-visible { outline: 3px solid #fff !important; outline-offset: 2px; }
