@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Noto+Kufi+Arabic:wght@500;700;800&display=swap");

:root {
  --paper: #f5f7fb;
  --paper-light: #ffffff;
  --paper-dark: #e6edf3;
  --brown: #365267;
  --brown-dark: #182a3a;
  --green: #008c89;
  --green-dark: #006d77;
  --accent: #d85f4f;
  --accent-soft: #fff0ec;
  --text: #1f2d3a;
  --muted: #667789;
  --border: rgba(53, 82, 103, 0.16);
  --shadow: 0 16px 34px rgba(24, 42, 58, 0.09);
  --body: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  --heading: "Noto Kufi Arabic", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.9;
  background:
    radial-gradient(circle at 18% 8%, rgba(0,140,137,.13), transparent 30%),
    radial-gradient(circle at 82% 4%, rgba(216,95,79,.12), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #eef3f7 52%, #f8fafc 100%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.top-header {
  padding: 26px 0 12px;
  text-align: center;
}

.site-logo img {
  width: min(100%, 980px);
  max-height: 190px;
  object-fit: contain;
}

.header-date {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--brown-dark);
  font-weight: 800;
}

.header-date span,
.header-date time {
  border: 1px solid rgba(53,82,103,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  padding: 4px 12px;
  box-shadow: 0 6px 16px rgba(24,42,58,.06);
}

.site-title-fallback {
  font-family: var(--heading);
  font-size: clamp(2rem, 6vw, 4.5rem);
  color: var(--brown-dark);
  margin: 0;
}

.nav-strip {
  border-top: 1px solid rgba(53,82,103,.14);
  border-bottom: 1px solid rgba(53,82,103,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(239,246,250,.92)),
    repeating-linear-gradient(90deg, rgba(0,109,119,.035) 0 10px, transparent 10px 20px);
  box-shadow: 0 8px 24px rgba(24,42,58,.05), inset 0 1px 0 rgba(255,255,255,.8);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 22px;
  align-items: center;
  padding: 12px 0;
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.nav-list a {
  color: var(--brown);
  font-weight: 800;
  font-size: 1.06rem;
}

.nav-list a:hover,
.nav-list a.active { color: var(--green-dark); }

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(53,82,103,.18);
  border-radius: 16px;
  padding: 2px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: .75rem .4rem;
}

.search-form input:focus { outline: none; }
.search-form button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: .55rem .75rem;
  cursor: pointer;
}

.main { padding: 34px 0 54px; }

.news-ticker {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  background:
    linear-gradient(135deg, rgba(16,37,49,.98), rgba(54,82,103,.96) 52%, rgba(0,109,119,.92)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 10px, transparent 10px 20px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(16,37,49,.16);
  padding: 12px 16px;
  margin-bottom: 26px;
  overflow: hidden;
}

.news-ticker::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.12), transparent 24%, transparent 76%, rgba(255,255,255,.08));
}

.ticker-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  background: #fff8e8;
  color: var(--brown-dark);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.ticker-badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(216,95,79,.16);
}

.ticker-marquee {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 14px;
  min-width: 0;
  white-space: nowrap;
  color: #ffffff;
  animation: newsTickerScroll 34s linear infinite;
}

.news-ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, 72vw);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  padding: 7px 13px;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.ticker-item:hover {
  background: rgba(255,255,255,.16);
}

.ticker-item-title {
  font-weight: 800;
}

.ticker-item-summary {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,.78);
}

.ticker-item-date {
  color: #bdf4f1;
  font-size: .88rem;
  direction: ltr;
}

@keyframes newsTickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

.cards-strip {
  display: grid;
  gap: 10px;
  margin: 0 auto 18px;
  padding: 18px;
  max-width: 900px;
  border: 1px solid rgba(0,109,119,.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,251,252,.9));
  box-shadow: 0 14px 30px rgba(24,42,58,.07);
}

.cards-strip-slider {
  position: relative;
  padding: 0 48px;
}

.cards-strip-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 0;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.cards-strip-track::-webkit-scrollbar {
  display: none;
}

.cards-strip-item {
  display: grid;
  gap: 10px;
  scroll-snap-align: start;
  min-width: 0;
  color: var(--ink);
}

.cards-strip-item img {
  width: 100%;
  max-height: min(430px, 54vh);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(53,82,103,.12);
  background: #fff;
  padding: 8px;
}

.cards-strip-item span {
  display: none;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
}

.cards-strip .slider-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
}

.cards-strip .slider-dots {
  margin-top: 0;
}

.hero,
.section-shell,
.single-shell {
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,249,252,.96)),
    radial-gradient(circle at top, rgba(0,140,137,.07), transparent 58%);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 32px;
}

