/* ============================================
   STYLES PAGES DESTINATION ET COUNTRY
   ============================================ */

/* Position user et share pour page index destinations */
body:has(.destination-index-page) .user-account-bar {
    top: 185px;
}

body:has(.destination-index-page) .user-account-bar.sticky-scrolled {
    top: 20px;
}

body:has(.destination-index-page) .share-bar {
    top: 20px;
}

body:has(.destination-index-page) .share-bar.sticky-scrolled {
    top: -145px;
}

/* Position user et share pour page country */
body:has(.country-page) .user-account-bar {
    top: 220px;
}

body:has(.country-page) .user-account-bar.sticky-scrolled {
    top: 20px;
}

body:has(.country-page) .share-bar {
    top: 53px;
}

body:has(.country-page) .share-bar.sticky-scrolled {
    top: -145px;
}

/* Position user et share pour page destination (pas country, pas port) */
body:has(.destination-page):not(:has(.country-page)):not(:has(.port-show-page)) .user-account-bar {
    top: 220px !important;
}

body:has(.destination-page):not(:has(.country-page)):not(:has(.port-show-page)) .user-account-bar.sticky-scrolled {
    top: 20px !important;
}

body:has(.destination-page):not(:has(.country-page)):not(:has(.port-show-page)) .share-bar {
    top: 55px !important;
}

body:has(.destination-page):not(:has(.country-page)):not(:has(.port-show-page)) .share-bar.sticky-scrolled {
    top: -145px !important;
}

/* Hero Section - Utilisé par destination et country */
.destination-page,
.country-page {
    overflow-x: clip;
}

.destination-page > .container,
.country-page > .container {
    overflow: visible;
}

.destination-page .port-hero,
.country-page .port-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -2rem;
    margin-bottom: 0;
}

.destination-page:not(.country-page):not(.port-show-page) .port-hero {
    margin-top: calc(-2rem - 5px);
}

.destination-page:not(.country-page):not(.port-show-page) .page-header-row {
    margin-top: calc(1.5rem - 5px);
}

.destination-page .port-hero-overlay,
.country-page .port-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

.destination-page .port-hero-content,
.country-page .port-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 1200px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.destination-page .port-hero-content h1,
.country-page .port-hero-content h1 {
    font-size: 3.5rem;
    margin: 0 0 1rem 0;
    font-weight: 700;
    color: white !important;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
}

/* Page Section */
.destination-page section,
.country-page section {
    padding: 3rem 0;
    margin-bottom: 0;
}

.destination-page .section-title,
.country-page .section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #3182ce;
    display: table;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    transform: none;
}

/* Content Area */
.destination-content {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    line-height: 1.75;
    font-size: 1.05rem;
    color: #374151;
}

.destination-content p {
    margin-bottom: 1rem;
    text-align: left;
    line-height: 1.8;
}

.destination-content p:last-child {
    margin-bottom: 0;
}

.destination-content h2 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e5e7eb;
}

.destination-content h3 {
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.destination-content ul {
    margin: 1.25rem 0;
    padding-left: 0;
    list-style: none;
}

.destination-content ul li {
    margin-bottom: 0.65rem;
    padding-left: 1.75rem;
    position: relative;
    line-height: 1.65;
}

.destination-content ul li:before {
    content: "•";
    color: #3182ce;
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: 0.4rem;
}

.destination-content ol {
    margin: 1.25rem 0;
    padding-left: 1.75rem;
}

.destination-content ol li {
    margin-bottom: 0.65rem;
    line-height: 1.65;
}

.destination-content strong {
    color: #1f2937;
    font-weight: 600;
}

.destination-content em {
    font-style: italic;
    color: #6b7280;
}

.destination-content a:not(.link-arrow) {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 1px solid rgba(49, 130, 206, 0.3);
    transition: all 0.2s;
}

.destination-content a:not(.link-arrow):hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.destination-info-section {
    margin-top: 0;
}

/* Sections Tourisme, Croisières et Météo avec fond coloré */
.destination-page #tourisme,
.country-page #tourisme,
.destination-page #croisieres,
.country-page #croisieres,
.destination-page #meteo,
.country-page #meteo {
    background: var(--cream);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 3rem calc(50vw - 50%);
}

/* Retirer les barres multicolores sous les h2 */
.destination-page section h2::after,
.country-page section h2::after {
    display: none;
}


/* Full-width sections */
.destination-page #pays,
.destination-page #ports,
.destination-page #destinations,
.country-page #pays,
.country-page #ports,
.country-page #destinations {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 3rem calc(50vw - 50%);
    background: white;
}

.destination-page #ports,
.country-page #ports {
    margin-top: 6rem;
}

/* Grille 3 colonnes égales pour pays et ports */
.destination-page #pays .posts-grid,
.destination-page #ports .destinations-grid,
.country-page #pays .posts-grid,
.country-page #ports .destinations-grid {
    grid-template-columns: repeat(3, 1fr);
}

.destination-page .card-wrapper,
.country-page .card-wrapper {
    height: 100%;
}

