/* =============================================================================
   styles.css — Best Destinations
   Organised in sections; search for "/* ===" to jump between them.
   ============================================================================= */


/* =============================================================================
   1. DESIGN TOKENS (CSS custom properties)
   ============================================================================= */

:root {
    /* Colours */
    --colour-teal:          #38c1c8;
    --colour-teal-dark:     #14818f;
    --colour-success:       #a3cf53;
    --colour-success-dark:  #5bb13c;
    --colour-yellow:        #f0ad4e;
    --colour-offwhite:      #f6f6f6;
    --colour-gray-light:    #e7e7e0;
    --colour-gray-text:     #555;
    --colour-near-black:    #1d1e1c;
    --colour-dark:          #151515;
    --colour-white:         #ffffff;

    /* Typography */
    --font-body:             -apple-system, BlinkMacSystemFont, 'Open Sans', 'Roboto', sans-serif;
    --font-heading:          -apple-system, BlinkMacSystemFont, Verdana, sans-serif;
    --font-ui:               -apple-system, BlinkMacSystemFont, Verdana, Helvetica, sans-serif;
    --font-size-xs:          0.875em;
    --font-size-sm:          1em;
    --font-size-default:     1.3em;
    --font-size-md:          1.5em;
    --font-size-lg:          2em;
    --font-size-xl:          2.5em;
    --font-size-xxl:         3em;
    --font-weight-thin:      200;
    --font-weight-bold:      600;

    /* Spacing */
    --space-xxs:     0.01rem;
    --space-xs:      0.25rem;
    --space-sm:      0.5rem;
    --space-md:      1rem;
    --space-default: 1.5rem;
    --space-lg:      2rem;
    --space-xl:      3rem;
    --space-xxl:     5rem;

    --letter-spacing-sm:    0.05em;
    --letter-spacing-md:    0.1em;

    /* Line heights */
    --line-height-reset:   0;
    --line-height-xs:      1rem;
    --line-height-sm:      1.25rem;
    --line-height-default: 1.2em;
    --line-height-md:      1.6rem;
    --line-height-lg:      2rem;

    /* Devices */
    --tablet:              767px;
    --desktop:             992px;
    --large-screen:        1080px;
    --extra-large-screen:  1920px;

    /* Layout */
    --min-element-height:            40vh;
    --max-element-height:            80vh;
    --one-third-element-size:        30%;
    --half-element-size:             50%;
    --seventhy-percent-element-size: 70%;
    --eighty-percent-element-size:   80%;
    --ninety-percent-element-size:   90%;
    --default-element-size:          100%;

    --max-screen-width:       100vw;
    --max-content-width:      90vw;
    --max-text-width:         90vw;
    --header-border-width:    1em;
    --min-image-height:       280px;
    --max-image-height:       800px;

    /* Component tokens */
    --contact-inner-max-width: 480px;
    --svg-divider-height:      40px;
    --dropdown-shadow:         0 4px 12px rgba(0, 0, 0, 0.1);
    --chevron-right-offset:    1rem;
    --dropdown-min-width:      180px;
    --card-image-max-width:    65vw;
    --brand-min-width:         100px;
    --icon-width:              20px;
    --carousel-percentage:     -50%;
    --nav-toggle-shift:        -50%;
    --svg-length-percentage:   -50%;
    --svg-angle:               180deg;
    --color-filter-opacity:    0.4;
    --accent-width:            9%;
}


/* =============================================================================
   2. RESET & BASE
   ============================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-xs);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body), sans-serif;
    color: var(--colour-near-black);
    background-color: var(--colour-offwhite);
    line-height: var(--line-height-default);
}

img {
    display: block;
    max-width: var(--default-element-size);
    height: auto;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: var(--font-body), sans-serif;
}


/* =============================================================================
   3. UTILITIES
   ============================================================================= */

.blue-fill       { fill: var(--colour-teal); }
.gray-light-fill { fill: var(--colour-gray-light); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-nav {
    position: absolute;
    top: -999px;
    left: 0;
    background: var(--colour-teal);
    color: var(--colour-white);
    padding: var(--space-sm) var(--space-md);
    z-index: 1000;
}

.skip-nav:focus {
    top: 0;
}


/* =============================================================================
   4. BUTTONS
   ============================================================================= */

.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-default);
    font-family: var(--font-body), sans-serif;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-sm);
    border: 2px solid transparent;
    border-radius: 3px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-green {
    background-color: var(--colour-success);
    border-color: var(--colour-success);
    color: var(--colour-white);
}

.btn-green:hover,
.btn-green:focus {
    background-color: var(--colour-success-dark);
    border-color: var(--colour-success-dark);
    outline: none;
}


/* =============================================================================
   5. HEADER & NAVIGATION
   ============================================================================= */

.page-wrapper {
    background-color: var(--colour-offwhite);
}

