/* Community site styles. Light only for now; dark mode comes later. */

:root {
  --paper: #F3F6F9;       /* page: soft cool grey */
  --surface: #FFFFFF;     /* cards, header, menu */
  --soft: #F6F6F6;        /* insets inside cards */
  --soft-cool: #F1F5F8;   /* contact rows */
  --ink: #1D1D1F;
  --muted: #5C5F62;
  --line: #D2E2EC;
  --chip-line: #C4D6E2;
  --accent: #0E5A70;
  --avatar: #EDEDED;
  --avatar-ink: #3A3A3A;
  --error: #9A2E20;
  --error-bg: #FBEDEA;
  --ok: #1F6B3A;
  --ok-bg: #E8F4EC;
  --tag-event: #0E5A70;  --tag-event-bg: #DCEEF3;
  --tag-job: #4B3FA0;    --tag-job-bg: #E6E4F8;
  --tag-promo: #1F6B3A;  --tag-promo-bg: #E2F1E6;
  --button: #022851;      /* buttons */
  --button-ink: #FFFFFF;
  --frame-line: rgba(15, 40, 60, 0.05);   /* barely-there edge on cards */
  --frame-shadow: 0 1px 2px rgba(15, 40, 60, 0.06), 0 2px 8px rgba(15, 40, 60, 0.07);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; font-size: 106.25%; }

/* System fonts: no downloads on slow connections, and phones' system
   fonts include Inuktitut syllabics. */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
               "Noto Sans Canadian Aboriginal", "Euphemia UCAS", sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.icon { flex-shrink: 0; }

/* ---------- Header and menu ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.55rem 0.5rem 0.55rem 1rem;
}

.site-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.menu { position: static; }

.menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.menu summary::-webkit-details-marker { display: none; }

.menu[open] summary { background: var(--soft-cool); }

.menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0.5rem;
  z-index: 20;
  width: min(22rem, calc(100vw - 1rem));
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.menu-heading {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.menu-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

a.menu-item:hover { text-decoration: underline; }

.menu-split { justify-content: space-between; gap: 1rem; }

.menu-stack { display: flex; flex-direction: column; }

.menu-strong, .menu-current { font-weight: 700; }

.menu-sub { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

.menu-rule { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 0.5rem 0; }

.menu-org { margin: 0 0 0.2rem; font-weight: 700; }

.menu-form { margin: 0; }

.menu-button {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

/* ---------- Page ---------- */

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 0.5rem; }

h2 { font-size: 1.3rem; line-height: 1.25; margin: 2.5rem 0 1rem; }

h3 { font-size: 1rem; line-height: 1.3; margin: 0 0 0.35rem; }

.lede { color: var(--muted); margin: 0 0 1.5rem; }

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

.page-title { margin-bottom: 1rem; }

.page-title h1 { margin: 0; font-weight: 800; }

.page-sub { margin: 0.1rem 0 0; color: var(--muted); }

.section-heading { margin: 2rem 0 0.75rem; }

/* ---------- Feed cards ---------- */

.feed { display: grid; gap: 0.85rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--frame-line);
  border-radius: 14px;
  box-shadow: var(--frame-shadow);
}

.card-head { display: flex; align-items: flex-start; gap: 0.6rem; }

