/* ============================================================
   SIMS — كاروسل البطل في الرئيسية
   File : wwwroot/css/sims-hero.css
   ------------------------------------------------------------
   الشريحةُ الأولى (s0) صارت شرائح: البطلُ كما كان، ثمّ إعلانُ مهرجان
   خورفكان البحري في نافذة عرضه (festival.json). التصميم المعتمد ١٩ نوفمبر
   ٢٠٢٦: تبدّلٌ كلَّ ٧ ثوانٍ بالتلاشي، يقف عند المرور على النصّ والأزرار
   وعند اللمس والتركيز، وزرُّ إيقاف، وأسهم، وسحبٌ أفقيّ، ولا حركةَ مع
   «تقليل الحركة».

   والشريحةُ الواحدة — حين لا مهرجان — تُرسم كما كان البطلُ تماماً:
   الشبكةُ نفسُها والصورةُ والتلاشي والمرساة، بلا أزرار.
   ============================================================ */

/* ============================================================
   1) الشرائح — طبقاتٌ بملء الشريحة، والظاهرةُ وحدها تُرى وتُلمس
   ============================================================ */
.pub .pub-hero.hc{ display: block; }

.pub .hc-slide{
    position: absolute; inset: 0;
    display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity .8s ease, visibility 0s linear .8s;
}
.pub .hc-slide.is-on{
    opacity: 1; visibility: visible;
    transition: opacity .8s ease, visibility 0s linear 0s;
}
/* النصُّ يصعد قليلاً حين تظهر شريحتُه */
.pub .hc-slide .pub-hero-txt{ transform: translateY(16px); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.pub .hc-slide.is-on .pub-hero-txt{ transform: none; }

/* شريحتان: يُترك أسفلُ الشريحة للأزرار فلا يلتقي النصُّ بها على الشاشات القصيرة */
.pub .hc.hc-multi .hc-slide{ padding-block-end: 96px; }

/* للقارئ الصوتيّ وحده */
.pub .hc-sr{
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   2) شريحةُ المهرجان — هويّتُه البرونزيّة على أرضٍ رمليّة
   ============================================================ */
.pub .hc-fest{
    --hc-bg: #F5EFE6;
    background: var(--hc-bg);
}
[data-mode="dark"] .pub .hc-fest{ --hc-bg: #14100C; }

/* التلاشي إلى أرض الشريحة لا إلى أرض الموقع */
.pub .hc-fest .pub-hero-img::before{ background: linear-gradient(180deg, var(--hc-bg), transparent); }
.pub .hc-fest .pub-hero-img::after{
    background: linear-gradient(to var(--pub-fade-dir, left),
        var(--hc-bg) 0%, color-mix(in srgb, var(--hc-bg) 45%, transparent) 18%, transparent 55%);
}

/* دفّةُ السفينة — علامةٌ مائيّةٌ خلف النصّ، كالمرساة في شريحة النادي */
.pub .hc-wheel{
    position: absolute; z-index: 0; pointer-events: none;
    inset-block-start: 50%; inset-inline-start: 4%;
    width: clamp(260px, 30vw, 460px); height: auto; aspect-ratio: 1;
    transform: translateY(-50%);
    fill: none; stroke: currentColor; stroke-linecap: round;
    color: #9C6830; opacity: .11;
}
[data-mode="dark"] .pub .hc-wheel{ color: #D9A866; opacity: .10; }

.pub .hc-fest .pub-eyebrow{ color: #7E5424; }
.pub .hc-fest .pub-lead{ color: #4A4033; margin-top: 1.1rem; }
[data-mode="dark"] .pub .hc-fest .pub-eyebrow{ color: #E2B57A; }
[data-mode="dark"] .pub .hc-fest .pub-lead{ color: #D8CBB9; }

.pub .hc-logo{ margin: .4rem 0 0; line-height: 0; }
.pub .hc-logo img{ width: min(560px, 100%); height: auto; }
.pub .hc-logo .dk{ display: none; }
[data-mode="dark"] .pub .hc-logo .lt{ display: none; }
[data-mode="dark"] .pub .hc-logo .dk{ display: block; }

.pub .hc-chips{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.8rem; }
.pub .hc-chip{
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 15px; border-radius: 999px;
    background: rgba(156, 104, 48, .11); color: #5C3C17;
    font-size: .88rem; font-weight: 600; line-height: 1.5;
}
[data-mode="dark"] .pub .hc-chip{ background: rgba(217, 168, 102, .14); color: #F0CF9E; }
.pub .hc-chip svg{ flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* الزرُّ البرونزيّ: نصٌّ أبيضُ على #9C6830 — تباينٌ ٤٫٧ : ١ */
.pub .pub-btn.hc-bronze{ background: #9C6830; color: #FFFFFF; }
.pub .pub-btn.hc-bronze:hover{ background: #7E5424; box-shadow: 0 10px 24px rgba(156, 104, 48, .30); }
[data-mode="dark"] .pub .pub-btn.hc-bronze{ background: #D9A866; color: #1E1A15; }
[data-mode="dark"] .pub .pub-btn.hc-bronze:hover{ background: #E8C08A; }
.pub .hc-fest .pub-btn.ghost{ border-color: rgba(60, 40, 15, .22); }
.pub .hc-fest .pub-btn.ghost:hover{ border-color: #9C6830; color: #7E5424; }
[data-mode="dark"] .pub .hc-fest .pub-btn.ghost{ border-color: rgba(255, 240, 220, .25); }
[data-mode="dark"] .pub .hc-fest .pub-btn.ghost:hover{ border-color: #D9A866; color: #E2B57A; }

/* ============================================================
   3) الأزرار — تظهر حين يعمل السكربت (hc-ready)، فبلا سكربت لا زرَّ معطّل
   ============================================================ */
.pub .hc-ctl{
    position: absolute; z-index: 7;
    inset-inline-start: var(--pub-pad-x); inset-block-end: 82px;
    width: min(628px, calc(52.5% - 2 * var(--pub-pad-x)));
    display: none; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.pub .hc.hc-ready .hc-ctl{ display: flex; }

.pub .hc{ --hc-acc: var(--pub-accent-ink); }
.pub .hc[data-at="1"]{ --hc-acc: #9C6830; }
[data-mode="dark"] .pub .hc[data-at="1"]{ --hc-acc: #D9A866; }

.pub .hc-tabs{ display: flex; gap: 24px; flex: 1 1 auto; min-width: 0; }
.pub .hc-tab{
    flex: 0 1 196px; min-width: 0;
    padding: 10px 0 6px; border: 0; background: transparent;
    font: inherit; color: var(--pub-muted); text-align: start; cursor: pointer;
    display: flex; flex-direction: column; gap: 11px;
}
.pub .hc-bar{ display: block; height: 3px; border-radius: 3px; background: var(--pub-line); overflow: hidden; }
.pub .hc-bar i{
    display: block; width: 100%; height: 100%; border-radius: 3px;
    background: var(--hc-acc);
    transform: scaleX(0);
}
[dir="rtl"] .pub .hc-bar i{ transform-origin: right center; }
[dir="ltr"] .pub .hc-bar i{ transform-origin: left center; }
.pub .hc-tab.is-on .hc-bar i{ animation: hc-fill var(--hc-dur, 7s) linear forwards; }
.pub .hc.is-paused .hc-tab.is-on .hc-bar i,
.pub .hc.is-hold .hc-tab.is-on .hc-bar i{ animation-play-state: paused; }
@keyframes hc-fill{ from{ transform: scaleX(0); } to{ transform: scaleX(1); } }

.pub .hc-lbl{ display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pub .hc-lbl b{ font-size: .75rem; font-weight: 700; }
.pub .hc-lbl span{ font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub .hc-tab.is-on .hc-lbl b{ color: var(--hc-acc); }
.pub .hc-tab.is-on .hc-lbl span{ color: var(--pub-fg); font-weight: 700; }
.pub .hc-tab:hover .hc-lbl span{ color: var(--pub-fg); }
.pub .hc-lbl .sm{ display: none; }

.pub .hc-btns{ display: flex; gap: 10px; flex: none; }
.pub .hc-btn{
    width: 44px; height: 44px; padding: 0; border-radius: 50%;
    border: 1px solid var(--pub-line);
    background: color-mix(in srgb, var(--pub-surface) 60%, transparent);
    color: var(--pub-fg); cursor: pointer;
    display: grid; place-items: center;
    transition: background-color .2s ease, border-color .2s ease;
}
.pub .hc-btn:hover{ background: var(--pub-surface); border-color: color-mix(in srgb, var(--pub-fg) 40%, transparent); }
.pub .hc-btn svg{ width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pub .hc-btn svg.fill{ width: 15px; height: 15px; fill: currentColor; stroke: none; }
/* السهمان مرسومان للعربيّة، وينقلبان في اللغات اليساريّة */
[dir="ltr"] .pub .hc-btn.dir svg{ transform: scaleX(-1); }
.pub .hc-btn .i-play{ display: none; }
.pub .hc.is-paused .hc-btn .i-play{ display: block; }
.pub .hc.is-paused .hc-btn .i-pause{ display: none; }

/* ============================================================
   4) الهاتف — التخطيطُ الحاليّ للبطل، والسحبُ بدلَ السهمين
   ============================================================ */
@media (max-width: 900px){
    .pub .hc-slide{ grid-template-columns: 1fr; }
    .pub .hc.hc-multi .hc-slide{ padding-block-end: 110px; }
    .pub .hc-wheel{ display: none; }
    .pub .hc-fest .pub-hero-img::after{
        background: linear-gradient(180deg, var(--hc-bg) 4%, transparent 60%, var(--hc-bg) 100%);
    }
    .pub .hc-ctl{ inset-inline: var(--pub-pad-x); inset-block-end: 58px; width: auto; gap: 16px; }
    .pub .hc-tabs{ gap: 16px; }
    .pub .hc-tab{ flex: 1 1 0; }
    .pub .hc-lbl .lg{ display: none; }
    .pub .hc-lbl .sm{ display: inline; }
    .pub .hc-prev, .pub .hc-next{ display: none; }
    /* نقاطُ الشرائح على حافّة النهاية — النصُّ يبتعد عنها فلا يمرّ تحتها (حين تكون شريحتان) */
    .pub .hc.hc-multi .hc-slide .pub-hero-txt{ padding-inline-end: calc(var(--pub-pad-x) + 14px); }
}
