/* مساحة آمال — ورقة الأنماط.
   الترتيب: الخط، الأساس المشترك مع لوحة آمال، الترويسة، الرئيسية، البطاقات، التقييم،
   صفحة المكان، صفحة الحي، الصفحات البسيطة، ثم المقاسات الصغيرة.
   عائلة واحدة: IBM Plex Sans Arabic بأوزانها الأصلية 400 و500 و600 و700، بلا أوزان مصطنعة. */

@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/IBMPlexSansArabic-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/IBMPlexSansArabic-Bold.woff2") format("woff2");
}

/* ---------- الأساس ---------- */

:root {
  --font-ui: "IBM Plex Sans Arabic", sans-serif;
  --bg: #f9f7f3;
  --paper: #fffefc;
  --sand: #f2eae1;
  --line: #e7e1d7;
  --ink: #39352e;
  --muted: #6b655d;
  --accent: #626c50;
  --accent-deep: #4f5841;
  --notice-bg: #f6f0e5;
  --notice-line: #d8c8ab;
  --notice-ink: #665139;
  --radius-l: 26px;
  --radius-m: 18px;
  --radius-s: 12px;
}
* {
  box-sizing: border-box;
}
html {
  font-family: var(--font-ui);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
body,
button,
input,
textarea,
select {
  font-family: var(--font-ui);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #929d7d;
  outline-offset: 3px;
}
#main:focus {
  outline: none;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -80px;
  z-index: 10;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-s);
}
.skip-link:focus {
  top: 12px;
}
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 30px 72px;
}

/* ---------- الترويسة ---------- */

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 92px;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  gap: 52px;
}
.brand {
  white-space: nowrap;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.25;
  color: #503e30;
}
.brand .leaf {
  font-size: 21px;
  color: #8c956d;
  margin-right: 5px;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: #a29988;
  text-align: center;
  margin-top: 4px;
}
.nav {
  display: flex;
  gap: 36px;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
}
.nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  border-top: 1px solid transparent;
}
.nav a:hover,
.nav a.active {
  border-bottom-color: var(--accent);
}
.top-actions {
  margin-right: auto;
  display: flex;
  gap: 8px;
}
.icon-btn {
  position: relative;
  border: none;
  background: transparent;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
  display: grid;
  place-items: center;
  border-radius: var(--radius-s);
}
.icon-btn:hover {
  background: #eeeae2;
}
.saved-counter {
  position: absolute;
  top: 3px;
  inset-inline-end: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}
.mobile-menu {
  display: none;
}
.mobile-nav-panel {
  display: none;
}

/* ---------- الرئيسية: الافتتاح ---------- */

/* افتتاح بالكلمات: جملة آمال بحجم العنوان، وصورة الطاولة والدفتر بجانبها.
   الصورة مقتطعة من نموذج قديم وفي أسفلها حقل بحث مرسوم؛ نعرض أعلاها فقط. */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 64px;
  padding: 36px 0 64px;
}
.masthead h1 {
  margin: 0;
  max-width: 11em;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
}
.masthead p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
}
.masthead-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-l);
  background: var(--sand) url("assets/hero.webp") 58% 0 / auto 122% no-repeat;
}

/* ---------- عناوين الأقسام والبحث والتصفية ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}
.section-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.5;
}
.soft-link {
  color: var(--muted);
  font-size: 15px;
}
a.soft-link:hover {
  text-decoration: underline;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px 20px;
  margin: 0 0 26px;
}
.search-box {
  flex: 0 1 320px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
}
.search-box:focus-within {
  outline: 3px solid #929d7d;
  outline-offset: 3px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.search-box input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  min-height: 44px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid #d9d2c6;
  border-radius: 24px;
  color: #555046;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.pill:hover {
  border-color: #b3aa9a;
}
.pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- بطاقة المقهى ---------- */

