/*
Theme Name: Sydän24
Theme URI: https://sydan24.fi
Author: Sydän24 Team
Author URI: https://sydan24.fi
Description: Custom standalone theme for Sydän24 cardiovascular healthcare service. Ultra-fast, responsive, modern Lovable design with zero WooCommerce dependency. Full support for Yoast SEO, Schema.org, and GDPR compliance.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: sydan24
Tags: medical, healthcare, responsive-layout, custom-menu, featured-images, translation-ready
*/

/* Reset & Base adjustments if needed */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #26283b;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
}

/* FAQ Accordion Styles - Guarantee clean zero-height on load */
.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.faq-item[data-state="open"] .faq-accordion-content {
    opacity: 1;
}

/* =====================================================================
 * Navigation Dropdown & Mega Menu System
 * ===================================================================== */

/* Bridge invisible gap between nav link and dropdown so cursor doesn't lose hover */
.nav-dropdown-bridge::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

/* Base Dropdown & Mega Menu Styles */
.nav-dropdown,
.services-megamenu,
.cardiologists-megamenu,
.heart-info-megamenu {
    position: absolute;
    top: 100%;
    z-index: 999;
    background-color: #ffffff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
}

/* Reveal dropdown on hover, focus, or open */
.group:hover>.nav-dropdown,
.group:hover>.services-megamenu,
.group:hover>.cardiologists-megamenu,
.group:hover>.heart-info-megamenu,
.group:focus-within>.nav-dropdown,
.group:focus-within>.services-megamenu,
.group:focus-within>.cardiologists-megamenu,
.group:focus-within>.heart-info-megamenu,
.group.is-open>.nav-dropdown,
.group.is-open>.services-megamenu,
.group.is-open>.cardiologists-megamenu,
.group.is-open>.heart-info-megamenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* Parent Link Highlight on Hover */
.group:hover>a {
    color: #00876c !important;
    border-bottom-color: #00876c !important;
}

/* Chevron Icon Rotation */
.nav-chevron {
    width: 0.95rem;
    height: 0.95rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
    margin-left: 0.25rem;
    display: inline-block;
    vertical-align: middle;
}

.group:hover .nav-chevron,
.group:focus-within .nav-chevron,
.group.is-open .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Standard Sub-nav Menu (WP Custom Submenus) */
.nav-dropdown-standard {
    left: 0;
    min-width: 250px;
    padding: 0.5rem;
    list-style: none;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.nav-dropdown-standard li {
    list-style: none;
    margin: 2px 0;
}

.nav-dropdown-standard a {
    display: block;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #26283b;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-standard a:hover {
    background-color: #f1f5f9;
    color: #00876c;
}

/* Mega Menus Full Width Base */
.nav-dropdown-mega,
.services-megamenu,
.cardiologists-megamenu,
.heart-info-megamenu {
    left: 0;
    right: 0;
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .mega-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.megamenu-column {
    display: flex;
    flex-direction: column;
}

/* Top Bar Indicator for Services & Cardiologists Mega Menus (Matches Screenshot 1) */
.megamenu-top-bar {
    width: 100%;
    height: 2px;
    background-color: #e2e8f0;
    margin-bottom: 1.15rem;
    transition: background-color 0.2s ease;
}

/* 1. Services Cards */
.megamenu-service-card,
.mega-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
}

.mega-card-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.mega-card-icon-wrap {
    width: 3.5rem;
    height: 3.5rem;
    background-color: #f1f5f9;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.mega-card-content {
    flex: 1;
    min-width: 0;
}

.mega-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #26283b;
    line-height: 1.3;
    transition: color 0.15s ease;
}

/* When hovered or active: Top line turns vibrant green & Title turns green */
.megamenu-service-card:hover .megamenu-top-bar,
.megamenu-service-card.is-active .megamenu-top-bar,
.mega-card:hover .megamenu-top-bar,
.mega-card.is-active .megamenu-top-bar {
    background-color: #009E82;
}

.megamenu-service-card:hover .mega-card-title,
.megamenu-service-card.is-active .mega-card-title,
.mega-card:hover .mega-card-title,
.mega-card.is-active .mega-card-title {
    color: #00876c;
}

.mega-card-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
    margin-top: 0.25rem;
}

.mega-card-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: #009E82;
    margin-top: 0.4rem;
}

/* 2. Cardiologist Cards (Matches Screenshot 1 & 2) */
.megamenu-doc-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.2s ease;
}

.megamenu-doc-card:hover .megamenu-top-bar,
.megamenu-doc-card.is-active .megamenu-top-bar {
    background-color: #009E82;
}

.megamenu-doc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #26283b;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.megamenu-doc-card:hover .megamenu-doc-title,
.megamenu-doc-card.is-active .megamenu-doc-title {
    color: #00876c;
}

.megamenu-doc-subtitle {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* 3. Heart Info Left Hover Effect (Matches Screenshot 2) */
.megamenu-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.megamenu-link-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.megamenu-nav-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #26283b;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    line-height: 1.4;
    transition: color 0.15s ease, border-left-color 0.15s ease;
}

/* Left vertical bar turns green & Text turns green on hover or when active */
.megamenu-nav-link:hover,
.megamenu-nav-link.is-active {
    border-left-color: #009E82;
    color: #009E82;
}

/* Mega Menu Bottom Bar */
.mega-bottom {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mega-bottom-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #00876c;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s ease;
}

