/* 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: 'Uthman';
  src: url('../fonts/UthmanicHafs1-Ver18.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Palatino';
  src: url('../fonts/pala.ttf') format('truetype');
  font-display: block;
}

@font-face {
  font-family: 'Traditional Arabic';
  src: url('../fonts/trado.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Traditional Arabic';
  src: url('../fonts/tradbdo.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Traditional Naskh';
  src: url('../fonts/Traditional-Naskh.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Traditional Naskh';
  src: url('../fonts/Traditional-Naskh-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

body {
  font-family: 'Palatino', serif;
  font-size: 20px;
  line-height: 1.75;
  color: #333;
  background-color: #f4f4f4;
  direction: ltr;
  text-align: left;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Keep sticky navigation pinned to the viewport instead of the body. */
  overflow-x: clip;
}

.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;
}

.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-iw.jpg');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.34);
  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-iw.jpg');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transition: opacity 2s ease;
  z-index: 0;
  pointer-events: none;
}
body.dark .hero::after {
  opacity: 1;
}
.header-domain {
  position: absolute;
  left: clamp(12px, 4.5vw, 55px);
  bottom: clamp(6px, 2vw, 24px);
  color: #007b8b;
  font-family: 'Palatino';
  font-size: clamp(0.9rem, 6.6vw, 2.75rem);
  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;
}
.header-domain-url {
  display: block;
  color: #ffffff;
  font-size: 0.4em;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-top: 0.25em;
  margin-left: 0.5em;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.95),
    0 0 6px rgba(0, 0, 0, 0.75);
}
.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: linear-gradient(to right, #006384 0%, #006384 28%, #4a4a4a 100%);
  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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #f5f5f5;
  text-decoration: none;
  padding: 5px 14px;
  margin: 6px 3px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Uthman', '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.35s ease, color 0.35s ease;
}

.nav-link {
  font-size: 1.1rem;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.16);
}

.nav-link.active {
  background-color: rgba(255,255,255,0.26);
  color: white;
}

body.dark .nav-link.active {
  background-color: rgba(255,255,255,0.18);
}

.spacer {
  flex: 1;
}

.lang-switcher {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0 2px;
}

.lang-opt {
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  background: transparent;
  display: flex;
  align-items: center;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}

.lang-opt + .lang-opt {
  border-left: 1px solid rgba(255,255,255,0.32);
}

.lang-opt.lang-current {
  color: #fff;
  background: rgba(255,255,255,0.18);
  cursor: default;
}

a.lang-opt:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.88);
}

