/**
 * Madurai Trip — Custom CSS Overrides & Extras
 * @version 1.0.0
 */

/* ── Google Fonts Preload Optimization ─── */
@font-face {
    font-family: 'Inter';
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    font-display: swap;
}

/* ── WordPress Core Fixes ─────────────── */
.wp-block-image img { border-radius: var(--radius); }
.wp-caption-text { font-size: 0.8rem; color: var(--text-light); font-style: italic; text-align: center; margin-top: 0.4rem; }
.wp-block-quote { border-left: 4px solid var(--primary); padding: 1rem 1.5rem; background: var(--light); border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; }
.wp-block-quote p { font-size: 1.05rem; font-style: italic; color: var(--text); }
.wp-block-button__link { background: var(--primary); color: var(--dark); border-radius: 50px; padding: 0.85rem 2rem; font-weight: 700; }
.wp-block-button__link:hover { background: var(--secondary); color: #fff; }
.has-primary-color { color: var(--primary) !important; }
.has-secondary-color { color: var(--secondary) !important; }
.has-primary-background-color { background-color: var(--primary) !important; }
.alignnone { margin: 1rem 0; }
.aligncenter { display: block; margin: 1.5rem auto; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }

/* ── Comments ─────────────────────────── */
.comment-list { margin: 2rem 0; list-style: none; }
.comment { padding: 1.5rem; background: var(--light); border-radius: var(--radius-lg); margin-bottom: 1rem; }
.comment-author .avatar { border-radius: 50%; border: 3px solid var(--primary); }
.comment-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.75rem; }
.comment-content p { font-size: 0.9rem; }
.reply a { color: var(--primary); font-size: 0.85rem; font-weight: 600; }
#respond { background: var(--light); border-radius: var(--radius-lg); padding: 2rem; margin-top: 2rem; }
#respond .comment-form input, #respond .comment-form textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; font-family: inherit; }
#respond .comment-form input:focus, #respond .comment-form textarea:focus { border-color: var(--primary); outline: none; }
#respond .submit { background: var(--primary); color: var(--dark); border: none; padding: 0.85rem 2rem; border-radius: 50px; font-weight: 700; cursor: pointer; transition: var(--transition); }
#respond .submit:hover { background: var(--secondary); color: #fff; }