.cafe-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.photo-link {
  display: block;
  overflow: hidden;
  background: var(--sand);
}
.cafe-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.cafe-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 18px;
}
.cafe-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.cafe-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cafe-line h3 {
  margin: 0;
  min-width: 0;
}
.cafe-title {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cafe-title:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}
.mini-save {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #7d766b;
  border-radius: var(--radius-s);
}
.mini-save:hover {
  background: #f1ede5;
}
.mini-save.saved {
  color: var(--accent);
}
.mini-save.saved .icon {
  fill: var(--accent);
}
.cafe-note {
  margin: 10px 0 0;
  color: #4f4a42;
  font-size: 15px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: auto;
  padding-top: 10px;
}
.card-directions {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #4d593f;
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.inner-page > .cards {
  margin-top: 0;
}
.more-link {
  display: block;
  margin: 22px auto 0;
  min-height: 48px;
  padding: 10px 26px;
  background: transparent;
  border: 1px solid #c9c2b7;
  border-radius: 24px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.more-link:hover {
  border-color: var(--accent);
}

/* البطاقة الكبيرة (أحدث اختيار) وبطاقة الصف (صفحة الحي): الصورة بجانب النص. */
.cafe-card.feature,
.cafe-card.row {
  display: grid;
  border-radius: var(--radius-l);
}
.cafe-card.feature {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
}
.cafe-card.row {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
}
.cafe-card.feature .cafe-img,
.cafe-card.row .cafe-img {
  aspect-ratio: auto;
  min-height: 100%;
}
.cafe-card.feature .photo-link {
  min-height: 440px;
}
.cafe-card.row .photo-link {
  min-height: 300px;
}
.cafe-card.feature .cafe-body {
  padding: 40px 44px 36px;
}
.cafe-card.row .cafe-body {
  padding: 28px 32px 26px;
}
.cafe-card.feature .cafe-meta,
.cafe-card.row .cafe-meta {
  font-size: 15px;
}
.cafe-card.feature .cafe-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.3;
}
.cafe-card.row .cafe-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}
.cafe-card.feature .rating,
.cafe-card.row .rating {
  margin-top: 10px;
}
/* ملاحظة آمال بخط أكبر وخط زيتي على حافتها، مثل هامش الدفتر. */
.cafe-card.feature .cafe-note,
.cafe-card.row .cafe-note,
.quote {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 16px;
  color: var(--ink);
}
.cafe-card.feature .cafe-note {
  margin-top: 22px;
  font-size: 21px;
  line-height: 1.9;
  -webkit-line-clamp: 4;
}
.cafe-card.row .cafe-note {
  margin-top: 18px;
  font-size: 18px;
}
.cafe-card.feature .card-actions,
.cafe-card.row .card-actions {
  padding-top: 22px;
  gap: 10px;
}
.cafe-card.feature .card-directions,
.cafe-card.row .card-directions,
.card-more {
  min-height: 48px;
  padding: 8px 20px;
  gap: 8px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.cafe-card.feature .card-directions,
.cafe-card.row .card-directions {
  background: var(--accent);
  color: #fff;
}
.cafe-card.feature .card-directions:hover,
.cafe-card.row .card-directions:hover {
  background: var(--accent-deep);
}
.card-more {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9c2b7;
  color: var(--ink);
}
.card-more:hover {
  border-color: var(--accent);
}

/* ---------- تقييم آمال ---------- */

.rating {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
  gap: 2px 18px;
}
.rating-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.rating-score {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.rating-value {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.rating-scale {
  color: var(--muted);
  font-size: 15px;
}
.rating-dots {
  display: inline-flex;
  gap: 7px;
}
.dot {
  width: 26px;
  height: 26px;
  flex: none;
}
.dot-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}
.dot-fill {
  fill: var(--accent);
}
/* في البطاقات: سطر واحد أصغر بنفس العناصر. */
.rating-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 4px;
}
.rating-compact .rating-label {
  font-size: 14px;
}
.rating-compact .rating-value {
  font-size: 20px;
  line-height: 1.6;
}
.rating-compact .rating-scale {
  display: none;
}
.rating-compact .rating-dots {
  gap: 4px;
}
.rating-compact .dot {
  width: 15px;
  height: 15px;
}
.cafe-card.feature .rating-compact .rating-value,
.cafe-card.row .rating-compact .rating-value {
  font-size: 28px;
  line-height: 1.4;
}
.cafe-card.feature .rating-compact .rating-label,
.cafe-card.row .rating-compact .rating-label {
  font-size: 15px;
}
.cafe-card.feature .rating-compact .dot,
.cafe-card.row .rating-compact .dot {
  width: 19px;
  height: 19px;
}
.cafe-card.feature .rating-compact .rating-dots,
.cafe-card.row .rating-compact .rating-dots {
  gap: 5px;
}

/* ---------- تنبيه الزوار ---------- */

.visitor-notice {
  margin: 22px 0 0;
  padding: 14px 18px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: 14px;
  color: var(--notice-ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.visitor-notice strong {
  font-weight: 600;
}
.visitor-notice p {
  margin: 2px 0 0;
  line-height: 1.8;
}
.visitor-notice a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.compact-notice {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 14px;
}

/* ---------- الأحياء والدفتر ---------- */

.lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: end;
  margin-top: 72px;
  scroll-margin-top: 16px;
}
.district-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
/* كل حي: صورة صغيرة من أماكن آمال فيه، واسمه، وعدد أماكنه. */
.district-btn {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.district-btn img {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--sand);
}
.district-copy {
  display: grid;
  min-width: 0;
}
.district-copy strong {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.district-copy small {
  color: var(--muted);
  font-size: 15px;
}
.district-btn:hover strong {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}
.journal {
  margin-top: 0;
  padding: 26px 28px 22px;
  background: var(--sand);
  border-radius: var(--radius-m);
}
.journal h3 {
  margin: 0;
  font-size: 19px;
}
.journal p {
  margin: 6px 0 4px;
  color: #5d574e;
  font-size: 16px;
}
.journal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #4d593f;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* ---------- الصفحات الداخلية ---------- */

.inner-page {
  padding-top: 4px;
  min-height: 70vh;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.back .icon {
  width: 18px;
  height: 18px;
}
.back:hover {
  color: var(--ink);
}
.page-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0 20px;
  margin: 8px 0 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.page-header h1 {
  grid-column: 1;
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.page-header p {
  grid-column: 1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 19px;
}
.page-count {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 15px;
}
.inner-page > .filters {
  margin: 0 0 26px;
}
.row-cards {
  display: grid;
  gap: 20px;
}

/* ---------- صفحة المكان ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.detail-photo-wrap {
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--sand);
}
.detail-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.photo-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 14px;
}
.photo-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detail-title-row h1 {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.detail-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 17px;
}
.detail-title-row .mini-save {
  margin-top: 14px;
}
.detail-info > .rating {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.quote {
  margin-top: 28px;
  font-size: 22px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.info-block {
  margin-top: 26px;
}
.info-block h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.suitability {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 5px 16px;
  border: 1px solid #d9d2c6;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
}
.location-panel {
  margin-top: 22px;
}
.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.map-link,
.location-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 24px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 500;
}
.map-link {
  flex: 1 1 auto;
  background: var(--accent);
  color: #fff;
}
.map-link:hover {
  background: var(--accent-deep);
}
.location-view {
  border: 1px solid #c9c2b7;
}
.location-view:hover {
  border-color: var(--accent);
}
.fineprint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- صفحات بسيطة وحالات فارغة ---------- */

.about {
  max-width: 720px;
  margin: 24px 0 0;
}
.about h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.35;
}
.about p {
  margin: 0;
  color: #4f4a42;
  font-size: 20px;
  line-height: 2.1;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 44px 24px;
  border: 1px dashed #d3cabd;
  border-radius: var(--radius-m);
  color: var(--muted);
  text-align: center;
}
.empty strong,
.empty h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}
.empty p {
  margin: 0;
}
.empty button,
.empty-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 6px 22px;
  background: transparent;
  border: 1px solid #c9c2b7;
  border-radius: 24px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.preview-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #f1ede5;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: #5d574e;
  font-size: 15px;
}
.preview-note button {
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
}
.footer {
  margin-top: 8px;
  padding: 26px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- المقاسات المتوسطة ---------- */

@media (max-width: 1000px) {
  .masthead {
    gap: 36px;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    flex: none;
  }
  .cafe-card.feature .cafe-body {
    padding: 30px 30px 28px;
  }
  .cafe-card.feature .cafe-title {
    font-size: 40px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lower {
    grid-template-columns: 1fr;
  }
  .journal {
    margin-top: 0;
  }
  .detail-grid {
    gap: 32px;
  }
}

/* ---------- الجوال ---------- */

@media (max-width: 800px) {
  .container {
    padding: 0 16px 56px;
  }
  .topbar {
    min-height: 72px;
    padding: 8px 16px;
    gap: 8px;
  }
  .brand {
    font-size: 24px;
  }
  .brand .leaf {
    font-size: 18px;
  }
  .brand small {
    font-size: 10px;
  }
  .nav {
    display: none;
  }
  .mobile-menu {
    display: grid;
  }
  .mobile-nav-panel {
    display: grid;
    margin: 0 16px 12px;
    padding: 6px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
  }
  .mobile-nav-panel a {
    display: flex;
    align-items: center;
    min-height: 50px;
    font-size: 17px;
    font-weight: 500;
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav-panel a:last-child {
    border-bottom: 0;
  }

  .masthead {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 10px 0 40px;
  }
  .masthead h1 {
    font-size: 34px;
    line-height: 1.45;
  }
  .masthead p {
    margin-top: 10px;
    font-size: 17px;
  }
  .masthead-photo {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-m);
    background-size: auto 128%;
  }
  .section-head h2 {
    font-size: 24px;
  }
  .toolbar {
    margin-bottom: 20px;
  }
  /* شريط التصفية يُمرَّر أفقيًا حتى حافة الشاشة. */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding: 4px 16px;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .pill {
    flex: none;
  }
  .inner-page > .filters {
    margin-bottom: 20px;
  }

  .cafe-card.feature,
  .cafe-card.row {
    display: flex;
    border-radius: var(--radius-m);
  }
  .cafe-card.feature .photo-link,
  .cafe-card.row .photo-link {
    min-height: 0;
  }
  .cafe-card.feature .cafe-img,
  .cafe-card.row .cafe-img {
    aspect-ratio: 5 / 4;
    min-height: 0;
  }
  .cafe-card.feature .cafe-body,
  .cafe-card.row .cafe-body {
    padding: 18px 20px 20px;
  }
  .cafe-card.feature .cafe-title,
  .cafe-card.row .cafe-title {
    font-size: 34px;
  }
  .cafe-card.feature .cafe-note,
  .cafe-card.row .cafe-note {
    margin-top: 16px;
    font-size: 18px;
  }
  .cafe-card.feature .card-actions,
  .cafe-card.row .card-actions {
    padding-top: 18px;
  }
  .cafe-card.feature .card-directions,
  .cafe-card.row .card-directions,
  .card-more {
    flex: 1 1 auto;
    justify-content: center;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lower {
    margin-top: 52px;
    gap: 24px;
  }
  .district-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .district-btn {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .district-btn img {
    width: 76px;
    height: 76px;
  }
  .district-copy strong {
    font-size: 20px;
  }

  .page-header {
    margin-bottom: 22px;
    padding-bottom: 18px;
  }
  .page-header p {
    font-size: 17px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .detail-photo-wrap {
    border-radius: var(--radius-m);
  }
  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-title-row h1 {
    font-size: 40px;
  }
  .detail-title-row .mini-save {
    margin-top: 6px;
  }
  .detail-info > .rating {
    margin-top: 20px;
    padding-top: 18px;
  }
  .rating-value {
    font-size: 46px;
  }
  .quote {
    margin-top: 22px;
    font-size: 20px;
  }
  .location-actions {
    display: grid;
  }
  .about p {
    font-size: 18px;
  }
  .footer {
    padding: 24px 16px;
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 22px;
    padding-block: 1px;
  }
  .brand small {
    font-size: 9px;
  }
  .masthead h1 {
    font-size: 29px;
  }
  .cafe-card.feature .cafe-title,
  .cafe-card.row .cafe-title {
    font-size: 30px;
  }
  .detail-title-row h1 {
    font-size: 34px;
  }
  .rating-value {
    font-size: 40px;
  }
  .dot {
    width: 23px;
    height: 23px;
  }
  .rating-dots {
    gap: 5px;
  }
  .photo-gallery {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
