/*
 * Styles for the post-wedding photo gallery page.
 * Builds on tooplate-wedding-lite.css (CSS variables + base typography).
 */

/* -----------------------------------------------------
   Page header / brand mark
----------------------------------------------------- */
.gallery-header {
    padding: 30px 0 10px;
    text-align: center;
}

.gallery-header .navbar-brand {
    display: inline-block;
    margin: 0 auto;
}

.gallery-header .gallery-date {
    color: var(--p-color);
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* -----------------------------------------------------
   Highlights carousel (hero)
----------------------------------------------------- */
.highlights-section {
    padding: 20px 0 32px;
}

#highlightsCarousel,
.highlights-static {
    position: relative;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.25);
    background: var(--section-bg-color);
    aspect-ratio: 3 / 2;
}

#highlightsCarousel .carousel-inner,
#highlightsCarousel .carousel-item {
    height: 100%;
}

#highlightsCarousel .highlight-link,
.highlights-static .highlight-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

#highlightsCarousel .highlight-img,
.highlights-static .highlight-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#highlightsCarousel .carousel-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 20px 28px;
    text-align: center;
}

#highlightsCarousel .carousel-caption p {
    font-family: var(--title-font-family);
    font-size: clamp(20px, 3vw, 32px);
    margin: 0;
    color: var(--white-color);
    letter-spacing: 0.05em;
}

#highlightsCarousel .carousel-control-prev,
#highlightsCarousel .carousel-control-next {
    width: 8%;
    opacity: 0.85;
}

#highlightsCarousel .carousel-indicators {
    margin-bottom: 12px;
}

/* Title overlay sat over the carousel */
.highlights-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 32px 20px 90px;
    text-align: center;
    color: var(--white-color);
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

.highlights-overlay h1 {
    font-size: clamp(36px, 6vw, 72px);
    color: var(--white-color);
    margin: 0;
    line-height: 1.1;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 4px 18px rgba(0, 0, 0, 0.5);
}

/* -----------------------------------------------------
   Album tabs
----------------------------------------------------- */
.albums-section {
    padding: 60px 0 80px;
    background: var(--section-bg-color);
}

.albums-section .section-title-wrap {
    margin-bottom: 30px;
}

.albums-section .section-title {
    color: var(--secondary-color);
}

.albums-section .section-subtitle {
    color: var(--p-color);
    margin-top: 8px;
    font-size: 16px;
}

/* --- Top-level section tabs (Professional / Guest) ---------------------- */
.section-tabs-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}

.section-tabs {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 5px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    gap: 4px;
}

.section-tabs .nav-item {
    display: block;
}

.section-tab {
    display: inline-block;
    padding: 10px 26px;
    border: none;
    background: transparent;
    color: var(--p-color);
    font-family: var(--title-font-family);
    font-size: 18px;
    letter-spacing: 0.04em;
    border-radius: var(--border-radius-large);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.section-tab:hover,
.section-tab:focus-visible {
    color: var(--primary-color);
    outline: none;
}

.section-tab.active {
    color: var(--white-color);
    background: var(--primary-color);
}

.section-tab.active:hover,
.section-tab.active:focus-visible {
    color: var(--white-color);
}

@media (max-width: 480px) {
    .section-tab {
        padding: 9px 18px;
        font-size: 16px;
    }
}

/* --- Empty state for a section with no albums yet ----------------------- */
.section-empty {
    padding: 60px 20px;
    color: var(--p-color);
}

.section-empty-icon {
    display: block;
    font-size: 44px;
    color: var(--primary-color);
    margin-bottom: 14px;
    opacity: 0.7;
}

.section-empty p {
    font-family: var(--title-font-family);
    font-size: 22px;
    margin: 0;
    color: var(--p-color);
}

.section-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 10px 24px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-family: var(--body-font-family);
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    letter-spacing: 0.04em;
    border-radius: var(--border-radius-large);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.section-empty-cta:hover,
.section-empty-cta:focus-visible {
    background: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-1px);
    outline: none;
}

.section-empty-cta i {
    transition: transform 0.2s ease;
}

.section-empty-cta:hover i,
.section-empty-cta:focus-visible i {
    transform: translateX(3px);
}

/* --- Album tabs (inside each section) ----------------------------------- */
/* On mobile the scrolling tab strip is replaced by .album-dropdown; see below. */
.album-tabs {
    display: none;
}

@media (min-width: 992px) {
    .album-tabs {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        overflow: visible;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 30px;

        /* Pin the album sub-tabs to the top of the viewport so guests can switch
           albums while scrolling a long grid. Span to the container edges and
           carry the section background so grid images don't show through behind
           the bar while it's stuck. */
        position: sticky;
        top: 0;
        z-index: 30;
        margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        padding: 16px calc(var(--bs-gutter-x, 1.5rem) * 0.5) 1px;
        background: var(--section-bg-color);
    }
}

.album-tabs .nav-item {
    flex: 0 0 auto;
}

.album-tabs .nav-link {
    color: var(--p-color);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-family: var(--title-font-family);
    font-size: 18px;
    letter-spacing: 0.04em;
    padding: 12px 18px;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.album-tabs .nav-link:hover {
    color: var(--primary-color);
}

.album-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Override tooplate-wedding-lite.css which adds a rotated diamond after
   active nav-tabs links - we don't want it on the album tabs. */
.album-tabs .nav-link::after,
.album-tabs .nav-link.active::after {
    content: none;
    display: none;
}

/* --- Album dropdown (mobile only) --------------------------------------- */
/* The .album-dropdown-sticky wrapper extends the background to the viewport
   edges so album photos don't show through behind the dropdown when it is
   stuck to the top of the screen. */
.album-dropdown-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    /* Pull outward so the wrapper reaches the container's edges (Bootstrap's
       .container adds half a gutter of padding on each side). */
    margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -0.5) 24px;
    padding: 14px calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    background: var(--section-bg-color);
    /* Soft fade under the sticky bar so the transition into the grid feels
       intentional rather than abrupt. */
    box-shadow: 0 6px 10px -8px rgba(0, 0, 0, 0.18);
}

