/* =========================================================
   1.10.0 — الفعاليات
   شريط الموعد · مبدّل القايمة/التقويم · شبكة الشهر · «اللي فاتت»
   كل القيم من توكنز --f7-*، وكل الاتجاهات logical (بتشتغل RTL/LTR زي ما هي).
   ========================================================= */

/* ---------------------------------------------------------
   شريط الموعد في الصفحة المفردة — أهم معلومة، فوق كل حاجة
   --------------------------------------------------------- */
.fos7ty-event-when {
    background: var(--f7-sand-50);
    border-block: var(--f7-line);
}

.fos7ty-event-when.is-past {
    background: var(--f7-white);
}

.fos7ty-event-when-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    padding-block: var(--f7-s-3);
}

.fos7ty-event-when-label {
    margin: 0;
    font-size: var(--f7-t-12);
    font-weight: var(--f7-w-meta);
    color: var(--f7-ink-60);
}

.fos7ty-event-when-date {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0;
    font-size: var(--f7-t-21);
    font-weight: var(--f7-w-title);
    line-height: var(--f7-lh-title);
    color: var(--f7-nile);
}

.fos7ty-event-when-date time {
    font-variant-numeric: tabular-nums;
}

/* سطر التكرار — شيب صغير جنب التاريخ، مش سطر لوحده */
.fos7ty-event-when-repeat {
    display: inline-block;
    padding-block: 2px;
    padding-inline: 10px;
    border: var(--f7-line);
    border-radius: var(--f7-r-chip);
    background: var(--f7-white);
    color: var(--f7-ink-60);
    font-size: var(--f7-t-13);
    font-weight: var(--f7-w-meta);
    line-height: 1.6;
}

.fos7ty-event-when-flag {
    display: inline-block;
    margin: 0;
    font-size: var(--f7-t-13);
    font-weight: var(--f7-w-sub);
    color: var(--f7-warn);
}

.fos7ty-event-when-flag--cancelled {
    color: var(--f7-danger);
}

.fos7ty-event-when-text {
    margin: 0;
    font-size: var(--f7-t-15);
    color: var(--f7-ink-60);
}

.fos7ty-event-when-text a {
    color: var(--f7-nile);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------
   كارت الحضور في العمود الجانبي
   --------------------------------------------------------- */
.fos7ty-event-box {
    display: flex;
    flex-direction: column;
    gap: var(--f7-s-2);
}

.fos7ty-event-box-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-block-end: var(--f7-s-2);
    border-block-end: var(--f7-line);
}

.fos7ty-event-box-value {
    font-size: var(--f7-t-17);
    font-weight: var(--f7-w-title);
    line-height: var(--f7-lh-title);
    color: var(--f7-nile);
}

.fos7ty-event-box-note {
    margin: 0;
    font-size: var(--f7-t-15);
    color: var(--f7-ink);
}

/* ---------------------------------------------------------
   قسم المكان + لينك الخرائط (مفيش iframe ومفيش API)
   --------------------------------------------------------- */
.fos7ty-event-place-name {
    margin: 0 0 4px;
    font-size: var(--f7-t-17);
    font-weight: var(--f7-w-sub);
    color: var(--f7-ink);
}

.fos7ty-event-place-address {
    margin: 0;
    font-size: var(--f7-t-15);
    color: var(--f7-ink-60);
}

.fos7ty-event-map {
    margin-block-start: var(--f7-s-3);
}

/* سعر الفعالية نص مش رقم — بياخد وزن العنوان مش وزن الرقم */
.fos7ty-price-note--event {
    color: var(--f7-ink);
    font-weight: var(--f7-w-sub);
}

/* ---------------------------------------------------------
   مبدّل القايمة / التقويم
   --------------------------------------------------------- */
.fos7ty-events-views {
    display: flex;
    gap: 2px;
    margin-block-start: var(--f7-s-4);
    border-block-end: var(--f7-line);
}

.fos7ty-events-view {
    display: inline-block;
    padding-block: 8px;
    padding-inline: 14px;
    border-block-end: 2px solid transparent;
    color: var(--f7-ink-60);
    font-size: var(--f7-t-15);
    font-weight: var(--f7-w-meta);
    text-decoration: none;
}

.fos7ty-events-view:hover {
    color: var(--f7-nile);
}

.fos7ty-events-view.is-active {
    color: var(--f7-nile);
    border-block-end-color: var(--f7-nile);
    font-weight: var(--f7-w-sub);
}

.fos7ty-events-view:focus-visible {
    outline: var(--f7-focus);
    outline-offset: 2px;
}

.fos7ty-events-list-title {
    margin-block-start: var(--f7-s-4);
}

/* ---------------------------------------------------------
   شبكة الشهر — CSS Grid، خطوط 1px من فجوة على خلفية sand
   --------------------------------------------------------- */
.fos7ty-calendar {
    margin-block: var(--f7-s-4);
    border: var(--f7-line);
    border-radius: var(--f7-r-card);
    background: var(--f7-white);
    overflow: hidden;
}

.fos7ty-calendar.is-loading {
    opacity: .55;
}

