/* 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(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: 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;
}

/* 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: 2.25rem;
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  color: #006384;
  border-bottom: 1px solid #cfdde2;
}

.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 {
  margin-top: 0;
}

.page-content p {
  margin-bottom: 22px;
  font-size: 1.3rem;
}

.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: 12px;
  padding: 14px;
  background-color: #e0eef2;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.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;
}

.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 {
  border-radius: 4px;
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.recommendation-domain {
  bottom: 14px;
  color: #00828a;
  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 0 rgba(255,255,255,0.55), 0 2px 6px rgba(0,0,0,0.25);
}

.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;
  margin: -14px;
  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 h3 {
    font-size: 1.45rem;
  }

  .page-content p,
  .page-content li {
    font-size: 1.3rem;
  }

  .page-content ul {
    padding-left: 0;
    padding-right: 0;
  }

  .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-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 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 h2 {
  color: #7eaebd;
  border-bottom-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 .page-content li {
  background-color: #242424;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
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 .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;
}
@media (max-width: 480px) {
  .content-box {
    padding: 20px 18px;
  }

  .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;
}
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;
}
