/* ==========================================================================
   DOCK Programme Timeline Stylesheet (BEM Methodology)
   Theme: Nautical Festival Timeline (High-Contrast Brutalist)
   ========================================================================== */

:root {
    --dock-black: #000000;
    --dock-white: #ffffff;
    --dock-gray: #5f5e5e;
    --dock-border-width: 6px;
    --dock-font: 'GT Pressura Mono', 'Courier New', Courier, monospace;
}

/* 1. Master Timeline Container */
.dock-timeline {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: var(--dock-font);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent; /* Seamless integration with pure white site background */
    overflow: hidden;
}

.dock-timeline *,
.dock-timeline *::before,
.dock-timeline *::after {
    box-sizing: border-box;
}

/* Fixing Elementor img height originally set to auto via .elementor img */
.dock-timeline__event img {
    height: 100%;
}

/* 2. Central Vertical Spine (Rope) */
.dock-timeline__rope {
    position: absolute;
    top: 72px; /* Starts exactly behind the boat's center */
    bottom: 60px; /* Ends exactly behind the anchor's center */
    left: 50%;
    width: 16px; /* 16px wide as requested */
    transform: translateX(-50%);
    background-image: url('../images/rope.svg');
    background-repeat: repeat-y;
    background-position: center top;
    z-index: 1;
}

/* 3. Top and Bottom Nautical Elements */
.dock-timeline__boat,
.dock-timeline__anchor {
    position: relative;
    z-index: 2; /* Sits on top of the rope line */
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.dock-timeline__boat {
    margin-bottom: 20px;
}

.dock-timeline__anchor {
    margin-top: 100px;
}

.dock-timeline__boat img {
    max-width: 300px; /* 300px max-width as requested */
    width: 100%;
    height: auto;
}

.dock-timeline__anchor img {
    max-width: 180px;
    width: 100%;
    height: auto;
}

/* 4. Date Group Section (Symmetric sign spacing) */
.dock-timeline__date-group {
    position: relative;
    width: 100%;
    z-index: 2;
    margin: 0; /* Clear margins to allow date header margins to define spacing */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 5. Date Hanging Sign (Equally spaced top and bottom, full-size responsive scaling) */
.dock-timeline__date-header {
    position: relative;
    width: 440px; /* Sign stays just as big on mobile */
    height: 200px; /* Sign stays just as big on mobile */
    max-width: 100%; /* Scales down fluidly only if screen is narrower than 440px */
    margin: 100px auto 100px auto; /* 100px top and bottom as requested */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.dock-timeline__date-header-bg {
    position: absolute;
    top: 0;
    left: -2px; /* Shifted left by -2px as requested */
    width: 100%;
    height: 100%;
    background-image: url('../images/rope-sign.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -1;
}

/* Two-line date title: Date on top, Day on bottom */
.dock-timeline__date-title {
    font-family: var(--dock-font);
    font-size: 2rem; /* 2rem as requested */
    font-weight: 700;
    color: var(--dock-black);
    text-align: center;
    margin: 5rem 0 0 0; /* margin-top 5rem as requested to perfectly center text */
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.dock-timeline__date-day-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.dock-timeline__date-day-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

/* 6. Events List Wrapper */
.dock-timeline__events {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 60px;
    z-index: 3;
}

/* 7. Event Row Wrapper */
.dock-timeline__event {
    position: relative;
    display: flex;
    width: 100%;
    z-index: 3;
    transition: all 0.3s ease;
}

/* 8. Event Card (Rounded 15px, brutalist borders, padded internally) */
.dock-timeline__event-card {
    display: flex;
    flex-direction: column; /* Vertically stack top side-by-side and bottom specs */
    width: 100%;
    max-width: 600px;
    background-color: var(--dock-white);
    border: var(--dock-border-width) solid var(--dock-black);
    border-radius: 15px; /* 15px border radius as requested */
    text-decoration: none;
    color: var(--dock-black);
    box-shadow: 10px 10px 0px var(--dock-black);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    padding: 24px; /* Internal content padding */
}

/* Cursor mapping depending on clickability */
a.dock-timeline__event-card {
    cursor: pointer;
}

div.dock-timeline__event-card {
    cursor: default; /* Non-clickable standard/shorts cards have default pointer */
}

/* Maintain hover effect on div as well as link card */
.dock-timeline__event-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 14px 14px 0px var(--dock-black);
}

/* 9. Event Image Wrapper-Bordered (Rounded 10px, poster vertical format, filled image) */
.dock-timeline__event-image-wrapper-bordered {
    width: 140px; /* Poster width */
    aspect-ratio: 2/3; /* Vertical movie poster dimensions */
    border: 3px solid var(--dock-black); /* Bordered wrapper like the shorts */
    border-radius: 10px; /* 10px border radius as requested */
    overflow: hidden;
    flex-shrink: 0;
    background-color: #eee;
}

.dock-timeline__event-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fills its container completely as requested */
    display: block;
}

/* 10. Multi-Viewport Layout Rules for Top Section */

/* Default viewport: Small Mobile (<460px) -> Wrapped/Stacked */
.dock-timeline__event-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
}

.dock-timeline__event-image-wrapper-bordered {
    margin-bottom: 20px;
}

.dock-timeline__event-content-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

/* From 460px to 767px -> Side-by-side */
@media (min-width: 460px) and (max-width: 767px) {
    .dock-timeline__event-card-top {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
    .dock-timeline__event-image-wrapper-bordered {
        margin-bottom: 0;
        margin-right: 24px;
    }
    .dock-timeline__event-content-top {
        align-items: flex-start;
    }
}

/* From 768px to 960px -> Wrapped/Stacked (prevents text clipping on tablet grids) */
@media (min-width: 768px) and (max-width: 960px) {
    .dock-timeline__event-card-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .dock-timeline__event-image-wrapper-bordered {
        margin-bottom: 20px;
        margin-right: 0;
    }
    .dock-timeline__event-content-top {
        align-items: center;
    }
}

/* Above 960px -> Side-by-side */
@media (min-width: 961px) {
    .dock-timeline__event-card-top {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
    .dock-timeline__event-image-wrapper-bordered {
        margin-bottom: 0;
        margin-right: 24px;
    }
    .dock-timeline__event-content-top {
        align-items: flex-start;
    }
}

/* Time & Event Title formatting inside Top Content */
.dock-timeline__event-meta-top {
    display: flex;
    align-items: center;
}

/* Digital Event Time Pill (Rounded 10px) */
.dock-timeline__event-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--dock-white);
    background-color: var(--dock-black);
    padding: 6px 14px;
    letter-spacing: 1px;
    border-radius: 10px; /* 10px radius as requested */
}

.dock-timeline__event-title {
    font-family: var(--dock-font);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    text-transform: uppercase;
}

.dock-timeline__event-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--dock-gray);
    margin: 0;
}

