/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: only light;
}

html {
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@font-face {
  font-family: 'KFGQPC Naskh';
  src: url('../fonts/KFGQPC Uthman Taha Naskh Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Palatino';
  src: url('../fonts/pala.ttf') format('truetype');
  font-display: block;
}

body {
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 20px;
  line-height: 1.75;
  color: #333;
  background-color: #f4f4f4;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Keep sticky navigation pinned to the viewport instead of the body. */
  overflow-x: clip;
}

body[data-lang="ar"] {
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
}

body[data-lang="de"],
body[data-lang="en"] {
  font-family: 'Palatino', serif;
  font-size: 20px;
}

.page-shell,
.page-content,
.content-box,
.page-content li,
.writing-link,
.writing-card,
.writing-title,
.writing-subtitle {
  min-width: 0;
}

.page-content {
  overflow-wrap: break-word;
  word-break: normal;
}

.writing-title,
.writing-subtitle {
  overflow-wrap: anywhere;
  word-break: normal;
}

body[data-lang="de"] .page-content,
body[data-lang="en"] .page-content {
  -webkit-hyphens: auto;
  hyphens: auto;
}

.page-content a,
.site-footer a,
.email-link {
  overflow-wrap: anywhere;
  word-break: break-word;
  unicode-bidi: isolate;
}

.page-content a[href^="http"],
.email-link {
  direction: ltr;
}

.mobile-break {
  display: none;
}

/* Hero section */
.hero {
  background-image: url('../images/header-braun-02.jpg?v=20260427-4');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  width: 100%;
  aspect-ratio: 6 / 1;
  padding: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url('../images/header-night-02.jpg?v=20260427-1'),
    url('../images/header-night.jpg?v=20260427-4');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 0;
  pointer-events: none;
}
body.dark .hero::after {
  opacity: 1;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200%;
  background-image: url('../images/cloud-01.png?v=20260508-1');
  background-position: 0 0;
  background-size: 50% 100%;
  background-repeat: repeat-x;
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: clouds-scroll 60s linear infinite;
}
@keyframes clouds-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
body.dark .hero::before {
  opacity: 0.35;
}
.header-domain {
  position: absolute;
  left: clamp(8px, 3.5vw, 45px);
  bottom: clamp(4px, 1.6vw, 18px);
  color: #007b8b;
  font-family: 'Palatino';
  font-size: clamp(0.75rem, 5.5vw, 2.3rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 6px rgb(255, 255, 255);
  transition: opacity 0.4s ease;
  z-index: 2;
}
.header-domain:hover {
  opacity: 0.80;
}
.hero-title h1,
.hero-title p {
  text-shadow: none;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-title h1 {
  font-size: 3.4rem;
  margin-bottom: 14px;
}

.hero-title p {
  font-size: 1.4rem;
  opacity: 0.9;
}

/* Navigation */
.main-nav {
  background-color: #7b1300;
  box-shadow: inset 0 4px 3px rgba(0,0,0,0.25), inset 0 -4px 6px rgba(0,0,0,0.25);
  padding: 0 20px;
  min-height: 47px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #f5f5f5;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.25s;
}

.nav-menu-toggle:hover {
  background-color: rgba(255,255,255,0.22);
}

.nav-menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.nav-menu-container {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.nav-link, .lang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #f5f5f5;
  text-decoration: none;
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'KFGQPC Naskh', 'Palatino', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  transition: background-color 0.55s, color 0.55s;
}

body[data-lang="de"] .nav-link,
body[data-lang="en"] .nav-link {
  font-size: 1.15rem;
}

body[data-lang="de"] .nav-link {
  padding-left: 14px;
  padding-right: 14px;
}

.lang-button[data-lang="de"],
.lang-button[data-lang="en"] {
  font-size: 1.15rem;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.22);
}

.lang-button {
  transform: skewX(-18deg);
}

.lang-button > span {
  display: inline-block;
  transform: skewX(18deg);
}

.lang-button:hover {
  background-color: rgba(255,255,255,0.22);
}

.nav-link.active {
  background-color: #962020;
  color: white;
}

body.dark .nav-link.active {
  background-color: #5a0f08;
}

.lang-button.active {
  background: linear-gradient(180deg, #006384 0%, #004d5a 100%);
  color: #f4f8ff;
  border: 1px solid rgba(0,0,0,0.16);
  padding: 8px 20px;
}

.spacer {
  flex: 1;
}

.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-dropdown-toggle {
  display: none;
  background: linear-gradient(180deg, #006384 0%, #004d5a 100%);
  color: #f4f8ff;
  border: 1px solid rgba(0,0,0,0.16);
  padding: 6px 22px;
  cursor: pointer;
  font-family: 'KFGQPC Naskh', 'Palatino', Arial, sans-serif;
  font-size: 1.6rem;
  transition: background-color 0.25s, color 0.25s;
}

.lang-dropdown-toggle:hover {
  background-color: rgba(255,255,255,0.08);
}

.lang-toggle-label {
  display: none;
}

.lang-dropdown {
  display: flex;
  position: static;
  top: auto;
  right: auto;
  min-width: auto;
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  z-index: auto;
  flex-direction: row;
}

.lang-dropdown button {
  width: auto;
  justify-content: center;
    padding: 8px 16px;
  display: flex;
}

/* Main content */
.page-shell {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-content {
  display: none;
  animation: fadeIn 1s ease-in;
}

.page-content.active {
  display: block;
}

.page-content h2 {
  font-size: 3rem;
  margin-bottom: 24px;
  color: #006384;
}

.page-content p {
  margin-bottom: 22px;
  font-size: 1.8rem;
}

.opening-dua {
  direction: rtl;
  text-align: center;
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 1.55rem;
  line-height: 1.9;
  margin: 0 auto 30px;
  max-width: 42em;
  padding-bottom: 24px;
  position: relative;
}

.opening-dua::before,
.opening-dua::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
}

.opening-dua::after {
  bottom: 7px;
  width: min(340px, 76%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to right, transparent, rgba(0, 99, 132, 0.18), #006384 48%, #006384 52%, rgba(0, 99, 132, 0.18), transparent);
}

.opening-dua::before {
  bottom: 2px;
  width: 10px;
  height: 10px;
  border: 1px solid #006384;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}

.page-content ul {
  list-style: none;
  padding-right: 20px;
}

.page-content li {
  margin-bottom: 12px;
  padding: 14px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 0 3px rgba(0,0,0,0.26);
}

.page-content li.notice-important {
  background-color: #fff3f0 !important;
  border-left: 4px solid #8d1f0f !important;
  box-shadow: 0 0 4px rgba(123, 19, 0, 0.38) !important;
}

.notice-points {
  display: grid;
  gap: 8px;
}

.notice-points > span {
  display: block;
  position: relative;
  padding-left: 1.15em;
}

.notice-points > span::before {
  content: "•";
  position: absolute;
  left: 0;
  line-height: 1.35;
}

.page-content address {
  font-style: normal;
  margin-top: 20px;
}

.page-content a {
  color: #006384;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

.writing-link {
  display: block;
  color: inherit;
  text-decoration: none;
  margin: -14px;
  padding: 14px;
  border-radius: 5px;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.writing-link:hover {
  background-color: #f0f0f0;
  text-decoration: none !important;
  color: #006384;
}

.writing-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.writing-cover {
  width: 90px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0,0,0,0.48);
  flex-shrink: 0;
}

.writing-title {
  flex: 1;
  min-width: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.45;
}

.honorific-symbol {
  display: inline-block;
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 0.84em;
  font-weight: 400;
  line-height: 1;
  margin-inline: 0.08em;
  vertical-align: -0.08em;
}

.writing-title-regular {
  font-weight: 400;
}

.writing-subtitle {
  display: block;
  min-width: 0;
  font-size: 1rem;
  font-weight: 400;
  margin-top: 4px;
  line-height: 1.55;
  text-wrap: balance;
}

.writing-pages {
  font-size: 0.8em;
  font-weight: 400;
}

.language-card-section {
  margin-top: 34px;
}

.section-divider + .language-card-section {
  margin-top: 18px;
}

.language-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.language-card-grid-stacked {
  grid-template-columns: 1fr;
}

.language-card {
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 18px 20px;
  border: 1px solid #b8ddeb;
  border-radius: 5px;
  background: linear-gradient(135deg, #edf8fc 0%, #dff0f7 100%);
  box-shadow: 0 0 4px rgba(0, 99, 132, 0.30);
  color: #00516d;
  text-decoration: none;
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.language-card:hover {
  border-color: #8fc8dc;
  background: linear-gradient(135deg, #e3f4fa 0%, #d2ebf4 100%);
  box-shadow: 0 0 12px rgba(0, 99, 132, 0.36);
  color: #004b65;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.language-card-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
}

.home-bio-card {
  margin-bottom: 18px;
}

body[data-lang="ar"] .language-card-section .section-category {
  font-size: 1.35rem;
  letter-spacing: 0;
  text-transform: none;
}

body[data-lang="ar"] .language-card-title {
  font-size: 1.45rem;
}

.support-list {
  list-style: disc !important;
  padding-left: 28px;
  margin-bottom: 0;
}
.support-list + .support-list {
  margin-top: 20px;
}
.support-list li {
  background: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 10px;
  border-radius: 0;
  font-size: 1.3rem;
  line-height: 1.65;
}
.support-note {
  margin: 12px 0 4px 4px;
  padding: 14px 18px;
  border-left: 3px solid #006384;
  font-size: 1.15rem;
  line-height: 1.7;
}
body.dark .support-note {
  border-left-color: #7eaebd;
}
.support-thanks {
  text-align: center;
  color: #7b1300;
  font-weight: 700;
  margin-top: 28px;
  font-size: 1.3rem;
}
body.dark .support-thanks {
  color: #bd8646;
}

.amazon-links {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #666;
}

.amazon-links a {
  color: #006384;
  text-decoration: none;
}

.amazon-links a:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive design */
@media (max-width: 1199px) {
  .hero-title h1 {
    font-size: 3rem;
  }

  .hero-title p {
    font-size: 1.3rem;
  }

  .nav-link, .lang-button {
    font-size: 1.35rem;
    padding: 4px 18px;
  }

  .page-shell {
    padding: 30px 16px;
  }
}

@media (max-width: 1199px) {
  .main-nav {
    align-items: center;
    padding: 0 14px;
    gap: 8px;
    min-height: 44px;
  }

  .nav-link, .lang-button {
    width: auto;
    text-align: center;
    padding: 4px 14px;
  }

  body[data-lang="de"] .nav-link,
  body[data-lang="en"] .nav-link,
  body[data-lang="de"] .lang-button,
  body[data-lang="en"] .lang-button {
    font-size: 1.1rem;
  }

  .lang-switcher {
    justify-content: flex-end;
    position: relative;
  }

  .lang-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #f5f5f5;
    font-family: 'Palatino', 'KFGQPC Naskh', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
  }

  .lang-dropdown-toggle svg {
    display: none;
  }

  .lang-dropdown-toggle::after {
    content: none;
  }

  .lang-toggle-label {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
  }

  .lang-toggle-ar {
    display: inline-block;
    line-height: 1;
    transform: scale(1.35);
    transform-origin: center;
    vertical-align: middle;
  }

  .lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 180px;
    background-color: #7b1300;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 18px rgba(0,0,0,0.3);
    padding: 6px 0;
    flex-direction: column;
    z-index: 200;
  }

  body[data-lang="ar"] .lang-dropdown {
    right: auto;
    left: 0;
  }

  .lang-dropdown button {
    width: 100%;
    text-align: left;
    padding: 10px 20px;
  }

  .lang-switcher.open .lang-dropdown {
    display: flex;
  }

  .lang-button,
  .lang-button.active {
    background: none;
    border: none;
    color: #f5f5f5;
    transform: none;
    font-weight: 700;
  }

  .lang-button:hover,
  .lang-button.active:hover {
    background-color: rgba(255,255,255,0.08);
  }

  .lang-button.active {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
  }

  .lang-button > span {
    transform: none;
    display: inline-block;
  }

  .hero-title h1 {
    font-size: 2.4rem;
  }

  .hero-title p {
    font-size: 1.2rem;
  }

  .page-shell {
    padding: 22px 12px;
  }

  .page-content h2 {
    font-size: 2.4rem;
  }

  .page-content p,
  .page-content li {
    font-size: 1.55rem;
  }

  .page-content ul {
    padding-right: 0;
    padding-left: 0;
  }

  .site-footer {
    padding: 14px 12px;
    font-size: 0.6rem;
  }
}

@media (max-width: 1199px) {
  .main-nav {
    flex-direction: row;
    justify-content: flex-start;
    gap: 3px;
    padding: 0 6px;
    flex-wrap: nowrap;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .spacer {
    display: none;
  }

  .nav-menu-toggle,
  .telegram-switcher,
  .telegram-direct,
  .contact-toggle,
  .search-wrap,
  .darkmode-toggle,
  .lang-switcher {
    flex: 0 0 auto;
  }

  .nav-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: -1;
    padding: 8px;
  }

  .nav-menu-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #7b1300;
    flex-direction: column;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    z-index: 99;
  }

  body.dark .nav-menu-container {
    background-color: #0d0300;
    border-bottom-color: rgba(255,255,255,0.08);
  }

  .nav-menu-container.open {
    display: flex;
  }

  .nav-menu-container .nav-link {
    width: 100%;
    text-align: center;
    padding: 8px;
    white-space: normal;
  }

  body[data-lang="ar"] .nav-menu-container {
    text-align: right;
  }

  .telegram-toggle,
  .telegram-direct,
  .contact-toggle,
  .darkmode-toggle {
    padding-left: 7px;
    padding-right: 7px;
  }

  .search-toggle {
    padding-left: 5px;
    padding-right: 5px;
  }

  .lang-dropdown-toggle {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .lang-toggle-label {
    font-size: 0;
  }

  .lang-toggle-label::after {
    content: "ع/EN";
    font-size: 0.95rem;
    line-height: 1;
  }

  .search-overlay {
    top: 100%;
    right: auto;
    left: 50%;
    width: min(280px, calc(100vw - 24px));
    transform: translateX(-50%);
  }

  [dir="rtl"] .search-overlay {
    right: auto;
    left: 50%;
  }
}

@media (max-width: 320px) and (orientation: portrait) {
  .hero-title h1 {
    font-size: 1.1rem;
  }

  .hero-title p {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) and (orientation: portrait) {
  .hero-title h1 {
    font-size: 1.4rem;
  }

  .hero-title p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .mobile-break {
    display: inline;
  }

  .hero {
    aspect-ratio: 4 / 1;
  }

  .hero,
  .hero::after {
    background-position: 85% center;
    background-size: auto 100%;
  }

  .hero::before {
    width: 300%;
    background-size: 50% 100%;
  }

  body.dark .hero::before {
    opacity: 0.6;
  }

  .page-content address {
    font-size: 1.4rem;
  }

  .page-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .page-content li {
    padding: 12px;
  }

  .writing-link {
    margin: 0;
    padding: 0;
  }

  .writing-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
  }

  .writing-cover {
    width: 96px;
  }

  .writing-title {
    font-size: 1.15rem;
  }

  .writing-subtitle {
    font-size: 0.95rem;
  }

  #scroll-top.audio-active {
    right: 8px;
  }

  .hero-title h1 {
    font-size: 2rem;
  }

  .hero-title p {
    font-size: 1.1rem;
  }

  .nav-link, .lang-button {
    font-size: 1.15rem;
    padding: 4px 12px;
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 6px 20px;
  min-height: 2rem;
  font-size: 0.8rem;
  font-family: Arial, sans-serif;
  line-height: 1.25;
  color: #555;
  background-color: #fff;
  border-top: 1px solid #ddd;
}

/* Audio list */
.audio-group-title {
  font-size: 1.4rem;
  color: #006384;
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
}

.audio-info {
  background-color: #e6f3ff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  box-shadow: 0 0 3px rgba(0,0,0,0.42);
  line-height: 1.4;
}

.audio-info ul {
  list-style-type: disc;
  margin: 0;
  padding-left: 20px;
}

.audio-info li {
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding: 0;
  background-color: transparent;
  box-shadow: none;
  border-radius: 0;
}

.audio-list {
  list-style: none;
  padding: 0;
}

.audio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 0 3px rgba(0,0,0,0.26);
  flex-wrap: wrap;
}

.audio-title {
  flex: 1;
  min-width: 180px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none !important;
  color: inherit;
  transition: opacity 0.3s ease;
  padding-left: 2em;
  text-indent: -2em;
}

.audio-title:hover,
.audio-title:focus,
.audio-title:active {
  opacity: 0.75;
  text-decoration: none !important;
}

.audio-item audio {
  width: 351px;
  height: 36px;
  flex-shrink: 0;
}

@media (max-width: 430px) and (orientation: portrait) {
  .page-content .audio-item {
    padding-left: 8px;
    padding-right: 8px;
  }

  .page-content .audio-item audio {
    display: block;
    width: 351px;
    max-width: 100%;
  }
}

/* Telegram button */
.telegram-switcher {
  position: relative;
  display: flex;
  align-self: stretch;
}

.telegram-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  background: none;
  border: none;
  color: #f5f5f5;
  padding: 0 14px;
  cursor: pointer;
  transition: background-color 0.25s;
}

.telegram-toggle:hover,
.telegram-direct:hover {
  background-color: transparent;
}

.telegram-toggle::before,
.telegram-direct::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  background-color: transparent;
  border-radius: 0.35rem;
  transition: background-color 0.25s;
  pointer-events: none;
}

.telegram-toggle:hover::before,
.telegram-direct:hover::before {
  background-color: rgba(255,255,255,0.22);
}

.telegram-direct {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  text-shadow: 0 1px 5px rgba(0,0,0,0.1);  color: #f5f5f5;
  padding: 0 14px;
  text-decoration: none;
  transition: background-color 0.25s;
}

.telegram-dropdown {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: #7b1300;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 18px rgba(0,0,0,0.3);
  padding: 6px 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.telegram-switcher.open .telegram-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .telegram-switcher:hover .telegram-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.telegram-link {
  display: block;
  color: #f5f5f5;
  text-decoration: none;
  padding: 10px 20px;
  white-space: nowrap;
  font-family: 'KFGQPC Naskh', 'Palatino', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  transition: background-color 0.25s;
}

.telegram-link:hover {
  background-color: rgba(255,255,255,0.08);
  text-decoration: none;
}

body[data-lang="ar"] .telegram-dropdown {
  left: auto;
  right: 0;
}

/* Language-specific styles */
body[data-lang="de"], body[data-lang="en"] {
  direction: ltr;
  text-align: left;
}

body[data-lang="de"] .page-content h2,
body[data-lang="en"] .page-content h2 {
  font-size: 2.25rem;
}

body[data-lang="de"] .page-content p,
body[data-lang="en"] .page-content p {
  font-size: 1.3rem;
}

body[data-lang="de"] .page-content .opening-dua,
body[data-lang="en"] .page-content .opening-dua {
  font-size: 1.55rem;
}

body[data-lang="de"] .page-content li,
body[data-lang="en"] .page-content li {
  font-size: 1.3rem;
}

body[data-lang="de"] .page-content ul,
body[data-lang="en"] .page-content ul {
  padding-left: 20px;
  padding-right: 0;
}

body[data-lang="de"] .audio-info li,
body[data-lang="en"] .audio-info li {
  font-size: 0.9rem;
}

body[data-lang="ar"] .writing-link {
  font-size: 1.5rem;
}

details {
  margin-top: 8px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: #c87000;
  display: inline-block;
  padding: 4px 0;
}

summary:hover {
  opacity: 0.75;
}

details ol {
  margin-top: 8px;
  padding: 4px 2px;
  list-style: none;
  overflow: hidden;
  transition: max-height 1.2s ease;
}

body[data-lang="de"] details ol li {
  position: relative;
  display: block;
}

details ol li::before {
  content: attr(data-num);
  font-weight: 700;
  min-width: 2.2em;
}

body[data-lang="de"] details ol li::before {
  position: absolute;
  left: 10px;
  top: 4px;
  min-width: 0;
  width: 2.2em;
}

body[data-lang="de"] details ol li {
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.58);
  border-radius: 4px;
  padding: 4px 10px 4px calc(10px + 2.2em);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

#unterrichte > ul > li {
  box-shadow: 0 0 14px rgba(0,0,0,0.38);
}

#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 34px;
  background-color: #fff;
  color: #666;
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0px 3px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease, box-shadow 0.25s;
  z-index: 500;
}

#scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

#scroll-top:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* Dark mode transitions */
body {
  transition: background-color 2s ease, color 2s ease;
}
.content-box,
.page-content li,
.audio-info,
.audio-item,
details ol li,
#scroll-top {
  transition: background-color 2s ease, color 2s ease, box-shadow 2s ease;
}
.site-footer {
  transition: background-color 2s ease, color 2s ease, border-color 2s ease;
}
.page-content h2,
.page-content a,
.amazon-links,
.amazon-links a,
.audio-group-title,
summary {
  transition: color 2s ease;
}
.main-nav {
  transition: background-color 2s ease;
}

/* Header icon buttons */
.contact-toggle,
.darkmode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  position: relative;
  background: none;
  border: none;
  color: #f5f5f5;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
}
.contact-toggle::before,
.darkmode-toggle::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  background-color: transparent;
  border-radius: 0.35rem;
  transition: background-color 0.25s;
  pointer-events: none;
}
.contact-toggle:hover::before,
.contact-toggle.active::before,
.darkmode-toggle:hover::before {
  background-color: rgba(255,255,255,0.22);
}
.icon-sun { display: none; }
body.dark .icon-moon { display: none; }
body.dark .icon-sun { display: block; }

.content-box {
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 0 3px rgba(0,0,0,0.26);
  padding: 24px 28px;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Dark mode */
body.dark {
  color-scheme: dark;
  color: #d8d2c8;
  background-color: #181818;
}
body.dark .content-box {
  background: #2a2a2a;
  box-shadow: 0 0 3px rgba(0,0,0,0.68);
}
body.dark .main-nav {
  background-color: #2a0d00;
}
body.dark .nav-menu-toggle,
body.dark .nav-link,
body.dark .lang-button,
body.dark .lang-dropdown-toggle,
body.dark .telegram-toggle,
body.dark .telegram-direct,
body.dark .telegram-link,
body.dark .contact-toggle,
body.dark .darkmode-toggle,
body.dark .search-toggle {
  color: #ded8d0;
}
body.dark .telegram-dropdown,
body.dark .lang-dropdown {
  background-color: #0d0300;
  box-shadow: 0 8px 18px rgba(0,0,0,0.6);
}
body.dark .page-content h2,
body.dark .audio-group-title {
  color: #7eaebd;
}
body.dark .opening-dua::after {
  background: linear-gradient(to right, transparent, rgba(126, 174, 189, 0.16), #7eaebd 48%, #7eaebd 52%, rgba(126, 174, 189, 0.16), transparent);
}
body.dark .opening-dua::before {
  border-color: #7eaebd;
  background: #2a2a2a;
}
body.dark .page-content li {
  background-color: #242424;
  box-shadow: 0 0 3px rgba(0,0,0,0.68);
}
body.dark .page-content li.notice-important {
  background-color: #30211f !important;
  border-left-color: #b97968 !important;
  box-shadow: 0 0 4px rgba(0,0,0,0.74) !important;
}
body.dark .page-content a,
body.dark .amazon-links a {
  color: #7eaebd;
}
body.dark .amazon-links {
  color: #9f988f;
}
body.dark .writing-link:hover {
  background-color: rgba(255,255,255,0.07);
  color: #7eaebd;
}
body.dark .language-card {
  border-color: rgba(126, 174, 189, 0.34);
  background: linear-gradient(135deg, #17282d 0%, #1d333b 100%);
  box-shadow: 0 0 4px rgba(0,0,0,0.64);
  color: #9fd0df;
}
body.dark .language-card:hover {
  border-color: rgba(126, 174, 189, 0.58);
  background: linear-gradient(135deg, #1b3037 0%, #24404a 100%);
  box-shadow: 0 0 12px rgba(0,0,0,0.70);
  color: #b8dfeb;
}
body.dark .site-footer {
  background-color: #181818;
  border-top-color: #333;
  color: #807a73;
}
.site-footer a {
  color: #555;
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
body.dark .site-footer a {
  color: #807a73;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  min-width: 0;
}
.site-footer > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
body[data-lang="ar"] .site-footer .footer-domain {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Arial, sans-serif;
  font-size: 0.86em;
}
body[data-lang="ar"] .site-footer {
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .content-box {
    padding: 20px 18px;
  }

  body[data-lang="de"] .page-content ul,
  body[data-lang="en"] .page-content ul {
    padding-left: 0;
  }

  .site-footer {
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    gap: 6px 14px;
  }
}

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 6px;
  color: #f5f5f5;
  transition: background 0.2s;
}
.search-toggle:hover {
  background: rgba(255,255,255,0.15);
}
.search-overlay {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  padding: 10px 14px 12px;
  visibility: hidden;
  clip-path: inset(0 50% 0 50% round 8px);
  transition: clip-path 0.32s cubic-bezier(0.4,0,0.2,1), visibility 0s 0.32s;
  z-index: 200;
}
.search-overlay.open {
  visibility: visible;
  clip-path: inset(0 0% 0 0% round 8px);
  transition: clip-path 0.32s cubic-bezier(0.4,0,0.2,1), visibility 0s 0s;
}
[dir="rtl"] .search-overlay {
  right: auto;
  left: 0;
}
body.dark .search-overlay {
  background: #1e1e1e;
  color: #d2ccc3;
  box-shadow: 0 6px 22px rgba(0,0,0,0.5);
}

.download-choice-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.36);
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.28s ease;
}

.download-choice-overlay.open {
  opacity: 1;
}

.download-choice-dialog {
  width: min(360px, 100%);
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  color: #222;
  box-shadow: 0 0 22px rgba(0,0,0,0.38);
  font-size: 1rem;
  line-height: 1.35;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.32s ease;
}

.download-choice-overlay.open .download-choice-dialog {
  transform: translateY(0) scale(1);
}

.download-choice-title {
  font-weight: 700;
  color: #7b1300;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.download-choice-file {
  margin-bottom: 14px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.download-choice-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.download-choice-button {
  border: 1px solid #b9b1aa;
  border-radius: 5px;
  background: #f6f1ed;
  color: #2b241f;
  padding: 6px 8px;
  cursor: pointer;
  font: 14px/1.2 Arial, sans-serif;
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

.download-choice-button:hover,
.download-choice-button:focus {
  background: #eadfd7;
}

.download-choice-primary {
  border-color: #7b1300;
  background: #7b1300;
  color: #fff;
}

.download-choice-primary:hover,
.download-choice-primary:focus {
  background: #962020;
}

body.dark .download-choice-dialog {
  background: #242424;
  color: #d8d2c8;
  box-shadow: 0 0 22px rgba(0,0,0,0.72);
}

body.dark .download-choice-title {
  color: #bd8646;
}

body.dark .download-choice-button {
  border-color: #5b5048;
  background: #2f2a27;
  color: #ded8d0;
}

body.dark .download-choice-button:hover,
body.dark .download-choice-button:focus {
  background: #3a332f;
}

body.dark .download-choice-primary {
  border-color: #7b1300;
  background: #7b1300;
  color: #fff;
}

body.dark .download-choice-primary:hover,
body.dark .download-choice-primary:focus {
  background: #962020;
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #999;
  border-bottom: 2px solid #7b1300;
  padding-bottom: 8px;
}
body.dark .search-inner {
  border-bottom-color: #9b3322;
  color: #777;
}
#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: #333;
}
body.dark #search-input { color: #d2ccc3; }
body.dark #search-input::placeholder { color: #8f887f; }
body[data-lang="ar"] #search-input {
  font-family: 'KFGQPC Naskh', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 1.05rem;
}
#search-input::placeholder { color: #bbb; }
.search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.search-close:hover { color: #444; }
body.dark .search-close { color: #958e85; }
body.dark .search-close:hover { color: #d8d2c8; }
.search-results { margin-top: 6px; }
.search-result {
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: color 0.15s;
}
.search-result:hover { color: #7b1300; }
body.dark .search-result { border-top-color: #2a2a2a; }
body.dark .search-result:hover { color: #b97968; }
.search-result-title { font-weight: 600; font-size: 0.92rem; }
.search-result-snippet {
  font-size: 0.79rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-no-results { padding: 8px 0; color: #aaa; font-size: 0.86rem; }
body.dark .search-no-results { color: #958e85; }
.section-category {
  font-size: 0.97rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7b1300;
  margin: 28px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
}
body.dark .section-category {
  color: #b97968;
  border-bottom-color: #333;
}
.section-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0 0 12px;
}
body.dark .section-divider {
  border-top-color: #333;
}
.subsection-label {
  font-size: 1.0rem;
  font-weight: 700;
  color: #222;
  margin: 24px 0 1px;
  padding: 0;
  line-height: 1;
}
body.dark .subsection-label {
  color: #bdb6ad;
}
mark.search-highlight {
  background: #ffe566;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  transition: background 2s ease;
}
mark.search-highlight.fade { background: transparent; }
body.dark mark.search-highlight { background: #7a5c00; }
body.dark mark.search-highlight.fade { background: transparent; }

body.dark .audio-info {
  background-color: #1a2d3d;
}
body.dark .audio-item {
  background-color: #242424;
}
body.dark details ol li {
  background: #242424;
}
body.dark summary {
  color: #c28a4b;
}
body.dark .header-domain {
  text-shadow: 1px 1px 5px rgba(0,0,0,0.85);
}
body.dark #scroll-top {
  background-color: #242424;
  color: #958e85;
}
