/* Mosque Management System public theme. Tokens and rules follow DESIGN.md. */

:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #6b6760;
  --line: #e7e3db;
  --changed: #b45309;
  --error: #b91c1c;
  --success: #15803d;
  --info: #1d4ed8;

  /* Overridden per mosque by base.html from MosqueSettings.primary_color. */
  --brand: #166534;
  --brand-ink: #166534;
  --brand-fill: #166534;
  --on-brand: #ffffff;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Geeza Pro", serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-hero: clamp(2.5rem, 6vw, 3.5rem);

  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --max-width: 72rem;
  --tab-bar-height: 64px;
  --ease-enter: ease-out;
  --duration-short: 200ms;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-md);
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-lg);
}

h3 {
  font-size: var(--text-base);
}

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--brand-ink);
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

[lang="ar"] {
  font-family: var(--font-arabic);
}

.tabular,
time,
td {
  font-variant-numeric: tabular-nums;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  background: var(--surface);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.site-main {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

.grid > * {
  grid-column: span 4;
}

@media (min-width: 960px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  .grid > *,
  .grid > .span-12 {
    grid-column: span 12;
  }

  .grid > .span-8 {
    grid-column: span 8;
  }

  .grid > .span-6 {
    grid-column: span 6;
  }

  .grid > .span-4 {
    grid-column: span 4;
  }
}

/* Header */
.site-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.site-header__pattern {
  position: absolute;
  inset: 0;
  background: var(--brand);
  opacity: 0.06;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Crect x='12' y='12' width='24' height='24'/%3E%3Cpath d='M24 7 41 24 24 41 7 24Z'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Crect x='12' y='12' width='24' height='24'/%3E%3Cpath d='M24 7 41 24 24 41 7 24Z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 48px 48px;
  mask-size: 48px 48px;
  pointer-events: none;
}

.site-header__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  min-height: 64px;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.site-brand__logo {
  width: auto;
  height: 40px;
}

.site-brand__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.15;
}

.site-nav {
  display: none;
  flex-basis: 100%;
  order: 3;
  flex-wrap: wrap;
  gap: 0 var(--space-lg);
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: var(--space-sm) 0;
}

.site-nav a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.lang-switch {
  display: flex;
  gap: var(--space-2xs);
}

.lang-switch button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 var(--text-sm) var(--font-body);
  cursor: pointer;
}

.lang-switch button[aria-current="true"] {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
  }

  .site-brand__name {
    font-size: var(--text-xl);
  }
}

.site-address {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-sm);
}

.site-address__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
  color: var(--muted);
}

.site-address__inner a {
  font-weight: 600;
}

.site-address__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

/* Social links: icon + name in the footer, icons only in the desktop address bar. */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.social-links__icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-links--compact {
  display: none;
  gap: var(--space-2xs);
}

.social-links--compact a {
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  color: var(--muted);
}

@media (min-width: 960px) {
  .social-links--compact {
    display: flex;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  padding: var(--space-lg) 0;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-md);
}

.site-footer__label {
  font-weight: 600;
}

/* Mobile tab bar */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--tab-bar-height);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}

.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  color: var(--muted);
  font-size: var(--text-xs);
  text-decoration: none;
}

.tab-bar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-bar a:hover,
.tab-bar a[aria-current="page"] {
  color: var(--brand-ink);
}

body {
  padding-bottom: var(--tab-bar-height);
}

@media (min-width: 960px) {
  .tab-bar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* Panels and lists */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

@media (min-width: 960px) {
  .panel {
    padding: var(--space-lg);
  }
}

.stack > * + * {
  margin-top: var(--space-md);
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list > li {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--line);
}

.item-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.item-list h2 {
  margin-bottom: var(--space-xs);
}

.meta {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0;
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header p {
  color: var(--muted);
}

/* Tags */
.tag {
  display: inline-block;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.tag--changed {
  color: var(--changed);
  background: color-mix(in srgb, var(--changed) 12%, var(--surface));
}

.tag--success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-lg);
  border: 1px solid var(--brand-fill);
  border-radius: var(--radius-md);
  background: var(--brand-fill);
  color: var(--on-brand);
  font: 600 var(--text-base) var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--duration-short) var(--ease-enter);
}

.btn:hover {
  filter: brightness(0.92);
}

.btn--secondary {
  background: var(--surface);
  color: var(--brand-ink);
  border-color: var(--line);
}

