/* ------------------- */
/* Custom properties   */
/* ------------------- */

:root {
    /* colors */
    --clr-dark: 230 35% 7%;
    --clr-light: 231 77% 90%;
    --clr-white: 0 0% 100%;

    /* font sizes */
    /* mobile */
    
    --fs-900: clamp(5rem, 10vw + 1rem ,9.375rem);
    --fs-800: 3.5rem;
    --fs-700: 1.5rem;
    --fs-600: 1rem;
    --fs-500: 1rem;
    --fs-400: 0.9375rem;
    --fs-300: 1rem;
    --fs-200: 0.875rem;

    /* font-families */
    --ff-serif: "Bellefair", serif;
    --ff-sans-cond: "Barlow Condensed", sans-serif;
    --ff-sans-normal: "Barlow", sans-serif;
}

/* tablet */
/* we use em with media query because of rem in safari browser differ from others browsers and with em is font size consistent across all browsers  */
@media (min-width: 35em) {
    :root {
        --fs-800: 5rem;
        --fs-700: 2.5rem;
        --fs-600: 1.5rem;
        --fs-500: 1.25rem;
        --fs-400: 1rem;
    }
}

/* laptop */
@media (min-width: 45em) {
    :root {
        /* font-sizes */
        --fs-800: 6.25rem;
        --fs-700: 3.5rem;
        --fs-600: 2rem;
        --fs-500: 1.75rem;
        --fs-400: 1.125rem;
    }
}



/* ------------------- */
/* Reset               */
/* ------------------- */

/* https://piccalil.li/blog/a-modern-css-reset/ */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
    margin: 0; 
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    font-weight: 400;
}

.long-name{
    font-size: clamp(1rem, 5vw + 1rem, 2.5rem);
}


/* set up the body */
body {
    font-family: var(--ff-sans-normal);
    font-size: var(--fs-400);
    color: hsl(var(--clr-white));
    background-color: hsl(var(--clr-dark));
    line-height: 1.5;
    min-height: 100vh;
    display: grid;
    grid-template-rows: min-content 1fr;
}

/* make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}
[hidden] {
    display: none !important;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
    font: inherit;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ------------------- */
/* Utility classes     */
/* ------------------- */

.flex {
    display: flex;
    gap: var(--gap, 1rem);
}

/* .equal-columns > *{
    width: 100%;
    outline: 1px solid green;
} */

.grid {
    display: grid;
    gap: var(--gap, 1rem);
}

.d-block{
    display: block;
}

/* the following rule is exactly as 
.flow > * + * {
    margin-top: 1rem;
    outline: 1px solid red;
} */
/* we use :where() to remove the specificity */
/* The difference between the two is that :is() counts towards the specificity of the overall selector (it takes the specificity of its most specific argument), whereas :where() has a specificity value of 0. */
.flow > *:where(:not(:first-child)) { 
    margin-top: var(--flow-space, 1rem);
    /* outline: 1px solid red; */
}

.flow--small-space {
    --flow-space: .75rem;
}

.container {
    padding-inline: 2em;
    margin-inline: auto;
    max-width: 80rem;
}

/* the following class for the screen reader */
/* the element is hidden from the page but still existing in the DOM */
.sr-only { 
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; /* added line */
    border: 0;
  }

  .skip-to-content {
    position: absolute;
    z-index: 9999;
    background: hsl( var(--clr-white) );
    color: hsl( var(--clr-dark) );
    padding: .5em 1em;
    margin-inline: auto;
    transform: translateY(-100%);
    transition: transform 300ms ease-in-out;
}

.skip-to-content:focus {
    transform: translateY(0);
}


/* colors */

.bg-dark{
    background-color: hsl(var(--clr-dark));
}
.bg-accent{
    background-color: hsl(var(--clr-light));
}
.bg-accent-20{
    background-color: hsl(var(--clr-light) / .6);
}
.bg-white{
    background-color: hsl(var(--clr-white));
}
.text-dark{
    color: hsl(var(--clr-dark));
}
.text-accent{
    color: hsl(var(--clr-light));
}
.text-white{
    color: hsl(var(--clr-white));
}

/* typography */

.ff-serif { font-family: var(--ff-serif); } 
.ff-sans-cond { font-family: var(--ff-sans-cond); } 
.ff-sans-normal { font-family: var(--ff-sans-normal); } 