header {
    max-width: var(--max-screen-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    border-bottom: var(--header-border-width) solid var(--colour-teal-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.header-brand {
    flex: 0 0 auto;
    min-width: var(--brand-min-width);
    display: flex;
    align-items: center;
}

/* ---- Navigation ---- */
.main-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: var(--default-element-size);
    justify-content: flex-end;
    position: relative !important;
}

/* Nav list — mobile: hidden by default, shown via .nav-open */
.nav-list {
    position: absolute;
    top: var(--default-element-size);
    left: 0;
    width: var(--default-element-size);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-family: var(--font-body), sans-serif;
    background-color: var(--colour-offwhite);
    border: 1px solid var(--colour-gray-light);
    z-index: 200;
}

.nav-list.nav-open {
    display: flex;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    font-family: var(--font-body), sans-serif;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: var(--colour-gray-text);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
    width: var(--default-element-size);
    justify-content: center;
    text-align: center;
    padding: var(--space-md);
}

.nav-item:not(:last-child) {
    border-bottom: 1px solid var(--colour-gray-light);
}

.nav-item {
    font-size: var(--font-size-sm);
    vertical-align: middle;
    color: var(--colour-teal);
}

.dropdown-menu {
    position: static;
    display: none;
    width: var(--default-element-size);
    background-color: var(--colour-gray-light);
    box-shadow: none;
    border: none;
    margin-top: var(--space-sm);
}

.has-dropdown {
    width: var(--default-element-size);
    text-align: center;
}

.dropdown-menu li a {
    display: block !important;
    text-align: center !important;
    padding: var(--space-md) 0;
    font-family: var(--font-body), sans-serif;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-bold);
    margin: 0 auto;
    color: var(--colour-gray-text);
    transition: background-color 0.15s ease;
}

.has-dropdown.open .dropdown-menu {
    display: block;
}

/* Mobile hamburger */
.nav-toggle {
    display: flex;
    background: none;
    border: none;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: inline-block;
}

/* Chevron - Menu */
.dropdown-toggle {
    position: relative;
    width: var(--default-element-size);
    text-align: center;
}

.dropdown-toggle img {
    position: absolute;
    right: var(--chevron-right-offset);
    top: var(--half-element-size);
    transform: translateY(var(--svg-length-percentage));
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"] img {
    transform: translateY(var(--svg-length-percentage)) rotate(var(--svg-angle));
}

.about-card .btn {
    margin-top: auto;
}


/* =============================================================================
   6. BANNER / CAROUSEL
   ============================================================================= */
.banner-wrapper {
    position: relative;
}

.banner-title {
    font-family: var(--font-heading), sans-serif;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-default);
    text-transform: uppercase;
    text-shadow: 1px 1px black;
    display: inline-block;
    padding: var(--space-sm);
    border: 2px solid var(--colour-offwhite);
    margin: 0 auto var(--space-md);
    max-width: var(--ninety-percent-element-size);
}

.banner-description {
    margin: 0 auto;
    max-width: var(--card-image-max-width);
    line-height: var(--line-height-default);
    word-wrap: break-word;
    width: var(--seventhy-percent-element-size);
}

/* Color filter for the carousel images */
.blue-filter,
.darker-filter {
    position: relative;
}

.blue-filter::before,
.darker-filter::before {
    content: "";
    position: absolute;
    inset: 0;
    mix-blend-mode: multiply;
    opacity: var(--color-filter-opacity);
    pointer-events: none;
}

