/* Taxonomy Header - LCP/FCP optimized */

.taxonomy-header,
.taxonomy-header * {
    box-sizing: border-box;
}

.taxonomy-header {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.taxonomy-header__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
    width: 100%;
    height: 400px;
    max-height: 400px;
    overflow: hidden;
}

.taxonomy-header__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 2rem;
    overflow: hidden;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.taxonomy-header__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

.taxonomy-header__breadcrumb a {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}

.taxonomy-header__breadcrumb a:hover {
    color: #495057;
    text-decoration: underline;
}

.taxonomy-header__breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.taxonomy-header__breadcrumb-text {
    flex: 1;
    min-width: 0;
}

.yoast-breadcrumb,
.fallback-breadcrumb {
    font-size: inherit;
}

.taxonomy-header__taxonomy-title {
    min-height: 1.95rem;
    margin: 0.5rem 0 0.25rem;
}

.taxonomy-header__taxonomy-title h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.taxonomy-header__motto {
    min-height: 1.8rem;
    margin: 0.25rem 0 0;
}

.taxonomy-header__motto p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #444;
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.6;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.taxonomy-header__places-count {
    min-height: 3.5rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    contain: layout style;
}

.taxonomy-header__places-count p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}

.taxonomy-header__places-count .material-symbols-outlined {
    width: 1.125rem;
    height: 1.125rem;
    flex: 0 0 1.125rem;
    color: #6c757d;
    font-size: 1.125rem;
    line-height: 1;
}

.taxonomy-header__social-share {
    min-height: 4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    contain: layout style;
}

.taxonomy-header__social-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-height: 36px;
}

.taxonomy-header__social-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.05) !important;
    color: #666 !important;
    text-decoration: none !important;
}

.taxonomy-header__social-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0 !important;
}

.taxonomy-header__social-icon:hover {
    color: #333 !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

.taxonomy-header__image {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 0 12px 12px 0;
    background: #f5f5f5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.taxonomy-header__background-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0 12px 12px 0;
    object-fit: cover;
    object-position: center;
}

.taxonomy-header__flag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.taxonomy-header__flag img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 1024px) {
    .taxonomy-header__content {
        padding: 1.5rem;
    }

    .taxonomy-header__taxonomy-title {
        min-height: 1.46rem;
    }

    .taxonomy-header__taxonomy-title h1 {
        font-size: 1.125rem;
    }

    .taxonomy-header__flag {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
    }

    .taxonomy-header__social-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .taxonomy-header__social-icon svg {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        min-height: 16px !important;
        max-width: 16px !important;
        max-height: 16px !important;
    }

    .taxonomy-header__social-share {
        min-height: 3.5rem;
    }

    .taxonomy-header__social-icons {
        min-height: 32px;
    }
}

@media (max-width: 768px) {
    .taxonomy-header__container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .taxonomy-header__content {
        order: 2;
        padding: 1.5rem;
        border-radius: 0;
    }

    .taxonomy-header__image {
        order: 1;
        height: 250px;
        max-height: 250px;
        border-radius: 0;
    }

    .taxonomy-header__background-image {
        border-radius: 0;
    }

    .taxonomy-header__flag {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .taxonomy-header__taxonomy-title {
        min-height: 1.3rem;
    }

    .taxonomy-header__taxonomy-title h1 {
        font-size: 1rem;
    }

    .taxonomy-header__social-icons {
        justify-content: center;
        min-height: 36px;
    }

    .taxonomy-header__social-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
}

@media (max-width: 480px) {
    .taxonomy-header__content {
        padding: 1rem;
    }

    .taxonomy-header__image {
        height: 200px;
        max-height: 200px;
    }

    .taxonomy-header__flag {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
    }

    .taxonomy-header__taxonomy-title {
        min-height: 1.17rem;
    }

    .taxonomy-header__taxonomy-title h1 {
        font-size: 0.9rem;
    }

    .taxonomy-header__social-share {
        min-height: 3rem;
    }

    .taxonomy-header__social-icons {
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .taxonomy-header,
    .taxonomy-header *,
    .taxonomy-header *::before,
    .taxonomy-header *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .taxonomy-header__content,
    .taxonomy-header__image {
        background: #fff !important;
        border: 2px solid #000;
    }

    .taxonomy-header__taxonomy-title h1 {
        color: #000;
    }

    .taxonomy-header__breadcrumb a {
        color: #0000ee;
    }

    .taxonomy-header__social-icon,
    .taxonomy-header__flag {
        color: #000 !important;
        background: #fff !important;
        border-color: #000 !important;
    }
}
