@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

/* ==========================================================================
   غصن — فرع الطائف
   مبني على تصميم العلامة المرسل (PDF): أرضية رملية/ورقية، حبر نبيذي،
   خيوط ذهبية تحت العناوين، وزخرفة الغصن المحفور شريطاً عرضياً.
   الخط: Tajawal (نفس خط فرع الشفا).
   ========================================================================== */

:root {
    --wine: #73243C;
    --wine-deep: #4A0C21;
    --sand: #ECDBCC;
    --sand-2: #EDDDCF;
    --paper: #FBFAF7;
    --gold: #C8A86E;
    --muted: #7A5648;
    --ink: #3B2A28;

    --rule: rgba(115, 36, 60, 0.14);
    --rule-strong: rgba(115, 36, 60, 0.28);
    --frame: #F5EADF;
    --thumb: clamp(126px, 13vw, 168px);
    --shell: min(1180px, 92vw);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Tajawal', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--ink);
    background-color: var(--paper);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- عناصر مشتركة ---------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.shell { width: var(--shell); margin-inline: auto; }

.eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.9rem;
}

.section-title {
    font-size: clamp(1.75rem, 4.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.5;
    color: var(--wine);
    margin: 0;
}

.gold-rule {
    width: 74px;
    height: 1px;
    background: var(--gold);
    border: 0;
    margin: 1.2rem auto 2.4rem;
}

.lede {
    max-width: 60ch;
    margin-inline: auto;
    color: var(--muted);
    font-weight: 300;
    font-size: 1.05rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--wine);
    background: var(--wine);
    color: var(--sand);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.pill:hover { background: var(--wine-deep); border-color: var(--wine-deep); transform: translateY(-2px); }

.pill--ghost {
    background: transparent;
    color: var(--wine);
    border-color: var(--rule-strong);
}

.pill--ghost:hover { background: rgba(115, 36, 60, 0.06); border-color: var(--wine); color: var(--wine); transform: translateY(-2px); }

.pill--light {
    background: var(--sand);
    border-color: var(--sand);
    color: var(--wine);
}

.pill--light:hover { background: #fff; border-color: #fff; color: var(--wine); }

/* ---------- الشريط العلوي ---------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--sand-2);
    border-bottom: 1px solid var(--rule);
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 96px;
}

.brand img { height: clamp(58px, 5vw, 72px); width: auto; }

.site-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2.6rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: inline-block;
    padding: 0.4rem 0;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--wine);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }

.utility {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--wine);
    text-decoration: none;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.icon-btn:hover { border-color: var(--rule-strong); background: rgba(115, 36, 60, 0.05); }

.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.4; }

.nav-toggle { display: none; }

/* ---------- بانر العلامة ---------- */

/* ---------- الواجهة ---------- */

.hero,
.page-hero {
    background: var(--sand);
    text-align: center;
    overflow: hidden;
}

/* الهيرو مشهد واحد: النص في الأعلى والغصن كاملاً أسفله */
.hero {
    position: relative;
    padding: clamp(2.6rem, 6vw, 4.2rem) 0 0;
}

.hero > .shell { position: relative; z-index: 1; }

.hero-made {
    display: block;
    margin: -0.4rem 0 1.8rem;
    font-size: clamp(0.8rem, 1.5vw, 0.98rem);
    font-weight: 500;
    color: var(--wine);
    letter-spacing: 0.04em;
}

/* رسم الغصن يظهر كاملاً بلا قص — بعرض الصفحة وبنسبته الطبيعية */
.hero-branch {
    margin-top: clamp(1.6rem, 4vw, 2.8rem);
    pointer-events: none;
    user-select: none;
}

.hero-branch img {
    width: 100%;
    height: auto;
    display: block;
}

.page-hero .hero-branch { margin-top: clamp(1.2rem, 3.5vw, 2.2rem); }

.hero-mark { height: clamp(92px, 14vw, 152px); width: auto; margin: 0 auto 1rem; }

.hero h1 {
    font-size: clamp(2.1rem, 6.4vw, 3.9rem);
    font-weight: 700;
    line-height: 1.45;
    color: var(--wine);
    margin: 0 0 1.4rem;
    text-wrap: balance;
}

.hero .eyebrow { margin-bottom: 1.6rem; }

.hero p { max-width: 62ch; margin: 0 auto; color: var(--muted); font-weight: 300; text-wrap: balance; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2.4rem 0 0;
}

/* ---------- صفوف القيم ---------- */

.values { background: var(--paper); padding: clamp(2.5rem, 7vw, 4.5rem) 0; }

.value-row {
    text-align: center;
    padding: clamp(1.4rem, 3.5vw, 2.1rem) 0;
    border-bottom: 1px solid var(--rule);
}

.values .value-row:last-child { border-bottom: 0; }

.value-row h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--wine);
    margin: 0 0 0.35rem;
}

