/*
    Cursor — custom cursor that follows the mouse and shows
    instruction text when hovering any element with [data-cursor-text].
    Reusable: add data-cursor-text="Whatever" to any interactible element.
*/

.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    padding: 0;
    background-color: var(--color-bg, white);
    color: var(--color-text, black);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    translate: -50% -50%;
    transform: translate(var(--cursor-x, 0px), var(--cursor-y, 0px));
    transition:
        width 250ms var(--easing-gentle),
        height 250ms var(--easing-gentle),
        padding 250ms var(--easing-gentle),
        background-color 250ms var(--easing-gentle),
        opacity 200ms var(--easing-gentle);
}

.cursor.is-visible {
    opacity: 1;
}

.cursor-text {
    display: inline-block;
    font-size: var(--text-min);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
    align-self: center;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 200ms var(--easing-gentle);
}

.cursor.has-text,
.cursor.has-icon {
    width: auto;
    height: auto;
    padding: 0.125rem 0.25rem;
    background-color: var(--color-bg, white);
    color: var(--color-text, black);
    mix-blend-mode: normal;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25em;
}

.cursor.has-text .cursor-text {
    opacity: 1;
}

/* Icons — pre-rendered inline in the cursor markup; JS toggles .is-active. */
.cursor-icon {
    display: none;
    line-height: 0;
}

.cursor-icon.is-active {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
}

.cursor-icon svg {
    width: 0.75rem;
    height: 0.75rem;
    display: block;
}

/* Inherit the cursor's text colour, so both the black arrows and the
   white expand icon render correctly inside the pill. */
.cursor-icon svg path {
    fill: currentColor;
}

/* Hide the native cursor on elements that drive the custom cursor */
[data-cursor-text],
[data-cursor-icon] {
    cursor: none !important;
}

/* Touch/no-hover devices: skip the custom cursor altogether */
@media (hover: none), (pointer: coarse) {
    .cursor { display: none; }
    [data-cursor-text],
    [data-cursor-icon] { cursor: pointer; }
}


/*
    Button
*/

.button {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    background-color: rgba(220, 220, 220, 1);
    color: var(--color-text, black);
    transition: 300ms var(--easing-gentle);
}

.button:hover {
    background-color: rgba(180, 180, 180, 1);
}

/*
    Link
*/

.link {
    position: relative;
    padding: 0;
    text-decoration: none;
    height: fit-content;
    font-size: var(--text-smaller);
    color: inherit;
}

.link::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.1em;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(1);
    transform-origin: left center;
    transition: transform 600ms var(--easing-gentle);
}

.link:hover::before,
.link:focus-visible::before {
    transform: scaleX(0);   
}


/*
    Icon — appends an SVG icon (from /assets/icons) after any element
    with a [data-icon] attribute. Color follows currentColor.
*/

[data-icon]::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.4em;
    margin-bottom: 0.1em;
    vertical-align: middle;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

[data-icon="icon-arrow-down"]::after,
[data-icon="arrow-down"]::after {
    background-color: currentColor;
    -webkit-mask-image: url("../icons/icon-arrow-down.svg");
    mask-image: url("../icons/icon-arrow-down.svg");
}

[data-icon="icon-arrow-top-right"]::after,
[data-icon="top-right-arrow"]::after {
    background-color: currentColor;
    -webkit-mask-image: url("../icons/icon-arrow-top-right.svg");
    mask-image: url("../icons/icon-arrow-top-right.svg");
}

/*
    Card
*/

.card {
    position: relative;
    display: block;
    height: fit-content;
}

.card-picture,
.card-picture-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.card-content {
    margin-top: 0.25rem;
}

.card-content-title {
    font-size: var(--text-h2);
    letter-spacing: -4%;
    line-height: 1em;
    margin: 0 0 1rem;
}

.card-content-details {
    font-size: var(--text-smaller);
    text-transform: uppercase;
    letter-spacing: 20%;
}

/* Large card: spans 2 columns and uses 3/2 image ratio */
.card--large .card-picture,
.card--large .card-picture-img {
    aspect-ratio: 3/2;
}

@media screen and (min-width: 640px) {
    .card--large {
        grid-column: span 2;
    }

    .card-content-title {
        font-size: var(--text-h3);
    }
}

/* Small card: horizontal 3/2 image and smaller title */
.card--small .card-picture,
.card--small .card-picture-img {
    aspect-ratio: 3/2;
}

.card--small .card-content-title {
    font-size: var(--text-p);
    margin: 0 0 0.5rem;
}

/* Absolute card: content sits on top of the image */
.card--absolute .card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    padding: 4rem 0.6rem 0.6rem;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    
    margin: 0;
    color: var(--color-bg, white);
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.28) 30%,
        rgba(0, 0, 0, 0.12) 60%,
        rgba(0, 0, 0, 0) 100%);
}

.card--absolute .card-content-title {
    margin: 0 0 0.25rem;
}

.card--absolute .card-content-details {
    margin: 0;
}

/* Reveal-on-hover content variant of .card--absolute */
.card--absolute.card--reveal .card-content {
    opacity: 0;
    transition: opacity 300ms var(--easing-gentle);
}

.card--absolute.card--reveal:hover .card-content,
.card--absolute.card--reveal:focus-within .card-content {
    opacity: 1;
}


/*
    Cardlet — image on the right, text on the left
*/

.cardlet {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: start;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    padding-top: 1rem;
}


.cardlet-picture,
.cardlet-picture-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.cardlet-content {
    padding-right: 1rem;
}

.cardlet-content-title {
    font-size: var(--text-h4);
    line-height: 1em;
    letter-spacing: -4%;
    margin: 0 0 1rem;
}