.section-title {
  margin: 0;
  text-align: center;
  color: var(--brown-dark);
  font-family: var(--heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.35;
}

.divider {
  width: min(260px, 70%);
  height: 12px;
  margin: 10px auto 24px;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: rgba(54,82,103,.22);
}

.divider::before { right: 0; }
.divider::after { left: 0; }
.divider span {
  display: block;
  width: 36px;
  height: 8px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: var(--green);
}

.latest-grid,
.cards-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.library-gateways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.library-gateway {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head action"
    "links action";
  gap: 10px 16px;
  align-content: space-between;
  min-height: 0;
  padding: 16px 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(241,249,250,.96));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(24,42,58,.045);
}

.library-gateway::before {
  content: "";
  position: absolute;
  inset-block: 14px;
  right: 0;
  width: 4px;
  border-radius: 999px 0 0 999px;
  background: var(--green-dark);
}

.library-gateway-head {
  grid-area: head;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.library-gateway-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 1.18rem;
  line-height: 1.4;
}

.library-gateway-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.library-gateway-links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.library-gateway-links a {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,140,137,.09);
  color: var(--green-dark);
  font-size: .84rem;
  font-weight: 800;
}

.library-gateway .btn {
  grid-area: action;
  align-self: center;
  justify-self: end;
  padding: 8px 13px;
  white-space: nowrap;
}

.popular-frame {
  border: 1px solid rgba(0,109,119,.16);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(237,248,248,.96)),
    radial-gradient(circle at top left, rgba(0,140,137,.11), transparent 42%);
  box-shadow: 0 12px 28px rgba(24,42,58,.065);
  padding: clamp(16px, 2.4vw, 24px);
  margin-bottom: 32px;
}

.popular-frame-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.popular-frame-head h2 {
  margin: 0;
  color: var(--brown-dark);
  font-family: var(--heading);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
}

.popular-frame-head span {
  color: var(--muted);
  font-weight: 800;
  font-size: .92rem;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.popular-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  border: 1px solid rgba(53,82,103,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  padding: 10px 12px;
}

.popular-item:hover {
  border-color: rgba(0,140,137,.3);
  transform: translateY(-1px);
}

.popular-rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(0,140,137,.11);
  color: var(--green-dark);
  font-weight: 900;
}

.popular-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.popular-body strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 1rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-slider {
  position: relative;
  padding: 0 46px;
}

.latest-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 230px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,109,119,.35) transparent;
}

.latest-track::-webkit-scrollbar {
  height: 8px;
}

.latest-track::-webkit-scrollbar-thumb {
  background: rgba(0,109,119,.35);
  border-radius: 999px;
}

.latest-slide {
  scroll-snap-align: start;
  min-width: 0;
}

.latest-slide .material-card {
  height: 100%;
  min-height: 0;
  border-radius: 16px;
  padding: 10px;
}

.latest-slide .material-thumb {
  border-radius: 12px;
  margin-bottom: 8px;
}

.latest-slide .meta-row {
  gap: 5px;
  margin-bottom: 6px;
  font-size: .82rem;
}

.latest-slide .pill,
.latest-slide .hijri-meta {
  padding: 4px 9px;
  font-size: .78rem;
}

.latest-slide .muted {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.latest-slide .card-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 4.2em;
  margin-bottom: 8px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 1.05rem;
  line-height: 1.4;
}

.latest-slide .excerpt {
  display: none;
}

.latest-slide .button-row {
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.latest-slide .icon-btn {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.latest-slide .material-icon {
  width: 18px;
  height: 18px;
}

.slider-arrow {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 38px;
  height: 58px;
  border: 1px solid rgba(53,82,103,.18);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #e8f1f5);
  color: var(--brown-dark);
  box-shadow: 0 10px 22px rgba(24,42,58,.12);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.slider-arrow:hover {
  background: var(--green-dark);
  color: #fff8e8;
}

.slider-next { right: 0; }
.slider-prev { left: 0; }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.slider-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(53,82,103,.24);
}

.slider-dots button.active {
  width: 26px;
  background: var(--green-dark);
}

.material-card,
.category-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(24,42,58,.06);
}

.category-tree {
  display: grid;
  gap: 16px;
}

.category-tree-roots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.category-tree-card {
  position: relative;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(24,42,58,.06);
}

.category-tree-card .card-title {
  margin-bottom: 6px;
}

.category-tree-card-head {
  display: grid;
  gap: 4px;
}

.category-tree-children {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-right: 18px;
  border-right: 2px solid rgba(0,140,137,.16);
}

.category-tree-children .category-tree-card {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,252,.98));
  box-shadow: none;
}

