/* ============================================
   Timeline Slider Widget - Main Styles
   v1.1 - Includes Swiper layout fallback
   ============================================ */

/* ---- WRAPPER ---- */
.tsw-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-bottom: 4rem;
    box-sizing: border-box;
}

/* ---- HEADER ---- */
.tsw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 1.5rem 0;
    flex-wrap: wrap;
    gap: 12px;
}
.tsw-header-no-title { justify-content: flex-start; }
[dir="rtl"] .tsw-header { flex-direction: row-reverse; }

.tsw-section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    flex: 1;
    text-align: right;
}
[dir="ltr"] .tsw-section-title { text-align: left; }

/* ---- ARROWS ---- */
.tsw-arrows-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
[dir="rtl"] .tsw-arrows-wrap { flex-direction: row-reverse; }

.tsw-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333333;
    cursor: pointer;
    transition: none;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}
.tsw-arrow:hover { background-color: #e63946; }
.tsw-arrow.swiper-button-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.tsw-arrow svg path { fill: #ffffff; transition: fill 0.25s ease; }

/* ============================================
   SWIPER CORE LAYOUT (critical — must be here
   so layout works even if swiper CSS is delayed)
   ============================================ */
.tsw-swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Force correct horizontal flex layout regardless of swiper.css load order */
.tsw-swiper .swiper-wrapper {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    flex-direction: row !important;
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: normal !important;
    -ms-flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.tsw-swiper .swiper-slide {
    -webkit-flex-shrink: 0 !important;
    -ms-flex-negative: 0 !important;
    flex-shrink: 0 !important;
    width: 100%;
    height: 300px;
    box-sizing: border-box;
    position: relative;
}

/* ---- SLIDE INNER ---- */
.tsw-slide-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 0 16px 0 0;
    box-sizing: border-box;
}
[dir="rtl"] .tsw-slide-inner { padding: 0 0 0 16px; }

/* ---- CONTENT AREA ---- */
.tsw-content-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 65%;
    overflow: hidden;
    padding-bottom: 12px;
}

.tsw-item-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    display: block;
}

.tsw-item-desc {
    font-size: 1.4rem;
    color: #a0a0a0;
    line-height: 1.7;
    display: block;
}

/* ---- BOTTOM SECTION ---- */
.tsw-bottom-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
}

/* ---- LINE & DOT ---- */
.tsw-line-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tsw-line {
    flex: 1;
    height: 2px;
    background-color: #444444;
    display: block;
}

.tsw-dot {
    width: 10px;
    height: 10px;
    background-color: #e63946;
    border-radius: 50%;
    flex-shrink: 0;
}
[dir="rtl"] .tsw-dot { order: -1; }

/* ---- DATE ---- */
.tsw-date-label {
    font-size: 1rem;
    font-weight: 700;
    color: #cccccc;
    display: block;
    margin-bottom: 2px;
}
.tsw-year {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .tsw-item-title { font-size: 1.4rem; }
    .tsw-item-desc  { font-size: 1.3rem; }
    .tsw-year       { font-size: 2.2rem; }
}
@media (max-width: 768px) {
    .tsw-section-title { font-size: 1.5rem; }
    .tsw-item-title    { font-size: 1.3rem; }
    .tsw-item-desc     { font-size: 1.2rem; }
    .tsw-year          { font-size: 2rem;   }
    .tsw-arrow         { width: 34px; height: 34px; }
}
@media (max-width: 480px) {
    .tsw-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    [dir="rtl"] .tsw-header { align-items: flex-end; }
    .tsw-section-title { font-size: 1.3rem; }
    .tsw-slide-inner   { padding: 0 8px 0 0; }
    [dir="rtl"] .tsw-slide-inner { padding: 0 0 0 8px; }
}
