/*
 * Home page hero (resources/views/home.blade.php).
 * All classes start with "hh-" (home hero) so they never clash with the rest of the site.
 * Plain CSS on purpose: no Tailwind rebuild is needed when this file changes.
 *
 * Layout: full-width photo slider (5 places in Crete), darkened on the left (desktop)
 * or on top (phones) so the white text is always easy to read.
 * The text stays still, only the photo behind it changes (script: public/js/home-hero.js).
 */

.hh {
    position: relative;
    isolation: isolate;          /* keeps the photo and shade layers inside the hero */
    min-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    background: var(--brand-blue); /* shown for a moment while the photo loads */
}

/* ---------- Photos (slides) + dark shade ---------- */
/* All slides sit on top of each other. Only the active one is visible (soft fade). */
.hh-slide {
    position: absolute; inset: 0; z-index: -2;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hh-slide.is-active { opacity: 1; }
.hh-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 65%; /* default. Each slide sets its own focus point in the HTML. */
}
/* Very slow zoom-out on the visible photo: makes it feel alive. Restarts on every slide change. */
.hh-slide.is-active .hh-photo { animation: hh-zoom 12s ease-out both; }
.hh-shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        /* left side: navy behind the text. Kept light on the right so the lagoon stays bright. */
        linear-gradient(100deg, rgba(0, 0, 50, .62) 0%, rgba(0, 0, 70, .32) 40%, rgba(0, 0, 70, 0) 65%),
        /* bottom: darker strip so the stats row stays readable */
        linear-gradient(0deg, rgba(0, 0, 30, .55) 0%, rgba(0, 0, 30, 0) 28%);
}

/* ---------- Text block ---------- */
.hh-inner {
    width: 100%; max-width: 80rem; margin: 0 auto;
    padding: 96px 24px 140px;
}
.hh-content { max-width: 620px; }

/* Small line above the title. The coordinates are Crete's position on the globe. */
.hh-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: .78rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}
.hh-eyebrow::before { content: ''; width: 34px; height: 2px; background: var(--brand-orange); }

/* Big serif title: "Why Crete?" with "Crete?" in orange italic */
.hh-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(3.6rem, 9vw, 7.5rem);
    line-height: .92;
    letter-spacing: -.01em;
    margin: 18px 0 22px;
    text-shadow: 0 2px 30px rgba(0, 0, 30, .35);
}
.hh-title em { font-style: italic; color: var(--brand-orange); }

.hh-lead {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, .9);
    max-width: 520px;
}

/* ---------- Search box ---------- */
.hh-search {
    display: flex; align-items: center; gap: 6px;
    margin-top: 30px; padding: 6px 6px 6px 18px;
    max-width: 540px;
    background: #fff; border-radius: 999px;
    box-shadow: 0 18px 50px rgba(0, 0, 40, .35);
}
.hh-search i { color: var(--brand-blue); opacity: .6; }
.hh-search input {
    flex: 1; min-width: 0;
    border: 0; outline: none; background: transparent; /* site CSS reset needs these set explicitly */
    padding: 12px 6px; font-size: 1rem; color: #111;
}
.hh-search button {
    border: 0; cursor: pointer;
    padding: 12px 22px; border-radius: 999px;
    background: var(--brand-orange); color: #fff; font-weight: 600;
    transition: background .2s;
}
.hh-search button:hover { background: #e55f00; }

/* ---------- Buttons under the search ---------- */
.hh-ctas { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin-top: 22px; }
.hh-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 22px; border-radius: 999px;
    font-weight: 600; text-decoration: none; transition: all .2s;
}
.hh-btn-main { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45); color: #fff; backdrop-filter: blur(6px); }
.hh-btn-main:hover { background: #fff; color: var(--brand-blue); }
.hh-link { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .5); padding-bottom: 2px; }
.hh-link:hover { border-color: var(--brand-orange); color: var(--brand-orange); }