.category-tree-children .category-tree-card::before {
  content: "";
  position: absolute;
  top: 28px;
  right: -20px;
  width: 18px;
  height: 2px;
  background: rgba(0,140,137,.22);
}

.category-tree-children .category-tree-children {
  margin-top: 10px;
  padding-right: 14px;
}

.category-directory {
  display: grid;
  gap: 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .95rem;
}

.breadcrumb a,
.breadcrumb span {
  line-height: 1.8;
}

.breadcrumb a {
  color: var(--green-dark);
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--brown-dark);
}

.category-directory-section {
  display: grid;
  gap: 12px;
}

.category-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(53,82,103,.14);
}

.category-directory-head h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
}

.category-directory-head span {
  color: var(--muted);
  font-size: .92rem;
  white-space: nowrap;
}

.category-content-head {
  margin: 22px 0 12px;
  padding-inline: 0;
}

.category-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.category-directory-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(24,42,58,.05);
}

.category-directory-card:hover {
  border-color: rgba(0,140,137,.38);
  transform: translateY(-1px);
}

.category-directory-card strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.category-directory-card span {
  color: var(--muted);
  font-size: .92rem;
}

.material-list {
  display: grid;
  gap: 12px;
}

.material-list .material-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb meta actions"
    "thumb title actions"
    "thumb excerpt actions";
  align-items: center;
  gap: 8px 16px;
  min-height: 122px;
  border-radius: 16px;
}

.material-list .material-thumb {
  grid-area: thumb;
  width: 132px;
  aspect-ratio: 4 / 3;
  margin: 0;
  border-radius: 12px;
}

.material-list .meta-row {
  grid-area: meta;
  margin: 0;
}

.material-list .card-title {
  grid-area: title;
  margin: 0;
  font-size: 1.18rem;
}

.material-list .excerpt {
  grid-area: excerpt;
  margin: 0;
}

.material-list .button-row {
  grid-area: actions;
  align-self: center;
  justify-content: flex-end;
  margin: 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.pager-count {
  min-width: 64px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: .48;
  pointer-events: none;
}

.material-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, #e7f3f4, #ffffff);
  border: 1px solid rgba(53,82,103,.16);
  margin-bottom: 12px;
}

.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  font-family: var(--heading);
  color: var(--brown);
  font-size: 2.4rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(0,140,137,.11);
  color: var(--green-dark);
  font-weight: 800;
  font-size: .96rem;
}

.hijri-meta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .96rem;
  font-weight: 800;
}

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

.card-title {
  margin: 0 0 10px;
  color: var(--brown-dark);
  font-family: var(--heading);
  font-size: 1.35rem;
  line-height: 1.45;
}

.card-title a:hover { color: var(--green-dark); }

.excerpt {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .94rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.latest-slide .button-row,
.material-card .button-row {
  flex-wrap: nowrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 9px 15px;
  background: var(--green-dark);
  color: #f7ffff;
  font-weight: 800;
  border: 1px solid rgba(0,109,119,.18);
}

button.btn {
  font: inherit;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  border: 1px solid rgba(0,109,119,.18);
  background: var(--green-dark);
  color: #f7ffff;
  font: 800 1rem/1 var(--body);
  cursor: pointer;
}

.material-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.icon-pause {
  display: none;
}

.play-btn.is-playing .icon-play {
  display: none;
}

.play-btn.is-playing .icon-pause {
  display: inline-flex;
}

.icon-btn.secondary {
  background: #ffffff;
  color: var(--brown-dark);
  border-color: var(--border);
}

.play-btn {
  background: var(--accent);
}

.btn.secondary {
  background: #ffffff;
  color: var(--brown-dark);
  border-color: var(--border);
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.type-tabs a {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  color: var(--brown);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 800;
}

.type-tabs a.active,
.type-tabs a:hover {
  background: var(--green-dark);
  color: #fff8e8;
}

.books-slider-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(229,244,244,.98), rgba(205,232,235,.96)),
    radial-gradient(circle at top left, rgba(0,140,137,.18), transparent 46%);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.4vw, 24px);
  margin-bottom: 32px;
  color: var(--brown-dark);
}

.books-side-title {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.books-side-title span {
  writing-mode: horizontal-tb;
  font-family: var(--heading);
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
}

.books-side-title a {
  display: none;
}

.books-slider {
  position: relative;
  min-width: 0;
  padding: 0 42px;
}

.books-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(205px, 248px);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  align-items: center;
  min-height: 285px;
  padding: 0 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,109,119,.28) transparent;
}

