/* History page specific styles */

.history-page {
    padding: 80px 0 120px;
}



.history-hero {
    max-width: 1120px;
    margin: 0 auto 64px;
    padding: 0 24px;
}

.history-hero-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.history-hero-copy {
    max-width: 720px;
    text-align: center;
}

#main .history-hero-title {
    font-size: 40px;
    line-height: 1.15;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.history-hero-lead {
    margin: 0 0 20px;
    font-size: 20px;
    line-height: 1.6;
}

.history-hero-arrow {
    margin-top: 32px;
    animation: history-arrow-bounce 1.6s ease-in-out infinite;
}

.history-hero-arrow-icon {
    display: inline-block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: #b3b3b3;
    position: relative;
}

.history-hero-arrow-icon::before,
.history-hero-arrow-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffd800;
}

.history-hero-arrow-icon::before {
    width: 3px;
    height: 36px;
    top: 15px;
}

.history-hero-arrow-icon::after {
    width: 14px;
    height: 14px;
    bottom: 19px;
    border-right: 3px solid #ffd800;
    border-bottom: 3px solid #ffd800;
    background: transparent;
    transform: translateX(-50%) rotate(45deg);
}

@keyframes history-arrow-bounce {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }
    30% {
        transform: translateY(8px);
        opacity: 1;
    }
    60% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 0.9;
    }
}


.history-hero-copy .history-intro {
    font-size: 18px;
    line-height: 1.6;
}

.history-react-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.history-react-wrapper {
    padding: 24px 0 40px;
}

.history-era-header {
    max-width: 640px;
    margin: 30px auto 40px;
    padding: 28px 48px 32px;
    background-color: #343639;
    border: 6px solid #e5e2d8;
    text-align: center;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0px 4px 4px 0px #00000040;

}

/* Yellow corner triangles – gradient so we get a single triangle, not a square */
.history-era-header::before,
.history-era-header::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    z-index: 0;
}

/* Top-left: right angle at corner, legs along top and left edges */
.history-era-header::before {
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #ffdd00 50%, transparent 50%);
}

/* Bottom-right: right angle at corner, legs along bottom and right edges */
.history-era-header::after {
    bottom: 0;
    right: 0;
    background: linear-gradient(315deg, #ffdd00 50%, transparent 50%);
}

#main .history-era-title {
    font-size: 36px;
    line-height: 1.2;
    margin: 0 0 8px;
    text-transform: uppercase;
    color: #ffffff;
    position: relative;
    z-index: 1;
    color: #ffdd00;
    text-transform: none;
}

.history-era-description {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

.history-timeline {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
}

.history-timeline-line {
    position: absolute;
    left: 50%;
    top: -40px;
    bottom: 24px;
    transform: translateX(-50%);
    border-left: 6px solid #2D2D2D;
}

.history-timeline-line::after {
    content: '';
    position: absolute;
    left: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    transform: translateX(-50%) rotate(45deg);
    border-right: 6px solid #2D2D2D;
    border-bottom: 6px solid #2D2D2D;
    background: transparent;
}

/* Special end marker for the last (2020) timeline: big grey ball with yellow center */
.history-timeline-end .history-timeline-line::after {
    left: 50%;
    bottom: -140px; /* move grey circle further down */
    width: 156px;
    height: 156px;
    transform: translateX(-50%);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background: #A8A8A8;
    border-radius: 50%;
    z-index: 1;
}

.history-timeline-end .history-timeline-line::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -100px; /* keep yellow centered inside the grey circle */
    width: 73px;
    height: 73px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #FEE220;
    z-index: 2;
    animation: history-end-pulse 2.2s ease-in-out infinite;
}

/* Add extra space so the end marker doesn't overlap following content */
.history-timeline-end {
    padding-bottom: 180px;
}

.history-end-tooltip-wrapper {
    position: relative;
    max-width: 960px;
    margin: 0 auto 80px;
    padding-top: 24px;
}

.history-end-trigger {
    position: absolute;
    left: 50%;
    bottom: -90px;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-end-trigger-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #2D2D2D;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 3;
    pointer-events: none;
    margin-left:5px;
}

.history-end-tooltip {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(12px);
    background: #D9D9D9;
    padding: 18px 22px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.history-end-tooltip.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.history-end-quote-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FEE220;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
  
}