/* Forms (Django form.as_p output) */
.form p {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.form label {
  font-weight: 600;
}

.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea {
  width: 100%;
  max-width: 32rem;
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.form textarea {
  min-height: 8rem;
}

.form .helptext {
  color: var(--muted);
  font-size: var(--text-sm);
}

.form .errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--error);
  font-size: var(--text-sm);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.table th,
.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Content blocks */
.hero {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.hero h2 {
  font-size: var(--text-2xl);
}

@media (min-width: 960px) {
  .hero--with-image {
    grid-template-columns: 3fr 2fr;
  }
}

.hero img {
  border-radius: var(--radius-md);
}

.card-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
  }
}

.callout {
  border-left: 4px solid var(--brand);
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.rich-text > :last-child {
  margin-bottom: 0;
}

/* Home page widgets */
.page-intro {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Home layout: each block starts at its admin-chosen width and grows to fill what its row
   has left, so hidden widgets and short rows never leave gaps. */
.page-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-grid > *,
.page-grid > .card-grid > * {
  flex: 1 1 100%;
  min-width: 0;
}

/* Card grids join the home rows as one-third blocks instead of nesting their own grid. */
.page-grid > .card-grid {
  display: contents;
}

@container main (min-width: 720px) {
  .page-grid {
    gap: var(--space-lg);
  }

  .page-grid > .span-8 {
    flex: 8 1 calc(66.666% - var(--space-lg));
  }

  .page-grid > .span-6 {
    flex: 6 1 calc(50% - var(--space-lg));
  }

  .page-grid > .span-4,
  .page-grid > .card-grid > .span-4 {
    flex: 4 1 calc(33.333% - var(--space-lg));
  }
}

@media (max-width: 959.98px) {
  .pin-mobile-1 {
    order: -3;
  }

  .pin-mobile-2 {
    order: -2;
  }

  .pin-mobile-3 {
    order: -1;
  }
}

.widget--urgent {
  border: 1px solid color-mix(in srgb, var(--changed) 35%, var(--surface));
  border-left: 4px solid var(--changed);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--changed) 8%, var(--surface));
  padding: var(--space-sm) var(--space-md);
}

.urgent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.urgent-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-xs) 0;
}

.urgent-list li + li {
  border-top: 1px solid color-mix(in srgb, var(--changed) 20%, var(--surface));
}

.urgent-list a {
  color: var(--ink);
  font-weight: 600;
}

.urgent-list__icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--changed);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.urgent-list__time {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-left: auto;
}

.event-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs);
}

.event-row__title {
  font-weight: 600;
}

.event-row__when {
  color: var(--brand-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

@media (min-width: 720px) {
  .event-row {
    grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 14rem) 9rem;
    align-items: baseline;
    gap: var(--space-md);
  }

  .event-row .event-spots {
    text-align: right;
  }
}

.event-item .event-spots {
  display: block;
}

.show-more {
  margin-top: var(--space-sm);
  border-top: 1px solid var(--line);
}

.show-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-ink);
  font-weight: 600;
  cursor: pointer;
}

.show-more[open] summary {
  margin-bottom: var(--space-sm);
}

.widget h2 {
  margin-bottom: var(--space-sm);
}

.widget__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-md);
}

.widget__header h2,
.widget__header p {
  margin: 0;
}

.widget__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  margin-top: var(--space-md);
}

.widget__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand-ink);
  margin: 0;
}

.freshness::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--space-xs);
  border-radius: 50%;
  background: var(--success);
  vertical-align: middle;
}

.widget--next {
  container-type: inline-size;
}

.next-prayer__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.1;
  margin: var(--space-xs) 0 0;
}

.next-prayer__name [lang="ar"] {
  font-size: var(--text-lg);
  color: var(--muted);
  margin-left: var(--space-sm);
}

.next-prayer__countdown {
  font-family: var(--font-display);
  /* Sized to the card, not the window, so the longest countdown always fits. */
  font-size: clamp(1.75rem, 13cqi, var(--text-hero));
  white-space: nowrap;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-ink);
  margin: var(--space-sm) 0;
  font-variant-numeric: tabular-nums;
}

.next-prayer__time {
  font-size: var(--text-xl);
  margin: 0;
}

time small,
.prayer-row__time small {
  font-size: var(--text-xs);
  margin-left: 2px;
  color: var(--muted);
}

.prayer-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.prayer-row__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-sm) var(--space-2xs);
  text-align: center;
  border-left: 1px solid var(--line);
}

.prayer-row__item:first-child {
  border-left: 0;
}

.prayer-row__item.is-next {
  box-shadow: inset 0 3px 0 var(--brand);
  color: var(--brand-ink);
}

.prayer-row__arabic {
  font-size: var(--text-base);
  line-height: 1.4;
}

.prayer-row__name {
  font-size: var(--text-sm);
  color: var(--muted);
}

