/*
Theme Name: IslamBieb
Theme URI: https://islambieb.nl/
Author: IslamBieb
Author URI: https://islambieb.nl/
Description: IslamBieb – De Maktaba – Digitale bibliotheek van authentieke islamitische kennis in het Nederlands.
Version: 3.1.3
Text Domain: islambieb
*/

/* ===========================================================
   IslamBieb — De Maktaba  ·  Design System
   =========================================================== */
:root {
  --paper: #FAF8F2;
  --paper-2: #F3EFE6;
  --surface: #FFFFFF;
  --ink: #17201B;
  --ink-soft: #3B453E;
  --muted: #6B736C;
  --faint: #9AA199;
  --line: #E7E2D6;
  --line-soft: #F0EBE0;
  --primary: #154A37;
  --primary-700: #0F3A2B;
  --primary-50: #EAF1ED;
  --primary-100: #D8E6DE;
  --accent: #A9824C;
  --accent-soft: #F3ECDF;
  --danger: #9B3B2E;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --arab: 'Amiri', 'Noto Naskh Arabic', serif;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 27, .05), 0 1px 1px rgba(23, 32, 27, .04);
  --shadow: 0 4px 18px -6px rgba(23, 32, 27, .14), 0 2px 6px -2px rgba(23, 32, 27, .08);
  --shadow-lg: 0 18px 50px -18px rgba(23, 32, 27, .30);
  --maxw: 1120px;
  --nav-h: 64px;
  --bottom-h: 66px;
}

* {
  box-sizing: border-box
}

[hidden] {
  display: none !important
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit
}

img {
  display: block;
  max-width: 100%
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 16px;
  color: inherit
}

::selection {
  background: var(--primary-100)
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15
}

p {
  margin: 0
}

.serif {
  font-family: var(--serif)
}

.arab {
  font-family: var(--arab);
  direction: rtl
}

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px
}

.app {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom))
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px
}

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 242, .86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--nav-h)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: none;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 21px;
  height: 21px
}

.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0
}

.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -.02em
}

.brand-name b {
  color: var(--primary);
  font-weight: 600
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 3px
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: background .15s, color .15s;
}

.icon-btn:hover {
  background: var(--paper-2);
  color: var(--ink)
}

.icon-btn svg {
  width: 21px;
  height: 21px
}

.btn-ghost-pill {
  display: none;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  border: 1px solid var(--primary-100);
  background: var(--primary-50);
  transition: background .15s;
}

.btn-ghost-pill:hover {
  background: var(--primary-100)
}

.btn-ghost-pill svg {
  width: 17px;
  height: 17px
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border-radius: 13px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(.99)
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm)
}

.btn-primary:hover {
  background: var(--primary-700)
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line)
}

.btn-secondary:hover {
  border-color: var(--ink-soft);
  background: #fff
}

.btn-block {
  width: 100%
}

.btn-sm {
  height: 42px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 11px
}

/* =========================================================
   SEARCH
   ========================================================= */
.search {
  position: relative;
  display: flex;
  align-items: center
}

.search svg.lead {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  color: var(--faint);
  pointer-events: none
}

.search input {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 46px 0 46px;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}

.search input::placeholder {
  color: var(--faint)
}

.search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
  outline: none
}

.search .clear {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: none;
  place-items: center;
  color: var(--muted)
}

.search .clear.show {
  display: grid
}

.search .clear:hover {
  background: var(--paper-2)
}

/* =========================================================
   FILTER ROW (chips)
   ========================================================= */
.chiprow {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 18px;
  margin: 0 -18px
}

.chiprow::-webkit-scrollbar {
  display: none
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all .15s;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink-soft)
}

.chip .n {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums
}

.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

.chip[aria-pressed="true"] .n {
  color: rgba(255, 255, 255, .7)
}

.langseg {
  display: inline-flex;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--line-soft)
}

.langseg button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  cursor: pointer;
}

.langseg button .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint)
}