/* ---------- Bottom row: stats (left) + photo caption (right) ---------- */
.hh-bottom {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-width: 80rem; margin: 0 auto; padding: 0 24px 28px;
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between;
}
.hh-stats { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.hh-stats li { font-size: .85rem; color: rgba(255, 255, 255, .8); line-height: 1.2; }
.hh-stats strong {
    display: block;
    font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
    font-size: 2.2rem; color: #fff;
}
.hh-caption {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .85rem; color: #fff; text-decoration: none;
    padding: 8px 14px; border-radius: 999px;
    background: rgba(0, 0, 40, .35); backdrop-filter: blur(6px);
}
.hh-caption:hover { background: var(--brand-orange); }

/* Right side of the bottom row: caption of the current photo + slider controls */
.hh-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

/* Only the current slide's caption and credit are shown */
.hh-caption:not(.is-active),
.hh-credit:not(.is-active) { display: none; }

/* ---------- Slider controls: arrow, dots, arrow ---------- */
.hh-controls { display: flex; align-items: center; gap: 8px; }
.hh-arrow {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, .45); background: rgba(0, 0, 40, .3);
    color: #fff; cursor: pointer; backdrop-filter: blur(6px);
    transition: background .2s, color .2s;
}
.hh-arrow:hover { background: #fff; color: var(--brand-blue); }

/* Each dot is a short line. The active one is longer and fills up with orange. */
.hh-dot {
    position: relative; overflow: hidden;
    width: 22px; height: 4px; padding: 0; border: 0; border-radius: 4px;
    background: rgba(255, 255, 255, .4); cursor: pointer;
    transition: width .3s, background .2s;
}
.hh-dot:hover { background: rgba(255, 255, 255, .7); }
.hh-dot.is-active { width: 44px; }
/* Bigger click area than the thin line, so it is easy to hit on phones */
.hh-dot::before { content: ''; position: absolute; inset: -12px -2px; }

/* The orange progress bar. When it is full, the script shows the next photo.
   7s = how long each photo stays. Change it here to make the slider faster or slower. */
.hh-dot span {
    position: absolute; inset: 0;
    background: var(--brand-orange);
    transform: scaleX(0); transform-origin: left;
}
.hh-dot.is-active span { animation: hh-progress 7s linear forwards; }

/* Pause the slider while the visitor types a search or has the mouse on the controls */
.hh:has(.hh-search:focus-within) .hh-dot span,
.hh-nav:hover .hh-dot span { animation-play-state: paused; }

/* Photo credit: required by the photo licences (CC BY / CC BY-SA) */
.hh-credit {
    position: absolute; right: 10px; top: 8px;
    font-size: .68rem; color: rgba(255, 255, 255, .6);
}
.hh-credit a { color: inherit; text-decoration: underline; }

/* ---------- Phones ---------- */
@media (max-width: 720px) {
    .hh { min-height: 0; }
    /* Big bottom padding: the stats + caption + slider controls sit in this space */
    .hh-inner { padding: 64px 20px 250px; }
    .hh-shade {
        /* top-to-bottom: dark behind the text, lighter over the lagoon, dark again behind the stats */
        background:
            linear-gradient(180deg, rgba(0, 0, 40, .72) 0%, rgba(0, 0, 50, .40) 50%, rgba(0, 0, 30, .70) 100%);
    }
    .hh-title { font-size: 4.4rem; }
    .hh-search button { padding: 12px 16px; }
    .hh-bottom { padding-bottom: 20px; }
    .hh-stats { gap: 22px; }
    .hh-stats strong { font-size: 1.8rem; }
    /* Caption + controls go under the stats, lined up on the left like the text above */
    .hh-nav { align-items: flex-start; width: 100%; }
}

/* ---------- Page-load animation: text rises in, one line after the other ---------- */
.hh-rise { animation: hh-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hh-rise:nth-child(2) { animation-delay: .08s; }
.hh-rise:nth-child(3) { animation-delay: .16s; }
.hh-rise:nth-child(4) { animation-delay: .24s; }
.hh-rise:nth-child(5) { animation-delay: .32s; }
.hh-bottom.hh-rise { animation-delay: .45s; }

@keyframes hh-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes hh-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes hh-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Visitors who turned off animations in their system settings get a still page.
   No progress bar also means no autoplay: they change photos with the arrows or dots. */
@media (prefers-reduced-motion: reduce) {
    .hh-slide.is-active .hh-photo, .hh-rise, .hh-dot.is-active span { animation: none; }
    .hh-dot.is-active span { transform: scaleX(1); }
    .hh-slide { transition: none; }
}