.destination-page .card-wrapper .destination-card,
.country-page .card-wrapper .destination-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.destination-page .card-wrapper .destination-content,
.country-page .card-wrapper .destination-content {
    flex: 1;
}

@media (max-width: 1024px) {
    .destination-page #pays .posts-grid,
    .destination-page #ports .destinations-grid,
    .country-page #pays .posts-grid,
    .country-page #ports .destinations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .destination-page #pays .posts-grid,
    .destination-page #ports .destinations-grid,
    .country-page #pays .posts-grid,
    .country-page #ports .destinations-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TABLEAUX MÉTÉO - STYLE SOBRE
   ============================================ */
.destination-page .weather-tables-container,
.country-page .weather-tables-container {
    max-width: 100%;
    margin: 2rem auto 0;
}

.destination-page .weather-table-wrapper,
.country-page .weather-table-wrapper {
    margin: 0;
}

.destination-page .weather-table-wrapper::before,
.country-page .weather-table-wrapper::before {
    display: none;
}

.destination-page .weather-table,
.country-page .weather-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 2px solid var(--dark-navy);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    overflow: hidden;
}

.destination-page .weather-table::after,
.country-page .weather-table::after {
    display: none;
}

.destination-page .weather-table caption,
.country-page .weather-table caption {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: white;
    padding: 1rem 1.5rem;
    background: var(--dark-navy);
    text-align: left;
    border: none;
    text-shadow: none;
    caption-side: top;
    width: 100%;
}