.history-end-quote-text {
    flex: 1 1 auto;
    text-align: center;
    padding:0 50px;
}

.history-end-quote-main {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.history-end-quote-author {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
}

@keyframes history-end-pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(0.8);
    }
    100% {
        transform: translateX(-50%) scale(1);
    }
}

.history-timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    margin-bottom: 56px;
    margin-bottom:0px;
}

.history-timeline-center {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.history-timeline-row-top .history-timeline-center {
    grid-column: 2;
}

.history-timeline-row-top .history-card-image-right {
    grid-column: 3;
    margin-left: 20px; /* spacing from vertical line on the right */
    justify-self: flex-start; /* pull figure towards the center */
}

.history-timeline-row-bottom .history-card-image-left {
    grid-column: 1;
    margin-right: 20px; /* spacing from vertical line on the left */
    justify-self: flex-end; /* pull figure towards the center */
}

/* Constrain figure width so caption does not grow much wider than the image */
.history-card-image-left,
.history-card-image-right {
    display: block;
    max-width: 100%;
    width: fit-content;
    max-width: 420px; /* can be adjusted if needed */
}

.history-timeline-row-bottom .history-timeline-center {
    grid-column: 2;
}

/* Section/element overlap: set margin-top (negative = pull up) per item – desktop only */
@media (min-width: 901px) {
    .section-1950-element-2 {
        margin-top: -140px;
    }

    .section-1960-element-2 {
        margin-top: -110px;
    }

    .section-1960-element-3 {
        margin-top: -130px;
    }

    .section-1970-element-2 {
        margin-top: -90px;
    }
    .section-1970-element-3 {
        margin-top: -100px;
    }
    .section-1970-element-4 {
        margin-top: -120px;
    }

    .section-1980-element-2 {
        margin-top: -110px;
    }

    .section-1980-element-3 {
        margin-top: -140px;
    }
    .section-1980-element-4 {
        margin-top: -120px;
    }

    .section-1990-element-2 {
        margin-top: -110px;
    }

    .section-2000-element-2 {
        margin-top: -120px;
    }
    .section-2000-element-3 {
        margin-top: -110px;
    }
    .section-2000-element-4 {
        margin-top: -120px;
    }

    .section-2010-element-2 {
        margin-top: -120px;
    }
    .section-2010-element-3 {
        margin-top: -110px;
    }
    .section-2010-element-4 {
        margin-top: -120px;
    }

    .section-2020-element-2 {
        margin-top: -130px;
    }
    .section-2020-element-3 {
        margin-top: -110px;
    }
}

.history-timeline-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #FFD800;
    border: 4px solid #2D2D2D;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* CTA: book + "read more" copy */

.history-cta {
    max-width: 1200px;
    margin: 140px auto 0;
    padding: 0 24px 80px;
}

.history-cta-inner {
    display: grid;
    grid-template-columns:320px minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.history-cta-image {
    display: flex;
    justify-content: center;
}

.history-cta-circle {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background-color: #D9D9D9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-cta-circle img {
    width:320px;
    height: auto;
    display: block;
}

.history-cta-text {
    max-width: 520px;
}

#main .history-cta-title {
    margin: 0 0 12px;
    font-weight: 700;
    font-style: normal;
    font-size: 25px;
    
    line-height: 1.2;
    text-transform: none;
}

.history-cta-body {
    margin: 0;
    font-weight: 500;
    font-style: normal;
    font-size: 20px;
    
    font-weight: 400;
    line-height: 1.2;
    line-height:1.6;
}

.history-cta-body a {
    color: inherit;
    text-decoration: underline;
}

.history-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 24px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.history-era-heading {
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.history-era-subtitle {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.6;
    color: #333c4d;
}

.history-card-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.history-card-image {
    margin: 0;
    background: #ffffff;
    overflow: hidden;
}

.history-card-image img {
    display: block;
    border: 9px solid #EDEAD9;
    box-shadow: 0px 4px 4px 0px #00000040;

 
}

.history-card-image figcaption {
    width: 500px;
    max-width: 100%;
    padding: 10px 12px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #333c4d;
    
    line-height: 1.2;
    padding-left: 0;
    padding-right: 0;
    margin-top: 10px;
}

.history-card-image figcaption strong {
    display: block;
    margin-bottom: 2px;
}

.history-card-credit {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #8a93a7;
    font-size:12px;
}

/* Scroll reveal animations for history images */

.history-card-image-left,
.history-card-image-right {
    opacity: 0;
    transform: translateX(0); /* will be overridden below */
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.history-card-image-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transform: translateX(-40px);
}

.history-card-image-left figcaption {
    text-align: right;
}

.history-card-image-right {
    transform: translateX(40px);
}

.history-card-image-left.is-visible,
.history-card-image-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 900px) {
  .history-era-header::before,
  .history-era-header::after {
    width: 24px;
    height: 24px;
  }



  .history-era-header {
    text-align: left;
  }

  #main .history-era-title {
    text-align: left;
  }

  .history-era-description {
    text-align: left;
  }

  .history-card-image figcaption,
  .history-card-image-left figcaption {
    text-align: left;
  }

  .history-card-image-left {
    align-items: flex-start;
  }

  .history-react-section {
    padding:0;
  }

  .history-page {
        padding: 48px 0 80px;
    }

    .history-react-wrapper {
        padding: 28px 18px 40px;
        padding:0;
    }

    .history-timeline {
        max-width: none;
        margin: 0;
        padding-left: 32px;
    }

    .history-timeline-line {
        left: 53px;
    }

    .history-timeline-row {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 32px;
        grid-template-columns: none;
    }

    .history-timeline-center {
        width: 40px;           /* allow space for 30px circle + 4px borders */
        flex: 0 0 40px;
        justify-content: center;
    }

    /* Always keep the timeline (ball) column on the left and content on the right */
    .history-timeline-row .history-timeline-center {
        order: 0;
    }

    .history-timeline-row .history-card-image {
        order: 1;
        flex: 1 1 auto;
        min-width: 0; /* allow flex item to shrink below content size */
        max-width: 100%;
        margin: 0; /* reset desktop margins near the vertical line for mobile */
    }

    /* Prevent images from being cut off – constrain to container */
    .history-card-image img {
        max-width: 100%;
        height: auto;
        width: auto;
        box-sizing: border-box;
    }

    .history-timeline-row-top .history-card-image-right img,
    .history-timeline-row-bottom .history-card-image-left img {
        margin: 0; /* no extra offset for images on mobile */
    }

    .history-cta {
        padding: 40px 16px 60px;
    }

    .history-cta-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: left;
    }

    .history-cta-text {
        max-width: none;
        text-align: left;
    }

    /* End trigger: align with left-aligned grey circle (same as timeline line), smaller ball */
    .history-end-trigger {
        left: 0px;
        transform: none;
        width: 100px;
        height: 100px;
        bottom: -66px;
    }

    /* Center the ? inside the white ball on mobile */
    .history-end-trigger-icon {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    .history-end-tooltip {
        left: 170px;
        transform: translateX(-50%) translateY(12px);
        bottom: -0px;
    }
}