.langseg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm)
}

.langseg button[aria-pressed="true"] .dot {
  background: var(--accent)
}

/* =========================================================
   BOOK GRID + CARD
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 14px
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line)
}

.card-cover {
  position: relative;
  aspect-ratio: 3/4.1;
  background: var(--paper-2);
  overflow: hidden
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease
}

.card:hover .card-cover img {
  transform: scale(1.04)
}

.card-cover .skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, var(--paper-2) 30%, #fff 50%, var(--paper-2) 70%);
  background-size: 200% 100%;
  animation: sh 1.3s linear infinite
}

@keyframes sh {
  to {
    background-position: -200% 0
  }
}

.langbadge {
  position: absolute;
  top: 9px;
  left: 9px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(23, 32, 27, .74);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .02em;
}

.langbadge .fl {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent)
}

.card-body {
  padding: 13px 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1
}

.card-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary)
}

.card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.card-author {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: auto;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px
}

.sec-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em
}

.sec-meta {
  font-size: 13px;
  color: var(--muted)
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: 26px 0 6px;
  position: relative
}

.hero h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1
}

.hero p {
  color: var(--ink-soft);
  margin-top: 10px;
  font-size: 15.5px;
  max-width: 46ch
}

.hero .arwrap {
  font-family: var(--arab);
  font-size: 19px;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 6px
}

.resultline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 14px
}

.resultline .count {
  font-size: 13.5px;
  color: var(--muted)
}

.resultline .count b {
  color: var(--ink);
  font-weight: 600
}

.sortbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer
}

.sortbtn svg {
  width: 16px;
  height: 16px;
  color: var(--muted)
}

/* =========================================================
   HERO BADGES
   ========================================================= */
.herobadges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px
}

.hbadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm)
}

.hbadge svg {
  width: 15px;
  height: 15px;
  color: var(--primary)
}

.hbadge.free {
  background: var(--primary-50);
  border-color: var(--primary-100);
  color: var(--primary)
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted)
}

.empty .ic {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--faint)
}

.empty .ic svg {
  width: 28px;
  height: 28px
}

.empty h3 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 6px
}

.empty p {
  font-size: 14.5px;
  max-width: 34ch;
  margin: 0 auto
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
}

.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .15s;
}

.bottomnav a svg {
  width: 23px;
  height: 23px
}

.bottomnav a[aria-current="page"] {
  color: var(--primary)
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */
.backbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0
}

.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 13px 0 9px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--surface)
}

.backbtn:hover {
  background: var(--paper-2)
}

.backbtn svg {
  width: 18px;
  height: 18px
}

.detail-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start
}

.detail-cover {
  flex: none;
  width: 132px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-2);
  aspect-ratio: 3/4.1;
  cursor: zoom-in
}

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

.detail-meta {
  flex: 1;
  min-width: 0;
  padding-top: 2px
}

.detail-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-50);
  padding: 5px 10px;
  border-radius: 7px
}

.detail-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 12px 0 8px
}

.detail-author {
  font-size: 15px;
  color: var(--ink-soft)
}

.detail-author b {
  font-weight: 600;
  color: var(--ink)
}

.detail-arab {
  font-family: var(--arab);
  direction: rtl;
  font-size: 21px;
  color: var(--accent);
  margin: 2px 0 10px;
  line-height: 1.3
}

.metalist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px
}

.metatag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500
}

.metatag svg {
  width: 15px;
  height: 15px;
  color: var(--muted)
}

.metatag b {
  color: var(--ink);
  font-weight: 600
}

.metatag.dl b {
  color: var(--primary)
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px
}

.vol-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.vol-row .btn {
  flex: 1;
  min-width: 0
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-top: 22px;
  box-shadow: var(--shadow-sm)
}

.panel h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin-bottom: 10px
}

.panel p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6
}

.panel .empty-note {
  color: var(--muted);
  font-size: 14px;
  font-style: italic
}

.sharebtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  border: 1px solid var(--primary-100);
  background: var(--primary-50);
  margin-left: auto;
  transition: background .15s;
  cursor: pointer
}

.sharebtn:hover {
  background: var(--primary-100)
}

.sharebtn svg {
  width: 17px;
  height: 17px
}

/* =========================================================
   BOOK PREVIEW GALLERY
   ========================================================= */
.preview {
  margin-top: 26px
}

.preview .sec-title {
  margin-bottom: 4px
}

.preview-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 52ch
}

.preview-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 18px 8px;
  margin: 0 -18px
}

.preview-grid::-webkit-scrollbar {
  display: none
}

.pv {
  flex: none;
  margin: 0;
  cursor: zoom-in;
  width: 150px
}

.pv.wide {
  width: 230px
}

.pv-img {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s
}

.pv:hover .pv-img {
  transform: translateY(-3px);
  box-shadow: var(--shadow)
}

.pv-img img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 120px;
  object-fit: cover
}

.pv-img .zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(23, 32, 27, .72);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(3px)
}

.pv-img .zoom svg {
  width: 16px;
  height: 16px
}

.pv figcaption {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(18, 22, 19, .94);
  display: none;
  flex-direction: column;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px)
}

.lightbox.open {
  display: flex;
  animation: lbfade .2s ease
}

@keyframes lbfade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.lb-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  padding-top: calc(14px + env(safe-area-inset-top))
}

.lb-cap {
  font-weight: 600;
  font-size: 15px
}

.lb-count {
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
  font-variant-numeric: tabular-nums
}

.lb-x {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  cursor: pointer
}

.lb-x:hover {
  background: rgba(255, 255, 255, .2)
}

.lb-x svg {
  width: 22px;
  height: 22px
}

.lb-stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0 8px
}

.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  touch-action: pan-y
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  cursor: pointer
}

.lb-nav:hover {
  background: rgba(255, 255, 255, .26)
}

.lb-nav svg {
  width: 24px;
  height: 24px
}

.lb-prev {
  left: 12px
}

.lb-next {
  right: 12px
}

.lb-nav.hide {
  display: none
}

.lb-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: calc(14px + env(safe-area-inset-bottom))
}

.lb-thumbs::-webkit-scrollbar {
  display: none
}

.lb-thumbs button {
  flex: none;
  width: 46px;
  height: 60px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: .5;
  transition: all .15s;
  background: #222;
  cursor: pointer
}

.lb-thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.lb-thumbs button[aria-current="true"] {
  opacity: 1;
  border-color: #fff
}

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-h, 0px) + 22px);
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  display: flex;
  align-items: center;
  gap: 9px
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0)
}

.toast svg {
  width: 18px;
  height: 18px;
  color: #8FD9B0
}

/* =========================================================
   FORMS (insturen pagina)
   ========================================================= */
.page-head {
  padding: 8px 0 18px
}

.page-head .eyebrow {
  margin-bottom: 10px
}

.page-head h1 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.025em
}

.page-head p {
  color: var(--ink-soft);
  margin-top: 10px;
  font-size: 15px;
  max-width: 54ch
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 6px
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink)
}

.field .hint {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400
}

.field .req {
  color: var(--danger)
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}

.textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.5
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
  outline: none
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B736C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 30px 20px;
  text-align: center;
  transition: all .18s;
  cursor: pointer
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--primary);
  background: var(--primary-50)
}

.dropzone .dz-ic {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--primary-50);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 14px
}

.dropzone.drag .dz-ic {
  background: #fff
}

.dropzone .dz-ic svg {
  width: 26px;
  height: 26px
}

.dropzone h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px
}

.dropzone p {
  font-size: 13px;
  color: var(--muted)
}

.dropzone .browse {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline
}

.filechip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px
}

.filechip .fic {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #fff;
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none
}

.filechip .fic svg {
  width: 20px;
  height: 20px
}

