/*
Theme Name: Saif Bin Hamed
Theme URI: https://saifbinhamed.com/
Author: Saif Bin Hamed Family
Description: قالب موقع عائلة سيف بن حمد — قالب كتل (Block Theme) عربي بالكامل (RTL) بخط ريدكس برو الحديث، انحناءات بسيطة، وأيقونات ملوّنة.
Version: 1.10.0
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: saif-bin-hamed
*/

/* التنسيقات الأساسية تأتي من theme.json؛ هنا فقط ما لا يغطيه. */

:root {
	--saif-radius: 10px;
	--saif-shadow: 0 2px 10px rgba(43, 39, 36, .07);
	--saif-shadow-lg: 0 8px 22px rgba(43, 39, 36, .12);
	--saif-line: #E8DECF;
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.saif-ic { width: 24px; height: 24px; display: block; }
.saif-ic .f { fill: currentColor; fill-opacity: .2; stroke: none; }

/* زخرفة المعيّن المستوحاة من الشعار */
.saif-diamond-rule { display: flex; align-items: center; gap: .75rem; margin-block: 1rem; color: var(--wp--preset--color--sand); }
.saif-diamond-rule::before, .saif-diamond-rule::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .6; }
.saif-diamond-rule > span { width: .55rem; height: .55rem; background: currentColor; transform: rotate(45deg); }

/* الهيدر */
.saif-header { border-block-end: 1px solid var(--saif-line); }
.saif-brand { font-size: 1.15rem; font-weight: 700; color: var(--wp--preset--color--charcoal) !important; text-decoration: none; line-height: 1.4; }
.saif-header .wp-block-navigation a { font-weight: 500; }
.saif-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--bronze); }

/* ───────── الرئيسية ───────── */
.saif-home { max-width: 1180px; margin: 0 auto !important; padding: 12px 16px 8px; }
main.wp-block-group { margin-block-start: 0; }
main.wp-block-group > * { margin-block-start: 0; }
.saif-home h1, .saif-home h2 { margin: 0; }

