/* =================================================================
   SHARE BUTTONS COMPONENT
   Reusable share buttons with mobile bottom sheet support
   ================================================================= */

/* Share Bar - Container below hero sections */
.natgeo-share-bar {
    background: var(--natgeo-sand, #f6f3ef);
    border-bottom: 1px solid var(--natgeo-border, #e8e5de);
}

.natgeo-share-bar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .natgeo-share-bar__inner {
        padding: 0.875rem 1.5rem;
        justify-content: flex-start;
    }
}

/* Share Component Base */
.natgeo-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.natgeo-share--compact {
    gap: 0.375rem;
}

.natgeo-share__buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.natgeo-share--compact .natgeo-share__buttons {
    gap: 0.375rem;
}

/* Share Button Base */
.natgeo-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    border: 1px solid var(--natgeo-border, #e8e5de);
    border-radius: 0.5rem;
    background: #fff;
    color: var(--natgeo-charcoal, #222);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.natgeo-share__btn:hover {
    background: var(--natgeo-sand, #f6f3ef);
    border-color: var(--natgeo-gold, #88a828);
}

.natgeo-share__btn:active {
    transform: scale(0.96);
}

.natgeo-share__btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Hide labels on mobile for compact view */
.natgeo-share--compact .natgeo-share__label {
    display: none;
}

@media (min-width: 768px) {
    .natgeo-share--compact .natgeo-share__label {
        display: inline;
    }
}

/* Copy button states */
.natgeo-share__btn--copy .natgeo-share__icon--check {
    display: none;
    color: var(--natgeo-green, #22c55e);
}

.natgeo-share__btn--copy.is-copied .natgeo-share__icon--link {
    display: none;
}

.natgeo-share__btn--copy.is-copied .natgeo-share__icon--check {
    display: block;
}

.natgeo-share__btn--copy.is-copied {
    border-color: var(--natgeo-green, #22c55e);
    color: var(--natgeo-green, #22c55e);
}

/* WhatsApp button */
.natgeo-share__btn--whatsapp {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}

.natgeo-share__btn--whatsapp:hover {
    background: #20bd5a;
    border-color: #20bd5a;
}

/* Share Dropdown */
.natgeo-share__dropdown {
    position: relative;
}

/* Mobile: ensure dropdown can escape parent stacking context */
@media (max-width: 767px) {
    .natgeo-share__dropdown.is-open {
        position: static;
    }
}

/* Share Panel - Desktop dropdown */
.natgeo-share__panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 100;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--natgeo-border, #e8e5de);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.natgeo-share__dropdown.is-open .natgeo-share__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel header */
.natgeo-share__panel-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--natgeo-border, #e8e5de);
}

.natgeo-share__panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--natgeo-charcoal, #222);
}

.natgeo-share__panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--natgeo-muted, #6f7376);
    cursor: pointer;
    transition: background 0.15s ease;
}

.natgeo-share__panel-close:hover {
    background: var(--natgeo-sand, #f6f3ef);
}

/* Panel list */
.natgeo-share__panel-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.natgeo-share__panel-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: none;
    color: var(--natgeo-charcoal, #222);
    font-family: inherit;
    font-size: 0.9375rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.natgeo-share__panel-link:hover {
    background: var(--natgeo-sand, #f6f3ef);
}

.natgeo-share__panel-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--natgeo-muted, #6f7376);
}

.natgeo-share__panel-separator {
    height: 1px;
    margin: 0.375rem 0.75rem;
    background: var(--natgeo-border, #e8e5de);
}

.natgeo-share__panel-link--rss {
    color: var(--natgeo-muted, #6f7376);
}

/* Mobile Bottom Sheet */
@media (max-width: 767px) {
    .natgeo-share__panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom, 0);
        z-index: 1010; /* Higher than navbar z-index (1000) */
    }

    .natgeo-share__dropdown.is-open .natgeo-share__panel {
        transform: translateY(0);
    }

    .natgeo-share__panel-header {
        display: flex;
    }

    .natgeo-share__panel-list {
        padding: 0.5rem 0 1rem;
    }

    .natgeo-share__panel-link {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 52px;
        /* Improve touch targets */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Ensure backdrop is above navbar on mobile */
@media (max-width: 767px) {
    .natgeo-share-backdrop {
        z-index: 1005;
    }
}

/* Backdrop for mobile */
.natgeo-share-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.natgeo-share-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* =================================================================
   CAROUSEL BASE STYLES
   Shared styles for country and blog post carousels
   ================================================================= */

/* Carousel Section */
.natgeo-carousel-section {
    padding: 3rem 1rem;
    background: var(--natgeo-sand, #f6f3ef);
}

@media (min-width: 768px) {
    .natgeo-carousel-section {
        padding: 4rem 1.5rem;
    }
}

.natgeo-carousel-section__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.natgeo-carousel-section__header {
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .natgeo-carousel-section__header {
        margin-bottom: 2rem;
        text-align: left;
    }
}

.natgeo-carousel-section__eyebrow {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--natgeo-gold, #88a828);
}

.natgeo-carousel-section__title {
    margin: 0;
    font-family: var(--font-heading, 'Bodoni Moda', Georgia, serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--natgeo-forest, #002200);
    line-height: 1.2;
}

@media (min-width: 768px) {
    .natgeo-carousel-section__title {
        font-size: 2.25rem;
    }
}

/* Carousel Container */
.natgeo-carousel {
    position: relative;
}

.natgeo-carousel__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.natgeo-carousel__track::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .natgeo-carousel__track {
        gap: 1.5rem;
    }
}

/* Carousel Item - flexible width */
.natgeo-carousel__item {
    flex: 0 0 calc(85% - 0.5rem);
    scroll-snap-align: start;
}

@media (min-width: 480px) {
    .natgeo-carousel__item {
        flex: 0 0 calc(50% - 0.75rem);
    }
}

@media (min-width: 768px) {
    .natgeo-carousel__item {
        flex: 0 0 calc(33.333% - 1rem);
    }
}

@media (min-width: 1024px) {
    .natgeo-carousel__item {
        flex: 0 0 calc(25% - 1.125rem);
    }
}

/* Carousel Navigation */
.natgeo-carousel__nav {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    justify-content: space-between;
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .natgeo-carousel__nav {
        display: flex;
    }
}

.natgeo-carousel__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: var(--natgeo-charcoal, #222);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.natgeo-carousel__nav-btn:hover {
    background: var(--natgeo-gold, #88a828);
    color: #fff;
}

.natgeo-carousel__nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.natgeo-carousel__nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Carousel Indicators */
.natgeo-carousel__indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .natgeo-carousel__indicators {
        display: none;
    }
}

.natgeo-carousel__indicator {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: var(--natgeo-border, #e8e5de);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.natgeo-carousel__indicator.is-active {
    background: var(--natgeo-gold, #88a828);
    transform: scale(1.2);
}

/* =================================================================
   COUNTRY CARD CAROUSEL
   Carousel for recommended country destinations
   ================================================================= */

.natgeo-country-carousel .natgeo-carousel-section {
    background: var(--natgeo-forest, #002200);
}

.natgeo-country-carousel .natgeo-carousel-section__eyebrow {
    color: var(--natgeo-coral, #ff694d);
}

.natgeo-country-carousel .natgeo-carousel-section__title {
    color: #fff;
}

/* Country Card */
.natgeo-country-card {
    display: block;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--natgeo-charcoal, #222);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.natgeo-country-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.natgeo-country-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.natgeo-country-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.natgeo-country-card:hover .natgeo-country-card__image img {
    transform: scale(1.05);
}

.natgeo-country-card__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0) 100%
    );
}

.natgeo-country-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    color: #fff;
}

.natgeo-country-card__flag {
    width: 24px;
    height: 18px;
    margin-bottom: 0.5rem;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.natgeo-country-card__name {
    margin: 0;
    font-family: var(--font-heading, 'Bodoni Moda', Georgia, serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.natgeo-country-card__teaser {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =================================================================
   BLOG POST CAROUSEL
   Carousel for recommended blog posts
   ================================================================= */

.natgeo-post-carousel .natgeo-carousel-section {
    background: #fff;
    border-top: 1px solid var(--natgeo-border, #e8e5de);
}

/* Post Card */
.natgeo-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--natgeo-border, #e8e5de);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.natgeo-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.natgeo-post-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--natgeo-sand, #f6f3ef);
}

.natgeo-post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.natgeo-post-card:hover .natgeo-post-card__image img {
    transform: scale(1.05);
}

.natgeo-post-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.natgeo-post-card__kicker {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--natgeo-gold, #88a828);
}

.natgeo-post-card__title {
    margin: 0;
    font-family: var(--font-heading, 'Bodoni Moda', Georgia, serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--natgeo-charcoal, #222);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.natgeo-post-card__excerpt {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--natgeo-muted, #6f7376);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.natgeo-post-card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--natgeo-muted, #6f7376);
}

.natgeo-post-card__author {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.natgeo-post-card__author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* =================================================================
   COUNTRY CAROUSEL SECTION (End of country page)
   ================================================================= */

.natgeo-explore-more {
    padding: 3rem 0;
    background: linear-gradient(180deg, var(--natgeo-sand, #f6f3ef) 0%, #fff 100%);
}

@media (min-width: 768px) {
    .natgeo-explore-more {
        padding: 4rem 0;
    }
}