.mega-bottom-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #006954;
}

/* =====================================================================
 * Google Translate & Browser Extension Translation Normalization
 * Prevents text overlapping/collision when pages are auto-translated
 * ===================================================================== */
html,
body,
p,
span,
div,
h1,
h2,
h3,
h4,
h5,
h6,
a,
li {
    text-wrap: wrap !important;
}

/* Force translation font wrappers to inherit layout and normal line height */
font,
font font,
.translated-ltr font,
.translated-rtl font,
font[style*="vertical-align: inherit"] {
    vertical-align: baseline !important;
    display: inline !important;
    position: static !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

/* Fix Mega Menu & Card Descriptions under translation */
.mega-card-desc,
.megamenu-doc-subtitle,
.doctor-service-desc {
    display: block !important;
    position: static !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    margin-top: 0.35rem !important;
}

/* In case translation tools (TWP, Immersive Translate, etc.) inject bilingual layers */
.immersive-translate-target-translation,
[data-immersive-translate-translation-element-mark],
.twp-translated-wrapper,
.twp-original-wrapper {
    display: block !important;
    margin-top: 0.35rem !important;
    position: static !important;
    line-height: 1.5 !important;
}

/* =====================================================================
 * Header, Logo & Admin Bar Normalization
 * ===================================================================== */
/* Prevent logged-in WordPress Admin Bar from obscuring the top announcement bar */
.admin-bar #site-header {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar #site-header {
        top: 46px !important;
    }
}

/* Guarantee Header Logo (Heart + Sydän24 text) is never cut off or clipped */
header a[aria-label*="Sydän24"] {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: 140px !important;
}

header a[aria-label*="Sydän24"] img,
.site-logo-img {
    height: 36px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    display: block !important;
}

/* =====================================================================
 * Doctor Profile Hero 2-Column Grid (Matches Sydän24 Live App)
 * ===================================================================== */
@media (min-width: 1024px) {

    .lg\:grid-cols-\[0\.9fr_1\.1fr\],
    .doctor-hero-grid {
        display: grid !important;
        grid-template-columns: 0.9fr 1.1fr !important;
        gap: 2.5rem !important;
        align-items: start !important;
    }

    /* Doctor Team Spotlight Grid alignment - top align text with doctor team image */
    .doctor-spotlight-grid {
        align-items: start !important;
    }
}

/* =====================================================================
 * WordPress Pagination & Category Archive Styling
 * ===================================================================== */
.sydan24-pagination .nav-links,
.pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sydan24-pagination .page-numbers,
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #26283b;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sydan24-pagination .page-numbers:hover,
.pagination .page-numbers:hover {
    border-color: #00876c;
    color: #00876c;
}

.sydan24-pagination .page-numbers.current,
.pagination .page-numbers.current {
    background-color: #00876c;
    border-color: #00876c;
    color: #ffffff;
    font-weight: 600;
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =====================================================================
 * Cardiology CTA Banner (Dark Navy Card Matching Reference Screenshot)
 * ===================================================================== */
.cardiology-cta-section {
    margin-top: 3.5rem !important;
    margin-bottom: 5.5rem !important;
}

@media (min-width: 1024px) {
    .cardiology-cta-section {
        margin-top: 4.5rem !important;
        margin-bottom: 6.5rem !important;
    }
}

.cardiology-cta-banner {
    background-color: #26283b !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

.cardiology-cta-banner h2 {
    color: #ffffff !important;
}

.cardiology-cta-banner p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.cardiology-cta-banner a {
    background-color: #ffffff !important;
    color: #00876c !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cardiology-cta-banner a:hover {
    background-color: #f8fafc !important;
    color: #006854 !important;
    transform: translateY(-1px);
}

/* =====================================================================
 * Category Pills Slider (Interactive Scroll / Slide Controls)
 * ===================================================================== */
.cat-slider-track {
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.cat-slider-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.cat-slider-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #26283b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.cat-slider-btn:hover:not(:disabled) {
    border-color: #00876c;
    color: #00876c;
    transform: scale(1.08);
}

.cat-slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* =====================================================================
 * Headings Top & Bottom Spacing - ONLY ON SINGLE POST PAGES
 * ===================================================================== */
.single .single-post-body h1,
.single-post .prose h1,
.single-post-body h1 {
    margin-top: 2.75rem !important;
    margin-bottom: 1.25rem !important;
}

.single .single-post-body h2,
.single-post .prose h2,
.single-post-body h2 {
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
}

.single .single-post-body h3,
.single-post .prose h3,
.single-post-body h3 {
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

.single .single-post-body h4,
.single-post .prose h4,
.single-post-body h4 {
    margin-top: 1.75rem !important;
    margin-bottom: 0.85rem !important;
}

/* Paragraph spacing inside single post body only */
.single .single-post-body p,
.single-post .prose p,
.single-post-body p {
    margin-top: 0 !important;
    margin-bottom: 1.35rem !important;
    line-height: 1.8 !important;
}

/* Card titles in archive, category, and grids: strictly 0 margin */
article h2,
.grid article h2 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Post main header title resets */
article header h1 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* CTA Card heading reset */
.cardiology-cta-banner h2 {
    margin-top: 0 !important;
    margin-bottom: 0.875rem !important;
}

/* Archive & Category hero header resets (compact, no excess gaps) */
.archive-header,
.archive-header h1,
.archive-title {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.archive-header p,
.archive-desc {
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
}