.fos7ty-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--f7-s-2);
    padding-block: var(--f7-s-2);
    padding-inline: var(--f7-s-3);
    border-block-end: var(--f7-line);
    background: var(--f7-sand-50);
}

.fos7ty-calendar-month {
    margin: 0;
    font-size: var(--f7-t-17);
    font-weight: var(--f7-w-title);
    color: var(--f7-ink);
}

.fos7ty-calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 34px;
    block-size: 34px;
    border: var(--f7-line);
    border-radius: var(--f7-r-btn);
    background: var(--f7-white);
    color: var(--f7-nile);
    text-decoration: none;
}

.fos7ty-calendar-nav:hover {
    background: var(--f7-sand-100);
}

.fos7ty-calendar-nav:focus-visible {
    outline: var(--f7-focus);
    outline-offset: 2px;
}

.fos7ty-calendar-nav.is-disabled {
    opacity: .45;
}

.fos7ty-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--f7-sand-200);
    border-block-end: var(--f7-line);
}

.fos7ty-calendar-weekdays span {
    padding-block: 6px;
    background: var(--f7-sand-50);
    text-align: center;
    font-size: var(--f7-t-12);
    font-weight: var(--f7-w-meta);
    color: var(--f7-ink-60);
}

.fos7ty-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--f7-sand-200);
}

.fos7ty-calendar-day {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-block-size: 92px;
    padding-block: 6px;
    padding-inline: 6px;
    background: var(--f7-white);
}

.fos7ty-calendar-day.is-blank {
    background: var(--f7-sand-50);
}

.fos7ty-calendar-day.is-today {
    background: var(--f7-sand-50);
    box-shadow: inset 0 0 0 2px var(--f7-nile);
}

.fos7ty-calendar-daynum {
    font-size: var(--f7-t-12);
    font-weight: var(--f7-w-meta);
    color: var(--f7-ink-60);
    font-variant-numeric: tabular-nums;
}

.fos7ty-calendar-day.is-today .fos7ty-calendar-daynum {
    color: var(--f7-nile);
    font-weight: var(--f7-w-title);
}

.fos7ty-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fos7ty-calendar-events a {
    display: block;
    padding-block: 2px;
    padding-inline: 4px;
    border-inline-start: 2px solid var(--f7-gold);
    border-radius: 2px;
    background: var(--f7-sand-50);
    color: var(--f7-nile);
    font-size: var(--f7-t-12);
    line-height: 1.45;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fos7ty-calendar-events a:hover {
    background: var(--f7-sand-100);
}

.fos7ty-calendar-events a:focus-visible {
    outline: var(--f7-focus);
    outline-offset: 1px;
}

.fos7ty-calendar-events a.is-cancelled {
    color: var(--f7-danger);
    border-inline-start-color: var(--f7-danger);
    text-decoration: line-through;
}

.fos7ty-calendar-time {
    margin-inline-end: 4px;
    color: var(--f7-ink-60);
    font-weight: var(--f7-w-meta);
    font-variant-numeric: tabular-nums;
}

.fos7ty-calendar-title {
    color: inherit;
}

.fos7ty-calendar-more {
    font-size: var(--f7-t-12);
    color: var(--f7-ink-60);
}

.fos7ty-calendar-note,
.fos7ty-calendar-noscript {
    margin: 0;
    padding-block: var(--f7-s-2);
    padding-inline: var(--f7-s-3);
    border-block-start: var(--f7-line);
    font-size: var(--f7-t-13);
    color: var(--f7-ink-60);
}

.fos7ty-calendar-noscript a {
    color: var(--f7-nile);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fos7ty-calendar-error {
    margin: 0;
    padding-inline: var(--f7-s-3);
    font-size: var(--f7-t-13);
    color: var(--f7-danger);
}

.fos7ty-calendar-error:empty {
    display: none;
}

/* ---------------------------------------------------------
   «اللي فاتت» — مطويّة، مش مخفية
   --------------------------------------------------------- */
.fos7ty-events-past {
    margin-block-start: var(--f7-s-6);
    padding-block-start: var(--f7-s-3);
    border-block-start: var(--f7-line);
}

.fos7ty-events-past > summary {
    display: flex;
    align-items: center;
    gap: var(--f7-s-2);
    padding-block: var(--f7-s-2);
    cursor: pointer;
    font-size: var(--f7-t-17);
    font-weight: var(--f7-w-sub);
    color: var(--f7-ink);
}

.fos7ty-events-past > summary:focus-visible {
    outline: var(--f7-focus);
    outline-offset: 2px;
}

.fos7ty-events-past[open] > summary {
    margin-block-end: var(--f7-s-3);
}

/* ---------------------------------------------------------
   موبايل: خلايا أقصر، والوقت بيتشال من الشيب
   --------------------------------------------------------- */
@media (max-width: 640px) {
    .fos7ty-event-when-date {
        font-size: var(--f7-t-17);
    }

    .fos7ty-calendar-day {
        min-block-size: 62px;
        padding-inline: 3px;
    }

    .fos7ty-calendar-weekdays span {
        font-size: 11px;
    }

    .fos7ty-calendar-time {
        display: none;
    }
}