.saif-hero2 { position: relative; overflow: hidden; background: #E9D5B8 url("assets/img/hero-m.webp") left center / cover no-repeat; }
.saif-hero2::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(251, 238, 220, .62) 0%, rgba(251, 238, 220, .56) 38%, rgba(251, 238, 220, .3) 52%, rgba(251, 238, 220, 0) 68%); pointer-events: none; }
.saif-hero2__in { max-width: 1180px; margin: 0 auto; position: relative; min-height: 340px; }
.saif-hero2__txt { width: 56%; padding: 24px 16px 26px 4px; position: relative; z-index: 1; }
.saif-hero2__txt small { display: block; color: var(--wp--preset--color--henna); font-weight: 600; font-size: .72rem; letter-spacing: .16em; }
.saif-hero2__txt h1 { font-size: clamp(1.6rem, 7vw, 3rem); line-height: 1.25; font-weight: 700; color: var(--wp--preset--color--ink); margin-block: 4px 8px; }
.saif-hero2__txt h1 span { display: block; font-size: .5em; font-weight: 400; color: var(--wp--preset--color--clay); }
.saif-hero2__txt p { margin: 0; color: #3A3029; font-weight: 500; font-size: .85rem; line-height: 1.75; max-width: 38ch; }
.saif-hero2__cta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
.saif-hero2__cta .saif-btn2 { min-height: 36px; padding: 0 16px; font-size: .8rem; border-radius: 8px; box-shadow: 0 3px 8px rgba(70, 64, 60, .2); }

.saif-btn2 { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: var(--saif-radius); background: var(--wp--preset--color--charcoal); color: #fff !important; font-weight: 500; font-size: .95rem; text-decoration: none; box-shadow: 0 4px 12px rgba(70, 64, 60, .25); transition: transform .15s, background .15s; }
.saif-btn2:hover { background: var(--wp--preset--color--ink); transform: translateY(-1px); }
.saif-btn2--ghost { background: rgba(255, 255, 255, .75); color: var(--wp--preset--color--charcoal) !important; box-shadow: none; border: 1px solid rgba(70, 64, 60, .25); }
.saif-btn2--ghost:hover { background: #fff; }

.saif-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.saif-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; background: #fff; border: 1px solid var(--saif-line); border-radius: var(--saif-radius); color: var(--wp--preset--color--charcoal); text-decoration: none; font-weight: 500; font-size: .92rem; box-shadow: var(--saif-shadow); transition: transform .15s, box-shadow .15s; }
.saif-tile:hover { transform: translateY(-2px); box-shadow: var(--saif-shadow-lg); }
.saif-tile i, .saif-more a i, .saif-tab i { font-style: normal; color: var(--ic, #46403C); }
.saif-tile i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--saif-radius); background: #F4EADB; background: color-mix(in srgb, var(--ic) 13%, #fff); }
.saif-tile i .saif-ic { width: 28px; height: 28px; }

.saif-sh { font-size: 1.1rem !important; font-weight: 600; color: var(--wp--preset--color--charcoal); margin-block: 22px 10px !important; }
.saif-shrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.saif-shrow a { font-size: .85rem; color: var(--wp--preset--color--bronze); text-decoration: none; }
/* تعداد العائلة: شريط بعرض الشاشة بثلاثة ألوان */
.saif-numsec { max-width: none; margin: 0 !important; padding: 12px 0 0; }
.saif-numsec { padding-top: 0; }
.saif-numsec .saif-sh { max-width: none; margin: 0 !important; padding: 12px 16px; text-align: center; background: #E6D5BC; color: var(--wp--preset--color--charcoal); }
.saif-nums { display: grid; grid-template-columns: repeat(3, 1fr); }
.saif-nums div { padding: 20px 6px 18px; text-align: center; }
.saif-nums b { display: block; font-size: clamp(1.9rem, 8vw, 3rem); line-height: 1.2; font-weight: 700; }
.saif-nums span { font-size: .9rem; font-weight: 500; }
.saif-nums div:nth-child(1) { background: #FFB162; color: #2B2724; }
.saif-nums div:nth-child(2) { background: #A35139; color: #fff; }
.saif-nums div:nth-child(3) { background: #2B2724; color: #FFB162; }
.saif-nums div:nth-child(3) span { color: #F0DEC8; }
@media (min-width: 900px) { .saif-nums div { padding: 34px 6px 30px; } }

/* الأقسام: شرائط بعرض الشاشة بدرجات شعار الأسرة */
.saif-rows { margin: 0 0 6px; }
.saif-row { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px max(16px, calc((100% - 1180px) / 2 + 16px)); text-decoration: none; transition: filter .15s; }
.saif-row:hover { filter: brightness(1.06); }
.saif-row i { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--saif-radius); background: rgba(255, 255, 255, .18); font-style: normal; }
.saif-row i .saif-ic { width: 28px; height: 28px; }
.saif-row__t { display: block; }
.saif-row__t b { display: block; font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.saif-row__t small { display: block; font-size: .82rem; font-weight: 400; opacity: .9; }
.saif-row__ar { margin-inline-start: auto; width: 22px; height: 22px; flex: none; }
.saif-row em { position: absolute; inset-inline-end: 44px; bottom: -22px; opacity: .1; pointer-events: none; }
.saif-row em .saif-ic { width: 96px; height: 96px; }
.saif-row:nth-child(1) { background: #46403C; color: #F3E6D2; }
.saif-row:nth-child(2) { background: #9A7456; color: #fff; }
.saif-row:nth-child(3) { background: #C7A589; color: #2B2724; }
.saif-row:nth-child(3) i { background: rgba(255, 255, 255, .5); }

/* مقالات وفعاليات الرئيسية */
.saif-latest { max-width: 1180px; margin: 0 auto; padding: 0 16px 28px; }
.saif-latest .wp-block-heading { font-size: 1.1rem; font-weight: 600; margin-block: 22px 10px; }

/* بطاقات عامة */
.saif-card { border: 1px solid var(--saif-line); border-radius: var(--saif-radius); background: var(--wp--preset--color--white); box-shadow: var(--saif-shadow); transition: transform .2s ease, box-shadow .2s ease; height: 100%; overflow: hidden; }
.saif-card:hover { transform: translateY(-2px); box-shadow: var(--saif-shadow-lg); }
.saif-card a { text-decoration: none; }

/* لوحة المناسبات */
.saif-events { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.saif-event { display: flex; gap: 14px; background: var(--wp--preset--color--white); border: 1px solid var(--saif-line); border-radius: var(--saif-radius); padding: 12px; align-items: stretch; box-shadow: var(--saif-shadow); }
.saif-event__date { flex: 0 0 4.2rem; background: var(--wp--preset--color--charcoal); color: var(--wp--preset--color--white); text-align: center; padding: .6rem .3rem; display: flex; flex-direction: column; justify-content: center; border-radius: 8px; }
.saif-event__day { font-size: 1.7rem; line-height: 1.1; font-weight: 700; color: var(--wp--preset--color--amber); }
.saif-event__month { font-size: .8rem; }
.saif-event__title { margin: 0 0 .25rem; font-size: 1.05rem; }
.saif-event__title a { text-decoration: none; }
.saif-event__meta { font-size: .88rem; color: var(--wp--preset--color--clay); }
.saif-empty { padding: 1.5rem; border: 1px dashed var(--wp--preset--color--sand); border-radius: var(--saif-radius); color: var(--wp--preset--color--clay); text-align: center; background: #fff; }

/* بطاقة العضو */
.saif-id-card { max-width: 420px; background: linear-gradient(135deg, var(--wp--preset--color--charcoal), var(--wp--preset--color--ink)); color: #fff; padding: 1.5rem; border-radius: 14px; border-inline-start: 6px solid var(--wp--preset--color--amber); }
.saif-id-card h3 { color: var(--wp--preset--color--sand); margin: 0 0 .25rem; }

/* النماذج */
.saif-form label { display: block; margin-block: .75rem .25rem; font-weight: 500; }
.saif-form input, .saif-form select, .saif-form textarea { width: 100%; padding: .65rem .8rem; border: 1px solid var(--wp--preset--color--sand); background: #fff; font: inherit; border-radius: var(--saif-radius); box-sizing: border-box; }

/* الأزرار */
.wp-block-button__link, .wp-element-button { border-radius: var(--saif-radius); }
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) { color: var(--wp--preset--color--charcoal) !important; border-color: var(--wp--preset--color--charcoal) !important; background: transparent !important; }

/* الشاشات الكبيرة */
@media (min-width: 900px) {
	.saif-home { padding-top: 24px; }
	.saif-hero2 { background-image: url("assets/img/hero-d.webp"); background-position: left 12%; }
	.saif-hero2::before { background: linear-gradient(to left, rgba(251, 238, 220, .66) 0%, rgba(251, 238, 220, .58) 30%, rgba(251, 238, 220, .28) 45%, rgba(251, 238, 220, 0) 60%); }
	.saif-hero2__in { min-height: 420px; display: flex; align-items: center; }
	.saif-hero2__txt { width: 44%; padding: 44px 20px; }
	.saif-hero2__cta { flex-direction: row; }
	.saif-hero2__cta .saif-btn2 { min-width: 150px; }
	.saif-tiles { max-width: 720px; }
}
@media (prefers-reduced-motion: reduce) { .saif-card, .saif-tile, .saif-btn2 { transition: none; } }

/* انتقالات ناعمة بين الصفحات (المتصفحات الداعمة فقط) */
@view-transition { navigation: auto; }
.saif-header { view-transition-name: saif-header; }
.saif-tabbar { view-transition-name: saif-tabbar; }
::view-transition-old(root) { animation: saif-fade-out .16s ease both; }
::view-transition-new(root) { animation: saif-fade-in .24s ease both; }
@keyframes saif-fade-out { to { opacity: 0; } }
@keyframes saif-fade-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* الفوتر: سطر الحقوق فقط */
.saif-footer { border-top: 1px solid var(--saif-line); }
.saif-footer .saif-copy { margin: 0; font-size: .8rem; font-weight: 400; color: var(--wp--preset--color--clay); }
main.wp-block-group { margin-block-start: 0; }
main.wp-block-group > * { margin-block-start: 0; }

/* ───────── صفحة الترحيب ───────── */
.saif-welcome { display: none; }
html.saif-wlc, html.saif-wlc body { overflow: hidden; }
html.saif-wlc .saif-welcome { display: block; }
.saif-welcome { position: fixed; inset: 0; z-index: 2000; background: #2B2724; transition: transform .55s cubic-bezier(.7, 0, .2, 1), opacity .45s; }
.saif-welcome.is-leaving { transform: translateY(-100%); opacity: .5; }
.saif-welcome__img { position: absolute; inset: 0; overflow: hidden; }
.saif-welcome__img picture, .saif-welcome__img img { display: block; width: 100%; height: 100%; }
.saif-welcome__img img { object-fit: cover; object-position: 50% 10%; }
/* الجوال: النص مباشرة على الصورة، مع ظل داكن خفيف أسفل الصورة ليبقى مقروءاً */
.saif-welcome__card { position: absolute; inset: auto 0 0 0; padding: 120px 24px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(26, 20, 16, .88) 0%, rgba(26, 20, 16, .72) 45%, rgba(26, 20, 16, 0) 100%); animation: saif-wl-up .7s .15s both cubic-bezier(.2, .7, .2, 1); }
.saif-welcome__card small { display: block; margin: 0 0 18px; color: #FFB162; font-weight: 600; font-size: .72rem; letter-spacing: .18em; }
.saif-welcome__title { margin: 2px 0 10px; font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.2; font-weight: 700; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.saif-welcome__title span { font-weight: 300; font-size: .62em; display: block; color: rgba(255, 255, 255, .85); }
.saif-welcome__sub { margin: 0 0 10px; color: rgba(255, 255, 255, .92); font-size: .98rem; line-height: 1.8; max-width: 36ch; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.saif-welcome__go { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-radius: 10px; background: #fff; color: var(--wp--preset--color--ink); font: 700 1.05rem inherit; font-family: inherit; cursor: pointer; box-shadow: 0 10px 22px rgba(0, 0, 0, .3); transition: transform .15s; }
.saif-welcome__go:active { transform: scale(.985); }
.saif-welcome__go svg { width: 20px; height: 20px; }
@keyframes saif-wl-up { from { opacity: 0; transform: translateY(24px); } }
/* الحاسوب: النص يميناً على تدرّج فاتح فوق الصورة العريضة */
@media (min-width: 900px) {
	.saif-welcome__img img { object-position: left 12%; }
	.saif-welcome__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(251, 238, 220, .9) 0%, rgba(251, 238, 220, .78) 30%, rgba(251, 238, 220, .35) 48%, rgba(251, 238, 220, 0) 62%); }
	.saif-welcome__card { inset: 0 auto 0 0; inset-inline-start: 0; inset-inline-end: auto; width: min(46%, 640px); display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(32px, 6vw, 96px); background: none; z-index: 2; }
	.saif-welcome__card small { color: var(--wp--preset--color--henna); }
	.saif-welcome__title { color: var(--wp--preset--color--ink); text-shadow: none; }
	.saif-welcome__title span { color: var(--wp--preset--color--clay); }
	.saif-welcome__sub { color: #3A3029; text-shadow: none; }
	.saif-welcome__go { max-width: 320px; background: linear-gradient(135deg, #5A4A42, #2B2724); color: #fff; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { .saif-welcome, .saif-welcome__card { transition: none; animation: none; } }