.card-org {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

a.card-org:hover .card-org-name { text-decoration: underline; }

.avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--avatar);
  color: var(--avatar-ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.avatar-large { width: 64px; height: 64px; font-size: 1.3rem; font-weight: 800; }

.card-org-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.card-org-name { font-weight: 700; line-height: 1.3; }

.chip {
  font-size: 0.72rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.tag-event { color: var(--tag-event); background: var(--tag-event-bg); }
.tag-job   { color: var(--tag-job);   background: var(--tag-job-bg); }
.tag-promo { color: var(--tag-promo); background: var(--tag-promo-bg); }

.card-time { margin: 0; font-size: 0.8rem; color: var(--muted); }

.card-text { margin: 0; font-size: 1.05rem; line-height: 1.45; overflow-wrap: anywhere; }

.card-event {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.card-image { display: block; }

.card-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 32rem;
  object-fit: contain;
  border-radius: 10px;
  background: var(--soft);
}

.card-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}

.file-icon {
  width: 44px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  border: 1.5px solid #8A8D90;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-file-text { display: flex; flex-direction: column; }

.card-file-title { font-weight: 700; overflow-wrap: anywhere; }

.card-file-hint { font-size: 0.8rem; color: var(--muted); }

.card-where {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Organization page ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; }

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.contact-head { display: flex; align-items: center; gap: 0.75rem; }

.contact-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.contact-name { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }

.contact-alt { margin: 0; color: var(--muted); }

.contact-rows { display: flex; flex-direction: column; gap: 0.5rem; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: var(--soft-cool);
  color: var(--ink);
  text-decoration: none;
}

.contact-row-text { display: flex; flex-direction: column; min-width: 0; }

.contact-row-label { font-size: 0.75rem; color: var(--muted); }

.contact-row-value { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Community list ---------- */

/* Feeds page: each region in a box like a post card, with its
   communities as round grey buttons. */
.region-box {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--frame-line);
  border-radius: 14px;
  box-shadow: var(--frame-shadow);
}

.region-heading { margin: 0 0 0.7rem; font-size: 1.05rem; }

.community-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.community-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.community-list a:hover { background: #E9EDF1; }

.community-list .area-link { font-weight: 800; }

/* ---------- Forms: login and posting ---------- */

.form { display: grid; gap: 0.35rem; max-width: 24rem; }

.post-form { max-width: 34rem; }

.form label { font-weight: 600; margin-top: 0.75rem; }

.form input[type="text"],
.form input[type="password"],
.form input[type="date"],
.form input[type="time"],
.form select,
.form textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.form input[type="file"] { font: inherit; }

/* The file picker's button, round like every other button. */
.form input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  margin-right: 0.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  cursor: pointer;
}

.form fieldset {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.form legend { font-weight: 700; padding: 0 0.35rem; }

.check {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-weight: 400;
  margin: 0.15rem 0;
}

.form .check { margin-top: 0.15rem; font-weight: 400; }

.check-all { font-weight: 700; margin-bottom: 0.5rem; }

/* "All" choices stand apart from single communities, with the same
   tint as file attachments. */
.check-all, .check-region {
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0 1rem;
}

.region { margin: 0.75rem 0 0.1rem; font-size: 0.9rem; font-weight: 700; color: var(--muted); }

.hint { color: var(--muted); font-size: 0.9rem; font-weight: 400; margin: 0; }

.button {
  justify-self: start;
  font: inherit;
  font-weight: 700;
  margin-top: 1.25rem;
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  cursor: pointer;
}

.link-button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.link-button.danger { color: var(--error); }

.inline { display: inline; margin: 0; }

.notice { padding: 0.75rem 1rem; border-radius: 8px; margin: 0 0 1rem; }

.notice p { margin: 0; }
.notice p + p { margin-top: 0.35rem; }

.notice.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }

.notice.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }

/* Posting page list of your posts */
.my-post {
  margin-bottom: 0.75rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.meta { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.95rem; }

.thumb {
  display: block;
  max-width: 12rem;
  max-height: 16rem;
  width: auto;
  height: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* ---------- Posting: message field and your posts ---------- */

.form textarea { resize: vertical; min-height: 5rem; line-height: 1.45; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.card-actions form { margin: 0; }

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

/* ---------- Admin: accounts ---------- */

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-top h1 { margin: 0; }

.button-small { margin-top: 0; padding: 0.5rem 1rem; font-size: 0.9rem; text-decoration: none; }

.account-list { display: grid; gap: 0.6rem; }

.account-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.account-row:hover .account-row-name { text-decoration: underline; }

.account-row-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }

.account-row-name { font-weight: 700; }

.account-row-meta { font-size: 0.8rem; color: var(--muted); }

.status {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.status-on  { color: var(--ok); background: var(--ok-bg); }
.status-off { color: var(--muted); background: var(--soft); border: 1px solid var(--chip-line); }

.admin-form { max-width: 34rem; }

.field-label { margin: 0.75rem 0 0; font-weight: 600; }

.field-static { margin: 0.25rem 0 0.5rem; font-weight: 600; }

.danger-zone {
  max-width: 34rem;
  margin-top: 2.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--error);
  border-radius: 10px;
}

.danger-zone h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }

.button-danger { background: var(--error); margin-top: 0.75rem; }

/* Section titles sit above their box, not on its border */
.form fieldset { position: relative; margin-top: 2.6rem; }
.form legend {
  position: absolute;
  top: -1.9rem;
  left: 0;
  padding: 0;
  font-size: 1.05rem;
}

/* ---------- Messages in several languages ---------- */

.card-lang-note { margin: 0; font-size: 0.8rem; color: var(--muted); }

.hint.count { text-align: right; margin-top: -0.1rem; }

/* ---------- Logos ---------- */

.avatar { overflow: hidden; }

.avatar.has-logo {
  background: #FFFFFF;
  border: 1px solid var(--line);
  padding: 0;
}

.avatar.has-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.logo-current { display: flex; align-items: center; gap: 1rem; margin: 0.25rem 0 0.5rem; }

/* ---------- Admin: post as ---------- */

.post-as { display: grid; gap: 0.35rem; max-width: 34rem; margin-bottom: 1rem; }

.post-as label { font-weight: 600; }

.post-as-row { display: flex; gap: 0.5rem; }

.post-as select {
  flex-grow: 1;
  min-width: 0;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.notice.as-notice {
  background: var(--tag-job-bg);
  color: var(--tag-job);
  border: 1px solid var(--tag-job);
  font-weight: 600;
}

/* ---------- Menu: New post and community dropdown ---------- */

.menu-new-post {
  display: block;
  margin: 0;
  text-align: center;
  text-decoration: none;
}

.menu-community { display: flex; gap: 0.5rem; margin: 0; }

.menu-community select {
  flex-grow: 1;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* ---------- Embeds ---------- */

body.embed { background: transparent; padding: 0.5rem; }

.embed-title {
  display: block;
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.embed-more {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  text-align: center;
}

.embed-list { display: grid; gap: 0.75rem; }

.embed-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.embed-item.embed-new { border-color: var(--ok); }

.embed-item h3 { margin: 0; }

.embed-item label { font-weight: 600; font-size: 0.9rem; }

.embed-code {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.5rem;
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  resize: vertical;
}

/* ---------- Region choices and community pages ---------- */

.check-region { font-weight: 700; margin-top: 0.75rem; }

.community-actions { display: flex; justify-content: flex-end; margin-bottom: 0.75rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header: quick language switch ---------- */

.site-name { min-width: 0; line-height: 1.2; }

.header-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }

.lang-quick, .lang-circle {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--chip-line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.lang-quick:hover, a.lang-circle:hover { border-color: var(--accent); color: var(--accent); }

.lang-quick[lang="iu-Cans"], .lang-circle[lang="iu-Cans"] { font-size: 0.95rem; font-weight: 600; }

/* Language circles in the menu: always one row. */
.lang-row { display: flex; flex-wrap: nowrap; gap: 0.5rem; padding: 0.2rem 0; }

.lang-circle.is-current { background: var(--button); border-color: var(--button); color: var(--button-ink); }

/* Menu button: same circle as the language switch */
.menu summary {
  border: 1px solid var(--chip-line);
  border-radius: 999px;
}
.menu summary:hover { border-color: var(--accent); color: var(--accent); }
.menu[open] summary { border-color: var(--accent); }

/* ---------- Card three-dot menu ---------- */

.card-menu { position: relative; flex-shrink: 0; margin: -0.35rem -0.35rem 0 0; }

.card-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}

.card-menu summary::-webkit-details-marker { display: none; }

.card-menu summary:hover,
.card-menu[open] summary { background: var(--soft-cool); color: var(--ink); }

.card-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 15;
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.card-menu-panel .card-expires {
  margin: 0 0 0.25rem;
  padding: 0.35rem 0.5rem 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.card-menu-panel form { margin: 0; }

.card-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.card-menu-item:hover { background: var(--soft-cool); }

.card-menu-item.danger { color: var(--error); }

/* ---------- Edit pop-up ---------- */

dialog.modal {
  width: min(40rem, calc(100vw - 1rem));
  height: min(52rem, calc(100vh - 1rem));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

dialog.modal::backdrop { background: rgba(20, 40, 55, 0.45); }

dialog.modal iframe { display: block; width: 100%; height: 100%; border: 0; }

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

body.framed .page { padding-top: 1rem; }

body.framed h1 { padding-right: 3.5rem; }

.form-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; }

.form-actions .button { margin-top: 0; }

.file-current { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.5rem; }

.file-current img {
  display: block;
  max-width: 7rem;
  max-height: 7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* ---------- Site map, Show dropdown, image grid, document list ---------- */

.breadcrumb { margin: 0 0 0.75rem; font-size: 0.9rem; }

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.breadcrumb li { display: flex; align-items: center; gap: 0.35rem; }

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

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb [aria-current] { font-weight: 700; color: var(--ink); }

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

.feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.feed-toolbar .button { margin-top: 0; }

.feed-toolbar-heading { margin-top: 2rem; }

.feed-toolbar-heading .section-heading { margin: 0; }

.view-picker { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0 auto; }

.view-picker label { font-weight: 600; font-size: 0.9rem; }

.view-picker select {
  min-height: 44px;
  font: inherit;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

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

.gallery-tile {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
}

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

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.doc-row:hover .doc-title { text-decoration: underline; }

.doc-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.doc-title { font-weight: 700; }

.doc-meta { font-size: 0.8rem; color: var(--muted); }

.doc-event { display: flex; align-items: center; gap: 0.3rem; }

/* ---------- Event calendar ---------- */

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
}

.cal-title {
  flex: 1;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
}

.cal-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.cal-arrow:hover { color: var(--accent); border-color: var(--chip-line); }

/* The day lists open below their day and span the whole grid. */
.cal-wrap { position: relative; margin: 0 0 1.25rem; }

.cal-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cal-grid th {
  padding: 0.3rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-cell { padding: 0; vertical-align: top; }

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 58px;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
}

.cal-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.cal-cell.is-today .cal-num { background: var(--button); color: var(--button-ink); font-weight: 700; }

details.cal-more > summary { list-style: none; cursor: pointer; }

details.cal-more > summary::-webkit-details-marker { display: none; }

.cal-day.has-events { background: var(--tag-event-bg); }

.cal-day.has-events .cal-num { font-weight: 700; }

details.cal-more[open] > .cal-day { outline: 2px solid var(--accent); outline-offset: -2px; }

.cal-count {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 0.05rem 0.3rem 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
}

.cal-count-long { display: none; }

@media (min-width: 600px) {
  .cal-count-short { display: none; }
  .cal-count-long { display: inline; }
  .cal-day { min-height: 76px; padding: 6px; }
}

.cal-pop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  margin-top: 4px;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--chip-line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 40, 60, 0.18);
}

.cal-pop-day { margin: 0 0 0.5rem; font-weight: 700; font-size: 0.9rem; }

.cal-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

.cal-pop-item {
  --ev: var(--tag-event);
  --ev-bg: var(--tag-event-bg);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.45rem 0.6rem;
  border-left: 4px solid var(--ev);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}

.cal-pop-item:hover { background: var(--ev-bg); }

.cal-pop-when { font-size: 0.75rem; font-weight: 700; color: var(--ev); }

.cal-pop-org { font-size: 0.9rem; font-weight: 600; }

.cal-pop-text { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }

.cal-day-heading { margin: 1.25rem 0 0.6rem; font-size: 1rem; font-weight: 700; }

.cal-day-heading.is-today { color: var(--accent); }

.cal-week-day .cal-day-heading { margin-top: 1rem; }

.cal-week-day:first-child .cal-day-heading { margin-top: 0; }

.cal-empty { margin: 0; font-size: 0.9rem; }

/* A card jumped to from the calendar: clear of the top, and outlined. */
.card[id] { scroll-margin-top: 1rem; }

.card:target { outline: 3px solid var(--accent); outline-offset: 2px; }


/* ---------- App icon ---------- */

.site-home { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }

.app-icon { display: block; width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }

/* ---------- Search ---------- */

.site-header-inner { gap: 0.6rem; }

.site-search { position: relative; flex: 1; min-width: 0; margin: 0; }

.site-search input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 42px;
  padding: 0 1rem 0 2.3rem;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  background: #FFFFFF;
  color: #3A3D40;
  font: inherit;
  font-size: 1rem;
}

.site-search input::placeholder { color: #6B6F73; }

.site-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.site-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: #5C5F62;
  pointer-events: none;
}

.search-heading { margin: 0 0 0.25rem; font-size: 1.3rem; font-weight: 800; overflow-wrap: anywhere; }

.search-scope { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }

.search-scope a { color: var(--accent); font-weight: 600; }

.org-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.org-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.org-row:hover { border-color: var(--chip-line); }

.org-row-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-width: 0; }

.org-row-name { font-weight: 700; overflow-wrap: anywhere; }

.site-name { flex-shrink: 0; }

/* ---------- Card head: name and menu, then organization type and post type ---------- */

.card-avatar { flex: none; display: block; text-decoration: none; }

.card-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }

.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; min-width: 0; }

.card-head-row .card-org-name { min-width: 0; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }

a.card-org-name:hover { text-decoration: underline; }

/* The menu sits in the card's top corner without making the name row taller. */
.card-head-row .card-menu { margin: -0.55rem -0.5rem -0.75rem 0; }

.card-head-sub { align-items: center; }

.card-head-sub .tag { margin-left: auto; }

/* Organization type: a coloured dot and the type's name */
.acct-type { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--muted); }