/* 11. Specifications Grid (Spans full width at the bottom) */
.dock-timeline__event-specs {
    border-top: 3px solid var(--dock-black);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.dock-timeline__spec-item {
    display: flex;
    font-size: 13px;
    line-height: 1.4;
}

.dock-timeline__spec-label {
    font-weight: 700;
    width: 110px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.dock-timeline__spec-value {
    color: var(--dock-black);
}

/* 12. Short Films Section (for Event Shorts cards) */
.dock-timeline__shorts-container {
    border-top: var(--dock-border-width) solid var(--dock-black);
    margin-top: 16px;
    padding-top: 20px;
    width: 100%;
}

.dock-timeline__shorts-header {
    font-family: var(--dock-font);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 16px 0;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--dock-black);
    padding-bottom: 6px;
    display: inline-block;
}

.dock-timeline__shorts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.dock-timeline__short-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: var(--dock-black);
    cursor: pointer;
    align-items: center;
}

/* Clickable short item hover effect */
.dock-timeline__short-item:hover .dock-timeline__short-title {
    text-decoration: underline;
}

/* Small element short-poster wrapper (10px border radius, limited to 150px width) */
.dock-timeline__short-poster-wrapper {
    width: 100%;
    max-width: 150px; /* Limited to 150px width as requested */
    aspect-ratio: 2/3;
    border: 3px solid var(--dock-black);
    border-radius: 10px; /* 10px radius as requested */
    overflow: hidden;
    position: relative;
    background-color: #eee;
}

.dock-timeline__short-poster {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fills container completely as requested */
    transition: transform 0.3s ease;
}

.dock-timeline__short-item:hover .dock-timeline__short-poster {
    transform: scale(1.05);
}

.dock-timeline__short-title {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dock-black);
    margin: 0;
    text-align: center;
}

/* Empty State Fallback */
.dock-timeline-empty {
    font-family: var(--dock-font);
    font-size: 16px;
    text-align: center;
    color: var(--dock-gray);
    padding: 40px;
}


/* ==========================================================================
   DESKTOP STAGGERED ALIGNMENT (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {

    /* Left aligned rows */
    .dock-timeline__event--left {
        justify-content: flex-end;
        padding-right: calc(50% + 40px); /* 50% + 40px gap from center rope */
    }

    .dock-timeline__event--left .dock-timeline__event-card {
        align-self: flex-end;
    }

    /* Right aligned rows */
    .dock-timeline__event--right {
        justify-content: flex-start;
        padding-left: calc(50% + 40px); /* 50% + 40px gap from center rope */
    }

    .dock-timeline__event--right .dock-timeline__event-card {
        align-self: flex-start;
    }
}


/* ==========================================================================
   MOBILE RESPONSIVENESS (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
    
    .dock-timeline {
        padding: 40px 10px;
    }

    /* Center rope goes behind centered cards */
    .dock-timeline__rope {
        top: 60px;
        bottom: 60px;
        z-index: 1;
    }

    /* Cards centered stack */
    .dock-timeline__event {
        justify-content: center;
        padding: 0 10px;
    }

    .dock-timeline__event-card {
        max-width: 100%;
        z-index: 3;
    }
}