.blue-filter::before   { background-color: #32b3b9; }
.darker-filter::before { background-color: #34425f; }

.carousel-item.blue-filter::after,
.carousel-item.darker-filter::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: var(--color-filter-opacity);
}

.carousel-item.blue-filter::after {
    background-color: #32b3b9;
    mix-blend-mode: multiply;
}

.carousel-item.darker-filter::after {
    background-color: #34425f;
    mix-blend-mode: multiply;
}

/* Carousel elements */
.carousel {
    position: relative;
    overflow: hidden;
    height: var(--min-element-height);
    min-height: var(--min-image-height);
}

.carousel-caption {
    position: absolute;
    top: 45%;
    left: var(--half-element-size);
    transform: translate(var(--carousel-percentage), var(--carousel-percentage));
    width: 95%;
    text-align: center;
    color: var(--colour-white);
    z-index: 2;
    pointer-events: none;
}

.carousel-image {
    width: var(--default-element-size);
    display: block;
    height: var(--min-element-height);
    object-fit: cover;
    min-height: var(--min-image-height);
}

.carousel-item {
    position: absolute;
    inset: 0;
    width: var(--default-element-size);
    visibility: hidden;
    z-index: 1;
    transform: translateX(0);
}

/* Carousel controls */
.carousel-control {
    position: absolute;
    top: var(--half-element-size);
    transform: translateY(var(--carousel-percentage));
    z-index: 10;
    background: none;
    border: none;
    font-size: var(--font-size-md);
    padding: var(--space-sm);
    transition: background-color 1.25s ease;
}

.carousel-control:hover,
.carousel-control:focus {
    background-color: rgba(0, 0, 0, 0.6);
    outline: none;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

/* Make everything involved in the slide animation visible */
.carousel-item.active,
.carousel-item.enter-next,
.carousel-item.enter-prev,
.carousel-item.exit-next,
.carousel-item.exit-prev {
    visibility: visible;
}

/* Animate when an item is moving to active, or exiting */
.carousel-item.active,
.carousel-item.exit-next,
.carousel-item.exit-prev {
    transition: transform 0.5s ease-in-out;
}

.carousel-item.active {
    transform: translateX(0);
    z-index: 2; /* Slide on top */
}

/* Placement (No transition): Where the item sits before sliding in */
.carousel-item.enter-next { transform: translateX(100%); }
.carousel-item.enter-prev { transform: translateX(-100%); }

/* Existing (With transition): Where it slides to when leaving */
.carousel-item.exit-next { transform: translateX(-100%); }
.carousel-item.exit-prev { transform: translateX(100%); }


/* =============================================================================
   7. SECTION — "WHAT ARE YOU LOOKING FOR?"
   ============================================================================= */

.section-what {
    padding: var(--space-lg) var(--space-md);
    padding-top: var(--space-md);
    text-align: center;
    background-color: var(--colour-gray-light);
}

.section-what h2 {
    padding-top: var(--space-md);
    width: var(--seventhy-percent-element-size);
    margin: 0 auto;
    line-height: var(--line-height-default);
    color: var(--colour-dark);
    font-size: var(--font-size-lg);
}

.section-title {
    font-family: var(--font-heading), sans-serif;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-default);
    text-transform: uppercase;
    color: var(--colour-gray-text);
    margin-bottom: var(--space-sm);
}

.accent-rule {
    width: var(--accent-width);
    border: 0.4vh solid;
    margin: var(--space-md) auto var(--space-lg);
}

.accent-yellow { color: var(--colour-yellow);  border-color: var(--colour-yellow); }
.accent-green  { color: var(--colour-success); border-color: var(--colour-success); }
.accent-blue   { color: var(--colour-teal);    border-color: var(--colour-teal); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--space-md);
}

.card {
    text-align: center;
    margin-bottom: var(--space-xs);
}

.card-image {
    width: var(--default-element-size);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--half-element-size);
    border: var(--space-sm) solid var(--colour-teal);
    padding: 0.5vh;
    margin: 0 auto var(--space-md);
    max-width: var(--card-image-max-width);
}

.card-title {
    font-family: var(--font-heading), sans-serif;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-thin);
    text-transform: uppercase;
    margin: var(--space-md) 0;
    color: var(--colour-near-black);
}

.card p {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    color: var(--colour-dark);
    max-width: var(--card-image-max-width);
    margin: 0 auto;
}


/* =============================================================================
   8. SECTION — "ABOUT OUR ACCOMMODATIONS"
   ============================================================================= */

.section-about {
    background-color: var(--colour-gray-light);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-xxl);
}

.section-about h2 {
    line-height: var(--line-height-lg);
    color: var(--colour-dark);
}

.section-about-inner {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    text-align: center;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.about-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.about-card-title {
    font-family: var(--font-heading), sans-serif;
    font-size: var(--font-size-default);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: var(--colour-near-black);
}

.about-card p {
    font-size: var(--font-size-sm);
    color: var(--colour-gray-text);
    line-height: var(--line-height-md);
    text-align: justify;
    hyphens: auto;
}


/* =============================================================================
   9. SVG DIVIDER
   ============================================================================= */

.svg-divider {
    position: relative;
    width: var(--default-element-size);
    height: var(--svg-divider-height);
    line-height: 0;
    pointer-events: none;
    margin-top: calc(var(--svg-divider-height) * -1);
    z-index: 10; /* <-- Bump this up to stay above the carousel */
}

.svg-divider svg {
    display: block;
    width: var(--default-element-size);
    height: var(--default-element-size);
    shape-rendering: geometricPrecision;
    overflow: visible;
}


/* =============================================================================
   10. SECTION — CONTACT FORM
   ============================================================================= */

.section-contact {
    background-color: var(--colour-teal);
    padding: var(--space-lg) var(--space-md) var(--space-xxl);
    color: var(--colour-offwhite);
}

.contact-inner {
    max-width: var(--contact-inner-max-width);
    margin: 0 auto;
}

.contact-title {
    font-family: var(--font-heading), serif;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: var(--space-xs);
}

.contact-subtitle {
    text-align: center;
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-lg);
}

