@font-face {
    font-family: "Hanken Grotesk";
    src: url("/fonts/hanken-grotesk/HankenGrotesk-Variable.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Shared surface, colour and typography values from the V3 prayer-times and finder previews. */
:root {
    --hero-top: #3a1670;
    --hero-mid: #1a0c58;
    --hero-bottom: #07034a;
    --gold: #f5cc34;
    --purple: #5a1a7f;
    --ink: #0d0647;
    --muted: #6b6b76;
    --muted-on-dark: #c9c3ea;
    --line: #dcdce3;
    --paper: #fff;
    --page: #efefef;
    --lavender: #d7d7e5;
    --card-radius: 16px;
    --card-shadow: 0 1px 2px rgb(13 6 71 / 5%);
    --content: 1250px;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    font-family: "Hanken Grotesk", system-ui, sans-serif;
    color: var(--ink);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
}

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

a:focus-visible {
    outline: 3px solid #b66ed4;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 20;
    padding: 12px 18px;
    background: white;
    color: var(--purple);
    border: 2px solid var(--purple);
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: none;
}

.page-wrap,
.masjid {
    width: min(var(--content), 100% - 32px);
    margin-inline: auto;
}

.page-band {
    position: relative;
    isolation: isolate;
    color: var(--paper);
    background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 60%, var(--hero-bottom) 100%);
}

.page-band::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--grain);
    mix-blend-mode: overlay;
    opacity: .38;
    pointer-events: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding-block: 28px;
}

.brand img {
    display: block;
    width: auto;
    height: 40px;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 36px;
}

.topbar nav a,
.page-heading a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: inherit;
    text-decoration: none;
}

.topbar nav a {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.topbar nav a[aria-current="page"] {
    box-shadow: inset 0 -2px var(--gold);
}

.topbar a:focus-visible,
.page-heading a:focus-visible {
    outline-color: var(--gold);
}

.page-heading {
    padding-bottom: 56px;
}

.page-heading h1 {
    margin: 24px 0 8px;
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.1;
    font-weight: 500;
}

.page-heading .back {
    color: var(--muted-on-dark);
    font-size: 13px;
}

.page-heading .community-jump {
    color: var(--gold);
}

.page-heading a:hover {
    text-decoration: underline;
}

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

.masjid {
    margin-block: 56px;
}

.masjid > .masjid-information {
    grid-column: 1 / -1;
}

.masjid-with-community {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
}

.masjid-with-community > .masjid-information,
.masjid-with-community > .masjid-community {
    grid-column: auto;
    min-width: 0;
}

@media (max-width: 900px) {
    .masjid-with-community {
        grid-template-columns: minmax(0, 1fr);
    }
}

.masjid-information > section,
.masjid-information > .masjid-photo,
.masjid-information > .illustrated-map,
.masjid > section,
.masjid > .masjid-photo,
.masjid > .illustrated-map {
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

.masjid-information > section,
.masjid > section {
    padding: clamp(16px, 3vw, 24px);
    background: var(--paper);
}

.masjid-information > section[aria-labelledby="prayers-heading"],
.masjid-information > section[aria-labelledby="correction-review-heading"],
.masjid-community {
    grid-column: 1 / -1;
}

.masjid > h1,
.masjid > p {
    grid-column: 1 / -1;
    margin: 0;
}

.masjid-photo {
    display: grid;
    place-items: center;
    background: var(--lavender);
    border-radius: 12px;
}

.masjid-photo svg {
    width: min(100%, 280px);
    height: auto;
}

.illustrated-map {
    position: relative;
    height: clamp(180px, 23vw, 280px);
    overflow: hidden;
    border-radius: 12px;
    background: #eae7df;
}

.illustrated-map svg {
    width: 100%;
    height: 100%;
}

.map-note {
    position: absolute;
    right: 10px;
    bottom: 10px;
    margin: 0;
    background: #ffffffed;
    padding: 7px 10px;
    font-size: 10px;
    color: #666;
}

h1,
h2,
h3,
p,
a,
li,
dd,
dt {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.4px;
}

h2 {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--purple);
}

h3 {
    margin: 16px 0 8px;
    font-size: 16px;
    font-weight: 700;
}

p,
li,
dd,
dt {
    font-size: 16px;
    line-height: 1.5;
}

.open-state {
    display: inline-block;
    margin: 0 0 8px;
    padding: 4px 10px;
    border-radius: 5px;
    background: var(--lavender);
    color: var(--purple);
    font-weight: 700;
}

.address {
    margin-top: 0;
}

.verification {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.info-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 2px;
}

.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;
}