.value-row p { margin: 0; color: var(--muted); font-weight: 300; }

/* ---------- المختارات / البطاقات ---------- */

.collection {
    background: var(--paper);
    padding: clamp(3rem, 8vw, 5.5rem) 0;
    text-align: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.2rem, 3vw, 2rem);
    text-align: center;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover { transform: translateY(-5px); border-color: var(--rule-strong); }

.card-media {
    background: var(--paper);
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.card--feature .card-media { background: var(--sand); }

.card-media img { width: 100%; height: 100%; object-fit: cover; }

/* صورة الأكواب عمودية — نثبّت التركيز على الكوب لا على الخلفية */
.card-media--cups img { object-position: center 35%; }
/* صورة الأكياس عمودية — التركيز على كيس الروز تي */
.card-media--bags img { object-position: center 42%; }

.card-body { padding: clamp(1.2rem, 3vw, 1.8rem); display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }

.card-name { font-size: 1.3rem; font-weight: 700; color: var(--wine); margin: 0; }

.card-latin {
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.card-note { margin: 0.4rem 0 0; color: var(--muted); font-weight: 300; font-size: 0.95rem; }

.card-price {
    margin: 0.6rem 0 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--wine);
    font-variant-numeric: tabular-nums;
}

.card .pill { margin-top: 1.1rem; width: 100%; }

/* ---------- شريط القصة ---------- */

.origin {
    position: relative;
    background: var(--wine);
    color: var(--sand);
    padding: clamp(3.2rem, 8vw, 5.5rem) 0 0;
    overflow: hidden;
}

.origin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.origin .eyebrow { color: rgba(236, 219, 204, 0.7); }
.origin h2 { color: var(--sand); font-size: clamp(1.7rem, 4.4vw, 2.6rem); font-weight: 700; margin: 0; line-height: 1.5; }
.origin .gold-rule { margin: 1.1rem 0 1.8rem; }
.origin p { color: rgba(236, 219, 204, 0.86); font-weight: 300; margin: 0 0 1.1rem; max-width: 52ch; }
.origin .pill { margin-top: 0.8rem; }

.origin-plate {
    background: var(--sand);
    overflow: hidden;
    border-radius: 4px;
    padding: clamp(1.2rem, 3vw, 2rem);
    display: grid;
    place-items: center;
}

.origin-plate img { max-height: 320px; width: auto; }

/* لوحة بصورة فعلية: تملأ الإطار بنسبة رأسية هادئة */
.origin-plate--photo { padding: 0; overflow: hidden; }

.origin-plate--photo img {
    width: 100%;
    max-height: none;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 42%;
}

.origin-band {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    height: clamp(96px, 16vw, 190px);
    overflow: hidden;
    opacity: 0.45;
}

.origin-band img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }

/* ---------- المتابعة ---------- */

.follow { background: var(--paper); padding: clamp(3rem, 8vw, 5rem) 0; text-align: center; }

/* ---------- الفوتر ---------- */

.site-footer { background: var(--wine-deep); color: rgba(236, 219, 204, 0.85); padding: clamp(3rem, 7vw, 4.5rem) 0 0; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: clamp(1.8rem, 4vw, 3rem);
}

.site-footer h3 {
    color: var(--gold);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 1.1rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }

