@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;600;700;800;900&display=swap');

:root {
  --page: #000000;
  --card: #ffffff;
  --card-soft: #f3f3f3;
  --ink: #000000;
  --muted: #666666;
  --line: #d4d4d4;
  --red: #f9032f;
  --white: #ffffff;
  --radius: 10px;
  --button-radius: 4px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--page);
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--white);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-weight: 500;
}

button { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;

  padding:
    max(12px, env(safe-area-inset-top))
    max(18px, calc((100vw - 900px) / 2))
    12px;

  background: rgba(0, 0, 0, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.brand-mark {
  color: var(--white);
  font-size: 48px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.brand-mark.small {
  font-size: 27px;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin: 7px 0 0;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.member-badge {
  padding: 7px 10px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: transparent;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: var(--button-radius);
}

.app-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 34px 18px 72px;
}

.hero-card,
.archive-section {
  padding: 28px;
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius);
}

.archive-section { margin-top: 28px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading .eyebrow { margin: 0 0 5px; }

.section-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  text-decoration: none;
  font-size: clamp(29px, 5vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.year-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  background: var(--ink);
  border-radius: var(--button-radius);
}

.latest-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--card-soft);
  border: 2px solid var(--ink);
  border-radius: 7px;
}

.latest-preview[data-full] { cursor: pointer; }
.latest-preview[data-full]:focus-visible { outline: 3px solid rgba(249, 3, 47, .35); outline-offset: 3px; }

.latest-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-preview.empty { display: grid; place-items: center; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
}

.camera-glyph { color: var(--red); font-size: 52px; line-height: 1; }

.archive-head { align-items: center; }

.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 17px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter {
  flex: 0 0 auto;
  padding: 10px 15px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--button-radius);
}

