/* Return immediately to the requested masjid section after navigation or sign-in. */
html { scroll-behavior: auto; }

/* The masjid page on the option D frame: the parts only this page has, on top of frame.css and mosque-page.css.
   The sky shows the name and the way there; the sheet's sections are rows, not cards; the details open in the
   frame's pop-up (frame-popups.js). */

/* Links on the sky are white and quiet; they underline when a visitor points at them. */
.stage a { color: var(--white); text-decoration: none; text-underline-offset: 3px; }
.stage a:hover, .stage a:focus-visible { text-decoration: underline; }
.topbar-link { color: var(--ink); }

/* The sun (or crescent) sits centred at the top of the sky at its normal size, and every detail starts below its rays,
   left-aligned, so nothing is drawn over it. The top bar is 54px tall; the rays end at about 45% of the art's width. */
.stage .stage-kicker { margin-top: calc(var(--art) * 0.45 - 54px); }

/* Phones: the smaller sun (300px wide) hangs from the very top edge of the page, as its art is drawn to, and the details
   start below its rays: they end at 45% of its width, less the 54px top bar. */
@media (max-width: 599px) {
  .stage .sky-art { display: block; position: absolute; left: 50%; top: 0; width: 300px; height: auto; transform: translateX(-50%); z-index: -2; }
  .stage .stage-kicker { margin-top: calc(300px * 0.45 - 54px); }
}

/* The name and "Save masjid" on the sky. */
.masjid-heading-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* Tablets, laptops and desktops: "Save masjid" sits under the name on the left, never off to the right. */
@media (min-width: 600px) {
  .masjid-heading-actions { flex-direction: column; align-items: flex-start; }
}
.masjid-heading-actions button {
  min-height: var(--tap); padding: 0 16px; border: 1px solid var(--white); border-radius: 999px; background: none;
  color: var(--white); font: inherit; font-weight: 600; cursor: pointer;
}

/* The sky now holds the details too, so it can be taller than the screen: let it scroll with the page, not stay pinned. */
@media (min-width: 900px) {
  .stage .stage-in { position: relative; }
}

/* The details are rows on the sky under the address, left-aligned; each one opens in the pop-up. */
.masjid-rows { margin-top: 26px; }
.masjid-rows > details.fold { margin: 0; padding: 0; border-top: 1px solid rgb(255 255 255 / 30%); }
.masjid-rows > details.fold:last-child { border-bottom: 1px solid rgb(255 255 255 / 30%); }
.masjid-rows > details.fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 14px 0;
  cursor: pointer; list-style: none;
}
.masjid-rows > details.fold > summary::-webkit-details-marker { display: none; }
.masjid-rows > details.fold > summary::after { content: "›"; font-size: 1.5rem; line-height: 1; color: rgb(255 255 255 / 70%); }
.masjid-rows > details.fold > summary h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--white); }
.masjid-rows > details.fold[open] { padding-bottom: 12px; }
.masjid-rows > details.fold > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* The review forms stay on the sheet. */
.masjid-information > section { margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; }

/* The three reactions under a comment: small pills; a pressed one is gold. */
.masjid-community .reactions, .masjid-community .reactions--static { display: flex; flex-wrap: wrap; align-items: center; margin: 2px 0 -6px -4px; }
.masjid-community .reaction { min-height: var(--tap); padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.masjid-community .reaction .pill, .masjid-community .reactions--static .pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 0.82rem; color: var(--muted);
}
.masjid-community .reaction .pill b, .masjid-community .reactions--static .pill b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.masjid-community .reaction[aria-pressed="true"] .pill { background: var(--gold); box-shadow: none; color: var(--ink); }
.masjid-community .reaction:focus-visible .pill { outline: 2px solid var(--purple); outline-offset: 2px; }
/* Community with nothing to read yet, or not open yet: one quiet bubble. */
.masjid-community .community-empty { margin: 14px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--white); color: var(--muted); }