.contact-form .form-group {
    border: 1px solid var(--colour-white);
    padding: var(--space-sm) var(--space-sm);
    margin-bottom: var(--space-md);
}

.contact-form label {
    display: inline;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: var(--colour-offwhite);
}

.contact-form input,
.contact-form textarea {
    width: var(--default-element-size);
    background: transparent;
    border: none;
    outline: none;
    color: var(--colour-offwhite);
    font-family: var(--font-body), sans-serif;
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
    box-shadow: none;
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--colour-gray-light);
}

.form-submit {
    text-align: center;
    margin-top: var(--space-md);
}


/* =============================================================================
   11. FOOTER
   ============================================================================= */

.site-footer {
    background-color: var(--colour-gray-light);
    padding: var(--space-lg) var(--space-md);
}

.footer-inner {
    max-width: var(--max-content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-body), sans-serif;
    font-size: var(--font-size-xs);
    color: var(--colour-near-black);
    transition: color 0.2s ease;
}

.social-link:hover,
.social-link:focus {
    color: var(--colour-teal-dark);
}

.social-icon {
    width: var(--icon-width);
    height: auto;
    padding-right: var(--space-xs);
}

.footer-copyright {
    font-size: var(--font-size-xs);
    color: var(--colour-gray-text);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.footer-copyright a img {
    display: inline-block;
    vertical-align: middle;
}


/* =============================================================================
   12. MEDIA QUERIES
   ============================================================================= */

/* Mobile settings */
@media (max-width: 767px) {
    .header-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .nav-toggle {
        position: absolute;
        top: -3rem; /* the brand's vertical center */
        transform: translateY(var(--nav-toggle-shift)); /* shift it up by an additional half its own height */
    }

    .header-inner {
        position: relative;
    }

    .nav-list {
        display: none;
        width: var(--max-content-width);
    }

    .nav-list.nav-open {
        display: flex;
        flex-direction: column;
    }

}

@media (min-width: 767px) {
    :root {
        --max-content-width: 70vw;
        --max-text-width: 50vw;
        --min-image-height: 500px;
    }

    /* Hide hamburger */
    .nav-toggle {
        display: none;
    }

    /* Horizontal nav */
    .main-nav {
        flex-direction: row;
        align-items: center;
        width: auto;
    }

    .nav-list {
        display: flex !important;
        flex-direction: row;
        position: static;
        width: auto;
        background: none;
        border: none;
        padding: 0;
        gap: 0;
        align-items: center;
    }

    .nav-item {
        width: auto;
        border-bottom: none;
        font-size: var(--font-size-default);
    }

    .nav-item:not(:last-child) {
        border-bottom: none;
    }

    .nav-link {
        justify-content: center;
        width: auto;
        padding: var(--space-sm) clamp(var(--space-sm), 2vw, var(--space-xl));
    }

    /* Chevron - Menu */
    .dropdown-toggle img {
        position: static;
        transform: none;
    }

    .dropdown-toggle[aria-expanded="true"] img {
        transform: rotate(var(--svg-angle));
    }

    /* Dropdown */
    .has-dropdown {
        position: relative;
        width: auto;
    }

    .dropdown-menu {
        position: absolute;
        top: var(--default-element-size);
        left: 0;
        min-width: var(--dropdown-min-width);
        box-shadow: var(--dropdown-shadow);
        z-index: 200;
        margin-top: 0;
    }

    .has-dropdown:last-child .dropdown-menu {
        left: auto;
        right: 0;
    }

    .dropdown-menu li a {
        font-size: var(--font-size-sm);
        padding: var(--space-sm) var(--space-md);
    }

    /* Banner / Carousel */
    .banner-description {
        width: var(--half-element-size);
        font-size: var(--font-size-default);
        line-height: var(--line-height-lg);
    }

    .banner-title {
        font-size: var(--font-size-xl);
        padding: var(--space-lg);
        border: 4px solid var(--colour-offwhite);
    }

    .banner-description {
        max-width: var(--card-image-max-width);
        line-height: var(--line-height-lg);
        width: var(--half-element-size);
    }
}

@media (min-width: 1080px) {
    .banner-description {
        width: var(--one-third-element-size);
    }
}

@media (min-width: 1920px) {
    html {
        font-size: var(--font-size-default);
    }

    /* Banner / Carousel */
    .banner-description {
        font-size: var(--font-size-default);
        line-height: var(--line-height-lg);
    }

    .banner-title {
        font-size: var(--font-size-xxl);
        padding: var(--space-xl);
        border: 4px solid var(--colour-offwhite);
    }

    .carousel {
        height: var(--max-element-height);
        min-height: var(--max-image-height);
    }

    .carousel-image {
        width: var(--default-element-size);
        height: var(--max-element-height);
        min-height: var(--max-image-height);
    }
}