.filter.active,
.filter:hover {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.filter:focus-visible,
.thumb-open:focus-visible,
.mini-btn:focus-visible,
.viewer-close:focus-visible,
.viewer-action:focus-visible {
  outline: 3px solid rgba(249, 3, 47, 0.32);
  outline-offset: 2px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.thumb-card {
  overflow: hidden;
  color: var(--ink);
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.thumb-card[hidden] { display: none; }

.thumb-open {
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: #111111;
  border: 0;
  border-bottom: 1px solid var(--line);
}

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

.thumb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 49px;
  padding: 7px 7px 7px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.thumb-meta > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-btn {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  padding: 0;
  color: var(--white);
  cursor: pointer;
  background: var(--ink);
  border: 0;
  border-radius: 3px;
}

.mini-btn:hover {
  background: var(--red);
}

.mini-btn:disabled,
.viewer-action:disabled {
  cursor: wait;
  opacity: .65;
}

.mini-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.archive-empty {
  padding: 36px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.viewer {
  width: min(94vw, 900px);
  padding: 0;
  overflow: hidden;
  color: var(--white);
  background: var(--page);
  border: 2px solid var(--white);
  border-radius: 7px;
}

.viewer::backdrop {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
}

.viewer img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: var(--white);
  font-size: 27px;
  cursor: pointer;
  background: var(--red);
  border: 0;
  border-radius: var(--button-radius);
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
}

.viewer-name {
  min-width: 0;
  overflow: hidden;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice {
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--button-radius);
}

.notice.error {
  color: #8a001a;
  background: #ffe5ea;
  border: 1px solid var(--red);
}

@media (min-width: 700px) {
  .app-shell { padding-top: 42px; }
  .hero-card, .archive-section { padding: 35px; }
  .latest-preview { aspect-ratio: 16 / 9; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 560px) {
  .app-shell { padding: 20px 12px 54px; }
  .hero-card, .archive-section { padding: 18px; border-radius: 8px; }
  .section-heading h1, .section-heading h2 { font-size: 29px; }
  .brand-mark.small { font-size: 25px; }
  .thumb-meta { font-size: 12px; }
}


/* iOS Home Screen: custom pull-to-refresh */
:root {
  --ptr-y: 0px;
}

.pull-refresh {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  left: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  transform: translate(-50%, calc(-70px + var(--ptr-y)));
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.pull-refresh.visible {
  opacity: 1;
}

.ptr-active .pull-refresh {
  transition: none;
}

.pull-refresh.ready {
  border-color: var(--red);
}

.pull-refresh svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.pull-refresh.ready svg {
  color: var(--red);
}

.pull-refresh.refreshing svg {
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pull-refresh,
  .pull-refresh.refreshing svg {
    transition: none;
    animation: none;
  }
}

/* =========================================================
   MEMBER FOTO VIEWER / DELEN / SLIDESHOW
   Styling staat bewust in styles.css; app.js regelt alleen gedrag.
   ========================================================= */

/* Oude downloadcontrols uit de member-app verbergen. */
[data-download-url],
#viewerDownload,
.download-btn,
.viewer-download {
  display: none !important;
}

.viewer .viewer-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  box-sizing: border-box;
}

.viewer .viewer-name {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.viewer .viewer-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.viewer .viewer-action {
  display: inline-flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--white);
  cursor: pointer;
  background: var(--red);
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.viewer .viewer-action:hover,
.thumb-share-btn:hover {
  background: #d90029;
}

.viewer .viewer-action svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.viewer .viewer-action:disabled {
  cursor: default;
  opacity: .55;
}

.viewer .viewer-action:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Deelknop onder iedere thumbnail. */
.thumb-share-btn {
  color: var(--white);
  background: var(--ink);
}

.thumb-share-btn:hover {
  background: #222222;
}

.thumb-share-btn svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.viewer .viewer-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.viewer .viewer-media #viewerImage {
  display: block;
  max-width: 100%;
}

/* Grote klikzone, maar visueel alleen een rood driehoekje. */
.viewer .photo-nav {
  position: absolute;
  top: 50%;
  z-index: 12;
  width: 48px;
  height: 72px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent;
}

.viewer .photo-nav::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  content: '';
  transform: translate(-50%, -50%);
}

.viewer .photo-nav-prev { left: 2px; }
.viewer .photo-nav-next { right: 2px; }

.viewer .photo-nav-prev::before {
  border-top: 13px solid transparent;
  border-right: 19px solid var(--red);
  border-bottom: 13px solid transparent;
}

.viewer .photo-nav-next::before {
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 19px solid var(--red);
}

.viewer .photo-nav:disabled {
  cursor: default;
  opacity: .18;
}

.viewer .photo-nav:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -6px;
}

/* Native browser-fullscreen. */
.viewer:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.viewer:fullscreen .viewer-media {
  width: 100%;
  height: 100%;
}

.viewer:fullscreen #viewerImage {
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain;
}

.viewer:fullscreen .viewer-bar {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 4px) !important;
  left: max(12px, env(safe-area-inset-left)) !important;
  z-index: 20;
  width: auto !important;
  padding: 7px 8px 7px 12px !important;
  color: var(--white);
  background: rgba(0, 0, 0, .78) !important;
  border-radius: 6px;
}

.viewer:fullscreen .viewer-close {
  position: fixed !important;
  top: calc(max(10px, env(safe-area-inset-top)) + 2px) !important;
  right: calc(max(10px, env(safe-area-inset-right)) + 2px) !important;
  z-index: 21;
}

/* iPhone/iPad fallback wanneer de Fullscreen API niet beschikbaar is. */
html.viewer-fullscreen-page,
html.viewer-fullscreen-page body {
  overflow: hidden !important;
}

.viewer.viewer-fullscreen-mode[open] {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}

.viewer.viewer-fullscreen-mode[open] .viewer-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding:
    calc(env(safe-area-inset-top) + 54px)
    0
    calc(env(safe-area-inset-bottom) + 72px);
  box-sizing: border-box;
}

.viewer.viewer-fullscreen-mode[open] #viewerImage {
  width: 100%;
  height: 100%;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
}

.viewer.viewer-fullscreen-mode[open] .viewer-bar {
  position: fixed !important;
  right: calc(env(safe-area-inset-right) + 10px) !important;
  bottom: calc(env(safe-area-inset-bottom) + 12px) !important;
  left: calc(env(safe-area-inset-left) + 10px) !important;
  z-index: 20;
  width: auto !important;
  min-height: 46px;
  margin: 0 !important;
  padding: 6px 7px 6px 11px !important;
  color: var(--white);
  background: rgba(0, 0, 0, .78) !important;
  border-radius: 6px;
}

.viewer.viewer-fullscreen-mode[open] .viewer-close {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 10px) !important;
  right: calc(env(safe-area-inset-right) + 10px) !important;
  z-index: 21;
}