.letter-spacing-1 { letter-spacing: 4.75px; } 
.letter-spacing-2 { letter-spacing: 2.7px; } 
.letter-spacing-3 { letter-spacing: 2.35px; } 

.uppercase { text-transform: uppercase; }

.fs-900 { font-size: var(--fs-900); }
.fs-800 { font-size: var(--fs-800); }
.fs-700 { font-size: var(--fs-700); }
.fs-600 { font-size: var(--fs-600); }
.fs-500 { font-size: var(--fs-500); }
.fs-400 { font-size: var(--fs-400); }
.fs-300 { font-size: var(--fs-300); }
.fs-200 { font-size: var(--fs-200); }


.fs-900,
.fs-800,
.fs-700,
.fs-600 {
    line-height: 1.1;
}

.numbered-title {
    font-family: var(--ff-sans-cond);
    font-size: var(--fs-500);
    text-transform: uppercase;
    letter-spacing: 4.72px; 
}

.numbered-title span {
    margin-right: .5em;
    font-weight: 700;
    color: hsl( var(--clr-white) / .25);
}

/* ------------------- */
/* Components         */
/* ------------------- */

.large-button{
    position: relative;
    display: inline-grid;
    place-items: center;
    padding: 0 2em;
    aspect-ratio: 1;
    text-decoration: none;
    border-radius: 50%;
    z-index: 1;
}

.large-button::after{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: hsl( var(--clr-white) / .125);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 500ms linear, 
                transform 750ms ease-in-out;
}

.large-button:hover::after,
.large-button:focus::after{
    opacity: 1;
    transform: scale(1.5);
}

/* primary header */

.primary-header {
    justify-content: space-between;
    align-items: center;
}

.logo {
    margin: 1.5rem clamp(1.5rem, 5vw, 4.5rem);
}

.primary-navigation{
    --gap: 2rem;
    --underline-gap: 2rem;
    list-style: none;
    /* min() function choose the less value and apply it */
    padding: 0;
    margin: 0;
    /* how we make Glassmorphism effect */
    background-color: hsl(var(--clr-dark) / .95);
    /* backdrop-filter: blur(2rem); */
}

/* because firefox does not support backdrop-filter: blur() */
@supports (backdrop-filter: blur(2rem)) {
    .primary-navigation {
        background-color: hsl(var(--clr-white) / .05);
        backdrop-filter: blur(2rem);
    }
}

.mobile-nav-toggle{
    display: none;
}

.primary-navigation a{
    text-decoration: none;
}

.primary-navigation a > span{
    font-weight: 700;
    margin-right: .5em;
}

/* this media query for mobile navigation */
@media (max-width: 35em) {
    .primary-navigation{
        --gap: 1rem;
        --underline-gap: .5rem;
        flex-direction: column;
        position: fixed;
        inset: 0 0 0 30%;
        z-index: 1000;
        
        list-style: none;
        /* min() function choose the less value and apply it */
        padding: min(10rem, 20vh) 2rem;
        margin: 0;
        transform: translateX(100%);
        transition: transform 500ms ease-in-out;
    }

    .primary-navigation.underline-indicators .active{
        border: 0;
    }

    .primary-navigation[data-visible="true"] {
        transform: translateX(0);
    }

    .mobile-nav-toggle{
        display: block;
        position: absolute;
        z-index: 2000;
        top: 2rem;
        right: 1.5rem;
        border: 0;
        background: transparent;  /* or 0 or none */
        background-image: url("./assets/shared/icon-hamburger.svg");
        background-repeat: no-repeat;
        background-position: center;
        width: 1.5rem;
        aspect-ratio: 1;
        cursor: pointer;
    }

    .mobile-nav-toggle[aria-expanded="true"] {
        background-image: url("./assets/shared/icon-close.svg");
    }

    /* with focus-visible we don't see the outline when clicking with mouse, only when using the keyboard */
    .mobile-nav-toggle:focus-visible{
        outline: 3px solid white;
        outline-offset: 5px;
    }
}

@media (min-width: 35em) {
    .primary-navigation {
        padding-inline: clamp(3rem, 7vw, 10rem);
    }
}

@media (min-width: 85em) {
    .primary-navigation {
        padding-inline: clamp(3rem, 15vw, 10rem);
    }
}

/* this media query because we need the numbers of primary navigation on mobile and desktop version but not on tablet */
@media (min-width: 35em) and (max-width: 45em) {
    .primary-navigation a > span{
        display: none;
    }   
}

