/*
 * Theme Name: My Timber 2.x Starter Theme
 * Description: Starter Theme to use with Timber
 * Author: Upstatement and YOU!
*/

/* Halb-Halb Component Enhancements */
.halb-halb-section .halb-halb-top-image {
    max-width: 300px;
    width: 100%;
}

.halb-halb-section .halb-halb-top-image img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

/* Halb-Halb Text Color Support */
.halb-halb-section .halb-halb-column {
    color: inherit !important;
}

.halb-halb-section .halb-halb-column * {
    color: inherit !important;
}

.halb-halb-section .halb-halb-title,
.halb-halb-section .halb-halb-content,
.halb-halb-section .halb-halb-content p,
.halb-halb-section .halb-halb-content h1,
.halb-halb-section .halb-halb-content h2,
.halb-halb-section .halb-halb-content h3,
.halb-halb-section .halb-halb-content h4,
.halb-halb-section .halb-halb-content h5,
.halb-halb-section .halb-halb-content h6 {
    color: inherit !important;
}

/* Fix image centering for text-center alignment */
.halb-halb-section .text-center .halb-halb-top-image {
    margin: 0 auto;
    text-align: center;
}

.halb-halb-section .text-end .halb-halb-top-image {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.halb-halb-section .text-start .halb-halb-top-image {
    margin-right: auto;
    margin-left: 0;
    text-align: left;
}

.halb-halb-section .halb-halb-button .btn {
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 6px;
}

/* Text alignment utilities for halb-halb */
.halb-halb-section .text-center {
    text-align: center;
}

.halb-halb-section .text-end {
    text-align: right;
}

.halb-halb-section .text-start {
    text-align: left;
}

/* Two-Line Title Styling for Title-Text Component */
.title-text-two-line-heading {
    display: block !important;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.title-text-first-line {
    display: block;
    font-size: 1.8rem;
    font-weight: var(--font-2-secondary-weight, 500);
    color: var(--color-2-secondary, #6c757d);
    margin-bottom: 0.2em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.title-text-second-line {
    display: block;
    font-size: 1.4rem;
    font-weight: inherit;
    color: inherit;
}

/* Title-Text Font Color Support */
.title-text h1,
.title-text h2,
.title-text h3,
.title-text h4,
.title-text h5,
.title-text h6,
.title-text p,
.title-text * {
    color: inherit !important;
}

.title-text .title-text-first-line {
    color: var(--color-2-primary, #000000) !important;
}

/* Shortcode Font Color Support */
.shortcode-section h1,
.shortcode-section h2,
.shortcode-section h3,
.shortcode-section h4,
.shortcode-section h5,
.shortcode-section h6,
.shortcode-section p,
.shortcode-section * {
    color: inherit !important;
}

/* Button Primary Styling - Will be enhanced by functions.php */
/* Paragraph Styling */
p {
    font-family: var(--font-1-primary, inherit);
    font-weight: var(--font-1-primary-weight, 400);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.btn-primary {
    padding: 12px 24px !important;
    font-weight: var(--font-2-secondary-weight, 500);
    border-radius: 6px;
    border: none;
    background-color: var(--color-1-primary, #007bff) !important;
    color: white !important;
    text-decoration: none !important;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--color-2-secondary, #0056b3) !important;
    color: white !important;
}

/* Header Height Utilities */
.min-h-300 {
    min-height: 300px;
}

.min-h-400 {
    min-height: 400px;
}

.min-h-500 {
    min-height: 500px;
}

.min-h-600 {
    min-height: 600px;
}

/* Viewport Height Utilities for Header */
.min-vh-25 {
    min-height: 25vh;
}

.min-vh-50 {
    min-height: 50vh;
}

.min-vh-75 {
    min-height: 75vh;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Header Three Columns - Ensure full height support and prevent overflow */
.header-three-columns {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.header-three-columns .container-fluid {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.header-three-columns .row {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.header-three-columns .row.min-vh-25,
.header-three-columns .row.min-vh-50,
.header-three-columns .row.min-vh-75,
.header-three-columns .row.min-vh-100 {
    align-items: stretch;
}

.header-three-columns .header-column {
    min-height: inherit;
}

/* Remove padding from outer edges of first and last columns */
.header-three-columns .row > div:first-child {
    padding-left: 0 !important;
}

.header-three-columns .row > div:last-child {
    padding-right: 0 !important;
}

/* Header Three Columns - Center image and bottom-align text */
.header-three-columns .header-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.header-three-columns .header-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.header-three-columns .header-text-content {
    flex-shrink: 0;
    padding-top: 0;
}

.header-three-columns .header-main-title,
.header-three-columns .header-subtitle {
    margin-bottom: 0.5rem;
}

/* Mitarbeiter-Row Component */
.mitarbeiter-row-section {
    background-color: var(--color-4-background, #f8f9fa);
}

/* Background color options for Mitarbeiter-Row - Using ACF Settings Colors */
.mitarbeiter-row-section.bg-primary {
    background-color: var(--color-1-primary, #007bff);
}

.mitarbeiter-row-section.bg-secondary {
    background-color: var(--color-2-secondary, #6c757d);
}

.mitarbeiter-row-section.bg-background {
    background-color: var(--color-4-background, #f8f9fa);
}

.mitarbeiter-row-section.bg-text {
    background-color: var(--color-3-text, #333333);
}

.mitarbeiter-row-section.bg-tertiary {
    background-color: var(--color-5-tertiary, #28a745);
}

.mitarbeiter-row-section.bg-white {
    background-color: #ffffff;
}

.mitarbeiter-row-section.bg-transparent {
    background-color: transparent;
}

/* Spacer background colors - applied directly to spacers */
.mitarbeiter-spacer.bg-primary {
    background-color: var(--color-1-primary, #007bff) !important;
}

.mitarbeiter-spacer.bg-secondary {
    background-color: var(--color-2-secondary, #6c757d) !important;
}

.mitarbeiter-spacer.bg-background {
    background-color: var(--color-4-background, #f8f9fa) !important;
}

.mitarbeiter-spacer.bg-text {
    background-color: var(--color-3-text, #333333) !important;
}

.mitarbeiter-spacer.bg-tertiary {
    background-color: var(--color-5-tertiary, #28a745) !important;
}

.mitarbeiter-spacer.bg-white {
    background-color: #ffffff !important;
}

.mitarbeiter-spacer.bg-transparent {
    background-color: transparent !important;
}

.mitarbeiter-row-container {
    position: relative;
    width: 100%;
    padding: 0;
}

.mitarbeiter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 20px 0;
    justify-content: center;
    align-items: flex-start;
}

.mitarbeiter-spacer {
    flex: 1;
    min-width: 80px;
    height: 200px;
    background-color: var(--color-1-primary, #28a745);
}

.mitarbeiter-item {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mitarbeiter-card {
    width: 100%;
    height: auto;
    position: relative;
    overflow: hidden;
    background-color: white;
}

.mitarbeiter-image {
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.mitarbeiter-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center top;
}

.mitarbeiter-content {
    padding: 15px 0;
    text-align: center;
    width: 100%;
    background: transparent;
}

.mitarbeiter-name {
    font-family: var(--font-2-secondary, 'Arial', sans-serif);
    font-weight: var(--font-2-secondary-weight, 500);
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
    line-height: 1.3;
}

.mitarbeiter-function {
    font-family: var(--font-1-primary, inherit);
    font-weight: var(--font-1-primary-weight, 400);
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mitarbeiter-row-section.pt-5 {
        padding-top: 1rem !important;
    }

    .mitarbeiter-row {
        flex-wrap: wrap;
        gap: 15px 10px;
        padding: 15px;
        justify-content: space-between;
    }

    .mitarbeiter-spacer {
        display: none;
    }

    .mitarbeiter-item {
        width: calc(50% - 5px);
    }

    .mitarbeiter-card {
        height: auto;
    }

    .mitarbeiter-content {
        padding: 10px 0;
    }
}

/* Image Text Side by Side - Image Display Modes */
.image-display-container {
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Image display container */
.image-display-container {
    position: relative;
    width: 100%;
}

.image-aspect-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 200px; /* Fallback für auto aspect-ratio */
    /* aspect-ratio wird inline gesetzt */
}

/* Wenn aspect-ratio auto ist, verwende eine feste Mindesthöhe */
.image-aspect-container[style*="aspect-ratio: auto"] {
    aspect-ratio: 16/9;
}

.image-aspect-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.image-contain {
    object-fit: contain;
    background-color: #f8f9fa;
    width: 100%;
    height: 100%;
}

.image-stretch {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

.image-normal {
    object-fit: scale-down;
    width: 100%;
    height: auto;
    max-height: 100%;
}

.image-normal {
    object-fit: scale-down;
    position: relative !important;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
}

/* Masonry Grid Lightbox */
.masonry-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.masonry-lightbox.active {
    display: flex;
}

.masonry-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.masonry-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.masonry-lightbox-caption {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;
    display: none;
    margin-top: 10px;
    border-radius: 4px;
    max-width: 100%;
}

.masonry-lightbox-prev,
.masonry-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: transform 0.3s ease;
    z-index: 10000;
}

.masonry-lightbox-prev img,
.masonry-lightbox-next img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.masonry-lightbox-prev {
    left: 40px;
}

.masonry-lightbox-next {
    right: 40px;
}

.masonry-lightbox-prev:hover,
.masonry-lightbox-next:hover {
    background: none;
    transform: translateY(-50%) scale(1.1);
}

.masonry-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: transform 0.3s ease;
    z-index: 10000;
}

.masonry-lightbox-close img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.masonry-lightbox-close:hover {
    background: none;
    transform: scale(1.1);
}

/* Masonry Filter Buttons */
.masonry-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 30px;
    justify-content: center;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.masonry-filter-buttons .masonry-filter-btn,
button.masonry-filter-btn {
    padding: 10px 30px;
    border: none;
    background-color: white;
    color: #333;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    font-family: var(--font-2-secondary, 'Arial', sans-serif) !important;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.masonry-filter-buttons .masonry-filter-btn:last-child,
button.masonry-filter-btn:last-child {
    border-right: none;
}

.masonry-filter-buttons .masonry-filter-btn:hover,
button.masonry-filter-btn:hover {
    background-color: #f5f5f5;
}

.masonry-filter-buttons .masonry-filter-btn.active,
button.masonry-filter-btn.active {
    background-color: var(--color-2-secondary, #8FBC8F);
    color: white;
}

/* Masonry grid cursor for clickable images */
.masonry-item.has-image:not(.has-link) {
    cursor: pointer;
}

.masonry-item.has-image:not(.has-link):hover img {
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

/* Carousel Custom Arrows and Round Indicators */
.custom-carousel-arrow {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Make carousel indicators perfectly round */
.carousel-indicators [type="button"] {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    margin: 0 3px;
    background-color: #c0c0c0;
    border: none;
    opacity: 1;
    transition: all 0.3s ease;
}

.carousel-indicators .active,
.carousel-indicators [type="button"]:hover {
    opacity: 1;
    background-color: #fff;
    transform: scale(1.2);
}

/* Remove background from carousel control arrows */
.carousel-control-prev,
.carousel-control-next {
    background: none !important;
}

/* Image Text Side by Side Font Color Support */
.image-text-side-by-side h1,
.image-text-side-by-side h2,
.image-text-side-by-side h3,
.image-text-side-by-side h4,
.image-text-side-by-side h5,
.image-text-side-by-side h6,
.image-text-side-by-side p,
.image-text-side-by-side .wysiwyg-content,
.image-text-side-by-side .wysiwyg-content * {
    color: inherit !important;
}

/* Navigation Styling */
.navbar-nav .nav-item {
    padding: 1.5rem;
}

/* Disable transitions on nav links */
.navbar-nav .nav-link {
    transition: none !important;
}

.navbar-nav .nav-item:hover {
    background-color: var(--color-1-primary, #007bff);
}

.navbar-nav .nav-item:hover .nav-link {
    color: white !important;
}

/* Dropdown Menu Styling */
.navbar-nav .dropdown-menu {
    background-color: var(--color-1-primary, #007bff);
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: auto;
    min-width: 100%;
    left: 0 !important;
    right: auto !important;
}

.navbar-nav .dropdown-menu .dropdown-item {
    color: white !important;
    transition: background-color 0.3s ease;
    padding: 0;
    margin: 0.75rem 1.5rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    border-left: none;
    border-right: none;
}

.navbar-nav .dropdown-menu li:last-child .dropdown-item {
    border-bottom: none;
}

.navbar-nav .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.navbar-nav .dropdown-menu .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* Teaser 2 Text Style Inheritance */
.teaser-text-content.custom-text-color p,
.teaser-text-content.custom-text-color * {
    color: inherit !important;
}

.teaser-text-content.custom-text-size p,
.teaser-text-content.custom-text-size * {
    font-size: inherit !important;
}
