/* تجربة الجوال — شريط سفلي بأيقونات ملوّنة، لوحة «المزيد»، وأهداف لمس مريحة. */
html { -webkit-text-size-adjust: 100%; }
a, button { touch-action: manipulation; }
html.saif-lock, html.saif-lock body { overflow: hidden; }

.saif-tabbar, .saif-more { display: none; }

@media (max-width: 899px) {
	body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
	header.wp-block-template-part { position: sticky; top: 0; z-index: 800; }
	.saif-header .wp-block-navigation { display: none; }
	.saif-header .alignwide { justify-content: center; position: relative; min-height: 44px; }
	body.admin-bar header.wp-block-template-part { top: 46px; }

	/* أزرار الهيدر */
	.saif-hbtn { position: absolute; top: 50%; transform: translateY(-50%); margin: 0 !important; width: 42px; height: 42px; display: grid; place-items: center; border: 0; padding: 0; border-radius: 10px; background: var(--wp--preset--color--paper); color: var(--wp--preset--color--charcoal); cursor: pointer; }
	.saif-hbtn svg { width: 22px; height: 22px; }
	.saif-hbtn--search { inset-inline-start: 0; }
	.saif-hbtn--user { inset-inline-end: 0; }

	/* الرئيسية: الهيدر شفاف فوق الصورة، ويصير كريمياً عند التمرير */
	body.home .saif-header.has-white-background-color { background-color: transparent !important; border-bottom-color: transparent; transition: background-color .2s, border-color .2s; }
	body.home.saif-scrolled .saif-header.has-white-background-color { background-color: rgba(251, 238, 220, .96) !important; border-bottom-color: var(--saif-line, #E8DECF); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
	body.home:not(.saif-scrolled) .saif-hbtn { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
	body.home .saif-hero2 { margin-top: calc(-1 * var(--saif-hh, 66px)); }
	body.home .saif-hero2__in { min-height: calc(340px + var(--saif-hh, 66px)); }
	body.home .saif-hero2__txt { padding-top: calc(24px + var(--saif-hh, 66px)); }

	/* شريط سفلي أبيض ملاصق، والتبويب النشط كبسولة كهرمانية خلف الأيقونة */
	.saif-tabbar { position: fixed; inset: auto 0 0 0; z-index: 900; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid #E8DECF; box-shadow: 0 -4px 14px rgba(43, 39, 36, .08); padding: 0 6px env(safe-area-inset-bottom); }
	.saif-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; padding: 6px 2px 6px; color: #7A6A5C; text-decoration: none; font: 500 11.5px/1.2 var(--wp--preset--font-family--body); background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
	.saif-tab i { width: 34px; height: 30px; display: grid; place-items: center; transition: transform .2s, background .2s; }
	.saif-tab .saif-ic { width: 24px; height: 24px; }
	.saif-tab[aria-current="page"] { color: #8A4E10; font-weight: 600; }
	.saif-tab[aria-current="page"] i { width: 54px; height: 32px; border-radius: 16px; background: #FFB162; color: #2B2724; }
	.saif-tab[aria-current="page"] .saif-ic { width: 24px; height: 24px; }
	.saif-tab:active i { transform: scale(.92); }

	.saif-more { position: fixed; inset: 0; z-index: 1000; display: block; }
	.saif-more[hidden] { display: none; }
	.saif-more__scrim { position: absolute; inset: 0; background: rgba(43, 39, 36, .5); opacity: 0; transition: opacity .2s; }
	.saif-more__sheet { position: absolute; inset: auto 0 0 0; background: #fff; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; transform: translateY(100%); transition: transform .22s ease; max-height: 80dvh; overflow: auto; }
	.saif-more.is-open .saif-more__scrim { opacity: 1; }
	.saif-more.is-open .saif-more__sheet { transform: none; }
	.saif-more__grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--wp--preset--color--sand-soft); margin: 4px auto 12px; }
	.saif-more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
	.saif-more a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 1px solid var(--saif-line, #E8DECF); border-radius: 10px; background: #fff; color: var(--wp--preset--color--charcoal); text-decoration: none; font: 500 15px var(--wp--preset--font-family--body); }
	.saif-more a i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #F4EADB; background: color-mix(in srgb, var(--ic) 13%, #fff); }
	.saif-more a .saif-ic { width: 24px; height: 24px; }

	/* صفحات المحتوى */
	.wp-block-post-title { font-size: 1.8rem; }
	.wp-element-button, .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
	input, select, textarea { font-size: 16px; }
}

/* زر البحث على الحاسوب: بجانب القائمة */
@media (min-width: 900px) {
	body.home .saif-header.has-white-background-color { background-color: #FBEEDC !important; border-bottom-color: transparent; }
	body.home .saif-hbtn { background: rgba(255, 255, 255, .7); }
	.saif-hbtn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; padding: 0; border-radius: 10px; background: var(--wp--preset--color--paper); color: var(--wp--preset--color--charcoal); cursor: pointer; }
	.saif-hbtn svg { width: 20px; height: 20px; }
	.saif-hbtn--user { display: none; }
}

/* لوحة البحث العام (كل الشاشات) */
.saif-search-panel { position: fixed; inset: 0; z-index: 1100; }
.saif-search-panel[hidden] { display: none; }
.saif-search-panel__scrim { position: absolute; inset: 0; background: rgba(43, 39, 36, .5); opacity: 0; transition: opacity .18s; }
.saif-search-panel__box { position: absolute; inset: 0 0 auto 0; max-width: 680px; margin: 0 auto; max-height: 88dvh; display: flex; flex-direction: column; background: #fff; border-radius: 0 0 14px 14px; box-shadow: 0 14px 40px rgba(43, 39, 36, .25); transform: translateY(-16px); opacity: 0; transition: transform .18s, opacity .18s; }
.saif-search-panel.is-open .saif-search-panel__scrim { opacity: 1; }
.saif-search-panel.is-open .saif-search-panel__box { transform: none; opacity: 1; }
body.admin-bar .saif-search-panel__box { top: 46px; }
.saif-search-panel__form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--saif-line, #E8DECF); }
.saif-search-panel__form .saif-ic { width: 22px; height: 22px; color: var(--wp--preset--color--clay); flex: none; }
.saif-search-panel__form input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; font: 500 1.05rem var(--wp--preset--font-family--body); color: var(--wp--preset--color--ink); outline: 0; -webkit-appearance: none; appearance: none; }
.saif-search-panel__close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--wp--preset--color--paper); color: var(--wp--preset--color--charcoal); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.saif-search-panel__results { overflow-y: auto; padding: 6px 14px 16px; }
.saif-search-panel__results h3 { margin: 14px 0 6px; font-size: .85rem; font-weight: 600; color: var(--wp--preset--color--clay); }
.saif-search-panel__results ul { list-style: none; margin: 0; padding: 0; }
.saif-search-panel__results a { display: flex; flex-direction: column; min-height: 52px; justify-content: center; padding: 6px 10px; border-radius: 10px; color: var(--wp--preset--color--ink); text-decoration: none; }
.saif-search-panel__results a:hover, .saif-search-panel__results a:focus-visible { background: var(--wp--preset--color--paper); }
.saif-search-panel__results a b { font-weight: 600; font-size: 1rem; }
.saif-search-panel__results a small { color: var(--wp--preset--color--clay); font-size: .8rem; }
.saif-search-panel__hint { margin: 14px 0; color: var(--wp--preset--color--clay); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { .saif-more__sheet, .saif-more__scrim, .saif-tab i, .saif-search-panel__box, .saif-search-panel__scrim { transition: none; } }