@media (min-width: 45em) {
    .primary-header::before{
        content: "";
        display: block;
        position: relative;
        width: 100%;
        height: 1px;
        background-color: hsl(var(--clr-white) / .25);
        order: 2;
        /* transform: translateX(12%); */
        margin-right: -3rem;
        z-index: 3000;
    }
    .logo-box{
        order: 1;
    }
    .primary-header nav {
        order: 3;
    }
    .primary-navigation{
        margin-block: 2rem;
    }
}


.underline-indicators > *{
    padding: var(--underline-gap, 1rem) 0;
    border: 0;
    cursor: pointer;
    border-bottom: .2rem solid hsl(var(--clr-white) / 0);
}

.underline-indicators > *:hover,
.underline-indicators > *:focus{
    border-color: hsl( var(--clr-white) / .5);
}
.underline-indicators > .active,
.underline-indicators > [aria-selected="true"]{
    color: hsl( var(--clr-white) / 1);
    border-color: hsl( var(--clr-white) / 1);
}

.tab-list{
    --gap: 2rem;
    --underline-gap: .5rem;
}
/* 
.dot-indicators {
    --gap: 1rem;
} */

.dot-indicators > * {   
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    /* aspect-ratio: 1; */
    padding: .5rem;
    background-color: hsl( var(--clr-white) / .25)   
}

.dot-indicators > *:hover,
.dot-indicators > *:focus {
    background-color: hsl( var(--clr-white) / .5);
}

.dot-indicators > [aria-selected="true"]{
    background-color: hsl( var(--clr-white) / 1);   
}


.number-indicators {
    flex-direction: column;
}
.number-indicators > * {
    font-size: 1.2rem;
    width: 3rem;
    height: 3rem;
    /* aspect-ratio: 1; */
    border-radius: 50%;
    background-color: hsl( var(--clr-white) / 0);
    color: hsl( var(--clr-white) / 1);
    border: .2rem solid hsl( var(--clr-white) / .125);    
    cursor: pointer;
}

.number-indicators > *:hover{
    border: .2rem solid hsl( var(--clr-white) / .5);
}

.number-indicators > [aria-selected="true"]{
    background-color: hsl( var(--clr-white) / 1);   
    color: #000;
}



/* ----------------------------- */
/* Page specific background      */
/* ----------------------------- */
body {
    background-size: cover;
    background-position: bottom center;
}

/* home */

.home {
    background-image: url("./assets/home/background-home-mobile.jpg");
}

@media (min-width: 35em) {
    .home {
        background-image: url("./assets/home/background-home-tablet.jpg");
    }

    
}

@media (min-width: 45em) {
    .home {
        background-image: url("./assets/home/background-home-desktop.jpg");
    }
}

/* destination */

.destination{
    background-image: url("./assets/destination/background-destination-mobile.jpg");
}

@media (min-width: 35em) {
    .destination {
        background-image: url("./assets/destination/background-destination-tablet.jpg");
    }

    
}

@media (min-width: 45em) {
    .destination {
        background-image: url("./assets/destination/background-destination-desktop.jpg");
    }
}

/* crew */

.crew{
    background-image: url("./assets/crew/background-crew-mobile.jpg");
}

@media (min-width: 35em) {
    .crew {
        background-image: url("./assets/crew/background-crew-tablet.jpg");
    }

    
}

@media (min-width: 45em) {
    .crew {
        background-image: url("./assets/crew/background-crew-desktop.jpg");
    }
}
/* technology */

.technology{
    background-image: url("./assets/technology/background-technology-mobile.jpg");
}

@media (min-width: 35em) {
    .technology {
        background-image: url("./assets/technology/background-technology-tablet.jpg");
    }

    
}

@media (min-width: 45em) {
    .technology {
        background-image: url("./assets/technology/background-technology-desktop.jpg");
    }
}

.tab-list *{
    background-color: transparent;
}

/* ----------------------------- */
/* Layout                        */
/* ----------------------------- */

.grid-container{
    text-align: center;
    display: grid;
    place-items: center;
    padding-inline: 1rem;   
    padding-bottom: 3rem;
}

.grid-container p:not([class]){ /* this selector select only p that not have a class */
    /* ch unit Relative to the width of the "0" (zero) */
    max-width: 50ch;
    /* outline: 3px solid yellow; */
}