.directions,
.prayers,
.masjid ul {
    padding: 0;
    margin: 12px 0 0;
    list-style: none;
}

.directions a,
.masjid section > p a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin: 4px 8px 4px 0;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.prayers li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 700px) {
    .topbar {
        flex-wrap: wrap;
        padding-block: 18px;
    }

    .topbar nav {
        gap: 12px 20px;
    }

    .page-heading {
        padding-bottom: 32px;
    }

    .masjid,
    .masjid-information {
        grid-template-columns: minmax(0, 1fr);
    }

    .masjid {
        margin-block: 32px;
    }

    .illustrated-map {
        height: 160px;
    }

    .map-note {
        max-width: calc(100% - 20px);
        line-height: 1.4;
    }

    .hours dd {
        text-align: left;
    }

    .hours div,
    .prayers li {
        align-items: flex-start;
    }
}

/* The cookie block uses the prayer page's Tailwind classes. This layout does
   not load Tailwind, so these rules draw that same footer under the card. */
details.container {
    width: min(720px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    margin: 0 auto 48px;
    padding: 16px;
}

details.container summary {
    cursor: pointer;
    font-size: 16px;
}

details.container p {
    margin: 12px 0;
}

details.container form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 0;
    border: 0;
    background: transparent;
}

details.container button {
    width: auto;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    details.container {
        width: min(720px, calc(100vw - 28px));
        max-width: calc(100vw - 28px);
    }
}

.community-jump,
.masjid-community summary {
    color: var(--purple);
    font-weight: 800;
}

.masjid-community {
    scroll-margin-top: 18px;
}

.masjid-community .community-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--page);
    padding: 14px;
    margin-bottom: 10px;
}

.masjid-community label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.masjid-community textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid #8f829a;
    border-radius: 10px;
    padding: 12px;
    font: inherit;
    color: inherit;
}

.masjid-community button {
    border: 0;
    border-radius: 9px;
    background: var(--gold);
    color: var(--ink);
    min-height: 44px;
    padding: 9px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.masjid-community button:disabled {
    opacity: .65;
    cursor: wait;
}

.masjid-community .community-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
}

.masjid-community .community-meta {
    color: var(--muted);
}

.masjid-community summary {
    cursor: pointer;
    min-height: 44px;
    align-content: center;
}

.masjid-community .community-thread {
    margin-top: 8px;
    border-left: 2px solid var(--line);
    padding-left: 12px;
}

.masjid-community .community-body {
    margin: 4px 0 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.masjid-community :focus-visible,
.community-jump:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}


.masjid-site-footer {
    display: block;
    margin: 0;
    padding: 32px 0 40px;
    background: var(--lavender);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-row + .footer-row {
    border-top: 1px solid rgb(13 6 71 / 12%);
    margin-top: 14px;
    padding-top: 14px;
}

.footer-row p,
.footer-row nav {
    margin: 0;
    font-size: 13px;
}

.footer-row nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-row nav[aria-label="Legal"] a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
}

.footer-logo {
    display: block;
    height: 26px;
    width: auto;
}

.footer-row .site-social-link img {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 0;
    background: none;
    filter: brightness(0) saturate(100%) invert(9%) sepia(60%) saturate(4000%) hue-rotate(245deg);
}

.footer-row .site-social-link:hover {
    background: rgb(13 6 71 / 8%);
}

.masjid-heading-actions {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 24px;
}