/* ── Search Form ──────────────────────── */
.search-form { display: flex; gap: 0.5rem; }
.search-field { flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.search-submit { background: var(--primary); color: var(--dark); border: none; padding: 0.75rem 1.25rem; border-radius: var(--radius); font-weight: 600; cursor: pointer; }

/* ── 404 Page ─────────────────────────── */
.not-found-section { text-align: center; padding: 6rem 0; }
.not-found-code { font-size: 8rem; font-weight: 900; color: var(--border); line-height: 1; font-family: var(--font-heading); }
.not-found-section h1 { color: var(--secondary); }

/* ── WooCommerce ──────────────────────── */
.woocommerce .button { background: var(--primary) !important; color: var(--dark) !important; border-radius: 50px !important; font-weight: 700 !important; }
.woocommerce .button:hover { background: var(--secondary) !important; color: #fff !important; }
.woocommerce-Price-amount.amount { color: var(--secondary); font-weight: 700; }
.woocommerce .woocommerce-product-gallery__image img { border-radius: var(--radius-lg); }
.woocommerce div.product .product_title { font-family: var(--font-heading); }

/* ── Elementor Compatibility ──────────── */
.elementor-section { position: relative; }
.elementor-heading-title { font-family: var(--font-heading); }
.elementor-widget-button .elementor-button { border-radius: 50px; font-family: var(--font-accent); font-weight: 700; }

/* ── Keyboard Navigation Focus ────────── */
body.using-keyboard a:focus,
body.using-keyboard button:focus,
body.using-keyboard input:focus,
body.using-keyboard select:focus,
body.using-keyboard textarea:focus {
    outline: 3px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* ── Custom Selection Color ───────────── */
::selection { background: var(--primary); color: var(--dark); }
::-moz-selection { background: var(--primary); color: var(--dark); }

/* ── Custom Scrollbar ─────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* ── Admin bar offset ─────────────────── */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ── Post content images ──────────────── */
.post-content img { border-radius: var(--radius); box-shadow: var(--shadow); }
.post-content table { margin: 1.5rem 0; }
.post-content th { background: var(--dark); color: var(--white); padding: 0.75rem 1rem; }
.post-content td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); }
.post-content tr:hover td { background: var(--light); }

/* ── Dark Mode Support ────────────────── */
@media (prefers-color-scheme: dark) {
    /* Optional: uncomment to enable dark mode support */
    /*
    :root {
        --white: #1C1C2E;
        --light: #2D2D45;
        --text: #E5E5E5;
        --border: #3D3D55;
    }
    */
}

/* ── Print Styles ─────────────────────── */
@media print {
    .site-header, .site-footer, .whatsapp-widget, .scroll-top,
    .preloader, .booking-form, .sidebar, .newsletter-section,
    .promo-banner, .hero-slider, .slider-controls, .slider-arrows {
        display: none !important;
    }
    body { font-size: 12pt; color: #000; }
    a { color: #000; text-decoration: underline; }
    .breadcrumb-section { background: #fff !important; color: #000 !important; margin-top: 0; padding: 1rem 0; }
    .page-title-heading { color: #000 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    @page { margin: 1in; }
}

/* ── Reduced Motion ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-slide-bg { transition: none !important; transform: none !important; }
    .animate-on-scroll { opacity: 1 !important; transform: none !important; }
    * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ── High Contrast ────────────────────── */
@media (forced-colors: active) {
    .btn-primary { border: 2px solid ButtonText; }
    .social-link { border: 1px solid ButtonText; }
}

/* ── Performance: will-change on animated elements ── */
.hero-slide, .card, .service-icon-card, .blog-card, .vehicle-card { will-change: transform; }
.animate-on-scroll { will-change: opacity, transform; }

/* ── Swiper (if used for testimonials) ── */
.swiper-pagination-bullet-active { background: var(--primary) !important; }
.swiper-button-next, .swiper-button-prev { color: var(--primary) !important; }

/* ── Cookie Bar ───────────────────────── */
#mt-cookie-bar { box-shadow: 0 -4px 20px rgba(0,0,0,0.3); }
#mt-cookie-bar a { text-decoration: underline; }
#mt-cookie-accept:hover { background: var(--primary-dark) !important; }

/* ── Page-specific hero padding (no top-bar) ── */
.page-id-home .breadcrumb-section { padding-top: 120px; }
.is-home-page .hero-slider { margin-top: 0; }

/* ── Flex gap for older browsers ─────── */
.d-flex { gap: 1rem; }

/* ── Loading spinner ──────────────────── */
.mt-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* ── Tour Package Single Page ─────────── */
.single-tour_package .post-content h2 { color: var(--secondary); }
.single-tour_package .itinerary { margin: 1.5rem 0; }

/* ── Includes / Excludes List ─────────── */
.pkg-includes-list, .pkg-excludes-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pkg-includes-list .item { background: #ecfdf5; color: #065f46; padding: 0.3rem 0.75rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600; }
.pkg-includes-list .item::before { content: '✓ '; }
.pkg-excludes-list .item { background: #fef2f2; color: #991b1b; padding: 0.3rem 0.75rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600; }
.pkg-excludes-list .item::before { content: '✗ '; }

/* ── Responsive Video Embed ───────────── */
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ── Notification Badges ──────────────── */
.badge-new { background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 800; padding: 0.15rem 0.5rem; border-radius: 50px; text-transform: uppercase; letter-spacing: 1px; vertical-align: middle; margin-left: 0.25rem; }

/* ── Menu dropdown arrow on desktop ───── */
@media (min-width: 993px) {
    .main-nav .dropdown-arrow { display: inline-block; font-size: 0.65rem; margin-left: 0.25rem; transition: transform 0.3s; }
    .main-nav li:hover .dropdown-arrow { transform: rotate(180deg); }
}

/* ── Breadcrumb inner pages ───────────── */
.breadcrumb-section + .section { padding-top: 60px; }

/* ── Form validation states ───────────── */
.form-control.is-invalid { border-color: #e74c3c; }
.form-control.is-valid { border-color: #27ae60; }
.invalid-feedback { color: #e74c3c; font-size: 0.8rem; margin-top: 0.25rem; display: none; }
.is-invalid ~ .invalid-feedback { display: block; }
