/* Best Time Map Page Styles - Redesigned with Hero Images and NatGeo Cards */

:root {
    --best-time-gold: #E5A832;
    --best-time-green: #88A828;
    --best-time-blue: #4A90D9;
}

.best-time-page {
    min-height: 100vh;
    background: var(--sand-50, #F6F3EF);
}

/* =================================================================
   HERO SECTION
   ================================================================= */

.best-time-hero {
    position: relative;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(0, 34, 0, 0.04) 0%, transparent 100%);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.best-time-hero--has-image {
    min-height: 400px;
    padding: 5rem 1.5rem 4rem;
    background: transparent;
}

@media (min-width: 768px) {
    .best-time-hero--has-image {
        min-height: 480px;
        padding: 6rem 2rem 5rem;
    }
}

.best-time-hero__image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.best-time-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.best-time-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 34, 0, 0.4) 0%,
        rgba(0, 34, 0, 0.6) 50%,
        rgba(0, 34, 0, 0.75) 100%
    );
}

.best-time-hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.best-time-hero__eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--avocado-700, #88A828);
}

.best-time-hero--has-image .best-time-hero__eyebrow {
    color: var(--coral-500, #FF8066);
}

.best-time-hero__title {
    font-family: var(--font-serif, 'Bodoni Moda', Georgia, serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--forest-900, #002200);
    margin: 0 0 0.75rem;
    line-height: 1.15;
}

.best-time-hero--has-image .best-time-hero__title {
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.best-time-hero__subtitle {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 1.125rem;
    color: var(--charcoal-700, #444);
    margin: 0 0 1rem;
    opacity: 0.85;
}

.best-time-hero--has-image .best-time-hero__subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.best-time-hero__intro {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 1rem;
    color: var(--charcoal-600, #555);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.best-time-hero--has-image .best-time-hero__intro {
    color: rgba(255, 255, 255, 0.85);
}

/* =================================================================
   MONTH SELECTOR
   ================================================================= */

.best-time-months {
    padding: 0 1rem;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.best-time-hero--has-image + .best-time-months {
    margin-top: -2rem;
}

.best-time-months__container {
    max-width: 1000px;
    margin: 0 auto;
}

.best-time-months__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 34, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 34, 0, 0.08);
}

@media (min-width: 768px) {
    .best-time-months__nav {
        gap: 0.5rem;
        padding: 1rem 1.25rem;
        flex-wrap: nowrap;
    }
}

.best-time-months__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.625rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--forest-900, #002200);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .best-time-months__item {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
}

.best-time-months__item:hover {
    background: rgba(0, 34, 0, 0.06);
}

.best-time-months__item--active {
    background: var(--forest-900, #002200);
    color: var(--sand-50, #F6F3EF);
    box-shadow: 0 2px 8px rgba(0, 34, 0, 0.2);
}

.best-time-months__item--active:hover {
    background: var(--forest-900, #002200);
}

/* Short/full month name display */
.best-time-months__item-full {
    display: none;
}

.best-time-months__item-short {
    display: inline;
}

@media (min-width: 768px) {
    .best-time-months__item-full {
        display: inline;
    }
    .best-time-months__item-short {
        display: none;
    }
}

/* =================================================================
   MAP SECTION - NO BOX/FRAME
   ================================================================= */

.best-time-map-section {
    padding: 0 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.best-time-map__wrapper {
    position: relative;
    background: transparent;
    overflow: hidden;
}

.best-time-map__svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 250px;
}

@media (min-width: 768px) {
    .best-time-map__svg {
        min-height: 400px;
    }
}

.best-time-map__svg path {
    transition: fill 0.25s ease, stroke 0.25s ease;
}

.best-time-map__svg path.country {
    fill: rgba(0, 34, 0, 0.06);
    stroke: rgba(0, 34, 0, 0.12);
    stroke-width: 0.4;
    cursor: default;
}

.best-time-map__svg path.country--highlighted {
    stroke: var(--forest-900, #002200);
    stroke-width: 0.6;
    cursor: pointer;
}

/* Weather category - Green */
.best-time-map__svg path.country--weather {
    fill: var(--best-time-green);
}

.best-time-map__svg path.country--weather:hover {
    fill: #9DC035;
    stroke-width: 0.8;
}

/* Cheapest category - Blue */
.best-time-map__svg path.country--cheapest {
    fill: var(--best-time-blue);
}

.best-time-map__svg path.country--cheapest:hover {
    fill: #6BA8E5;
    stroke-width: 0.8;
}

/* Both category - Gold/Special */
.best-time-map__svg path.country--both {
    fill: var(--best-time-gold);
}

.best-time-map__svg path.country--both:hover {
    fill: #F0BC4F;
    stroke-width: 0.8;
}

.best-time-map__svg path.country--highlighted.active {
    fill: var(--coral-600, #FF694D);
    stroke: var(--forest-900, #002200);
    stroke-width: 1;
}

/* Map loading state */
.best-time-map__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--forest-900, #002200);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.875rem;
    opacity: 0.7;
}

.best-time-map__wrapper.loaded .best-time-map__loading {
    display: none;
}

.best-time-map__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 34, 0, 0.1);
    border-top-color: var(--best-time-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Map legend */
.best-time-map__legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 768px) {
    .best-time-map__legend {
        gap: 2rem;
    }
}

.best-time-map__legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    color: var(--charcoal-700, #555);
}

.best-time-map__legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 34, 0, 0.15);
}

.best-time-map__legend-item--both .best-time-map__legend-color {
    background: var(--best-time-gold);
}

.best-time-map__legend-item--weather .best-time-map__legend-color {
    background: var(--best-time-green);
}

.best-time-map__legend-item--cheapest .best-time-map__legend-color {
    background: var(--best-time-blue);
}

/* =================================================================
   TOOLTIP
   ================================================================= */

.best-time-tooltip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    background: var(--forest-900, #002200);
    color: var(--sand-50, #F6F3EF);
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    box-shadow: 0 8px 24px rgba(0, 34, 0, 0.3);
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease;
    font-family: var(--font-sans, 'Inter', sans-serif);
    max-width: 180px;
}

.best-time-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.best-time-tooltip__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    line-height: 1;
    margin-bottom: 0.375rem;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.best-time-tooltip__flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.best-time-tooltip__name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.best-time-tooltip__category {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.375rem;
    display: inline-block;
}

.best-time-tooltip__category--both {
    background: var(--best-time-gold);
    color: #1a1a1a;
}

.best-time-tooltip__category--weather {
    background: var(--best-time-green);
    color: white;
}

.best-time-tooltip__category--cheapest {
    background: var(--best-time-blue);
    color: white;
}

.best-time-tooltip__cta {
    font-size: 0.6875rem;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* =================================================================
   COUNTRY CARDS SECTION - NATGEO STYLE
   ================================================================= */

.best-time-countries {
    padding: 3rem 1rem 4rem;
    background: var(--forest-900, #002200);
}

@media (min-width: 768px) {
    .best-time-countries {
        padding: 4rem 1.5rem 5rem;
    }
}

.best-time-countries__container {
    max-width: 1200px;
    margin: 0 auto;
}

.best-time-countries__header {
    margin-bottom: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .best-time-countries__header {
        text-align: left;
        margin-bottom: 2.5rem;
    }
}

.best-time-countries__eyebrow {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--coral-500, #FF8066);
}

.best-time-countries__title {
    font-family: var(--font-serif, 'Bodoni Moda', Georgia, serif);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

/* Country Cards Grid */
.best-time-countries__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .best-time-countries__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .best-time-countries__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .best-time-countries__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

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

.best-time-country-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

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

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

.best-time-country-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(136, 168, 40, 0.3) 0%, rgba(0, 34, 0, 0.5) 100%);
}

.best-time-country-card__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* Category badge on image */
.best-time-country-card__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.best-time-country-card__badge--both {
    background: var(--best-time-gold);
    color: #1a1a1a;
}

.best-time-country-card__badge--weather {
    background: var(--best-time-green);
    color: white;
}

.best-time-country-card__badge--cheapest {
    background: var(--best-time-blue);
    color: white;
}

/* Card content */
.best-time-country-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    color: #fff;
}

.best-time-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);
}

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

.best-time-country-card__teaser {
    margin: 0.375rem 0 0.5rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    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;
}

/* Category label at bottom */
.best-time-country-card__category-label {
    display: inline-block;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.best-time-country-card__category-label--both {
    background: var(--best-time-gold);
    color: #1a1a1a;
}

.best-time-country-card__category-label--weather {
    background: var(--best-time-green);
    color: white;
}

.best-time-country-card__category-label--cheapest {
    background: var(--best-time-blue);
    color: white;
}

/* Empty state */
.best-time-countries__empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.best-time-countries__empty i {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 1rem;
    display: block;
}

.best-time-countries__empty p {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.best-time-countries__empty-hint {
    font-size: 0.875rem;
    opacity: 0.65;
}

/* =================================================================
   MOBILE RESPONSIVE STYLES
   ================================================================= */

@media (max-width: 767px) {
    .best-time-hero {
        padding: 3rem 1rem 2.5rem;
    }

    .best-time-hero__title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    .best-time-hero__subtitle {
        font-size: 1rem;
    }

    .best-time-hero__intro {
        font-size: 0.9375rem;
    }

    .best-time-months {
        margin-bottom: 1.5rem;
    }

    .best-time-months__nav {
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
    }

    .best-time-months__item {
        padding: 0.4rem 0.5rem;
        font-size: 0.6875rem;
    }

    .best-time-map-section {
        padding: 0 0 1.5rem;
    }

    .best-time-map__legend {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .best-time-map__legend-item {
        font-size: 0.6875rem;
    }

    .best-time-countries {
        padding: 2rem 1rem 3rem;
    }

    .best-time-countries__header {
        margin-bottom: 1.5rem;
    }

    .best-time-country-card__content {
        padding: 0.875rem;
    }

    .best-time-country-card__name {
        font-size: 1.125rem;
    }

    .best-time-country-card__teaser {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 479px) {
    .best-time-hero--has-image {
        min-height: 320px;
    }

    .best-time-months__item {
        padding: 0.375rem 0.4rem;
        font-size: 0.625rem;
    }

    .best-time-country-card__badge {
        width: 24px;
        height: 24px;
        font-size: 0.625rem;
    }
}

/* =================================================================
   ACCESSIBILITY & REDUCED MOTION
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
    .best-time-tooltip,
    .best-time-country-card,
    .best-time-country-card__image img,
    .best-time-map__svg path,
    .best-time-map__spinner {
        transition: none;
        animation: none;
    }
}

/* Focus styles for accessibility */
.best-time-months__item:focus-visible,
.best-time-country-card:focus-visible {
    outline: 2px solid var(--coral-500, #FF8066);
    outline-offset: 2px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .best-time-country-card__gradient {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0) 100%
        );
    }

    .best-time-hero__overlay {
        background: linear-gradient(
            180deg,
            rgba(0, 34, 0, 0.6) 0%,
            rgba(0, 34, 0, 0.8) 50%,
            rgba(0, 34, 0, 0.9) 100%
        );
    }
}