[data-save-masjid] button,
.masjid-community [data-helpful] {
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

[data-save-masjid] button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

[data-save-masjid] button[aria-pressed="true"] [data-star] {
    color: var(--gold);
}

[data-save-feedback] {
    display: block;
    color: var(--muted-on-dark);
    font-size: 13px;
}

.masjid-community [data-helpful] {
    float: right;
    margin-left: 12px;
}

.masjid-community [data-helpful][aria-pressed="true"] {
    background: var(--gold);
    color: var(--ink);
}

.masjid-community .community-thread {
    clear: both;
}

.field-feedback {
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.field-feedback textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    margin: 6px 0;
    padding: 8px;
    font: inherit;
    resize: vertical;
}

.field-feedback button,
.field-feedback summary {
    min-height: 44px;
    color: var(--purple);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.field-feedback button {
    padding-inline: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--page);
}

.field-feedback button:disabled {
    color: var(--muted);
    cursor: default;
}

.field-feedback summary {
    align-content: center;
}

.masjid-community .comment-report {
    clear: both;
}

.field-feedback label {
    display: block;
    margin-block: 8px;
}

.field-feedback label :is(input, select) {
    display: block;
    min-height: 44px;
    max-width: 100%;
    padding-inline: 8px;
    font: inherit;
}

/* ==========================================================================
   Community and Sign in, direction B "Conversation first" (chosen 2026-11-20).
   Look only: no markup, id, form, action, aria, script or policy depends on it.
   Self-contained: remove this whole section to return to the previous look.
   Uses the tokens above. Two added values:
     --field-line  field border, same grey as the finder search box
     --error       dark red for form errors (7.9:1 on white). NEW TO THE SITE.
   ========================================================================== */
:root {
    --field-line: #8d8b99;
    --muted-strong: #5f5f6b;
    --error: #a3121f;
}

/* Brand indigo instead of purple for headings, links and disclosure labels. */
.masjid h2,
.masjid a,
.masjid .open-state,
.masjid-community summary,
.field-feedback summary,
.field-feedback button,
.sign-in-page .account-page a {
    color: var(--ink);
}

.masjid-community :focus-visible,
.field-feedback :focus-visible,
.sign-in-page .account-page :focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

/* --- Layout: Community is the wide column on laptops, the facts a narrow one. --- */
.masjid-with-community > .masjid-community {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.masjid-community > h2 {
    margin-bottom: 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    text-transform: none;
}

@media (min-width: 1000px) {
    .masjid-with-community {
        grid-template-columns: 360px minmax(0, 1fr);
        gap: 32px;
    }

    .masjid-with-community > .masjid-information > section {
        grid-column: 1 / -1;
    }

    .masjid-with-community .illustrated-map {
        height: auto;
        min-height: 150px;
    }

    .masjid-with-community .map-note {
        left: 6px;
        right: 6px;
        bottom: 6px;
        padding: 4px 6px;
        font-size: 11px;
        line-height: 1.3;
    }
}

/* --- Guest line: "Sign in" is the one gold action.
   The link may carry a return address (/sign-in?return_to=...), so match any link to the sign-in page. --- */
.masjid-community > p:has(> a[href*="/sign-in"]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 16px;
}

.masjid-community > p > a[href*="/sign-in"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--gold);
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

/* --- One comment: a white card on the page; controls on one row under the text. --- */
.masjid-community .community-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-bottom: 12px;
    padding: 18px 20px;
    border: 0;
    border-radius: var(--card-radius);
    background: var(--paper);
    box-shadow: var(--card-shadow);
}

.masjid-community .community-card > * {
    flex: 0 0 100%;
    min-width: 0;
}

.masjid-community .community-card > [data-author] {
    flex: 0 0 auto;
    font-size: 14px;
}

.masjid-community .community-card > [data-state] {
    flex: 1 1 0;
    font-size: 13px;
}

.masjid-community .community-card > [data-helpful],
.masjid-community .community-card > .comment-report:not([open]) {
    flex: 0 0 auto;
}

.masjid-community .community-body {
    margin: 2px 0 6px;
}

.masjid-community .community-meta {
    color: var(--muted-strong);
}

/* Status lines hold no text until there is a message. They stay in the page for screen readers
   (never display: none, so "Posting…", "Report sent for review." and errors are announced);
   while empty they only give up their space. */
.masjid-community [role="status"]:empty {
    margin: 0;
    padding: 0;
    min-height: 0;
}

.masjid-community .community-card > [role="status"]:empty {
    margin-top: -4px; /* takes back the row gap of the card */
}

.masjid-community [data-feedback],
.masjid-community [data-reply-feedback],
.field-feedback [data-field-status] {
    margin: 0;
}

.masjid-community [data-feedback] {
    padding-block: 4px;
}

/* Helpful: a pill under the text. Filled indigo once marked. */
.masjid-community [data-helpful] {
    float: none;
    margin: 0;
    padding: 0 16px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
}

.masjid-community [data-helpful][aria-pressed="true"] {
    background: var(--ink);
    color: var(--paper);
}

/* Report: a quiet word beside Helpful. */
.masjid-community .comment-report > summary {
    display: inline-flex;
    align-items: center;
    padding-inline: 8px;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    list-style: none;
}

.masjid-community .comment-report > summary::-webkit-details-marker {
    display: none;
}

.masjid-community .comment-report[open] {
    padding: 4px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--page);
}