.books-track::-webkit-scrollbar {
  height: 8px;
}

.books-track::-webkit-scrollbar-thumb {
  background: rgba(0,109,119,.28);
  border-radius: 999px;
}

.book-slide {
  position: relative;
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: auto;
  gap: 0;
  min-width: 0;
  border: 1px solid rgba(0,109,119,.18);
  border-radius: 18px;
  padding: 9px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 10px 22px rgba(24,42,58,.08);
}

.book-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  border: 1px solid rgba(0,109,119,.14);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover span {
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255,255,255,.76);
}

.book-slide h3 {
  display: none;
}

.book-slide .button-row {
  position: absolute;
  right: 12px;
  bottom: 12px;
  gap: 6px;
  margin: 0;
}

.book-slide .icon-btn {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  padding: 0;
  background: rgba(0,109,119,.92);
  border-color: rgba(255,255,255,.36);
}

.book-slide .btn::before {
  content: "↗";
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
}

.book-slide .btn.secondary {
  background: rgba(255,255,255,.92);
}

.book-slide .btn.secondary::before {
  content: "↓";
  color: var(--brown-dark);
}

.book-slide .icon-btn.secondary {
  background: rgba(255,255,255,.94);
  color: var(--brown-dark);
}

.book-slide .material-icon {
  width: 17px;
  height: 17px;
}

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
}

.single-title {
  margin: 0 0 12px;
  color: var(--brown-dark);
  font-family: var(--heading);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.35;
}

.player-card,
.side-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
}

.share-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(53,82,103,.12);
}

.share-box h2 {
  margin: 0 0 12px;
  color: var(--brown-dark);
  font-family: var(--heading);
  font-size: 1.05rem;
  line-height: 1.5;
}

.share-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 900;
  font-size: .9rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 20px rgba(53,82,103,.08);
}

.share-link .material-icon {
  width: 18px;
  height: 18px;
}