/* 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 h1 {
  font-size: 2.45rem;
  line-height: 1.18;
  margin: 0 0 24px;
  padding-bottom: 10px;
  color: #006384;
  border-bottom: 1px solid #cfdde2;
}

.page-content h2 {
  font-size: 2.25rem;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 0;
  color: #006384;
  position: relative;
}

.page-content h1.section-heading-equivalent {
  font-size: 2.25rem;
  line-height: normal;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 0;
  color: #006384;
  border-bottom: 0;
  position: relative;
}

.page-content h2::after {
  content: "";
  display: block;
  width: min(100%, 34rem);
  height: 1px;
  margin-top: 8px;
  background-color: #cfdde2;
}

.page-content h1.section-heading-equivalent::after {
  content: "";
  display: block;
  width: min(100%, 34rem);
  height: 1px;
  margin-top: 8px;
  background-color: #cfdde2;
}

.content-box > h2 {
  font-size: 1.65rem;
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.page-content h3 {
  color: #006384;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 28px 0 14px;
}

.page-content > h2:first-child,
.content-box > h2:first-child,
.page-content > h1.section-heading-equivalent:first-child,
.content-box > h1.section-heading-equivalent:first-child {
  margin-top: 0;
}

.page-content p {
  margin-bottom: 22px;
  font-size: 1.3rem;
}

.external-profile-link {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-top: 34px;
  padding-top: 18px;
  padding-right: 32px;
  border-top: 1px solid #cfdde2;
}

.opening-dua {
  direction: rtl;
  text-align: center;
  font-family: 'Uthman', 'Traditional Naskh', 'Traditional Arabic', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 1.55rem;
  line-height: 1.9;
  margin: 0 auto 24px;
  max-width: 42em;
  padding-bottom: 22px;
  position: relative;
}

.opening-dua::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: min(280px, 60%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.65) 50%, transparent);
  pointer-events: none;
}

.page-content ul {
  list-style: none;
  padding-left: 20px;
  padding-right: 0;
}

.page-content li {
  margin-bottom: 20px;
  padding: 14px;
  background-color: #e0eef2;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.36);
}

.page-content .focus-list {
  list-style: disc;
  margin: -2px 0 26px;
  padding: 16px 24px 16px 44px;
  background-color: #f5fafb;
  border: 1px solid #d6e5ea;
  border-radius: 5px;
}

.page-content .focus-list li {
  display: list-item;
  margin-bottom: 7px;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.page-content .focus-list li:last-child {
  margin-bottom: 0;
}

.page-content .statement-list li {
  max-width: 62ch;
  font-style: italic;
}

.statement-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.statement-card-link {
  display: block;
  max-width: 680px;
  padding: 14px 18px;
  border: 1px solid #d4dde3;
  border-radius: 6px;
  background-color: #f5f6f7;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.statement-card-link:hover {
  background-color: #e8edf0;
  border-color: #a8c4d0;
  text-decoration: none !important;
}

.statement-card-title {
  display: block;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
}

.statement-card-action {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #8a1538;
  font-style: normal;
}

.all-statements-link {
  margin-top: 4px;
}

.show-all-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: #8a1538;
}

.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-description {
  display: block;
  margin-top: 8px;
  color: #333;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

.writing-link:hover .writing-description {
  color: #333;
}

.writing-action {
  color: #8a1538;
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 9px;
}

.writing-link:hover .writing-action {
  color: #8a1538;
}

.book-blurb {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.65;
}

.book-blurb summary {
  color: #006384;
  cursor: pointer;
  font-weight: 700;
}

.book-blurb > .book-blurb-content {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
}

.book-blurb[open] > .book-blurb-content {
  max-height: var(--book-blurb-height, 1200px);
  opacity: 1;
}

.book-blurb-inner {
  min-height: 0;
  overflow: hidden;
}

.book-blurb p {
  margin: 12px 0 0;
  font-size: inherit;
}

.recommendation-list {
  max-width: 780px;
}

.recommendation-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.recommendation-link:hover {
  text-decoration: none !important;
}

.recommendation-icon {
  align-items: center;
  background-color: #229ed9;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 46px;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.recommendation-title {
  color: #006384;
}

.recommendation-image-link {
  aspect-ratio: 6 / 1;
  border-radius: 4px;
  display: block;
  overflow: hidden;
  position: relative;
}

.recommendation-image-link::after {
  background: linear-gradient(90deg, rgba(2, 14, 18, 0.7), rgba(2, 14, 18, 0.42) 34%, rgba(2, 14, 18, 0) 70%);
  bottom: 0;
  content: "";
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 62%;
}

.recommendation-image {
  border-radius: 4px;
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.recommendation-domain {
  bottom: 14px;
  color: #68d2da;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.8rem, 3.1vw, 1.7rem);
  font-weight: 700;
  left: 20px;
  line-height: 1;
  position: absolute;
  text-shadow: 0 1px 1px rgba(255,255,255,0.28), 0 3px 12px rgba(0,0,0,0.85);
  z-index: 1;
}

.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 2px 8px rgba(0,0,0,0.25);
  flex-shrink: 0;
}

.writing-title {
  flex: 1;
  min-width: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.45;
}

.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;
}

.amazon-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  width: min(100%, 760px);
  margin: -14px auto;
  padding: 14px;
  border-radius: 5px;
  transition: background-color 0.5s ease;
}

.amazon-card-link:hover {
  background-color: #cee0e6;
  text-decoration: none !important;
}

.amazon-card-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.amazon-card-title {
  margin-top: 14px;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.amazon-logo {
  height: 1.5em;
  width: auto;
  vertical-align: middle;
}

.amazon-card-subtitle {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 400;
  color: #000;
  text-align: center;
}

.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: 1024px) {
  .hero-title h1 {
    font-size: 3rem;
  }

  .hero-title p {
    font-size: 1.3rem;
  }

  .nav-link {
    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 {
    width: auto;
    text-align: center;
    padding: 4px 14px;
  }

  .nav-link {
    font-size: 1.1rem;
  }

  .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.25rem;
  }

  .page-content h1.section-heading-equivalent {
    font-size: 2.25rem;
  }

  .page-content h1 {
    font-size: 2.1rem;
  }

  .content-box > h2 {
    font-size: 1.5rem;
  }

  .page-content h3 {
    font-size: 1.45rem;
  }

  .page-content p,
  .page-content li {
    font-size: 1.3rem;
  }

  .page-content ul {
    padding-left: 0;
    padding-right: 0;
  }

  .page-content .focus-list {
    padding-left: 36px;
  }

  .site-footer {
    padding: 14px 12px;
    font-size: 0.6rem;
  }
}

@media (max-width: 1024px) {
  .main-nav {
    flex-direction: row;
    justify-content: flex-start;
    gap: 4px;
    padding: 0 8px;
  }

  .spacer {
    display: none;
  }

  .nav-menu-toggle,
  .telegram-switcher,
  .telegram-direct,
  .contact-toggle,
  .search-wrap,
  .darkmode-toggle {
    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: #006384;
    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: #003344;
    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;
    margin: 0;
    border-radius: 0;
    white-space: normal;
  }

  .telegram-toggle,
  .telegram-direct,
  .contact-toggle,
  .darkmode-toggle {
    padding-left: 8px;
    padding-right: 8px;
  }

  .search-toggle {
    padding-left: 6px;
    padding-right: 6px;
  }

  .search-overlay {
    top: 100%;
    right: auto;
    left: 50%;
    width: min(280px, calc(100vw - 24px));
    transform: translateX(-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%;
  }

  .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-description {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .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;
  }

  .hero-title h1 {
    font-size: 2rem;
  }

  .hero-title p {
    font-size: 1.1rem;
  }

  .nav-link {
    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;
}

/* 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: #006384;
  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: 'Uthman', '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;
}

#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,
#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 h1,
.page-content a,
.amazon-links,
.amazon-links a {
  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 1px 3px rgba(0,0,0,0.1);
  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 1px 3px rgba(0,0,0,0.4);
}
body.dark .main-nav {
  background: linear-gradient(to right, #003344 0%, #003344 28%, #262626 100%);
}
body.dark .nav-menu-toggle,
body.dark .nav-link,
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 {
  background-color: #003344;
  box-shadow: 0 8px 18px rgba(0,0,0,0.6);
}
body.dark .page-content h1 {
  color: #7eaebd;
  border-bottom-color: #2d4d59;
}
body.dark .page-content h2 {
  color: #7eaebd;
}
body.dark .page-content h2::after {
  background-color: #2d4d59;
}
body.dark .page-content h1.section-heading-equivalent {
  color: #7eaebd;
}
body.dark .page-content h1.section-heading-equivalent::after {
  background-color: #2d4d59;
}
body.dark .page-content h3 {
  color: #7eaebd;
}
body.dark .opening-dua::after {
  background: linear-gradient(to right, transparent, rgba(216, 210, 200, 0.55) 50%, transparent);
}
body.dark .external-profile-link {
  border-top-color: #2d4d59;
}
body.dark .page-content li {
  background-color: #242424;
  box-shadow: 0 2px 4px rgba(0,0,0,0.72);
}
body.dark .page-content .focus-list {
  background-color: #242424;
  border-color: #333;
}
body.dark .page-content .focus-list li {
  background-color: transparent;
  box-shadow: none;
}
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 .writing-description,
body.dark .writing-link:hover .writing-description {
  color: #d8d2c8;
}
body.dark .writing-action,
body.dark .writing-link:hover .writing-action {
  color: #d78a9e;
}
body.dark .statement-card-link {
  background-color: #242424;
  border-color: #3a3a3a;
  box-shadow: 0 2px 5px rgba(0,0,0,0.45);
}
body.dark .statement-card-link:hover {
  background-color: #2f3435;
  border-color: #4d6a73;
}
body.dark .statement-card-action {
  color: #d78a9e;
}
body.dark .book-blurb summary {
  color: #7eaebd;
}
body.dark .recommendation-title {
  color: #7eaebd;
}
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;
}
.page-lead {
  font-style: italic;
  color: #555;
  margin-top: -4px;
  margin-bottom: 18px;
}
body.dark .page-lead {
  color: #b3aca0;
}

.bib-info {
  background: #f5f1ea;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 5px;
  padding: 16px 22px;
  margin: 18px 0 22px;
  font-size: 0.95rem;
}
.bib-info > h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.bib-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 18px;
  row-gap: 6px;
}
.bib-list dt {
  font-weight: 600;
  margin: 0;
}
.bib-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
body.dark .bib-info {
  background: #1f1f1f;
  border-color: rgba(255, 255, 255, 0.2);
}
@media (max-width: 600px) {
  .bib-list {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .bib-list dt {
    margin-top: 8px;
  }
  .bib-list dt:first-of-type {
    margin-top: 0;
  }
}

.rubrik-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted, #555);
  margin: 28px 0 12px;
}
.rubrik-heading:first-of-type {
  margin-top: 8px;
}
body.dark .rubrik-heading {
  color: #aaa;
}

.paragraph-box {
  background: #ebebeb;
  border-left: 4px solid #aaa;
  border-radius: 5px;
  padding: 14px 20px;
  margin: 14px 0 18px;
  font-style: italic;
  line-height: 1.65;
}
body.dark .paragraph-box {
  background: #2a2a2a;
  border-left-color: #888;
}

.translation-note {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 22px 0 6px;
  font-style: italic;
}
.kurzfassung-box {
  background: #f5f1ea;
  border-left: 4px solid #8a1538;
  border-radius: 5px;
  padding: 18px 22px;
  margin: 22px 0 26px;
}
.kurzfassung-box > h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.15rem;
}
.kurzfassung-box > p {
  margin: 0;
  line-height: 1.65;
}
.kurzfassung-box > p + p {
  margin-top: 0.9em;
}
body.dark .kurzfassung-box {
  background: #1f1f1f;
  border-left-color: #d78a9e;
}

.pdf-hint {
  margin-top: 22px;
  margin-bottom: 8px;
  font-weight: 600;
}

.pdf-link-list {
  list-style: none;
  padding-left: 0;
}

@media (max-width: 480px) {
  .content-box {
    padding: 20px 18px;
  }

  .page-content ul {
    padding-left: 0;
  }

  .kurzfassung-box {
    padding: 16px 16px;
  }

  .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;
}
body.dark .search-overlay {
  background: #1e1e1e;
  color: #d2ccc3;
  box-shadow: 0 6px 22px rgba(0,0,0,0.5);
}
.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; }
#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; }
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 .header-domain {
  text-shadow: 1px 1px 5px rgba(0,0,0,0.85);
}
body.dark #scroll-top {
  background-color: #242424;
  color: #958e85;
}

/* LVT witness table */
.page-content .lvt-table-wrap {
  overflow-x: auto;
  margin: 18px 5% 26px;
  -webkit-hyphens: none;
  hyphens: none;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}