.is-next .prayer-row__name {
  color: var(--brand-ink);
  font-weight: 600;
}

.prayer-row__time {
  font-size: var(--text-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 960px) {
  .prayer-row__item {
    padding: var(--space-md) var(--space-sm);
  }

  .prayer-row__arabic {
    font-size: var(--text-xl);
  }

  .prayer-row__time {
    font-size: var(--text-xl);
  }
}

.session {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.session__number {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.session__time {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
}

.event-item {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.event-item__body {
  flex: 1;
  min-width: 0;
}

.event-item h3 {
  margin: 0 0 var(--space-2xs);
}

.date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  width: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 1.1;
}

.date-block__weekday {
  width: 100%;
  background: var(--brand-fill);
  color: var(--on-brand);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  padding: 2px 0;
}

.date-block__day {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  padding-top: var(--space-2xs);
}

.date-block__month {
  font-size: var(--text-xs);
  text-transform: uppercase;
  padding-bottom: var(--space-2xs);
}

.btn--small {
  min-height: 36px;
  padding: 0 var(--space-md);
  font-size: var(--text-sm);
}

.widget--announcements h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-body);
  font-weight: 600;
}

/* Sidebar layout: menu left, content middle, prayer times then address and links right.
   Phones: brand, prayer times, content, address and links, in one column. */
.sidebar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "nav"
    "prayers"
    "main"
    "info";
  gap: var(--space-md);
  width: 100%;
  max-width: 88rem;
  margin: 0 auto;
}

.sidebar-layout__nav {
  grid-area: nav;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.sidebar-layout__prayers {
  grid-area: prayers;
  padding: 0 var(--space-md);
}

.sidebar-layout__main {
  grid-area: main;
  min-width: 0;
  padding: 0 var(--space-md) var(--space-lg);
}

.sidebar-layout__info {
  grid-area: info;
  display: grid;
  gap: var(--space-md);
  align-content: start;
  padding: 0 var(--space-md) var(--space-lg);
}

.sidebar-layout__footer {
  max-width: 88rem;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.sidebar-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  padding: var(--space-sm) var(--space-md);
}

.sidebar-nav__menu {
  display: none;
}

@media (min-width: 960px) {
  .sidebar-layout {
    grid-template-columns: 13rem minmax(0, 1fr) 19rem;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "nav main prayers"
      "nav main info";
    gap: 0 var(--space-lg);
    padding: var(--space-lg);
  }

  .sidebar-layout__nav {
    align-self: start;
    position: sticky;
    top: var(--space-lg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .sidebar-layout__prayers,
  .sidebar-layout__main,
  .sidebar-layout__info {
    padding: 0;
  }

  .sidebar-layout__prayers {
    margin-bottom: var(--space-md);
  }

  .sidebar-layout__main.site-main {
    padding-top: 0;
  }

  .sidebar-nav {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-md);
  }

  .sidebar-nav .site-brand {
    margin-right: 0;
  }

  .sidebar-nav__menu {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    padding-top: var(--space-sm);
  }

  .sidebar-nav__menu a {
    color: var(--ink);
    text-decoration: none;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav__menu a:last-child {
    border-bottom: 0;
  }

  .sidebar-nav__menu a:hover {
    color: var(--brand-ink);
  }

  .sidebar-nav .lang-switch {
    justify-content: flex-start;
  }
}

/* Content in the middle column is narrower: widths apply only when there is room. */
.site-main {
  container: main / inline-size;
}

.side-card h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.side-card__subheading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  margin: var(--space-md) 0 var(--space-xs);
}

.side-card__more {
  display: inline-block;
  margin-top: var(--space-sm);
  font-weight: 600;
}

.side-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-sm);
  margin: 0 0 var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.side-next__label {
  flex-basis: 100%;
  color: var(--brand-ink);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.side-next strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.side-next time {
  color: var(--brand-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.side-prayers {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-sm);
}

.side-prayers th,
.side-prayers td {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.side-prayers td {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.side-prayers [lang="ar"] {
  color: var(--muted);
  margin-left: var(--space-xs);
}

.side-prayers .is-next th,
.side-prayers .is-next td {
  color: var(--brand-ink);
  font-weight: 700;
}

.side-prayers .is-next th {
  box-shadow: inset 3px 0 0 var(--brand);
  padding-left: var(--space-sm);
}

.side-prayers .is-sunrise th,
.side-prayers .is-sunrise td {
  color: var(--muted);
  font-weight: 400;
  font-size: var(--text-sm);
}

.side-jumuah {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
}

.side-jumuah li {
  padding: var(--space-2xs) 0;
}

.sidebar-layout__info .social-links {
  flex-direction: column;
  gap: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