.viewer.viewer-fullscreen-mode[open] .photo-nav-prev {
  left: calc(env(safe-area-inset-left) + 2px);
}

.viewer.viewer-fullscreen-mode[open] .photo-nav-next {
  right: calc(env(safe-area-inset-right) + 2px);
}

@media (max-width: 560px) {
  .viewer .viewer-bar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .viewer .viewer-actions { gap: 6px; }

  .viewer .viewer-action {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .viewer .viewer-action svg {
    width: 20px;
    height: 20px;
  }

  .viewer .photo-nav {
    width: 42px;
    height: 64px;
  }

  .viewer .photo-nav-prev::before {
    border-top-width: 11px;
    border-right-width: 16px;
    border-bottom-width: 11px;
  }

  .viewer .photo-nav-next::before {
    border-top-width: 11px;
    border-bottom-width: 11px;
    border-left-width: 16px;
  }
}

/* =========================================================
   LIKES
   Eén like per IP-adres per foto; teller komt uit like.php.
   ========================================================= */

.thumb-member-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.like-btn {
  color: var(--white);
  cursor: pointer;
  background: var(--ink);
  border: 0;
  border-radius: 3px;
  -webkit-tap-highlight-color: transparent;
}

.like-btn .like-heart {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.like-btn.is-liked {
  background: var(--red);
}

.like-btn.is-liked .like-heart {
  fill: currentColor;
  stroke: currentColor;
}

.like-btn:hover {
  background: #222222;
}

.like-btn.is-liked:hover {
  background: #d90029;
}

.like-btn:disabled {
  cursor: wait;
  opacity: .6;
}

.like-count {
  min-width: 1ch;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.thumb-like-btn {
  display: inline-flex;
  width: auto;
  min-width: 35px;
  height: 35px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
}

.thumb-like-btn .like-heart {
  width: 17px;
  height: 17px;
}

/* Viewer: like mag iets breder zijn voor de teller.
   Share en Fullscreen blijven exact even groot. */
.viewer .viewer-like {
  flex: 0 0 auto;
  width: auto;
  min-width: 42px;
  padding: 0 9px;
  gap: 5px;
  background: var(--ink);
}

.viewer .viewer-like.is-liked {
  background: var(--red);
}

.viewer .viewer-like:hover {
  background: #222222;
}

.viewer .viewer-like.is-liked:hover {
  background: #d90029;
}

.viewer .viewer-like .like-heart {
  width: 20px;
  height: 20px;
  fill: none;
}

.viewer .viewer-like.is-liked .like-heart {
  fill: currentColor;
}

.viewer .viewer-like .like-count {
  font-size: 12px;
}

@media (max-width: 560px) {
  .thumb-member-actions {
    gap: 5px;
  }

  .viewer .viewer-like {
    width: auto;
    min-width: 40px;
    padding: 0 7px;
  }
}

/* =========================================================
   LAATSTE FOTO - OVERLAY ACTIES
   Dezelfde Like / Share / Fullscreen-iconen als in de viewer.
   ========================================================= */

.latest-photo-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.latest-photo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--white);
  cursor: pointer;
  background: var(--red);
  border: 0;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  -webkit-tap-highlight-color: transparent;
}

.latest-photo-action:hover {
  background: #d90029;
}

.latest-photo-action svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.latest-photo-action:focus-visible {
  outline: 3px solid rgba(249, 3, 47, .32);
  outline-offset: 2px;
}

.latest-photo-action:disabled {
  cursor: wait;
  opacity: .6;
}

.latest-photo-like {
  width: auto;
  min-width: 42px;
  gap: 5px;
  padding: 0 9px;
  background: var(--ink);
}

.latest-photo-like:hover {
  background: #222222;
}

.latest-photo-like.is-liked {
  background: var(--red);
}

.latest-photo-like.is-liked:hover {
  background: #d90029;
}

.latest-photo-like .like-heart {
  width: 20px;
  height: 20px;
}

.latest-photo-like .like-count {
  font-size: 12px;
}

@media (max-width: 560px) {
  .latest-photo-controls {
    right: 8px;
    bottom: 8px;
    gap: 6px;
  }

  .latest-photo-action {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .latest-photo-action svg {
    width: 20px;
    height: 20px;
  }

  .latest-photo-like {
    width: auto;
    min-width: 40px;
    padding: 0 7px;
  }
}