.masjid-community .comment-report select,
.field-feedback label :is(input, select) {
    display: block;
    width: 100%;
    max-width: 360px;
    min-height: 44px;
    margin-top: 6px;
    padding: 8px 12px;
    border: 1.5px solid var(--field-line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

/* On the grey report box the menu needs a darker edge (5.5:1 on the grey, 6.3:1 on white). */
.masjid-community .comment-report select {
    border-color: var(--muted-strong);
}

/* Replies: grey bubbles set in under the comment. */
.masjid-community .community-card > details:not(.comment-report) > summary {
    font-size: 14px;
}

.masjid-community .community-thread {
    margin-top: 4px;
    border-left: 3px solid var(--line);
    padding-left: 14px;
}

.masjid-community .community-thread > .community-body,
.masjid-community .community-thread .community-card {
    margin: 0 0 8px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--page);
    box-shadow: none;
}

/* Gold is for "Post comment" only. Other buttons are white pills with an indigo line. */
.masjid-community textarea {
    border: 1.5px solid var(--field-line);
    border-radius: 12px;
    background: var(--paper);
    font-size: 16px;
}

.masjid-community button {
    border-radius: 999px;
    padding-inline: 20px;
}

.masjid-community [data-thread] form button,
.masjid-community .comment-report form button,
.masjid-community [data-more],
.masjid-community [data-more-replies] {
    background: var(--paper);
    box-shadow: inset 0 0 0 1.5px var(--ink);
}

.masjid-community .comment-report form button {
    margin-top: 10px;
}

/* --- Masjid facts: Confirm (outlined) and Confirmed (filled grey) on one row with the correction link. --- */
.field-feedback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding-top: 12px;
}

.field-feedback > * {
    flex: 0 0 100%;
    min-width: 0;
}

.field-feedback > [data-field-summary] {
    margin: 0 0 4px;
    font-size: 14px;
}

.field-feedback > button,
.field-feedback > details:not([open]) {
    flex: 0 0 auto;
}

.field-feedback button {
    border: 0;
    border-radius: 999px;
    padding-inline: 18px;
    background: var(--paper);
    box-shadow: inset 0 0 0 1.5px var(--ink);
}

.field-feedback button:disabled {
    background: var(--page);
    box-shadow: none;
    color: var(--muted-strong);
}

.field-feedback summary {
    font-size: 14px;
    text-decoration: underline;
}

.field-feedback label {
    font-size: 14px;
    font-weight: 700;
}

/* Moderator "Review corrections" uses the same form class: one case = summary line, the proposed
   values, then "Approve and publish" as the outlined pill and its status line. */
.field-feedback[data-approve-correction] > dl {
    margin: 4px 0 8px;
}

.field-feedback[data-approve-correction] > dl dt {
    font-size: 14px;
    color: var(--muted-strong);
}

.field-feedback[data-approve-correction] > dl dd {
    margin: 0 0 6px;
}

.field-feedback > [role="status"]:empty {
    margin: 0;
}

/* "Correction pending review." as a small notice. */
.masjid [data-public-correction]:not([hidden]) {
    display: inline-block;
    margin: 12px 0 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--lavender);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

/* --- Sign in: a compact card that sits up into the band. --- */
.sign-in-page .page-band {
    padding-bottom: 100px;
}

.sign-in-page .account-page {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: -100px auto 56px;
    padding: 28px;
    box-shadow: 0 6px 24px rgb(13 6 71 / 12%);
}

.sign-in-page .account-page form {
    gap: 6px;
}

.sign-in-page .account-page form label {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
}

.sign-in-page .account-page form label:first-of-type {
    margin-top: 0;
}

.sign-in-page .account-page form input:not([type="hidden"]) {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--field-line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
}

/* ERROR RED (new colour, for Aziz to confirm): the field border and the message under it. */
.sign-in-page .account-page form input:has(+ [role="alert"]) {
    border-color: var(--error);
    border-width: 2px;
}

.sign-in-page .account-page form [role="alert"] {
    margin: 2px 0 0;
    padding-left: 10px;
    border-left: 3px solid var(--error);
    color: var(--error);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.sign-in-page .account-page form button {
    justify-self: stretch;
    min-height: 48px;
    margin-top: 16px;
    border-radius: 999px;
    font-size: 16px;
}

.sign-in-page .account-page > p {
    margin: 8px 0 0;
    text-align: center;
}

.sign-in-page .account-page > p a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 12px;
    font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
    .masjid-community button,
    .field-feedback button,
    .sign-in-page .account-page form button {
        transition: background-color .15s;
    }
}
