/*
Theme Name: Koshitharu Jamaa
Theme URI: https://localhost/wordpress/
Author: Codex
Description: Single-page, RTL-friendly theme with a hero header and centered latest-posts list.
Version: 1.0.0
Text Domain: koshitharujamaa
*/

@font-face {
  font-family: "MV Waheed";
  src:
    url("assets/fonts/MV_Waheed.woff2") format("woff2"),
    url("assets/fonts/MV_Waheed.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --kj-bg: #f3f0ea;
  --kj-ink: #1a2320;
  --kj-muted: rgba(26, 35, 32, 0.72);
  --kj-deep: #0f2c25;
  --kj-deep-2: #173a31;
  --kj-accent: #184338;
  --kj-card: rgba(255, 255, 255, 0.76);
  --kj-card-border: rgba(15, 44, 37, 0.16);
  --kj-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
  --kj-radius-xl: 22px;
  --kj-radius-lg: 18px;
  --kj-radius-md: 14px;
  --kj-gap: 18px;
  --kj-shell: min(980px, 92vw);
}

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

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  white-space: nowrap;
}

.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  height: auto;
  width: auto;
  margin: 0;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--kj-ink);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  z-index: 100000;
  inset-inline-start: 12px;
  top: 12px;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  direction: rtl;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(24, 67, 56, 0.18), transparent 65%), var(--kj-bg);
  color: var(--kj-ink);
  font-family: "MV Waheed", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Arial, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.kj-shell {
  width: var(--kj-shell);
  margin-inline: auto;
}

.kj-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(13, 39, 33, 0.92), rgba(13, 39, 33, 0.72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  overflow: visible;
}

.kj-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
  /* Keep header layout LTR: brand on left, menu/icons on right. */
  direction: ltr;
  position: relative;
}

.kj-prayertimes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
  padding: 8px 18px;
  direction: rtl;
  unicode-bidi: isolate;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: thin;
}

.kj-pt-mobile {
  display: none;
}

.kj-pt-desktop {
  display: block;
}

/* Ensure mobile dropdown uses the same Dhivehi font everywhere (avoid fallback fonts for bold/italic). */
.kj-pt-mobile,
.kj-pt-mobile .kj-pt-toggle,
.kj-pt-mobile .kj-pt-panel,
.kj-pt-mobile .kj-pt-panel__meta,
.kj-pt-mobile .kj-pt-grid,
.kj-pt-mobile .kj-pt-card,
.kj-pt-mobile .kj-pt-upcoming,
.kj-pt-mobile .kj-pt-hijri {
  font-family: "MV Waheed", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Arial, sans-serif;
  font-style: normal;
  font-synthesis: none;
}

