/* ══════════════════════════════════════════════════
   NILE MEMORY — Home Page Styles
   Path: wwwroot/css/home.css
══════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   HERO SLIDER
══════════════════════════════════════════════════ */
/* ── Hero full viewport ── */
html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
}

#hero {
    position: relative;
    width: 100%;
    /* height: calc(100vh - 160px);  160px = navbar + timeline */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 60px - 160px);
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    padding: 0; /* remove any padding */
    margin: 0; /* remove any margin */
    /* background image support */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    z-index: 1;
}

#timeline-section {
    height: 160px;
    flex-shrink: 0;
    /*  overflow: hidden;*/
    position: relative;
    z-index: 10; /* above hero so title pill shows */
    overflow: visible !important;
    background: var(--clr-bg);
    border-top: 1px solid var(--clr-border);
    position: relative;
    user-select: none;
    height: 160px;
    overflow: visible !important;
    z-index: 10;
}

#hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.6s ease;
    filter: grayscale(60%) brightness(0.7);
    z-index: 0;
}

#hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 1;
}

/* ── Hero content centered ── */
#hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    height: 10%; /* fill the hero section */
 
}

/* ── The dark trapezoid card ── */
/*#hero-card {
    display: flex;
    flex-direction: row-reverse;*/ /* RTL: title on right */
    /*align-items: stretch;
    background: rgba(20, 18, 26, 0.82);
    clip-path: polygon(2% 0%, 100% 0%, 98% 100%, 0% 100%);
    padding: 2.5rem 3.5rem 2.5rem 3rem;
    gap: 0;
    max-width: 780px;
    width: 100%;
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
}*/
#hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(20, 18, 26, 0.82);
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    padding: 2.5rem 3.5rem 2.5rem 3rem;
    gap: 1rem;
    max-width: 780px;
    width: 100%;
    backdrop-filter: blur(4px);
}

/* ── Right side: big title ── */
#hero-card-title {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0;
    padding-left: 2rem;
    flex-shrink: 0;
}

#hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: right;
    margin: 0;
    color: #AA78FF; /* updated dynamically */
    direction: rtl;
}

/* ── Vertical divider ── */
#hero-card-divider {
    width: 1px;
    background: rgba(255,255,255,0.15);
    margin: 0 1.5rem;
    flex-shrink: 0;
}

/* ── Left side: icon + description ── */
#hero-card-body {
    display: flex;
/*    flex-direction: column;*/
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    max-width: 400px;
    flex-direction: row-reverse;
}

#hero-cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

    #hero-cta-link:hover {
        transform: scale(1.1);
    }

#hero-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
    text-align: right;
    direction: rtl;
    margin: 0;
    /* truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex:1;
}

/* ── Fade animation ── */
.hero-fade-enter {
    animation: heroFade 0.45s ease forwards;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Arrows ── */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
}

    .hero-arrow:hover {
        background: rgba(255,255,255,0.25);
    }

#arrow-prev {
    right: 1.5rem;
}

#arrow-next {
    left: 1.5rem;
}

.hero-arrow svg {
    width: 20px;
    height: 20px;
}
/*#hero {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--nav-h));
    overflow: hidden;
    background: #111;
    flex: 1;*/ /* takes all remaining space */
   
    /*min-height: 0;*/ /* important — prevents flex blowout */
/*}*/

/* Background image layer */
/*#hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.1s, opacity 0.7s ease;
    filter: grayscale(60%) brightness(0.55);
}*/

/* Grain overlay */
/*#hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.35;
    z-index: 1;
}*/

/* Dark gradient from right */
/*#hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to left,
        rgba(13,13,13,0.0)  0%,
        rgba(13,13,13,0.5)  50%,
        rgba(13,13,13,0.85) 100%
    );
    z-index: 2;
}*/

/* Content panel */
/*#hero-content {
    position: absolute;
    top: 50%;
    right: 8%;
    transform: translateY(-50%);
    z-index: 3;
    text-align: right;
    max-width: 480px;
}

#hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.1;
    color: var(--clr-accent);
    margin-bottom: 1.2rem;
    transition: opacity 0.4s, transform 0.4s;
}

#hero-desc-wrap {
    background: rgba(13,13,13,0.7);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    transition: opacity 0.4s;
}

#hero-desc-wrap svg {
    width: 22px;
    height: 22px;
    color: var(--clr-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

#hero-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;*/ /* number of lines */
    /*-webkit-box-orient: vertical;
    overflow: hidden;
}

#hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--clr-accent);
    color: #fff;
    padding: 0.65rem 1.6rem;
    border-radius: 2px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: background 0.2s, transform 0.2s;
}

#hero-cta:hover {
    background: var(--clr-accent2);
    transform: translateX(-3px);
}*/

/* Nav arrows */
/*.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}

.hero-arrow:hover { background: rgba(255,255,255,0.25); }
.hero-arrow svg   { width: 20px; height: 20px; }*/
#arrow-prev       { right: 1.5rem; }
#arrow-next       { left: 1.5rem; }

/* Fade animation */
.hero-fade-enter {
    animation: fadeSlide 0.5s ease forwards;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-45%) translateX(12px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}


/* ══════════════════════════════════════════════════
   TIMELINE BAR
══════════════════════════════════════════════════ */
#timeline-section {
    background: var(--clr-bg);
    border-top: 1px solid var(--clr-border);
    position: relative;
    user-select: none;
    height: 160px;
}

/* Year axis */
#timeline-axis {
    background: #111;
    border-bottom: none; /*1px solid var(--clr-border);*/
    display: flex;
    align-items: center;
  /*  overflow: hidden;*/
    position: relative;
    direction: rtl;
    height: 40px;
    overflow: visible !important;
  /*  position: relative;*/
    z-index: 0;