.acct-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }

.acct-government, .acct-inuit_org { background: #C9A227; }

.acct-school { background: #B3261E; }

.acct-group { background: #D9730D; }

.acct-business { background: #1F6FD1; }

.menu-new-post { font-size: 0.9rem; }

/* ---------- Confirmation pop-up ---------- */

dialog.confirm-dialog {
  width: min(26rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

dialog.confirm-dialog::backdrop { background: rgba(20, 40, 55, 0.45); }

.confirm-dialog h2 { margin: 0 0 0.5rem; font-size: 1.15rem; overflow-wrap: anywhere; }

.confirm-dialog p { margin: 0 0 1.25rem; }

.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }

.button-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--chip-line); }

.danger-zone .button-danger { margin-top: 0.75rem; }

.confirm-actions .button { margin-top: 0; }

/* Post type pills take the colour of the organization type. */
.tone-government, .tone-inuit_org { color: #6B5000; background: #FAF0C8; }
.tone-school   { color: #8F261C; background: #FBE3E1; }
.tone-group    { color: #9A420D; background: #FCE9DA; }
.tone-business { color: #1F4E99; background: #E1EAF8; }
.tone-none     { color: #5C5F62; background: #ECEEF0; }

/* Events get a grey pill, the same grey as the event's date box. */
.tag-plain { color: var(--ink); background: var(--soft); }

/* Notices are always red. */
.tag-notice { color: #9A2E20; background: #FBE3E1; }

/* "Baker Lake and 6 others": the line itself opens the full list, with no
   arrow or button look. */
details.card-where-more { display: block; }

details.card-where-more > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

details.card-where-more > summary::-webkit-details-marker { display: none; }

details.card-where-more > summary:hover .places-others { text-decoration: underline; }

.places-list { margin: 0.3rem 0 0 1.3rem; font-size: 0.8rem; color: var(--muted); }

/* iPhone Safari fades the top of the page under the status bar. Extra
   white space at the top of the header keeps the logo, search and buttons
   below that fade. Only iPhones and iPads get it. */
@supports (-webkit-touch-callout: none) {
  .site-header-inner { padding-top: calc(0.55rem + 22px); }
}

/* Round dropdowns: our own arrow, set in from the edge. */
.view-picker select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C5F62' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 12px;
}

/* ---------- Photo and document viewer ---------- */

dialog.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(12, 16, 20, 0.94);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
}

dialog.viewer:not([open]) { display: none; }

dialog.viewer::backdrop { background: rgba(12, 16, 20, 0.6); }

.viewer-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  padding-top: max(0.6rem, env(safe-area-inset-top));
}

.viewer-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.viewer-download { flex: none; color: #FFFFFF; font-weight: 600; font-size: 0.9rem; }

.viewer-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  cursor: pointer;
}

.viewer-close:hover { background: rgba(255, 255, 255, 0.24); }

.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 0.5rem 0.5rem; }

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

.viewer-document .viewer-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #FFFFFF; }

/* Posts that have left the feeds, on an organization's page. */
.past-tag {
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---------- Several files on a post ---------- */

.card-grid { display: grid; gap: 4px; border-radius: 10px; overflow: hidden; }

.card-grid-2 { grid-template-columns: 1fr 1fr; }

.card-grid-3 { grid-template-columns: 1fr 1fr; }

.card-grid-3 .card-grid-tile:first-child { grid-column: 1 / -1; }

.card-grid-4 { grid-template-columns: 1fr 1fr; }

.card-grid-tile { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--soft); }

.card-grid-3 .card-grid-tile:first-child { aspect-ratio: 2 / 1; }

.card-grid-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.card-grid-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 16, 20, 0.55);
  color: #FFFFFF;
  font-size: 1.6rem;
  font-weight: 800;
}

.card .card-file + .card-file { margin-top: -0.2rem; }

.file-current-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.5rem; }

.file-current-list .file-current { margin: 0; padding: 0.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

.file-current-list .file-current img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.file-current-name { flex: 1; min-width: 8rem; font-weight: 600; overflow-wrap: anywhere; }

/* Viewer: step through a post's photos. */
.viewer-step {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(12, 16, 20, 0.5);
  color: #FFFFFF;
  cursor: pointer;
}

.viewer-prev { left: 0.6rem; }

.viewer-next { right: 0.6rem; }

.viewer-body { position: relative; }

.viewer-count { flex: none; font-size: 0.85rem; opacity: 0.8; }

.files-status:empty { display: none; }

.files-status.files-error { color: var(--error); font-weight: 600; }