.kj-pt-toggle {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(0, 0, 0, 0.9);
  padding: 12px 12px 8px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.kj-pt-toggle__top {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.kj-pt-upcoming {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.kj-pt-upcoming-time {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.kj-pt-upcoming-name {
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.62);
}

.kj-pt-hijri {
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.62);
}

.kj-pt-toggle__sep {
  width: 2px;
  height: 22px;
  background: rgba(0, 0, 0, 0.14);
}

.kj-pt-toggle__icon {
  line-height: 0;
  color: rgba(0, 0, 0, 0.48);
}

.kj-pt-ico {
  width: 28px;
  height: 28px;
  display: block;
}

.kj-pt-ico--close {
  display: none;
}

.kj-pt-toggle[aria-expanded="true"] .kj-pt-ico--down {
  display: none;
}

.kj-pt-toggle[aria-expanded="true"] .kj-pt-ico--close {
  display: block;
}

.kj-pt-panel {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 18px 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.kj-pt-panel__meta {
  text-align: center;
  margin-bottom: 16px;
  color: rgba(0, 0, 0, 0.62);
}

.kj-pt-panel__date {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.kj-pt-panel__nakaiy {
  font-size: 1.15rem;
}

.kj-pt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kj-pt-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 14px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kj-pt-card--active {
  background: rgba(0, 0, 0, 0.08);
}

.kj-pt-card__time {
  font-weight: 700;
  font-size: 1.3rem;
  color: rgba(0, 0, 0, 0.8);
  font-style: normal;
}

.kj-pt-card__name {
  font-size: 1.15rem;
  color: rgba(0, 0, 0, 0.62);
}

.kj-prayertimesbar {
  position: relative;
  padding: 8px 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1;
}

/* On the homepage, let the hero image sit behind the prayer-times bar (no white band). */
@media (min-width: 721px) {
  body.home .kj-prayertimesbar {
    margin-bottom: -64px;
    z-index: 5;
  }
}

.kj-prayertimesbar .kj-shell {
  width: min(980px, 96vw);
}

.kj-pt-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 8px;
  color: var(--kj-deep);
  white-space: nowrap;
}

.kj-pt-item + .kj-pt-item {
  border-inline-start: 2px solid rgba(15, 44, 37, 0.14);
}

.kj-pt-time {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kj-pt-name {
  color: rgba(15, 44, 37, 0.72);
  font-size: 0.98rem;
}

.kj-pt-item--meta {
  color: rgba(0, 0, 0, 0.9);
  font-size: 0.98rem;
}

.kj-pt-item--meta .kj-pt-time,
.kj-pt-item--meta .kj-pt-name,
.kj-pt-item--meta .kj-day,
.kj-pt-item--meta .kj-date,
.kj-pt-item--meta .kj-date__day,
.kj-pt-item--meta .kj-date__month,
.kj-pt-item--meta .kj-date__year {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
}

@media (max-width: 920px) {
  .kj-prayertimes {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .kj-pt-desktop {
    display: none;
  }

  .kj-pt-mobile {
    display: block;
  }

  .kj-prayertimesbar .kj-shell {
    width: 100vw;
    margin-inline: 0;
    padding-inline: 12px;
  }

  .kj-pt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* On mobile homepage, remove the band above the hero by letting the hero sit behind this bar. */
@media (max-width: 720px) {
  body.home .kj-prayertimesbar {
    margin-bottom: -72px;
    z-index: 5;
  }
}

.kj-prayertimes::-webkit-scrollbar {
  height: 8px;
}

.kj-prayertimes::-webkit-scrollbar-thumb {
  background: rgba(15, 44, 37, 0.22);
  border-radius: 999px;
}

.kj-prayertimes::-webkit-scrollbar-track {
  background: transparent;
}

.kj-prayertimes:focus-within {
  outline: 2px solid rgba(24, 67, 56, 0.28);
  outline-offset: 2px;
}

.kj-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.94);
  /* Keep brand text RTL even though the bar layout is LTR. */
  direction: rtl;
  unicode-bidi: isolate;
}

.kj-brand__mark {
  width: auto;
  max-width: 260px;
  height: 64px;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 auto;
}

.kj-brand__mark img {
  width: auto;
  height: 100%;
  display: block;
  object-fit: contain;
  max-width: 260px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.32));
}

.kj-brand__title {
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  unicode-bidi: plaintext;
}

.kj-topicons {
  display: flex;
  align-items: center;
  gap: 10px;
  /* RTL feel inside the icon group (menu at the far-right). */
  flex-direction: row-reverse;
}

.kj-iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  transition: transform 160ms ease, background 160ms ease;
}

.kj-iconbtn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.kj-iconbtn svg {
  width: 18px;
  height: 18px;
}

.kj-menu-toggle {
  appearance: none;
}

.kj-topmenu {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 10px);
  width: min(380px, 92vw);
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 34, 29, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 220ms;
}

[data-kj-menu-host].is-open .kj-topmenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.kj-topmenu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  direction: rtl;
  text-align: right;
}

.kj-topmenu__list a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kj-topmenu__list a:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .kj-topmenu,
  [data-kj-menu-host].is-open .kj-topmenu {
    transition: none;
  }
}

.kj-hero {
  position: relative;
  overflow: clip;
  background: #0b1e19;
  border-bottom: 1px solid rgba(15, 44, 37, 0.16);
}

.kj-hero__media {
  min-height: clamp(380px, 46vw, 560px);
  background-image:
    linear-gradient(180deg, rgba(11, 30, 25, 0.18), rgba(11, 30, 25, 0.78)),
    var(--kj-hero-image),
    radial-gradient(900px 420px at 25% 35%, rgba(255, 255, 255, 0.08), transparent 60%),
    radial-gradient(800px 380px at 70% 30%, rgba(24, 67, 56, 0.26), transparent 65%),
    radial-gradient(520px 260px at 40% 70%, rgba(255, 255, 255, 0.08), transparent 70%);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(1.05) contrast(1.05);
}

.kj-hero__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.94);
  text-align: right;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.46),
    0 0 1px rgba(0, 0, 0, 0.35);
}

.kj-hero__overlay-inner {
  display: grid;
  justify-items: end;
  width: min(1100px, 96vw);
  margin-left: auto;
  margin-right: 0;
  padding-right: clamp(28px, 5vw, 96px);
  padding-left: 0;
}

.kj-hero__quote {
  margin: 0;
  max-width: 66ch;
  margin-inline-start: auto;
  margin-inline-end: 0;
  padding-right: 0;
  padding-left: clamp(6px, 1vw, 14px);
  font-family: "MV Waheed", inherit;
  font-weight: 400;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.55;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: right;
}

.kj-hero__line {
  display: block;
}

/* Indent the second line inward (RTL = push left by adding right padding). */
.kj-hero__line--2 {
  padding-right: 0;
}

.kj-hero__title {
  margin: 10px 0 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  font-weight: 800;
}

.kj-hero__copy {
  margin: 12px auto 0;
  max-width: 70ch;
  color: rgba(255, 255, 255, 0.86);
}

.kj-main {
  padding: 26px 0 44px;
}