.destination-page .weather-table caption::before,
.country-page .weather-table caption::before {
    content: '🌡️';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.destination-page .weather-table caption::after,
.country-page .weather-table caption::after {
    display: none;
}

.destination-page .weather-table thead,
.country-page .weather-table thead {
    background: #f8f9fa;
}

.destination-page .weather-table thead::after,
.country-page .weather-table thead::after {
    display: none;
}

.destination-page .weather-table th,
.country-page .weather-table th {
    padding: 0.75rem 0.5rem;
    color: var(--dark-navy);
    font-weight: 600;
    text-transform: none;
    font-size: 0.85rem;
    letter-spacing: normal;
    border-right: 1px solid #e5e7eb;
    border-bottom: 2px solid var(--dark-navy);
    text-align: center;
    font-family: var(--font-body);
    text-shadow: none;
}

.destination-page .weather-table th:last-child,
.country-page .weather-table th:last-child {
    border-right: none;
}

.destination-page .weather-table tbody tr,
.country-page .weather-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.destination-page .weather-table tbody tr:nth-child(even),
.country-page .weather-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.destination-page .weather-table tbody tr:nth-child(odd),
.country-page .weather-table tbody tr:nth-child(odd) {
    background-color: white;
}

.destination-page .weather-table tbody tr:hover,
.country-page .weather-table tbody tr:hover {
    background-color: rgba(49, 130, 206, 0.08);
    transform: none;
    box-shadow: none;
}

.destination-page .weather-table tbody tr:last-child,
.country-page .weather-table tbody tr:last-child {
    border-bottom: none;
}

.destination-page .weather-table td,
.country-page .weather-table td {
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.9rem;
}

.destination-page .weather-table td:last-child,
.country-page .weather-table td:last-child {
    border-right: none;
}

.destination-page .weather-table td:first-child,
.country-page .weather-table td:first-child {
    font-weight: 600;
    text-align: left;
    background: transparent;
    color: var(--dark-navy);
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.9rem;
    border-right: 1px solid #e5e7eb;
    padding-left: 1rem;
}

.destination-page .weather-icon,
.country-page .weather-icon {
    font-size: 1.5rem;
    display: block;
    margin: 0 auto 0.25rem;
    filter: none;
}

.destination-page .temp-range,
.country-page .temp-range {
    display: block;
    font-weight: 600;
    color: var(--dark-navy);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    font-family: var(--font-body);
}

.destination-page .weather-table tbody td:not(:first-child)::before,
.country-page .weather-table tbody td:not(:first-child)::before {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .destination-page .port-hero,
    .country-page .port-hero {
        height: 350px;
    }

    .destination-page:not(.country-page):not(.port-show-page) .port-hero {
        margin-top: -9px;
    }

    body:has(.destination-page:not(.country-page):not(.port-show-page)) .user-account-bar {
        top: 208px !important;
    }

    body:has(.destination-page:not(.country-page):not(.port-show-page)) .share-bar {
        top: 51px !important;
    }

    body:has(.destination-page:not(.country-page):not(.port-show-page)) .user-account-bar.sticky-scrolled {
        top: 8px !important;
    }

    body:has(.destination-page:not(.country-page):not(.port-show-page)) .share-bar.sticky-scrolled {
        top: -144px !important;
    }

    /* Page index destinations - mobile */
    body:has(.destination-index-page) .user-account-bar {
        top: 149px;
    }

    body:has(.destination-index-page) .share-bar {
        top: -5px;
    }

    body:has(.destination-index-page) .share-bar.sticky-scrolled {
        top: -132px;
    }

    .destination-page:not(.country-page) #pays .posts-grid {
        gap: var(--spacing-sm);
        margin-top: var(--spacing-sm);
    }

    .destination-page:not(.country-page) #pays {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .destination-page:not(.country-page) #pays .destination-content {
        padding: var(--spacing-sm);
    }

    .destination-page:not(.country-page) #pays .destination-content h3 {
        margin-bottom: 0.3rem;
        font-size: 1rem;
    }

    .destination-page:not(.country-page) #pays .destination-content p {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .destination-page:not(.country-page) .section-title {
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .destination-page .port-hero-content h1,
    .country-page .port-hero-content h1 {
        font-size: 2.5rem;
    }

    .destination-content {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .destination-page .section-title,
    .country-page .section-title {
        font-size: 1.5rem;
    }

    .destination-content h2 {
        font-size: 1.35rem;
    }

    .destination-page .page-header-row,
    .country-page .page-header-row {
        flex-direction: column;
        gap: 0;
        margin-top: 15px;
    }

    .destination-page .page-header-row > div:first-child,
    .country-page .page-header-row > div:first-child {
        margin-bottom: 0;
    }

    .destination-page .page-header-row .breadcrumb,
    .country-page .page-header-row .breadcrumb {
        margin-bottom: 0;
        padding: 0;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    .destination-page .breadcrumb-text a,
    .destination-page .breadcrumb-current,
    .country-page .breadcrumb-text a,
    .country-page .breadcrumb-current {
        padding: 0.2rem 0.3rem;
        font-size: 0.75rem;
    }

    .destination-page .breadcrumb-current,
    .country-page .breadcrumb-current {
        white-space: nowrap;
    }

    .destination-page .breadcrumb-separator,
    .country-page .breadcrumb-separator {
        padding: 0 0.2rem;
        font-size: 0.75rem;
    }

    .destination-page .page-header-actions,
    .country-page .page-header-actions {
        margin-top: 5px;
        margin-bottom: 15px;
        justify-content: flex-end;
        width: 100%;
    }

    .destination-page .page-header-actions .favorite-button,
    .destination-page .page-header-actions .like-button,
    .destination-page .page-header-actions .share-button,
    .country-page .page-header-actions .favorite-button,
    .country-page .page-header-actions .like-button,
    .country-page .page-header-actions .share-button {
        height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }

    .destination-page .port-hero,
    .country-page .port-hero {
        margin-top: 0;
    }

    .destination-page .page-navigation,
    .country-page .page-navigation {
        border-radius: 0;
    }

    .destination-page #ports,
    .country-page #ports {
        margin-top: 0;
    }

    .destination-page:not(.port-show-page) ~ .user-account-bar,
    body:has(.destination-page:not(.port-show-page)) .user-account-bar,
    .country-page ~ .user-account-bar,
    body:has(.country-page) .user-account-bar {
        top: 225px;
    }

    .destination-page:not(.port-show-page) ~ .user-account-bar.sticky-scrolled,
    body:has(.destination-page:not(.port-show-page)) .user-account-bar.sticky-scrolled,
    .country-page ~ .user-account-bar.sticky-scrolled,
    body:has(.country-page) .user-account-bar.sticky-scrolled {
        top: 8px;
    }

    .destination-page:not(.port-show-page) ~ .share-bar,
    body:has(.destination-page:not(.port-show-page)) .share-bar,
    .country-page ~ .share-bar,
    body:has(.country-page) .share-bar {
        top: 68px;
    }

    .destination-page:not(.port-show-page) ~ .share-bar.sticky-scrolled,
    body:has(.destination-page:not(.port-show-page)) .share-bar.sticky-scrolled,
    .country-page ~ .share-bar.sticky-scrolled,
    body:has(.country-page) .share-bar.sticky-scrolled {
        top: -145px;
    }

    /* Tableau météo mobile */
    .destination-page .weather-table-wrapper,
    .country-page .weather-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .destination-page .weather-table,
    .country-page .weather-table {
        min-width: 600px;
        font-size: 0.8rem;
        border-radius: 0;
    }

    .destination-page .weather-table caption,
    .country-page .weather-table caption {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
        min-width: 600px;
    }

    .destination-page .weather-table th,
    .country-page .weather-table th {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }

    .destination-page .weather-table td,
    .country-page .weather-table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.8rem;
    }

    .destination-page .weather-table td:first-child,
    .country-page .weather-table td:first-child {
        font-size: 0.8rem;
        padding-left: 0.5rem;
        min-width: 80px;
    }

    .destination-page .weather-icon,
    .country-page .weather-icon {
        font-size: 1.2rem;
    }

    .destination-page .temp-range,
    .country-page .temp-range {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .destination-page .port-hero,
    .country-page .port-hero {
        height: 300px;
    }

    .destination-page .port-hero-content h1,
    .country-page .port-hero-content h1 {
        font-size: 2rem;
    }
}