/* The Community section is a plain part of the sheet, not a card of its own (its comments are the bubbles). */
.masjid > .masjid-community, .masjid-with-community > .masjid-community { margin: 0; padding: 26px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.masjid-community h2 { color: var(--purple); }

/* With Community on, the old page put the details and Community side by side (a narrow second column). On the frame's
   sheet they are one column: the detail rows, then Community under them. */
.masjid.masjid-with-community { display: block; }

/* Leave the discussion directory link in view on an anchored visit. */
.masjid > #community { scroll-margin-top: 3.5rem; }

@media (max-width: 599px) {
  .stage .sky-art { width: min(100vw, 387px); }
  .stage .stage-kicker { margin-top: min(104px, 27vw); }
}
.stage .stage-kicker { margin-bottom: 4px; }
.masjid-heading-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.masjid-heading-actions .now-name { font-size: 2.125rem; line-height: 1.1; }
.masjid-listing-note { margin-top: 4px; color: var(--date); font-size: .875rem; }
.masjid-listing-note .verification { margin: 0; color: inherit; }
.masjid-listing-note .info-icon { display: none; }
.masjid-listing-note > p + p { margin: 4px 0 0; }
.masjid-listing-note .masjid-invite { color: var(--white); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.masjid-listing-note summary.masjid-invite { font-weight: 700; }
.masjid-listing-note a.masjid-invite { display: flex; width: fit-content; max-width: 100%; }
.masjid-listing-note a.masjid-invite + a.masjid-invite { margin-top: 8px; }

.masjid-prayer-card {
  display: grid; gap: 12px; margin-top: 16px; padding: 16px 0 0; min-width: 0;
  border-top: 1px solid rgb(255 255 255 / 30%); color: var(--white);
}
.masjid-prayer-card h2 {
  margin: 0; color: var(--white); font-size: .75rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.masjid-prayer-facts {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 12px 24px; overflow-wrap: anywhere;
}
.masjid-prayer-facts > div { min-width: 0; }
.masjid-prayer-facts > div:first-child:last-child,
.masjid-prayer-facts > div:first-child:has(+ [hidden]),
.masjid-prayer-facts > div:nth-child(3):not([hidden]) { grid-column: 1 / -1; }
.masjid-prayer-fact { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.masjid-clock { white-space: nowrap; }
.masjid-prayer-fact small { display: block; font-size: .875rem; }
.masjid-prayer-label { margin: 0; color: var(--white); font-size: .875rem; }
.stage .masjid-route {
  min-height: 52px; padding-inline: 12px; border: 0; background: var(--gold);
  color: var(--ink); font-size: 1.0625rem; font-weight: 700; text-align: center;
}
.stage .masjid-prayer-card a:focus-visible { outline-color: var(--gold); }
.masjid-heading-actions form, .masjid-guest-favorite { margin-top: 12px; }
.masjid-heading-actions button, .masjid-guest-favorite .btn { min-height: 48px; border-width: 1.5px; }
.masjid-heading-actions [data-save-feedback]:not(:empty) { display: block; margin-top: 4px; }

.masjid-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: .875rem; }
.masjid-chip {
  display: inline-flex; align-items: center; max-width: 100%; padding: 6px 14px;
  border: 1px solid rgb(255 255 255 / 60%); border-radius: 999px; overflow-wrap: anywhere;
}
a.masjid-chip { min-height: var(--tap); text-decoration: none; }
a.masjid-chip:is(:hover, :focus-visible) {
  text-decoration: underline; text-underline-offset: 3px;
  background: rgba(255,255,255,.14); border-color: white;
}
.masjid-chip-open { border-color: var(--gold); background: var(--gold); color: var(--ink); font-weight: 700; }

.masjid-rows { display: flex; flex-direction: column; margin-top: 18px; }
.masjid-rows > details.fold > summary { min-height: 52px; }
.masjid-rows > details.fold > summary h2 {
  font-size: .875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
@media (min-width: 600px) and (max-width: 899px) {
  .masjid-heading-actions, .masjid-chips, .masjid-rows { max-width: 560px; }
}
@media (min-width: 600px) {
  .masjid-heading-actions form, .masjid-guest-favorite { align-self: flex-start; }
}

.masjid-invite { display: inline-flex; align-items: center; min-height: var(--tap); }

.masjid-access { border-top: 1px solid rgb(255 255 255 / 30%); margin-top: 18px; padding-top: 14px; }
.stage .masjid-access h2 { color: white; font-size: .875rem; letter-spacing: .14em; text-transform: uppercase; }
.masjid-access p { margin-block: 6px; }
.masjid-access a { color: var(--white); }

/* Published hours and iqama times in the detail dialog. */
.hours div, .prayers li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.hours dt, .hours dd { margin: 0; }
.hours dd { text-align: right; }
.prayers { padding: 0; margin: 12px 0 0; list-style: none; }
.prayers li { padding: 12px 0; }
.open-state { display: inline-block; padding: 4px 10px; color: var(--purple); font-weight: 700; }
.masjid-discussions-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
}
.masjid-community .community-card summary {
  box-sizing: border-box;
  min-height: 44px;
  padding-block: .7rem;
  cursor: pointer;
}

.discussion-tabs, .discussion-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.discussion-tabs { margin-block: 1rem; }
.discussion-tabs a {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid #4b0e6c;
  border-radius: 999px;
  color: #4b0e6c;
  background: white;
  text-decoration: none;
}
.discussion-tabs a[aria-selected="true"] { background: #08004d; color: white; }
.masjid-community .discussion-post {
  margin-block: .75rem;
  padding: 1rem;
  border: 1px solid #dcdce3;
  border-radius: 20px;
  background: white;
  color: #08004d;
  overflow-wrap: anywhere;
}
.discussion-post h4 { margin: 0; font-size: 1rem; }
.discussion-post .discussion-reply, .discussion-post .community-thread {
  margin: .75rem 0 0 .5rem;
  padding: .75rem;
  border-radius: 12px;
  background: #f5f5f8;
}
.discussion-status:not(:empty) { padding: .2rem .5rem; border-radius: 999px; background: #fccb00; }