.album-dropdown {
    position: relative;
    margin: 0 auto;
    max-width: 420px;
}

@media (min-width: 992px) {
    .album-dropdown-sticky {
        position: static;
        margin: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .album-dropdown {
        display: none;
    }
}

.album-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    color: var(--secondary-color);
    font-family: var(--title-font-family);
    font-size: 18px;
    letter-spacing: 0.04em;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.album-dropdown-toggle:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.18);
}

.album-dropdown.open .album-dropdown-toggle {
    border-color: var(--primary-color);
}

.album-dropdown-current {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.album-dropdown-current-icon {
    color: var(--primary-color);
    font-size: 18px;
    flex: 0 0 auto;
}

.album-dropdown-current-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-dropdown-chevron {
    color: var(--p-color);
    font-size: 16px;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}

.album-dropdown.open .album-dropdown-chevron {
    transform: rotate(180deg);
}

.album-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateY(-4px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.album-dropdown.open .album-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.album-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    color: var(--p-color);
    font-family: var(--title-font-family);
    font-size: 17px;
    letter-spacing: 0.03em;
    text-align: left;
    border-radius: calc(var(--border-radius-small) - 4px);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.album-dropdown-item:hover,
.album-dropdown-item:focus-visible {
    background: var(--section-bg-color);
    color: var(--primary-color);
    outline: none;
}

.album-dropdown-item.active {
    color: var(--primary-color);
    background: rgba(0, 109, 119, 0.08);
}

.album-dropdown-item-icon {
    color: var(--primary-color);
    font-size: 18px;
    flex: 0 0 auto;
}

.album-dropdown-item-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-dropdown-item-check {
    color: var(--primary-color);
    font-size: 18px;
    flex: 0 0 auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.album-dropdown-item.active .album-dropdown-item-check {
    opacity: 1;
}

.album-header {
    margin-bottom: 24px;
}

.album-title {
    font-size: clamp(28px, 4vw, 40px);
    color: var(--secondary-color);
    margin: 0;
}

.album-subtitle {
    color: var(--p-color);
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 6px;
}

/* -----------------------------------------------------
   Album image grid
----------------------------------------------------- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

@media (min-width: 768px) {
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }
}

.album-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--border-radius-small);
    aspect-ratio: 1 / 1;
    background: var(--white-color);
    cursor: zoom-in;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.album-item:hover,
.album-item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    outline: none;
}

.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.album-item:hover img {
    transform: scale(1.04);
}

.album-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 109, 119, 0.0) 60%, rgba(0, 109, 119, 0.05));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.album-item:hover::after {
    opacity: 1;
}

/* -----------------------------------------------------
   Download / thank-you footer
----------------------------------------------------- */
/* --- Originals CTA (between the cover and the albums) ------------------- */
.gallery-originals {
    padding: 8px 20px 56px;
    text-align: center;
}

.gallery-originals h2 {
    color: var(--secondary-color);
}

.gallery-originals p {
    color: var(--p-color);
    max-width: 560px;
    margin: 16px auto;
    font-size: 18px;
    line-height: 1.6;
}

.gallery-originals .gallery-footer-buttons {
    margin: 24px 0;
}

/* Scroll cue: nudges guests to browse photos on the page rather than
   assuming Google Photos is the only option. */
.scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--body-font-family);
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
    color: #005760;
    outline: none;
}

.scroll-cue-arrow {
    font-size: 26px;
    line-height: 1;
    animation: scroll-cue-bounce 1.8s ease-in-out infinite;
}

.scroll-cue:hover .scroll-cue-arrow,
.scroll-cue:focus-visible .scroll-cue-arrow {
    animation-play-state: paused;
}

@keyframes scroll-cue-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue-arrow {
        animation: none;
    }
}

.gallery-footer {
    padding: 44px 20px 72px;
    text-align: center;
}

.gallery-footer-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 14px 32px;
    border-radius: var(--border-radius-large);
    font-family: var(--body-font-family);
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 109, 119, 0.25);
}

.btn-download:hover,
.btn-download:focus-visible {
    background: #005760;
    color: var(--white-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 109, 119, 0.32);
    outline: none;
}

.gallery-signoff {
    margin-top: 40px;
    font-family: var(--title-font-family);
    color: var(--p-color);
    font-size: 18px;
    letter-spacing: 0.1em;
}

.gallery-signoff .heart {
    color: var(--primary-color);
    margin: 0 4px;
}

/* -----------------------------------------------------
   Magnific Popup tweaks
----------------------------------------------------- */
.mfp-fade.mfp-bg {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
    opacity: 0.85;
}

.mfp-fade.mfp-bg.mfp-removing {
    opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
    opacity: 0;
}

.mfp-title {
    font-family: var(--title-font-family);
    font-size: 18px;
    text-align: center;
    color: var(--white-color);
}

/* -----------------------------------------------------
   Small-screen tweaks
----------------------------------------------------- */
@media (max-width: 576px) {
    .gallery-header {
        padding-top: 20px;
    }

    .highlights-overlay {
        padding: 20px 16px 40px;
    }

    .albums-section {
        padding: 40px 0 60px;
    }

    .album-grid {
        gap: 10px;
    }

    .gallery-originals {
        padding: 4px 16px 40px;
    }

    .gallery-footer {
        padding: 36px 16px 56px;
    }
}
