.custom-itinerary-block {
    margin-bottom: 20px;
    padding-top: 12px;
    font-family: Avenir !important;
    position: relative;
}

.itinerary-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #121010;
    padding-bottom: 1rem;
    gap: 1.5rem;
}

.itinerary-title {
    font-weight: 900;
    color: #BF3F36;
    font-size: 2.7rem !important;
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

/* Style for the map image container */
.itinerary-map {
    margin: 2rem 0;
    text-align: center;
}

.itinerary-map img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: inline-block;
}

.itinerary-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.itinerary-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    border: 2px solid #BF3F36;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 900;
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    background: none;
    font-family: Avenir, sans-serif;
}

.print-button {
    background-color: #BF3F36;
    color: white;
}

.print-button svg {
    margin-right: 10px;
}

.map-button {
    background-color: white;
    color: #BF3F36;
}

.itinerary-button:hover {
    background-color:#121010;
    border-color: #121010;
    color:white;
}

.itinerary-content-wrapper {
    position: relative;
    overflow: hidden;
}

.itinerary-content {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

/* Remove height restriction and overflow for single itinerary pages */
.itinerary-content.single-itinerary {
    max-height: none !important;
    overflow: visible;
}

.itinerary-content.expanded {
    max-height: none;
}

.itinerary-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 80%);
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.itinerary-fade.hidden {
    opacity: 0;
}

.itinerary-load-more {
    display: block;
    margin: -30px auto 0;
    padding: 10px 20px;
    background-color: #C03F35;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-family: Avenir, sans-serif;
    font-weight: 900;
    font-size: 1rem;
    transition: background-color 0.3s ease, margin-top 0.3s ease;
    position: relative;
    z-index: 1;
}

.itinerary-load-more.expanded {
    margin-top: 10px;
}

.itinerary-load-more:hover {
    background-color: #333333;
}

.itinerary-load-more.hidden {
    display: none;
}

.itinerary-day {
    margin-bottom: 30px;
}

.itinerary-day:last-child {
    margin-bottom: 0;
}

.itinerary-day-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

.itinerary-day-title {
    font-weight: 900;
    margin-right: 8px;
    margin-bottom: 0;
    text-transform: uppercase;
    font-size: 1.6rem;
    color: #121010;
}

.itinerary-day-description {
    margin-bottom: 0;
    font-size: 1.6rem;
    color: #121010;
}

.itinerary-day-description p{
    margin-bottom:0 !important;
}

.itinerary-day-content {
    padding-left: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #121010;
    color: #121010;
}

.itinerary-day:last-child .itinerary-day-content {
    border-bottom: none;
    padding-bottom: 0;
}

.itinerary-day-content ul,
.itinerary-day-content ol {
    margin: 0 0 24px 20px;
}

.itinerary-day-content ul{
    list-style-type: disc;
}
.itinerary-day-content ul ul{
    list-style-type: circle;
}
.itinerary-day-content ul ul ul{
    list-style-type: square;
}

.itinerary-day-content ul:last-child,
.itinerary-day-content ol:last-child {
    margin: 0 0 10px 20px;
}

.itinerary-day-content li {
    margin-bottom: 8px;
}

.itinerary-day-content li:last-child {
    margin-bottom: 0px;
}

.itinerary-day-content p {
    margin-bottom: 10px;
}

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

@media screen and (max-width: 767px) {
    .itinerary-header {
        flex-direction: column;
        align-items: stretch;
    }
    .itinerary-buttons {
        flex-direction: column;
    }

    .itinerary-button {
        width: 100%;
        justify-content: center;
    }
}

/* Print styles */
@media print {
    /* General print optimization */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide unnecessary elements */
    .itinerary-buttons,
    .itinerary-fade,
    .itinerary-load-more,
    .print-button {
        display: none !important;
    }

    /* Reset page margins for US Letter size */
    @page {
        margin: 0.5in;  /* Standard US Letter margins */
        size: letter;   /* US Letter size: 8.5in x 11in */
    }

    /* Container adjustments */
    .custom-itinerary-block {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* Header styling */
    .itinerary-header {
        margin-bottom: 0.5in;
        padding-bottom: 0.25in;
        border-bottom-color: #000 !important;
        display: block !important;
    }

    .itinerary-title {
        font-size: 24pt !important;
        color: #000 !important;
        margin-bottom: 0 !important;
    }

    /* Day styling */
    .itinerary-day {
        page-break-inside: avoid;
        margin-bottom: 0.4in;
    }

    .itinerary-day-title {
        font-size: 16pt !important;
        color: #000 !important;
    }

    .itinerary-day-description {
        font-size: 14pt !important;
        color: #000 !important;
    }

    .itinerary-day-content {
        font-size: 12pt !important;
        line-height: 1.4;
        color: #000 !important;
        border-bottom-color: #ccc !important;
        padding-bottom: 0.3in;
    }

    /* List styling */
    .itinerary-day-content ul,
    .itinerary-day-content ol {
        margin: 0 0 0 0.4in !important;
    }

    .itinerary-day-content li {
        margin-bottom: 0;
    }

    /* Ensure proper page breaks */
    .itinerary-day {
        break-inside: avoid;
    }

    .itinerary-day-header {
        break-after: avoid;
    }

    /* Font optimization for print */
    body {
        font-family: "Avenir", "Arial", sans-serif !important;
    }

    /* Hide other page elements */
    header, footer, nav, aside, .sidebar, .comments-section, .navigation {
        display: none !important;
    }
}