/**
 * STP Find-a-Car — Tours Frontend Styles
 * Used on: archive-stpfc_tour, single-stpfc_tour, [stpfc_tours] shortcode
 * @package STPFindACar
 */

/* ================================
   Tours Grid (archive + shortcode)
   ================================ */
.stpfc-tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin: 40px 0;
}

.stpfc-tours-grid.stpfc-tours-layout-compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* ================================
   Tour Card
   ================================ */
.stpfc-tour-card {
    background: var(--color-white, #fff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}

.stpfc-tour-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* Image */
.stpfc-tour-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--color-primary-light, #d1fae5);
}

.stpfc-tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.stpfc-tour-card:hover .stpfc-tour-card-image img {
    transform: scale(1.04);
}

.stpfc-tour-card-emoji {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: 2rem;
    line-height: 1;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stpfc-tour-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--color-primary, #16a34a);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Island badge — bottom-left of the card image */
.stpfc-island-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1.3;
    white-space: nowrap;
}

.stpfc-island-badge--sao-tome {
    background: rgba(15, 118, 110, 0.88);
    color: #fff;
}

.stpfc-island-badge--principe {
    background: rgba(99, 48, 168, 0.88);
    color: #fff;
}

.stpfc-island-badge--ambas {
    background: rgba(15, 76, 130, 0.88);
    color: #fff;
}

/* Body */
.stpfc-tour-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.stpfc-tour-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary-dark, #14532d);
    margin: 0;
    line-height: 1.3;
}

.stpfc-tour-card-desc {
    font-size: .875rem;
    color: var(--color-gray, #6b7280);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

/* Meta chips */
.stpfc-tour-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stpfc-tour-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: var(--color-primary-dark, #14532d);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 3px 10px;
    font-weight: 500;
}

.stpfc-tour-meta-chip svg {
    flex-shrink: 0;
}

/* Price */
.stpfc-tour-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary, #16a34a);
}

/* CTA */
.stpfc-tour-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.stpfc-tour-card-actions .stpfc-btn {
    font-size: .82rem;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
    border-radius: 8px;
    font-weight: 600;
    justify-content: center;
}

.stpfc-tour-card-actions .stpfc-btn-outline {
    border: 2px solid var(--color-primary, #16a34a);
    color: var(--color-primary, #16a34a) !important;
    background: transparent;
}

.stpfc-tour-card-actions .stpfc-btn-outline:hover {
    background: var(--color-primary, #16a34a);
    color: #fff !important;
}

.stpfc-tour-card-actions .stpfc-tour-cta-btn {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.stpfc-tour-card-actions .stpfc-btn-whatsapp {
    background: #25d366;
    color: #fff !important;
}

.stpfc-tour-card-actions .stpfc-btn-whatsapp:hover {
    background: #1da851;
    color: #fff !important;
}

/* ================================
   Thank You Tours Section
   ================================ */
.stpfc-thankyou-tours {
    margin: 48px 0;
    padding: 40px 0;
    border-top: 1px solid #e5e7eb;
}

.stpfc-thankyou-tours-header {
    text-align: center;
    margin-bottom: 32px;
}

.stpfc-thankyou-tours-header h2 {
    font-size: 1.75rem;
    color: var(--color-primary-dark, #14532d);
    margin: 0 0 8px;
}

.stpfc-thankyou-tours-header p {
    color: var(--color-gray, #6b7280);
    margin: 0;
    font-size: .95rem;
}

.stpfc-thankyou-tours-footer {
    text-align: center;
    margin-top: 28px;
}

/* ================================
   Single Tour Page
   ================================ */
.stpfc-single-tour {}

/* Hero */
.stpfc-tour-hero {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 40px;
}

.stpfc-tour-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stpfc-tour-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 60%, transparent 100%);
}

.stpfc-tour-hero-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    color: #fff;
}

.stpfc-tour-hero-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
}

.stpfc-tour-hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.2;
}

/* Details bar */
.stpfc-tour-details-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 36px;
}

.stpfc-tour-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: var(--color-primary-dark, #14532d);
}

.stpfc-tour-detail-item svg {
    color: var(--color-primary, #16a34a);
    flex-shrink: 0;
}

.stpfc-tour-detail-label {
    font-weight: 600;
}

.stpfc-tour-price-highlight {
    margin-left: auto;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary, #16a34a);
}

/* Itinerary */
.stpfc-tour-itinerary {
    margin: 36px 0;
}

.stpfc-tour-itinerary h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary-dark, #14532d);
    margin: 0 0 20px;
}

.stpfc-itinerary-timeline {
    position: relative;
    padding-left: 32px;
}

.stpfc-itinerary-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #bbf7d0;
}

.stpfc-itin-step {
    position: relative;
    margin-bottom: 24px;
}

.stpfc-itin-step::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--color-primary, #16a34a);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--color-primary, #16a34a);
}

.stpfc-itin-step-time {
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-primary, #16a34a);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.stpfc-itin-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary-dark, #14532d);
    margin: 0 0 4px;
}

.stpfc-itin-step-desc {
    font-size: .875rem;
    color: var(--color-gray, #6b7280);
    line-height: 1.6;
    margin: 0;
}

/* Gallery */
.stpfc-tour-gallery {
    margin: 36px 0;
}

.stpfc-tour-gallery h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary-dark, #14532d);
    margin: 0 0 16px;
}