.site-footer a { color: rgba(236, 219, 204, 0.85); text-decoration: none; font-weight: 300; }
.site-footer a:hover { color: var(--sand); text-decoration: underline; text-underline-offset: 5px; }

.footer-brand img { height: 52px; width: auto; margin-bottom: 1.1rem; }
.footer-brand p { margin: 0 0 1.4rem; font-weight: 300; max-width: 34ch; }

.socials { display: flex; gap: 0.7rem; }

.socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(236, 219, 204, 0.4);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.socials a:hover { background: rgba(236, 219, 204, 0.12); border-color: var(--sand); }
.socials svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.4; }

.footer-bottom {
    margin-top: clamp(2.2rem, 5vw, 3.2rem);
    border-top: 1px solid rgba(236, 219, 204, 0.18);
    padding: 1.4rem 0 1.8rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 300;
    color: rgba(236, 219, 204, 0.7);
}

/* ---------- صفحات المنيو ---------- */

.page-hero { padding: clamp(2.6rem, 7vw, 4.5rem) 0 0; }
.page-hero h1 { font-size: clamp(1.9rem, 5.4vw, 3rem); font-weight: 700; color: var(--wine); margin: 0 0 0.6rem; }
.page-hero p { margin: 0 auto; max-width: 56ch; color: var(--muted); font-weight: 300; }

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    padding: clamp(1.6rem, 4vw, 2.4rem) 0 0;
}

.tab {
    min-height: 46px;
    padding: 0 1.6rem;
    border-radius: 999px;
    border: 1px solid var(--rule-strong);
    background: transparent;
    color: var(--wine);
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.tab:hover { background: rgba(115, 36, 60, 0.06); }
.tab[aria-selected="true"] { background: var(--wine); border-color: var(--wine); color: var(--sand); }

.menu-block { padding: clamp(2.4rem, 6vw, 4rem) 0; }
.menu-block[hidden] { display: none; }

.menu-head { text-align: center; margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }

.menu-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr));
    gap: 0 clamp(2rem, 6vw, 4.5rem);
}

.menu-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--rule);
}

.menu-row h3 { margin: 0; font-size: 1.08rem; font-weight: 500; color: var(--ink); }
.menu-row .latin { display: block; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 300; margin-top: 0.15rem; }
.menu-row .price { font-size: 1rem; font-weight: 500; color: var(--wine); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- صور الأصناف ---------- */

.menu-row.has-photo {
    grid-template-columns: var(--thumb) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.85rem, 2vw, 1.15rem);
    padding: 1.3rem 0;
}

.row-thumb {
    width: var(--thumb);
    height: var(--thumb);
    object-fit: contain;
    background: var(--frame);
    border: 1px solid rgba(115, 36, 60, 0.10);
    border-radius: 14px;
    padding: 8px;
}

.menu-list--cards .row-thumb { background: var(--frame); }

/* صور فوتوغرافية (أطباق) تملأ الإطار بدل احتوائها */
.row-thumb--cover {
    object-fit: cover;
    padding: 0;
    background: var(--frame);
}

.row-text { min-width: 0; }

/* الأصناف بلا صورة: علامة غصن بدل الصورة */
.row-thumb--mark {
    padding: clamp(0.9rem, 2.2vw, 1.5rem);
    opacity: 0.42;
}

.menu-list--cards .row-thumb--mark { padding: clamp(1.6rem, 5vw, 2.8rem); }

.row-desc {
    margin: 0.35rem 0 0;
    font-size: 0.84rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

@media (max-width: 480px) {
    :root { --thumb: 108px; }
    .row-desc { font-size: 0.78rem; }
    .menu-row.has-photo { gap: 0.8rem; }
}

/* ---------- بطاقات الحلويات: صورة كبيرة والمحتوى تحتها ---------- */

.menu-list--cards {
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: clamp(1.6rem, 3.5vw, 2.6rem);
}

.menu-list--cards .menu-row,
.menu-list--cards .menu-row.has-photo {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-bottom: 0;
    text-align: center;
}

.menu-list--cards .row-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    padding: clamp(0.7rem, 2vw, 1.1rem);
}

