/* Page styles: browse */

.hero {
  padding:2.8rem 0 1rem;
  text-align:center;
  display:grid;
  gap:.9rem;
  justify-items:center;
}
.hero h1 {
  font-size:clamp(2.8rem,6vw,4.4rem);
  line-height:1.15;
  margin:0;
}
.hero p {
  margin:0;
  max-width:40rem;
  color:var(--muted);
}
.om {
  display:flex;
  gap:.5rem;
  width:min(46rem,100%);
}
.omw {
  position:relative;
  flex:1;
}
.omw svg {
  position:absolute;
  inset-inline-start:1rem;
  top:50%;
  translate:0 -50%;
  width:1.4rem;
  height:1.4rem;
  color:var(--muted);
  pointer-events:none;
}
.omw input {
  width:100%;
  min-height:3.6rem;
  padding:0 3.2rem 0 1rem;
  font:500 1.15rem var(--font-body);
  border:1.5px solid var(--line-2);
  border-radius:.9rem;
  background:#fff;
  color:var(--slate-900);
  box-shadow:var(--shadow-sm);
}
.omw input:focus-visible {
  outline:2px solid var(--primary);
  outline-offset:2px;
  border-color:var(--primary);
}
.om .qhd-btn {
  min-height:3.6rem;
  border-radius:.9rem;
}
.sug {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:.4rem;
  list-style:none;
  margin:0;
  padding:0;
}
.stat {
  font-size:.9rem;
  color:var(--muted);
}
.sw .in a.chip {
  min-height:2.2rem;
}
.sec {
  padding:2rem 0 .5rem;
  scroll-margin-top:calc(var(--header-h) + 3.5rem);
}
.sec h2 {
  font-size:2.2rem;
  margin:0;
}
.sec>p {
  margin:.2rem 0 0;
  color:var(--muted);
  font-size:.95rem;
}
.map {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(5.4rem,1fr));
  gap:.4rem;
  list-style:none;
  margin:0;
  padding:1rem 0 .5rem;
}
.map a,
.map .z {
  display:grid;
  justify-items:center;
  align-content:center;
  min-height:4.6rem;
  padding:.35rem .2rem;
  border-radius:.6rem;
  border:1px solid var(--line);
  text-align:center;
}
.map a {
  background:color-mix(in srgb,var(--primary) calc(var(--i)*62%),#fff);
  transition:transform .15s,border-color .2s,box-shadow .2s;
}
.map a:hover {
  border-color:var(--amber-600);
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
}
.map a[data-hi] {
  color:#fff;
}
.map .z {
  opacity:.4;
  border-style:dashed;
}
.map small {
  font-size:.72rem;
  opacity:.7;
}
.map b {
  font:700 1.15rem var(--font-display);
  line-height:1.2;
}
.legend {
  display:flex;
  align-items:center;
  gap:.5rem;
  font-size:.8rem;
  color:var(--muted);
}
.legend i {
  width:6rem;
  height:.5rem;
  border-radius:9px;
  background:linear-gradient(90deg,#fff,var(--primary));
  border:1px solid var(--line);
}
.topics {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(13rem,1fr));
  gap:.8rem;
  list-style:none;
  margin:0;
  padding:1rem 0 .5rem;
}
.topics a {
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:1.6rem;
  min-height:8.5rem;
  padding:1.1rem 1.25rem;
  border-radius:.9rem;
  background:var(--c);
  color:#fff;
  transition:transform .2s,box-shadow .2s;
}
.topics a:hover {
  transform:translateY(-3px);
  box-shadow:var(--shadow-lg);
}
.topics b {
  font:700 1.8rem var(--font-display);
  line-height:1.2;
}
.topics small {
  opacity:.85;
}
.cloud {
  display:flex;
  flex-wrap:wrap;
  gap:.45rem .55rem;
  align-items:baseline;
  padding:1rem 0;
}
.cloud a {
  font-size:var(--s);
  line-height:1.5;
  padding:.1em .6em;
  border:1px solid var(--line-2);
  border-radius:999px;
  background:var(--card);
  color:var(--slate-800);
  transition:border-color .2s,color .2s;
}
.cloud a:hover {
  border-color:var(--primary);
  color:var(--primary);
}
.cloud small {
  font-size:.62em;
  color:var(--muted);
  margin-inline-start:.4em;
}
.cloud[hidden] {
  display:none;
}
.tg-more {
  margin-bottom:3.5rem;
}
#res {
  padding:1rem 0 3.5rem;
}
#res[hidden] {
  display:none;
}
.searching .browse {
  display:none;
}
.rg {
  padding:.8rem 0;
}
.rg h2 {
  font-size:1.5rem;
  margin:0 0 .5rem;
}
.rl {
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  list-style:none;
  margin:0;
  padding:0;
}
.rl small {
  color:var(--muted);
  margin-inline-start:.4em;
}
.vl {
  list-style:none;
  margin:0;
  padding:0;
}
.vl a,
.dl a {
  display:flex;
  gap:.7rem;
  padding:.65rem .2rem;
  border-bottom:1px solid var(--line);
  line-height:1.7;
}
.vl a:hover,
.dl a:hover {
  color:var(--primary);
}
.vl b,
.dl b {
  flex:none;
  min-width:2rem;
  color:var(--amber-text);
  font-size:.85rem;
  padding-top:.2rem;
}
dialog.dr {
  position:fixed;
  inset-block:0;
  inset-inline:0 auto;
  margin:0;
  width:min(34rem,100vw);
  max-width:none;
  height:100dvh;
  max-height:none;
  padding:0;
  border:0;
  background:var(--card);
  color:var(--slate-900);
  box-shadow:-20px 0 60px rgba(15,23,42,.3);
}
dialog.dr[open] {
  display:flex;
  flex-direction:column;
  animation:drin .28s ease;
}
dialog.dr::backdrop {
  background:rgba(15,23,42,.5);
}
@keyframes drin {
  from { transform:translateX(100%) }
}