/* Lightbox styles */
.history-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease-in-out;
    overflow-y: auto;
}

.history-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.history-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.history-lightbox-content {
    position: relative;
    max-width: 90vw;
    width: auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    transform: scale(0.9);
    transition: transform 300ms ease-in-out;
    margin: auto;
}

.history-lightbox.is-open .history-lightbox-content {
    transform: scale(1);
}

.history-lightbox-image {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border: 9px solid #EDEAD9;
    box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.5);
    background: #ffffff;
}

.history-lightbox-caption {
    margin-top: 20px;
    padding: 16px 20px;
    background: #D9D9D9;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: #333c4d;
    text-align: center;
    box-sizing: border-box;
    display:none !important;
}

.history-lightbox-caption strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.history-lightbox-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    border: none;
    background: #ffffff;
    color: #2D2D2D;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
    z-index: 2;
}

.history-lightbox-close:hover {
    background: #FFD800;
    color: #2D2D2D;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.history-lightbox-close:focus {
    outline: 2px solid #FFD800;
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .history-lightbox {
        padding: 50px 15px 15px;
    }

    .history-lightbox-content {
        max-width: 95vw;
        width: auto;
    }

    .history-lightbox-image {
        max-height: calc(75vh - 100px);
        border-width: 6px;
    }

    .history-lightbox-close {
        top: -14px;
        right: -14px;
        width: 36px;
        height: 36px;
        font-size: 32px;
    }

    .history-lightbox-caption {
        margin-top: 16px;
        padding: 12px 16px;
        font-size: 13px;
        max-width: 100%;
    }
}