.share-link.whatsapp { background: #168a45; }
.share-link.telegram { background: #2477ad; }
.share-link.facebook { background: #2856a3; }
.share-link.x { background: #1d2d3a; }

.share-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.image-viewer-card {
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
}

.image-viewer-card img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 16px;
}

.file-actions {
  margin-top: 0;
}

.single-neighbor-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.single-neighbor-link {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid rgba(0,140,137,.2);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(24,42,58,.07);
}

.single-neighbor-link span {
  color: var(--teal);
  font-weight: 900;
  font-size: .9rem;
}

.single-neighbor-link strong {
  color: var(--ink);
  font-family: var(--heading);
  font-size: 1rem;
  line-height: 1.45;
}

.single-neighbor-link.next {
  text-align: left;
}

.single-neighbor-link.disabled {
  opacity: .55;
  box-shadow: none;
}

audio { width: 100%; margin-top: 12px; }

.custom-audio-player {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(0,140,137,.18);
  border-radius: 24px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(0,140,137,.12), rgba(255,255,255,.94) 52%, rgba(216,95,79,.09)),
    #ffffff;
  box-shadow: 0 16px 32px rgba(24,42,58,.09);
}

.custom-audio-play {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(0,109,119,.28);
  cursor: pointer;
}

.custom-audio-play:hover {
  background: linear-gradient(135deg, var(--brown-dark), var(--green-dark));
}

.custom-audio-play .material-icon {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.custom-audio-play .icon-pause,
.custom-audio-player.is-playing .custom-audio-play .icon-play {
  display: none;
}

.custom-audio-player.is-playing .custom-audio-play .icon-pause {
  display: inline-flex;
}

.custom-audio-body {
  min-width: 0;
}

.custom-audio-label {
  margin-bottom: 10px;
  color: var(--brown-dark);
  font-weight: 900;
}

.custom-audio-progress {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(53,82,103,.13);
  cursor: pointer;
}

.custom-audio-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

.custom-audio-times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  direction: ltr;
  font-weight: 800;
  font-size: .88rem;
}

.content-box {
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(53,82,103,.14);
  border-radius: 18px;
  padding: 16px;
  margin-top: 16px;
}

.article-content {
  max-width: 860px;
  margin-top: 22px;
  padding: clamp(22px, 4vw, 38px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,253,.96));
  border-color: rgba(53,82,103,.12);
  border-radius: 20px;
  color: #1d2d3a;
  font-size: 1.08rem;
  line-height: 2.25;
  text-align: justify;
  overflow-wrap: anywhere;
}

.article-content br {
  content: "";
  display: block;
  margin-bottom: .7em;
}

.article-content p {
  margin: 0 0 1.05em;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.4em 0 .55em;
  color: var(--brown-dark);
  font-family: var(--heading);
  line-height: 1.5;
}

.article-content a {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer {
  background: #102531;
  color: #eef8fb;
  padding: 28px 0;
}

.footer-simple {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.footer-quote {
  width: min(920px, 100%);
  border: 1px solid rgba(126,224,220,.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(126,224,220,.08));
  padding: 12px 16px;
  color: rgba(238,248,251,.92);
  line-height: 1.9;
}

.footer-quote span {
  display: block;
  margin-bottom: 2px;
  color: #7ee0dc;
  font-weight: 900;
  font-size: .92rem;
}

.footer-quote strong {
  display: block;
  font-family: var(--heading);
  font-size: clamp(.98rem, 1.7vw, 1.18rem);
  font-weight: 800;
}

.footer a {
  color: rgba(238,248,251,.84);
}

.footer a:hover { color: #7ee0dc; }

.footer-social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.footer-social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255,255,255,.06);
}

.footer-social-links a:hover {
  background: rgba(126,224,220,.12);
  border-color: rgba(126,224,220,.32);
}

.footer-designer {
  color: rgba(238,248,251,.76);
  font-size: .95rem;
}

.footer-designer a {
  color: #ffffff;
  font-weight: 800;
}

.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .nav-inner,
  .single-layout,
  .books-slider-shell {
    grid-template-columns: 1fr;
  }
  .nav-list { gap: 12px 14px; }
  .search-form {
    max-width: 520px;
    margin-inline: auto;
  }
  .books-side-title {
    min-height: auto;
    align-items: center;
  }
  .books-side-title span {
    writing-mode: horizontal-tb;
  }
  .books-slider {
    padding: 0 36px;
  }
  .books-track {
    min-height: 210px;
  }
  .popular-frame-head {
    align-items: start;
    flex-direction: column;
  }
  .popular-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top-header { padding-top: 16px; }
  .header-date {
    gap: 6px;
    font-size: .86rem;
  }
  .header-date span,
  .header-date time {
    padding: 3px 9px;
  }
  .container {
    width: min(100% - 20px, 1180px);
  }
  .nav-inner {
    gap: 10px;
    padding: 10px 0;
  }
  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .nav-list li {
    min-width: 0;
  }
  .nav-list a {
    display: block;
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(53,82,103,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.66);
    padding: 6px 8px;
    font-size: .92rem;
  }
  .search-form {
    max-width: none;
    border-radius: 14px;
    padding: 2px 6px;
  }
  .search-form input {
    padding: .62rem .35rem;
    font-size: 1rem;
  }
  .search-form button {
    padding: .48rem .55rem;
  }
  .main { padding-top: 22px; }
  .news-ticker {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    border-radius: 18px;
    padding: 12px;
  }
  .ticker-badge {
    width: fit-content;
  }
  .ticker-marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ticker-item {
    max-width: 82vw;
  }
  .ticker-item-summary,
  .ticker-item-date {
    display: none;
  }
  .hero,
  .section-shell,
  .single-shell { border-radius: 20px; }
  .latest-slider { padding: 0 0 4px; }
  .latest-track { grid-auto-columns: minmax(180px, 72%); }
  .cards-strip-slider { padding: 0 0 4px; }
  .books-slider { padding: 0 0 4px; }
  .books-track { grid-auto-columns: minmax(196px, 78%); }
  .slider-arrow { display: none; }
  .latest-grid,
  .cards-grid,
  .category-grid { grid-template-columns: 1fr; }
  .material-list .material-card {
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-areas:
      "thumb meta"
      "thumb title"
      "thumb excerpt"
      "actions actions";
    align-items: start;
    gap: 8px 12px;
    min-height: 0;
  }
  .material-list .material-thumb {
    width: 86px;
  }
  .material-list .button-row {
    justify-content: flex-start;
  }
  .single-neighbor-nav {
    grid-template-columns: 1fr;
  }
  .single-neighbor-link.next {
    text-align: right;
  }
  .category-tree-roots {
    grid-template-columns: 1fr;
  }
  .category-tree-card {
    border-radius: 18px;
    padding: 13px;
  }
  .category-tree-children {
    padding-right: 12px;
  }
  .category-tree-children .category-tree-card::before {
    right: -14px;
    width: 12px;
  }
  .custom-audio-player {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    border-radius: 18px;
    padding: 12px;
  }
  .custom-audio-play {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
  .custom-audio-play .material-icon {
    width: 28px;
    height: 28px;
  }
}