.grid-container--destination {
    --flow-space: 2rem;
    grid-template-areas: 
        'title'
        'image'
        'tabs'
        'content'
    ;
}

.numbered-title {
    grid-area: title;
}

/* destination layout */

.grid-container--destination > picture {
    grid-area: image;
    max-width: 50%;
    align-self: start;
}

.grid-container--destination .tab-list{
    grid-area: tabs;
}

.grid-container--destination .destination-info{
    grid-area: content;
}

.destination-meta{
    flex-direction: column;
    padding-top: 2.5rem;
    margin-top: 2.5rem;
    border-top: 1px solid hsl( var(--clr-white) / .125);
}

.destination-meta p{
    font-size: 1.75rem;
}

/* crew layout */

.grid-container--crew {
    --flow-space: 2rem;
    grid-template-areas: 
        'title'
        'image'
        'tabs'
        'content';
}

.grid-container--crew > picture {
    grid-area: image;
    max-width: 60%;
    border-bottom: 1px solid hsl( var(--clr-white) / .125);
}

.grid-container--crew > .dot-indicators {
    grid-area: tabs;
}

.grid-container--crew > .crew-details {
    grid-area: content;
}

.crew-details h2{
    color: hsl( var(--clr-white) / .5);
}

/* technology layout */
.grid-container--technology {
    padding-inline: 0;
    --flow-space: 2rem;
    grid-template-areas: 
        'title'
        'image'
        'tabs'
        'content';
}

.grid-container--technology > picture {
    grid-area: image;
    grid-column: 1 / -1;
}

.grid-container--technology > .number-indicators {
    flex-direction: row;
    grid-area: tabs;
}

.grid-container--technology > .technology-details {
    grid-area: content;
    padding-inline: 1rem;
}


@media (min-width: 35em) {
    .numbered-title {
        justify-self: start;
        margin-top: 2rem;
    }

    .grid-container--technology > .numbered-title{
        margin-left: 1rem;
    }

    .destination-meta{
        flex-direction: row;
        justify-content: space-evenly;
    }

    .grid-container--crew {
        padding-bottom: 0;
        grid-template-areas: 
            'title'
            'content'
            'tabs'
            'image';
    }
}

@media (min-width: 45em) {

    .grid-container{
        text-align: left;
        gap: var(--container-gap, 2rem);
        grid-template-columns: minmax(2rem, 1fr) repeat(2, minmax(0, 40rem)) minmax(2rem, 1fr);
    }

    .grid-container--home > *:first-child{
        grid-column: 2;
        /* outline: 1px solid red; */
    }

    .grid-container--home > *:last-child{
        grid-column: 3;
        /* outline: 1px solid yellow; */
    }

    .grid-container--home{
        /* to push all to the bottom */
        align-items: end;
        /* max() function choose the heigh value and apply it  */
        padding-bottom: max(6rem, 15vh);
    }

    .grid-container--destination {
        grid-template-areas: 
            '. title title .'
            '. image tabs .'
            '. image content .'
        ;
        justify-items: start;
        align-content: start; /* for large screen to prevent content from being away frm each other */
    }

    .grid-container--destination > picture {
        max-width: 90%;
    }


    .destination-meta{
        --gap: min(8vw, 6rem);
        justify-content: start;
    }

    .grid-container--crew {
        grid-template-columns: minmax(2rem, 1fr) minmax(0, 40rem) minmax(0, 20rem) minmax(2rem, 1fr);

        justify-items: start;
        grid-template-areas: 
            '. title title .'
            '. content image .'
            '. tabs image .'
            ;
    }

    .grid-container--crew > picture{
        grid-column: span 2;
        max-width: 80%;
    }

    .grid-container--crew > .dot-indicators {
        align-self: start;
    }

    .grid-container--technology {
        grid-template-columns: minmax(2rem, 1fr) minmax(0, 5rem) minmax(0, 30rem) minmax(0, 45rem) minmax(2rem, 1fr);
        align-items: center;
        --container-gap: 3rem;
        grid-template-areas: 
            '. title title title .'
            '. tabs content image .'
            ;
    }

    .grid-container--technology > .number-indicators{
        --gap: 2rem;
        flex-direction: column;
        justify-self: start;
    }

    .grid-container--technology > picture{
        grid-area: image;
        grid-column: span 2;
        justify-self: end;
        align-self: start;
    }

    .number-indicators > * {
        font-size: 1.5rem;
        width: 5rem;
        height: 5rem;
    }



}