/*    display: inline-block;*/
}

#axis-inner {
    display: flex;
    align-items: center;
    height: 100%;
    position: absolute;
    top: 0;
    transform: scaleX(-1);
}

.axis-tick {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
}

.axis-tick-label {
    font-size: 0.72rem;
    color: var(--clr-muted);
    white-space: nowrap;
    margin-bottom: 3px;
    transform: scaleX(-1); /* عكس النص عشان يرجع صح بعد عكس الـ container */
    display: inline-block;
}

.axis-tick-line {
    width: 1px;
    height: 8px;
    background: var(--clr-border);
}

/* Era blocks row */
#era-blocks-wrap {
    /*overflow-x: auto;*/
    /*overflow-y: hidden;*/
    /*scrollbar-width: thin;
    scrollbar-color: #333 transparent;
    cursor: grab;
    direction: rtl;
    height: 120px;
    overflow-y: visible;*/ /* allow labels to show above */
/*    overflow-x: auto;*/
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
    cursor: grab;
    direction: rtl;
    height: 120px;
    /*margin-top: 0;*/ /* remove any gap */
    padding-top: 0;
    margin-top: -1px;
}

#era-blocks-wrap:active          { cursor: grabbing; }
#era-blocks-wrap::-webkit-scrollbar       { height: 4px; }
#era-blocks-wrap::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

#era-blocks-inner {
    /*display: flex;
    align-items: stretch;
    height: 110px;
    position: relative;*/
    /* عكس الـ container عشان الأقدم يكون على اليمين */
    /*transform: scaleX(-1);
    
    padding-top: 40px;*/
    display: flex;
    align-items: stretch;
    height: 100%;
    position: relative;
    transform: scaleX(-1);
    padding-top: 0; /* REMOVE this — was pushing blocks down */
    margin-top: 0;
}

/* عكس كل block عشان النص يفضل صح */
.era-block {
    transform: scaleX(-1);
}

/* Single era block */
/*.era-block {
    position: absolute;
    top: 0;
    height: 100%;
    cursor: pointer;
    border-right: 1px solid rgba(0,0,0,0.4);
    transition: filter 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 8px 8px;
}*/

.era-block:hover { filter: brightness(1.3); }

.era-block.active {
    /*outline: 2px solid #fff;*/
    outline-offset: -2px;
    filter: brightness(1.2);
    z-index: 20;
    height:210px;
    top:-45px;
    opacity:0.83
}

/* Label inside block */
.era-block-label {
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    /*opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;*/
}

.era-block:hover .era-block-label,
.era-block.active .era-block-label {
   /* opacity: 1;*/
    transform: translateY(0);
}

/* Tooltip above active block */
#era-tooltip {
    position: absolute;
    top: -36px;
    background: #fff;
    color: #000;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 2px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 10;
    transition: left 0.3s ease;
}

#era-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #fff;
    border-bottom: none;
}


/* ── Start/end date labels on active block ── */
.era-date {
    position: absolute;
    bottom: calc(100% + 4px); /* sit just above the axis */
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    color: #fff;
    opacity: 0; /* hidden by default */
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

 .era-date {
    opacity: 1; /* show only on active block */
}

.era-date-start {
    right: 0; /* RTL: start date on right edge */
    transform: translateX(50%);
}

.era-date-end {
    left: 0; /* RTL: end date on left edge */
    transform: translateX(-50%);
}




/* ── Era name pill above block ── */
/*#title_selected {
    position: absolute;
    bottom: 100%;
    margin-bottom: 4px;
    display: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    padding: 4px 14px;*/
    /* border-radius: 4px;*/
    /*white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transform: translateX(-50%);
    transition: left 0.25s ease;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
}*/

/* ── Start date — large bold, left edge of block ── */
#date_start_selected {
    position: absolute;
    bottom: 2px;
    display: none;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Rockwell Nova', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transform: translateX(-50%);
    transition: left 0.25s ease;
   /* text-shadow: 0 1px 4px rgba(0,0,0,0.6);*/
    /* Property 1=left */
    /* Auto layout */
    display: flex;
    /*flex-direction: row;
    align-items: center;
    padding: 0px 0px 0px 9px;
    gap: 5px;
    position: absolute;
    width: 143px;
    height: 31px;
    left: 20px;
    top: 20px;*/
    background: linear-gradient(270deg, rgba(36, 36, 36, 0) 0%, #242424 36.06%);
}

/* ── End date — large bold muted, inside block ── */
#date_end_selected {
    position: absolute;
    bottom: 2px;
    display: none;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Rockwell Nova', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transform: translateX(-50%);
    transition: left 0.25s ease;
    top: 0; /* sit at TOP of axis row */
    /*background: linear-gradient(270deg, rgba(36, 36, 36, 0) 0%, #242424 36.06%);*/
}



#timeline-section {
    overflow: visible !important;
}


.era-block {
    position: absolute;
    top: 0;
    height: 100%;
    cursor: pointer;
    border-right: 1px solid rgba(0,0,0,0.4);
    transition: filter 0.2s;
    overflow: visible; /* allow it to show labels */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 8px 8px;
    transform: scaleX(-1);
}

/* Title pill and dates sit on the axis — position them there via JS */
#title_selected {
    position: absolute;
    bottom: 100%; /* above the axis-inner's top */
    margin-bottom: 2px;
    display: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Noto Kufi Arabic', sans-serif;
    padding: 10px 23px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    transform: translateX(-50%);
    transition: left 0.25s ease;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
}