@media(prefers-reduced-motion:reduce) {
  dialog.dr[open] {
    animation:none;
  }
}

body:has(dialog[open]) {
  overflow:hidden;
}
.dh {
  padding:1.1rem 1.3rem .8rem;
  border-bottom:1px solid var(--line);
  display:grid;
  gap:.6rem;
}
.dh .top {
  display:flex;
  align-items:center;
  gap:.5rem;
}
.dh h2 {
  font-size:2rem;
  margin:0;
  flex:1;
  line-height:1.2;
}
.dh .ico {
  width:2.4rem;
  height:2.4rem;
}
.dh .m {
  font-size:.85rem;
  color:var(--muted);
}
.dl {
  flex:1;
  overflow-y:auto;
  margin:0;
  padding:0 1.3rem;
  list-style:none;
}
.df {
  padding:.8rem 1.3rem 1rem;
  border-top:1px solid var(--line);
  display:flex;
  gap:.6rem;
  align-items:center;
}
.df .qhd-btn {
  flex:1;
}

/* Phones.
   The search box is the point of this page, so it gets the whole width and "فاجئني" moves under it rather than
   squeezing the field down to a few characters. The map, the topic tiles and the tag cloud all grow a real tap
   height: at 20px they were readable but not reliably hittable. */
@media (max-width:45rem) {
  .om {
    flex-wrap:wrap;
  }
  .om .omw {
    flex:1 1 100%;
  }
  .om > .qhd-btn {
    flex:1 1 auto;
    justify-content:center;
    min-height:2.9rem;
  }
  .map a,
  .map .z {
    min-height:3.1rem;
  }
  .topics a {
    min-height:4.5rem;
  }
  .cloud a {
    min-height:2.6rem;
    align-items:center;
  }
  .browse-nav {
    gap:.4rem;
  }
  .sw .in a.chip {
    min-height:2.75rem;
  }
  .dr {
    width:100%;
    max-width:100%;
    max-height:88vh;
    margin:auto auto 0;
    border-end-start-radius:0;
    border-end-end-radius:0;
  }
}