.filechip .fmeta {
  flex: 1;
  min-width: 0
}

.filechip .fname {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.filechip .fsize {
  font-size: 12px;
  color: var(--muted)
}

.filechip .frm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
  cursor: pointer
}

.filechip .frm:hover {
  background: #fff;
  color: var(--danger)
}

.formnote {
  display: flex;
  gap: 11px;
  background: var(--accent-soft);
  border: 1px solid #E8DcC4;
  border-radius: var(--r);
  padding: 13px 15px;
  font-size: 13px;
  color: #6B5836;
  line-height: 1.5
}

.formnote svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
  margin-top: 1px
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-hero {
  padding: 24px 0 4px
}

.about-hero .arwrap {
  font-family: var(--arab);
  font-size: 22px;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 10px
}

.about-hero h1 {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -.025em;
  line-height: 1.12
}

.prose {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.7
}

.prose p {
  margin-bottom: 15px
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm)
}

.stat .num {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  color: var(--primary)
}

.stat .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px
}

.valuecard {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft)
}

.valuecard .vic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none
}

.valuecard .vic svg {
  width: 21px;
  height: 21px
}

.valuecard h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 4px
}

.valuecard p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55
}

.contactrow {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-top: 12px
}

.contactrow .cic {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--paper-2);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none
}

.contactrow .cic svg {
  width: 20px;
  height: 20px
}

.contactrow .clabel {
  font-size: 12px;
  color: var(--muted)
}

.contactrow .cval {
  font-size: 15px;
  font-weight: 600
}

.contactrow .go {
  margin-left: auto;
  color: var(--faint)
}

/* =========================================================
   FOOTER
   ========================================================= */
.credit {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7
}

.credit .by {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--ink)
}

.credit .by .vch {
  color: #1FA463
}

.credit .jalla {
  color: var(--accent);
  font-family: var(--arab);
  font-size: 15px;
  padding: 0 2px
}

.foot {
  margin-top: 36px;
  padding: 26px 0 20px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--muted);
  font-size: 13px
}

.foot .fbrand {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 6px
}

.foot .arab {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px
}

.success {
  text-align: center;
  padding: 38px 20px 20px
}

.success .sic {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  animation: pop .4s ease
}

@keyframes pop {
  0% {
    transform: scale(.6);
    opacity: 0
  }

  60% {
    transform: scale(1.06)
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

.success .sic svg {
  width: 36px;
  height: 36px
}

.success h2 {
  font-family: var(--serif);
  font-size: 23px;
  margin-bottom: 10px
}

.success p {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 40ch;
  margin: 0 auto 22px
}

.view {
  animation: fade .32s ease
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade {
    from {
      opacity: .4;
      transform: translateY(7px)
    }

    to {
      opacity: 1;
      transform: none
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .view {
    animation: none
  }
}

/* =========================================================
   DESKTOP
   ========================================================= */
@media(min-width:680px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px
  }

  .hero h1 {
    font-size: 38px
  }

  .detail-cover {
    width: 180px
  }

  .detail-title {
    font-size: 30px
  }
}

@media(min-width:900px) {
  :root {
    --bottom-h: 0px
  }

  .app {
    padding-bottom: 40px
  }

  .grid {
    grid-template-columns: repeat(4, 1fr)
  }

  .bottomnav {
    display: none
  }

  .btn-ghost-pill {
    display: inline-flex
  }

  .topnav-links {
    display: flex !important
  }

  .hero h1 {
    font-size: 44px
  }

  .detail-hero {
    gap: 28px
  }

  .detail-cover {
    width: 230px
  }

  .wrap {
    padding: 0 28px
  }

  .detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start
  }
}

.topnav-links {
  display: none;
  align-items: center;
  gap: 4px;
  margin-right: 6px
}

.topnav-links a {
  height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  transition: background .15s, color .15s
}

.topnav-links a:hover {
  background: var(--paper-2)
}

.topnav-links a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-50)
}