.menu-list--cards .row-text { margin-top: clamp(0.9rem, 2vw, 1.1rem); }
.menu-list--cards .menu-row h3 { font-size: 1.16rem; }
.menu-list--cards .row-desc { margin-top: 0.45rem; }

.menu-list--cards .price {
    align-self: center;
    margin-top: auto;
    padding-top: 0.18rem;
    padding: 0.18rem 0.95rem;
    margin-block-start: 0.85rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    font-size: 0.95rem;
}

.menu-list--cards .menu-row:not(.has-photo) {
    padding-inline-end: 0;
    align-self: center;
}

.beans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: clamp(1.2rem, 3vw, 2rem);
}

.bean {
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: clamp(1.3rem, 3vw, 1.8rem);
    background: var(--paper);
}

.bean-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bean h3 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--wine); }
.bean .latin { display: block; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 300; margin-top: 0.2rem; }
.bean .price { font-size: 1.05rem; font-weight: 500; color: var(--wine); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bean dl { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin: 0.9rem 0 0.7rem; font-size: 0.82rem; color: var(--muted); }
.bean dl div { display: flex; gap: 0.4rem; }
.bean dt { font-weight: 500; }
.bean dd { margin: 0; font-weight: 300; }
.bean p { margin: 0; font-weight: 300; color: var(--ink); }
.bean .flag { margin-top: 0.9rem; display: inline-block; font-size: 0.72rem; letter-spacing: 0.14em; border: 1px solid var(--gold); color: #9A7A3C; padding: 0.1rem 0.7rem; border-radius: 999px; }

/* ---------- الاستجابة ---------- */

@media (max-width: 900px) {
    .origin-grid { grid-template-columns: 1fr; }
    .origin-plate { order: -1; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--rule-strong);
        border-radius: 999px;
        background: transparent;
        color: var(--wine);
        cursor: pointer;
    }

    .nav-toggle svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none; }

    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background: var(--sand-2);
        border-bottom: 1px solid var(--rule);
        display: none;
    }

    .site-nav[data-open="true"] { display: block; }

    .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 4vw 1rem; }
    .site-nav a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }

    .masthead { position: sticky; }
    .masthead-inner { position: relative; }

}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .hero-actions .pill { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

::selection { background: var(--wine); color: var(--sand); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }


/* ==========================================================================
   النسخة النبيذية من الهيرو — فعّلها بإضافة hero--wine على <section class="hero">
   ========================================================================== */

.hero .on-wine { display: none; }
.hero--wine .on-cream { display: none; }
.hero--wine .on-wine { display: block; }
.hero--wine .hero-mark.on-wine { margin-inline: auto; }

.hero.hero--wine { background: var(--wine); }
.hero.hero--wine h1,
.hero.hero--wine .hero-made { color: var(--sand); }
.hero.hero--wine p { color: rgba(236, 219, 204, 0.82); }
.hero.hero--wine .eyebrow { color: rgba(236, 219, 204, 0.7); }

.hero.hero--wine .pill {
    background: var(--sand);
    border-color: var(--sand);
    color: var(--wine);
}

.hero.hero--wine .pill:hover { background: #fff; border-color: #fff; color: var(--wine); }

.hero.hero--wine .pill--ghost {
    background: transparent;
    border-color: rgba(236, 219, 204, 0.5);
    color: var(--sand);
}

.hero.hero--wine .pill--ghost:hover {
    background: rgba(236, 219, 204, 0.14);
    border-color: var(--sand);
    color: var(--sand);
}

/* ---------- لحظة الدخول ---------- */

@keyframes hero-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.hero > .shell > * {
    animation: hero-rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero > .shell > *:nth-child(2) { animation-delay: 90ms; }
.hero > .shell > *:nth-child(3) { animation-delay: 150ms; }
.hero > .shell > *:nth-child(4) { animation-delay: 210ms; }
.hero > .shell > *:nth-child(5) { animation-delay: 270ms; }
.hero > .shell > *:nth-child(6) { animation-delay: 330ms; }

@media (prefers-reduced-motion: reduce) {
    .hero > .shell > * { animation: none; }
}