.kj-sectionhead {
  text-align: center;
  padding: 8px 0 18px;
}

.kj-sectionhead__title {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 800;
  color: rgba(26, 35, 32, 0.92);
}

.kj-feed {
  display: grid;
  gap: 14px;
}

.kj-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 140px;
  grid-template-areas: "num body btn";
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border-radius: var(--kj-radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66));
  border: 1px solid var(--kj-card-border);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
  overflow: clip;
}

.kj-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at 20% 25%, rgba(24, 67, 56, 0.12), transparent 62%);
  pointer-events: none;
}

.kj-card__btn {
  position: relative;
  grid-area: btn;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 45, 37, 1), rgba(15, 67, 56, 1));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.94);
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.kj-card__btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.kj-card__body {
  position: relative;
  grid-area: body;
  min-width: 0;
  text-align: right;
  direction: rtl;
  unicode-bidi: isolate;
}

.kj-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.15px;
  unicode-bidi: plaintext;
}

.kj-card__meta {
  margin-top: 6px;
  color: var(--kj-muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  /* In RTL, flex-start is the visual right edge. */
  justify-content: flex-start;
  text-align: right;
  direction: rtl;
  unicode-bidi: isolate;
}

.kj-card__meta time {
  direction: rtl;
  unicode-bidi: isolate;
}

.kj-date__day,
.kj-date__year {
  direction: ltr;
  unicode-bidi: isolate;
}

.kj-card__sep {
  opacity: 0.55;
}
}

.kj-card__excerpt {
  margin: 8px 0 0;
  color: rgba(26, 35, 32, 0.82);
  font-size: 0.98rem;
}

.kj-card__num {
  position: relative;
  grid-area: num;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: rgba(26, 35, 32, 0.9);
  font-weight: 900;
}

.kj-card__num::before {
  content: "";
  width: 2px;
  height: 44px;
  background: rgba(15, 44, 37, 0.2);
  border-radius: 999px;
}

.kj-card__num span {
  font-size: 1.4rem;
  line-height: 1;
}

.kj-footer {
  margin-top: 34px;
  background: linear-gradient(180deg, rgba(9, 34, 29, 1), rgba(9, 34, 29, 0.92));
  color: rgba(255, 255, 255, 0.9);
}

.kj-footer__inner {
  padding: 22px 0 26px;
  display: grid;
  gap: 12px;
  text-align: center;
}

.kj-footrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.kj-footrow a {
  color: rgba(255, 255, 255, 0.9);
}

.kj-copy {
  margin: 0;
  opacity: 0.8;
  font-size: 0.92rem;
}

.kj-empty {
  text-align: center;
  padding: 28px 18px;
  border-radius: var(--kj-radius-xl);
  border: 1px dashed rgba(15, 44, 37, 0.2);
  background: rgba(255, 255, 255, 0.55);
}

.kj-post {
  border-radius: var(--kj-radius-xl);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 44, 37, 0.14);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12);
  padding: 20px 18px;
}

.kj-post__back {
  display: inline-block;
  margin-bottom: 10px;
  color: rgba(15, 44, 37, 0.88);
  text-decoration: none;
}

.kj-post__back:hover {
  text-decoration: underline;
}

.kj-post__title {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1.3;
  unicode-bidi: plaintext;
}

.kj-post__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
  direction: rtl;
  color: var(--kj-muted);
}

.kj-post__sep {
  opacity: 0.55;
}

.kj-post__thumb {
  margin: 16px 0 0;
  border-radius: var(--kj-radius-xl);
  overflow: hidden;
  border: 1px solid rgba(15, 44, 37, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.kj-post__thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.kj-post__content {
  margin-top: 16px;
  direction: rtl;
  text-align: right;
}

.kj-post__content p {
  margin: 0 0 12px;
}

.kj-post__content a {
  color: var(--kj-accent);
  text-decoration: underline;
}

@media (max-width: 860px) {
  .kj-card {
    grid-template-columns: 76px minmax(0, 1fr) 120px;
  }
}

@media (max-width: 720px) {
  .kj-topbar__inner {
    padding: 10px 0;
  }

  .kj-brand__mark {
    height: 56px;
    max-width: 220px;
  }

  .kj-brand__title {
    font-size: 0.98rem;
  }

  .kj-hero__media {
    min-height: clamp(320px, 72vw, 460px);
  }

  .kj-hero__quote {
    max-width: 30ch;
    font-size: clamp(1.25rem, 5.4vw, 1.65rem);
    line-height: 1.6;
  }

  .kj-main {
    padding: 18px 0 34px;
  }

  .kj-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 14px;
  }

  .kj-card__num {
    order: -1;
    grid-auto-flow: column;
    justify-content: end;
    align-items: center;
  }

  .kj-card__num::before {
    width: 36px;
    height: 2px;
  }

  .kj-card__btn {
    width: 100%;
  }
}
