/* Small, shared refinements for the existing mobile and desktop shells. */
:root {
  --hz-ui-ink: #263d35;
  --hz-ui-muted: #6c7a70;
  --hz-ui-paper: #fffdf8;
  --hz-ui-line: #dedfd4;
  --hz-ui-teal: var(--hz-accent, #57b7b7);
  --hz-ui-soft-shadow: 0 9px 24px -17px rgba(70, 110, 92, .2);
  --hz-ui-radius: 16px;
  --hz-ui-control-height: 42px;
}

/* Mobile tab bar: one warm selected state, safe-area spacing, visible keyboard focus. */
#tabBar {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(83, 117, 97, .16);
  border-radius: 24px;
  box-shadow: var(--hz-ui-soft-shadow), inset 0 1px 0 rgba(255, 255, 255, .94);
}

#tabBar .tab {
  min-height: 46px;
  border-radius: 17px;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

#tabBar .tab.active,
#tabBar .tab[aria-current="page"] {
  color: var(--hz-accent-ink, #173c3c);
  background: var(--hz-accent-soft, #e6f3f1);
}

#activityView #tabBar .tab.active,
#activityView #tabBar .tab[aria-current="page"] {
  color: var(--hz-accent-ink, #173c3c);
  background: var(--hz-accent-soft, #e6f3f1);
}

#tabBar .tab:focus-visible,
.nav-links .nav-link:focus-visible {
  outline: 3px solid var(--hz-accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  #tabBar .tab:not(.active):hover { color: var(--hz-accent-ink); background: var(--hz-accent-soft); }
  .nav-links .nav-link:not(.active):hover { color: var(--hz-accent-ink); background: var(--hz-accent-soft); }
}

@media (max-width: 760px) {
  #activityView .tab-bar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 360px) {
  #tabBar { width: calc(100% - 24px); padding: 4px; }
  #tabBar .tab { min-height: 44px; font-size: 11px; }
}

/* Desktop navigation uses the same selected and focus colors as the mobile bar. */
.nav-links .nav-link {
  appearance: none;
  border: 0;
  padding: 8px 16px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-logo { appearance: none; border: 0; padding: 0; background: transparent; font-family: inherit; text-align: left; cursor: pointer; }
.nav-logo:focus-visible { outline: 3px solid #3f7770; outline-offset: 4px; border-radius: 12px; }

@media (max-width: 760px) {
  .nav-links .nav-link { min-height: 42px; padding: 8px 5px; font-size: 12px; }
}

@media (max-width: 600px) {
  .nav-links .nav-link { min-height: 44px; padding: 8px 6px; font-size: 14px; }
}

.nav-links .nav-link.active,
.nav-links .nav-link[aria-current="page"] {
  color: var(--hz-accent-ink);
  background: var(--hz-accent-soft);
}

/* Keep the community reading column within its intended desktop measure even
   when the shared page-chrome stylesheet widens other page headers. */
@media (min-width: 1181px) {
  #feedView .treehole-app.treehole-web {
    width: min(100%, 1058px);
    max-width: 1058px;
    grid-template-columns: minmax(0, 740px) 244px;
    gap: 26px;
  }
}

/* Match the encounter discovery column to the 1120px My Activities canvas. */
#eventHubRoot .hz-discovery {
  max-width: 1120px;
  padding: 34px 24px 80px;
  color: var(--hz-ui-ink);
}

#eventHubRoot .hz-discovery-heading { gap: 24px; margin-bottom: 30px; }
#eventHubRoot .hz-discovery-heading h1 { font-size: 38px; line-height: 1.35; }
#eventHubRoot .hz-discovery-heading > button { min-height: var(--hz-ui-control-height); border-radius: 12px; }
#eventHubRoot .hz-discovery-title-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
#eventHubRoot .hz-discovery-title-row > button { display: inline-flex; min-height: 42px; align-items: center; gap: 6px; margin: 0; padding: 0 13px; border: 1px solid rgba(87,183,183,.38); border-radius: 10px; color: var(--hz-accent-ink); background: #fffefa; font-size: 13px; white-space: nowrap; }
#eventHubRoot .hz-discovery-card {
  border-radius: var(--hz-ui-radius);
  border-color: var(--edge);
  background: var(--hz-ui-paper);
  box-shadow: 0 1px 0 rgba(56, 77, 61, .025);
  animation: none;
}

#eventHubRoot .hz-discovery-photo { position: relative; height: auto; aspect-ratio: 2.18 / 1; overflow: hidden; isolation: isolate; background: #e8f0ed; }
#eventHubRoot .hz-discovery-photo::after { position: absolute; z-index: 1; inset: 0 0 auto; height: 58%; background: linear-gradient(180deg,rgba(15,30,29,.55),rgba(15,30,29,.18) 68%,transparent); content: ""; pointer-events: none; }
#eventHubRoot .hz-discovery-photo img { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: none; }
#eventHubRoot .hz-discovery-photo h2 { position:absolute; z-index:2; top:15px; left:16px; max-width:calc(100% - 32px); margin:0; color:#fff; font-size:clamp(19px,1.6vw,23px); font-weight:750; line-height:1.28; letter-spacing:-.015em; overflow-wrap:anywhere; text-shadow:0 1px 8px rgba(15,30,29,.28); }
#eventHubRoot .hz-discovery-card.is-image-unavailable .hz-discovery-photo { background:#e8f3f1; }
#eventHubRoot .hz-discovery-card.is-image-unavailable .hz-discovery-photo::after { display:none; }
#eventHubRoot .hz-discovery-card.is-image-unavailable .hz-discovery-photo img { display:none; }
#eventHubRoot .hz-discovery-card.is-image-unavailable .hz-discovery-photo h2 { color:#173c3c; text-shadow:none; }
#eventHubRoot .hz-discovery-copy { padding: 22px; }
#eventHubRoot .hz-discovery-meta { align-items: center; color: #52665a; }
#eventHubRoot .hz-discovery-meta > span:first-child {
  padding: 4px 8px;
  border-radius: 8px;
  color: #405c59;
  background: var(--hz-accent-soft, #e6f3f1);
  font-weight: 650;
}
#eventHubRoot .hz-discovery-copy h2 { margin: 0; color: #2f4c3e; font-size: 23px; line-height: 1.4; }
#eventHubRoot .hz-discovery-copy > p { color: #58665b; font-size: 14px; line-height: 1.8; }
#eventHubRoot .hz-discovery-foot small { min-height: 38px; }
#eventHubRoot .hz-discovery-action {
  min-height: var(--hz-ui-control-height);
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--hz-accent, #57b7b7);
  color: var(--hz-accent-ink, #173c3c);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
#eventHubRoot .hz-discovery-action:hover { background: var(--hz-accent-hover, #49a6a6); }
#eventHubRoot .hz-discovery-action:active { transform: scale(.985); }
#eventHubRoot .hz-discovery-action:focus-visible,
#eventHubRoot .hz-persona-strip button:focus-visible,
#eventHubRoot .hz-discovery-heading > button:focus-visible {
  outline: 3px solid #3f7770;
  outline-offset: 3px;
}
#eventHubRoot .hz-icon { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#eventHubRoot .hz-discovery-action .hz-icon { margin-left: auto; }
#eventHubRoot .hz-module-dialog [data-hz-close] { display: grid; place-items: center; }
#eventHubRoot .hz-module-dialog [data-hz-close] .hz-icon { width: 18px; height: 18px; }

/* Static geometry skeletons reserve the same photo and card space as the loaded page. */
#eventHubRoot .event-skeleton-hub { display: block; width: 100%; justify-items: stretch; align-items: stretch; min-height: 0; color: var(--hz-ui-ink); }
#eventHubRoot .event-skeleton-status { display: block; margin: 0 0 18px; color: var(--hz-ui-muted); font-size: 13px; }
#eventHubRoot .event-skeleton-heading { width: min(360px, 58%); height: 34px; margin-bottom: 22px; border-radius: 10px; background: #e7e8dd; }
#eventHubRoot .event-skeleton-cards { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
#eventHubRoot .event-skeleton-card { overflow: hidden; border: 1px solid #e3e1d6; border-radius: var(--hz-ui-radius); background: var(--hz-ui-paper); }
#eventHubRoot .event-skeleton-photo { aspect-ratio: 2.18 / 1; background: #e8f0ed; }
#eventHubRoot .event-skeleton-lines { display: grid; gap: 12px; padding: 20px; }
#eventHubRoot .event-skeleton-line { height: 12px; border-radius: 8px; background: #e9e8df; }
#eventHubRoot .event-skeleton-line.short { width: 54%; }

/* My Activities' loading state follows its real two-column card layout. */
#eventMyEventsRoot .ma-loading { display: grid; gap: 16px; color: var(--hz-ui-muted); }
#eventMyEventsRoot .ma-loading > p { margin: 0; font-size: 14px; }
#eventMyEventsRoot .ma-loading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
#eventMyEventsRoot .ma-loading-card { overflow: hidden; border: 1px solid #dedfd4; border-radius: 16px; background: #fffdf8; }
#eventMyEventsRoot .ma-loading-cover { aspect-ratio: 2.25 / 1; background: #e8f0ed; }
#eventMyEventsRoot .ma-loading-body { display: grid; gap: 16px; padding: 20px; }
#eventMyEventsRoot .ma-loading-pill-row { display: flex; align-items: center; gap: 8px; min-height: 38px; }
#eventMyEventsRoot .ma-loading-pill { display: block; width: 76px; height: 22px; border-radius: 8px; background: #e6f3f1; }
#eventMyEventsRoot .ma-loading-pill.status { width: 98px; background: #f5f2ea; }
#eventMyEventsRoot .ma-loading-line { height: 12px; border-radius: 8px; background: #e9e8df; }
#eventMyEventsRoot .ma-loading-line.title { width: 72%; height: 28px; }
#eventMyEventsRoot .ma-loading-description { display: grid; gap: 7px; }
#eventMyEventsRoot .ma-loading-line.short { width: 55%; }
#eventMyEventsRoot .ma-loading-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
#eventMyEventsRoot .ma-loading-fact { display: grid; align-content: center; gap: 7px; min-width: 0; min-height: 70px; border-top: 1px solid #e5e4da; }
#eventMyEventsRoot .ma-loading-fact i,
#eventMyEventsRoot .ma-loading-fact b { display: block; height: 8px; border-radius: 6px; background: #e9e8df; }
#eventMyEventsRoot .ma-loading-fact i { width: 42px; }
#eventMyEventsRoot .ma-loading-fact b { width: 72px; max-width: 88%; }
#eventMyEventsRoot .ma-loading-cta { display: block; width: 116px; height: 44px; border-radius: 10px; background: #e6f3f1; }
#eventMyEventsRoot .ma-loading-button { display: block; width: 44px; height: 44px; border-radius: 12px; background: #e9e8df; }
#eventMyEventsRoot .ma-loading-filters { pointer-events: none; }
#eventMyEventsRoot .ma-loading-filters i { display: block; width: 74px; height: 36px; border-radius: 13px; background: #e9e8df; }

/* Scene zoom is attached to a real action/focus target, not the whole card. */
#eventMyEventsRoot .ma-cover img { transition: transform 200ms ease; }
#eventMyEventsRoot .ma-cover,
#eventMyEventsRoot .ma-action .ma-cover { height: auto; min-height: 0; aspect-ratio: 3 / 2; }
#eventMyEventsRoot .ma-action .ma-cover { align-self: center; }
#eventMyEventsRoot .ma-item { transition: box-shadow 180ms ease; }
@media (hover: hover) {
  #eventMyEventsRoot .ma-item:hover { box-shadow: none; }
  #eventMyEventsRoot .ma-item:hover .ma-cover img { transform: none; }
  #eventMyEventsRoot .ma-item:has(.event-btn:hover),
  #eventMyEventsRoot .ma-item:has(.event-btn:focus-visible) { box-shadow: 0 8px 22px rgba(40, 77, 59, .07); }
  #eventMyEventsRoot .ma-item:has(.event-btn:hover) .ma-cover img,
  #eventMyEventsRoot .ma-item:has(.event-btn:focus-visible) .ma-cover img { transform: scale(1.02); }
}

@media (max-width: 900px) {
  #eventHubRoot .hz-discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #eventHubRoot .hz-discovery-grid > :last-child { grid-column: 1 / -1; }
  #eventHubRoot .event-skeleton-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #eventHubRoot .event-skeleton-card:last-child { display: none; }
}

@media (max-width: 700px) {
  #eventMyEventsRoot .ma-loading-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  #eventHubRoot .hz-discovery { padding: 25px 16px 88px; }
  #eventHubRoot .hz-discovery-heading { align-items: flex-start; gap: 8px; margin-bottom: 24px; }
  #eventHubRoot .hz-discovery-heading > div { min-width: 0; }
  #eventHubRoot .hz-discovery-heading h1 { font-size: 29px; line-height: 1.35; }
  #eventHubRoot .hz-discovery-heading > button { flex: 0 0 auto; padding: 8px; font-size: 12px; }
  #eventHubRoot .hz-discovery-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #eventHubRoot .hz-discovery-grid > :last-child { grid-column: auto; }
  #eventHubRoot .hz-discovery-photo { aspect-ratio: 3 / 2; }
  #eventHubRoot .hz-discovery-copy { padding: 20px; }
  #eventHubRoot .event-skeleton-cards { grid-template-columns: minmax(0, 1fr); }
  #eventHubRoot .event-skeleton-card:nth-child(n + 2) { display: block; }
  #eventHubRoot .event-skeleton-line { height: 11px; }
  #eventMyEventsRoot .ma-loading-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  #tabBar .tab,
  .nav-links .nav-link,
  #eventHubRoot .hz-discovery-action,
  #eventMyEventsRoot .ma-cover img,
  #eventMyEventsRoot .ma-item { transition: none; }
  #eventHubRoot .hz-discovery-action:active { transform: none; }
  #eventMyEventsRoot .ma-item:has(.event-btn:hover) .ma-cover img,
  #eventMyEventsRoot .ma-item:has(.event-btn:focus-visible) .ma-cover img { transform: none; }
}