.stpfc-tour-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.stpfc-tour-gallery-grid a,
.stpfc-tour-gallery-item {
    display: block;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    aspect-ratio: 4/3;
}

.stpfc-tour-gallery-item {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    width: 100%;
}

.stpfc-tour-gallery-item:focus-visible {
    outline: 3px solid var(--color-primary, #16a34a);
    outline-offset: 3px;
}

.stpfc-tour-gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.stpfc-tour-gallery-grid a:hover img,
.stpfc-tour-gallery-item:hover img {
    transform: scale(1.05);
}

.stpfc-gallery-open {
    overflow: hidden;
}

.stpfc-tour-gallery-lightbox[hidden] {
    display: none;
}

.stpfc-tour-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.stpfc-tour-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 16, .88);
}

.stpfc-tour-gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    min-height: min(72vh, 760px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stpfc-tour-gallery-lightbox__figure {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stpfc-tour-gallery-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    background: #111827;
}

.stpfc-tour-gallery-lightbox__caption,
.stpfc-tour-gallery-lightbox__counter {
    color: #fff;
    text-align: center;
}

.stpfc-tour-gallery-lightbox__caption {
    font-size: .95rem;
    line-height: 1.5;
}

.stpfc-tour-gallery-lightbox__counter {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
}

.stpfc-tour-gallery-lightbox__close,
.stpfc-tour-gallery-lightbox__nav {
    appearance: none;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.stpfc-tour-gallery-lightbox__close:hover,
.stpfc-tour-gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, .24);
}

.stpfc-tour-gallery-lightbox__close:focus-visible,
.stpfc-tour-gallery-lightbox__nav:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.stpfc-tour-gallery-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 2rem;
    line-height: 1;
}

.stpfc-tour-gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    font-size: 2.8rem;
    line-height: 1;
    transform: translateY(-50%);
}

.stpfc-tour-gallery-lightbox__nav--prev {
    left: 0;
}

.stpfc-tour-gallery-lightbox__nav--next {
    right: 0;
}

/* Includes / Excludes */
.stpfc-tour-inex {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 36px 0;
    padding: 28px;
    background: #f9fafb;
    border-radius: var(--radius-lg, 12px);
}

.stpfc-tour-inex-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.stpfc-tour-inex-col.includes h4 { color: #166534; }
.stpfc-tour-inex-col.excludes h4 { color: #991b1b; }

.stpfc-tour-inex-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stpfc-tour-inex-col ul li {
    font-size: .875rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.stpfc-tour-inex-col.includes li::before { content: '✓'; color: #16a34a; font-weight: 700; flex-shrink: 0; }
.stpfc-tour-inex-col.excludes li::before { content: '✕'; color: #dc2626; font-weight: 700; flex-shrink: 0; }

/* Guide card */
.stpfc-tour-guide-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg, 12px);
    margin: 36px 0;
}

.stpfc-tour-guide-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0fdf4;
}

.stpfc-tour-guide-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stpfc-tour-guide-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary-dark, #14532d);
    margin: 0 0 4px;
}

.stpfc-tour-guide-langs {
    font-size: .8rem;
    color: var(--color-primary, #16a34a);
    font-weight: 600;
    margin-bottom: 10px;
}

.stpfc-tour-guide-bio {
    font-size: .875rem;
    color: var(--color-gray, #6b7280);
    line-height: 1.6;
    margin: 0;
}

/* Booking CTA box */
.stpfc-tour-cta-box {
    background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
    color: #fff;
    border-radius: var(--radius-lg, 12px);
    padding: 36px 32px;
    text-align: center;
    margin: 40px 0;
}

.stpfc-tour-cta-box h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 8px;
}

.stpfc-tour-cta-box p {
    font-size: .95rem;
    opacity: .85;
    margin: 0 0 24px;
}

.stpfc-tour-cta-box .stpfc-btn {
    font-size: 1.05rem;
    padding: 14px 32px;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .stpfc-tours-grid {
        grid-template-columns: 1fr;
    }

    .stpfc-tour-hero {
        height: 300px;
    }

    .stpfc-tour-hero-title {
        font-size: 1.5rem;
    }

    .stpfc-tour-inex {
        grid-template-columns: 1fr;
    }

    .stpfc-tour-guide-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stpfc-tour-details-bar {
        flex-direction: column;
    }

    .stpfc-tour-price-highlight {
        margin-left: 0;
    }

    .stpfc-tour-gallery-lightbox {
        padding: 14px;
    }

    .stpfc-tour-gallery-lightbox__dialog {
        min-height: 70vh;
        padding: 54px 0 64px;
    }

    .stpfc-tour-gallery-lightbox__image {
        max-height: 68vh;
    }

    .stpfc-tour-gallery-lightbox__close {
        top: 4px;
        right: 4px;
    }

    .stpfc-tour-gallery-lightbox__nav {
        top: auto;
        bottom: 0;
        width: 46px;
        height: 46px;
        font-size: 2.4rem;
        transform: none;
    }

    .stpfc-tour-gallery-lightbox__nav--prev {
        left: calc(50% - 58px);
    }

    .stpfc-tour-gallery-lightbox__nav--next {
        right: calc(50% - 58px);
    }
}