@media (max-width: 600px) {
  .page-content .lvt-table-wrap {
    margin-left: 0;
    margin-right: 0;
  }
}
.page-content .lvt-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  background: #fff;
  table-layout: fixed;
}
.page-content .lvt-table caption {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  padding: 4px 0 10px;
  caption-side: top;
  color: #777;
}
.page-content .lvt-table thead th {
  padding: 12px 14px;
  color: #fff;
  font-weight: 600;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.15);
  width: 50%;
  vertical-align: middle;
  line-height: 1.35;
}
.page-content .lvt-table thead th:first-child {
  background-color: #8a1538;
}
.page-content .lvt-table thead th:last-child {
  background-color: #1a5c52;
}
.page-content .lvt-table tbody td {
  padding: 12px 14px;
  border: 1px solid #d4d4d4;
  vertical-align: top;
  background: #fff;
  word-wrap: break-word;
}
.page-content .lvt-table tbody tr:nth-child(even) td {
  background-color: #f6f6f6;
}
.page-content .lvt-table tbody ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-content .lvt-table tbody ul li {
  padding: 0 0 0 1.1em;
  margin: 0 0 0.55em 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-indent: -1.1em;
  font-size: inherit;
  position: relative;
}
.page-content .lvt-table tbody ul li:last-child {
  margin-bottom: 0;
}
.page-content .lvt-table tbody ul li::before {
  content: "•\00a0";
  font-weight: 700;
}
body.dark .page-content .lvt-table-wrap {
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
body.dark .page-content .lvt-table {
  background: #1a1a1a;
  color: #ddd;
}
body.dark .page-content .lvt-table thead th {
  border-color: rgba(255,255,255,0.15);
}
body.dark .page-content .lvt-table tbody td {
  border-color: #3a3a3a;
  background: #1a1a1a;
  box-shadow: none;
}
body.dark .page-content .lvt-table tbody tr:nth-child(even) td {
  background-color: #242424;
}

@media (max-width: 600px) {
  .page-content .lvt-table {
    font-size: 0.85rem;
  }
  .page-content .lvt-table thead th,
  .page-content .lvt-table tbody td {
    padding: 9px 10px;
  }
}

.writing-title-display {
  display: block;
  max-width: 100%;
  background-position: left center;
  background-repeat: no-repeat;
  background-size: contain;
}
.writing-title-display--card {
  width: min(100%, 900px);
  aspect-ratio: 2264 / 96;
  margin: 0 0 2px -6px;
  background-image: url('../images/t-en-01-card-light.png?v=20260505-2');
}
body.dark .writing-title-display--card {
  background-image: url('../images/t-en-01-card-dark.png?v=20260505-2');
}
@media (max-width: 600px) {
  .writing-title-display--card {
    aspect-ratio: 900 / 320;
    margin-left: -4px;
    background-image: url('../images/t-en-01-card-narrow-light.png?v=20260505-3');
  }
  body.dark .writing-title-display--card {
    background-image: url('../images/t-en-01-card-narrow-dark.png?v=20260505-3');
  }
}

/* Page note (translation/version links) */
.page-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 4px 0 22px;
  font-style: italic;
}
.page-note a {
  color: inherit;
}
body.dark .page-note {
  color: #9aa0a6;
}