.cardlet-content-details {
    font-size: var(--text-smaller);
    text-transform: uppercase;
    letter-spacing: 20%;
}

@media screen and (min-width: 800px) {
    .cardlet {
        grid-column: span 2;
    }

    .cardlet-content {
        padding-right: 2rem;
    }
}

@media screen and (min-width: 1024px) {
    .cardlet {
        grid-column: span 2;
    }
}


/*
    Table — generic row-based table with a top-border separator
*/

.table {
    display: flex;
    flex-direction: column;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.table-cell {
    font-size: var(--text-p);
    line-height: 1.2em;
}

.table-cell--details {
    font-size: var(--text-smaller);
    text-transform: uppercase;
    letter-spacing: 15%;
}

@media screen and (min-width: 800px) {
    .table-row {
        grid-template-columns: 1fr 5fr 2fr 4fr;
        align-items: start;
    }
}


/*
    Blocks
*/

/* Blocks: Text */

.block-text {
    font-size: var(--text-p);
    line-height: 130%;
    letter-spacing: -2%;
    padding: 1rem;
    margin: 1rem 0;
}

.block-text-aside {
    font-size: var(--text-smaller);
    line-height: 140%;
    margin-top: 1.5rem;
}

@media screen and (min-width: 640px) {
    .block-text {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 1rem;
    }

    .block-text-main,
    .block-text-aside {
        grid-column: 2/-2;
    }

    /* Has-aside: main keeps left columns, aside takes the right pair */
    .block-text--has-aside .block-text-main {
        grid-column: 2/6;
    }

    .block-text--has-aside .block-text-aside {
        grid-column: 6/-2;
        margin-top: 0;
        position: sticky;
        top: 6rem;
    }
}

@media screen and (min-width: 1024px) {
    .block-text {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 1rem;
    }

    .block-text-main,
    .block-text-aside {
        grid-column: 4/-4;
    }

    /* Has-aside: main ≈ left 2/3, aside ≈ right 1/3 of the content area */
    .block-text--has-aside .block-text-main {
        grid-column: 2/7;
    }

    .block-text--has-aside .block-text-aside {
        grid-column: 8/-1;
        margin-top: 0;
        padding-right: 2rem;
    }
}

/* Blocks: Heading */
.block-heading {
    font-size: var(--text-h3);
    letter-spacing: -4%;
    padding: 1rem;
    margin: 1rem 0 0;
}

@media screen and (min-width: 640px) {
    .block-heading {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 1rem;
    }

    .block-heading * {
        grid-column: 2/-2;
    }
}

@media screen and (min-width: 1024px) {
    .block-heading {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 1rem;
    }

    .block-heading * {
        grid-column: 4/-4;
    }
}

/* Blocks: Quote */
.block-quote {
    padding: 1rem;
    margin: 2rem 0;
}

.block-quote-text {
    font-size: var(--text-h3);
    line-height: 100%;
    letter-spacing: -4%;
    padding: 0 2rem;
    margin-bottom: 1rem;
}

.block-quote-citation {
    font-size: var(--text-smaller);
    text-transform: uppercase;
    letter-spacing: 15%;
    padding: 0 2rem;
}

@media screen and (min-width: 640px) {
    .block-quote {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 1rem;
    }

    .block-quote * {
        grid-column: 2/-2;
    }
}

@media screen and (min-width: 1024px) {
    .block-quote {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 1rem;
    }

    .block-quote * {
        grid-column: 4/-4;
    }

    .block-quote-text,
    .block-quote-citation {
        padding: 0 6rem 0 4rem;
    }
}

/* Blocks: Image */
.block-image {
    margin: 2rem 0;
    height: 100dvh;
    max-height: 100dvh;
    scroll-snap-align: center;
}

.block-image-picture,
.block-image-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media screen and (min-width: 640px) {
    .block-image {
        margin: 4rem 0;
    }
}


/* Blocks: Gallery */
.block-gallery {
    height: 100dvh;
    max-height: 100dvh;
    scroll-snap-align: center;
    margin: 3rem 0;
}

/* Grid variant: lay out naturally, not full-viewport */
.block-gallery--grid {
    height: auto;
    max-height: none;
    scroll-snap-align: none;
}

@media screen and (min-width: 640px) {
    .block-gallery {
        margin: 6rem 0;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
}

.gallery-grid-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.gallery-grid-item-picture,
.gallery-grid-item-picture img,
.gallery-grid-item .video-player,
.gallery-grid-item .video-player-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* When a ratio is set, lock the thumbnail to it; otherwise flow naturally */
.gallery-grid-item {
    aspect-ratio: var(--ratio, auto);
}

/* The companion slideshow acts only as the lightbox: hidden until opened */
.gallery-grid-lightbox .slideshow:not(.is-fullscreen) {
    display: none;
}

@media screen and (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media screen and (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blocks: Video */
.block-video {
    max-height: 100dvh;
    scroll-snap-align: center;
    margin: 3rem 0;
}

/* 
    Particles 
*/
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}


/* 
    List 
*/

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    border-top: 1px solid var(--color-text, black);
    padding: 0.25rem 0 0.4rem;
    transition: 300ms var(--easing-gentle);
}

.list--side .list-item,
.list:hover .list-item {
    opacity: 0.25;
}

.list-item.active,
.list-item:hover,
.list-item:focus-visible {
    opacity: 1 !important;
}

.list-item button {
    text-transform: uppercase;
    font-size: var(--text-smaller);
    letter-spacing: 15%;
    text-align: left;
    padding: 0;
    width: 100%;
}

.list--white .list-item {
    border-color: var(--color-bg, white);
}