
@import url('../fonts/AlegreyaSansSC.css');  /* Corrected import path for the custom font */
@import url('termine-daily.css');  /* Termine page styles */

html {
    overflow: scroll;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 0;  /* Remove scrollbar space */
    background: transparent;  /* Optional: just make scrollbar invisible */
}

body {
    /*font-style: italic;*/
    /*letter-spacing: 0.15em;*/
    --gold: #D4AF37;
    --golddark: #b49327;
    --goldlight: #e2cf91;
    --wald: #013220;
    --waldtrans: #013220C0;
    --waldlight: #5a9b7f; /* Darker green derived from wald */
    color: var(--wald); /* Waldgrün als Standard Schriftfarbe */
    font-family: 'AlegreyaSansSC', sans-serif;
    font-weight: 500;
    background-color: #F5F5F5;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

body.loaded {
    opacity: 1;
}

header {
    background-color: #D4AF37;
    padding: 0px;
    position: fixed;
    width: 100%;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    
    box-sizing: border-box;
    transition: padding 0.3s ease, height 0.3s ease;
}

header.shrink {
    padding: 0px;
}

header img {
    height: 120px;
    transition: height 0.3s ease;
    position: absolute;
    top: 20px;
    padding-left: 20px;
}

header.shrink img {
    height: 50px;
    top: 10px;
}

header h1 {
    padding-left: 160px;
    transition: padding-left 0.3s ease;
}

header.shrink h1 {
    font-size: 28px;
    padding-left: 100px;
    transition: font-size 0.3s ease;
    transition: padding-left 0.3s ease;
}

header.shrink .subtitle-off {
    display: none;
}

.contact a:link {
  color: var(--golddark);
  background-color: #FFFFFF80;
  font-weight: 700;
}

.contact a:visited {
  color: var(--golddark);
}

.contact a:hover {
  color: var(--golddark);
  font-weight: 800;
}

.contact a:active {
  color: var(--golddark);
  font-weight: 500;
}
.contact a:link, .contact a:visited {
	text-decoration: none;
}

nav {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    flex: 1;
}

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: var(--wald);
    font-size: 18px;
}

/* Ensure nav is always visible on desktop */
@media (min-width: 1025px) {
    nav {
        display: flex !important; /* Override any inline styles from mobile menu toggle */
        align-items: baseline;
    }
}

.menu-icon {
    display: none;
    font-size: 30px;
    cursor: pointer;
}

footer {
    background-color: var(--gold);
    padding: 10px;
    text-align: center;
    position: fixed;
    width: 100%;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

footer p {
    margin: 0;
}

footer a {
    text-decoration: none;
}

#content {
    /*margin-top: 60px;*/  /* Start just below the header */
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    padding-bottom: 50px;
}

#spa-content {
    /*margin-top: 60px;*/  /* Start just below the header */
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    padding-bottom: 50px;
}

.subtitle {
    flex-grow: 1;
    text-align: center;
}

.subtitle h2 {
    padding: 0;
    margin: 0;
}

.subtitle h4 {
    padding: 0;
    margin: 0;
}

.container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-bottom: 50px;
}

.about {
    width: 33%;
    margin-bottom: 20px;
    text-align: center;
}

.about img {
    width: 100%;
    height: auto;
}

/* Team member profile layouts */
.team-member {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--goldlight);
    border-radius: 8px;
}

.team-member-image {
    flex: 0 0 600px;
    max-width: 600px;
}

.team-member-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.team-member-text {
    flex: 1;
}

.team-member-text h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--wald);
}

.team-member-text p {
    margin: 10px 0;
    line-height: 1.6;
}

/* Reverse layout for alternating rows */
.team-member.reverse {
    flex-direction: row-reverse;
}

/* Medium screens (iPad portrait, smaller tablets) - wrap services and team members earlier */
@media (max-width: 1024px) {
    .team-member,
    .team-member.reverse {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .team-member-image {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .team-member-image img {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .service,
    .service.reverse {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .service-image-container {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .service-image-container img {
        width: 100% !important;
        height: auto;
        object-fit: cover;
    }
    
    .service-content {
        width: 100%;
    }
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
    .team-member,
    .team-member.reverse {
        flex-direction: column;
    }
    
    .team-member-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%; /* Force full width on mobile */
    }
    
    .team-member-image img {
        width: 100%;
        max-width: 100%;
    }
}

.service {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--goldlight);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.service-image-container {
    flex: 0 0 600px;
    max-width: 600px;
}

.service-image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.service-content {
    flex: 1;
}

.service-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--wald);
}

/* Services list can be two columns when enough space */
.service-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 equal columns by default */
    gap: 10px;
    width: 100%;
}

/* 3 columns on ultra-wide screens (above Full HD) */
@media (min-width: 1921px) {
    .service-content ul {
        grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
    }
}

/* Reverse layout for alternating rows */
.service.reverse {
    flex-direction: row-reverse;
}

/* Responsive: single column when content area would be narrower than ~600px */
@media (max-width: 1400px) {
    .service-content ul {
        grid-template-columns: 1fr; /* Single column - boxes similar width to image */
    }
}

@media (max-width: 768px) {
    .service,
    .service.reverse {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .service-image-container {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .service-image-container img {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .service-content ul {
        grid-template-columns: 1fr; /* Single column on mobile */
        width: 100%;
    }
    
    .service-content {
        width: 100%;
    }
}

/* Legacy styles - can be removed if not used */
.service-single { width: 100%; }
.service-single-inner { display:flex; gap:20px; align-items:flex-start; }
.service-single .service-media { flex: 1 1 45%; }
.service-single .service-media img { width:100%; height:auto; border-radius:6px; display:block; }
.service-single .service-detail-list { flex: 1 1 55%; text-align:left; }
.service-single .service-detail-list h3 { margin-top:0; }
.service-single > h3 { text-align: center; margin: 0 0 12px 0; font-size: 1.4em; }
.service-single .service-detail-list ul { margin: 0; padding-left: 0; }

.service img {
    width: 100%;
    height: auto;
}

.service ul li[data-detail] {
    cursor: pointer;
    font-weight: 700;
}

.service ul li:not([data-detail]) {
    cursor: default;
}

.popup {
    display: none;
    position: absolute;
    background-color: var(--goldlight);
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    border: 1px solid var(--wald);
}

.popup.active {
    display: block;
}

#about img, #about p {
    width: 33%;
    margin: 0 auto 20px auto;
    text-align: center;
}

#home img, #home p {
    width: 33%;
    margin: 0 auto 20px auto;
    text-align: center;
}

.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.form-container textarea {
	height: 300px;
}

table {
    margin-left: auto;
    margin-right: auto;
    width: 80%;
}

.tab table {
    border-style: solid;
    border-width: 1px;
    border-collapse: collapse;
    width: 100%;
}

.tab td, th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.tab tr:nth-child(even) {
    background-color: #ddd;
}
/*
.tab td:hover {
    background-color: #f2f2f2;
}
*/
.tab th {
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: var(--gold);
    color: white;
    text-align: center;
}

.time {
    position: sticky;
    top: 60px; /* Höhe des Headers */
}

.field {
    width: 350px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.contact-bg {
    /* Hintergrundbild */
    background: 
        linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.7)), /* dezente Weiß-Überlagerung */
        url('../images/Haus_DSC_4339-s.jpg') no-repeat center center fixed;
    background-size: cover;
}

.submit-btn {
    background-color: var(--waldtrans);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
}
.submit-btn:hover {
    background-color: var(--wald);
}

.service ul li[data-detail] {
    cursor: pointer;
    font-weight: 700;
    position: relative;
    background: var(--gold);
    border: 1px solid var(--wald);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 8px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Hide all other list items when one is active */
.service-detail-open ul li[data-detail]:not(.active) {
    opacity: 0;
    transform: scale(0.8);
    max-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

/* Active service item - zooms to full width of all columns */
.service ul li[data-detail].active {
    grid-column: 1 / -1; /* Span all columns */
    transform: scale(1.0); /* No scaling, stay within grid bounds */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background: white;
    margin-bottom: 0;
    padding: 20px;
}

.service ul li .detail {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
    background: transparent;
    border: none;
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
}

.service ul li.active .detail {
    max-height: 500px;
    opacity: 1;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid var(--gold);
}

.service-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 24px 0;
}
.service-links li {
    margin: 0;
}
.service-links a {
    display: block;
    padding: 12px 24px;
    background: var(--goldlight);
    border-radius: 6px;
    color: var(--wald);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}
.service-links a:hover {
    background: var(--gold);
}

/* Selector buttons on services page reuse service-links styles but for <li><button> */
#service-selector { display:flex; justify-content:center; gap:12px; margin: 12px 0 20px 0; }
.selector-btn {
    padding: 10px 18px;
    border-radius: 6px;
    background: var(--goldlight);
    color: var(--wald);
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
}
.selector-btn:hover { background: var(--gold); }
.selector-btn.active { background: var(--wald); color: #fff; border-color: var(--wald); }

/* Utility to hide the visible heading while keeping it accessible */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

@media (max-width: 1024px) {
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--gold);
        position: absolute;
        top: 60px;
        left: 0;
        z-index: 1000;
    }

    nav a {
        margin: 10px;
        text-align: center;
        font-size: 16px;
    }
    
    /* User widget in mobile menu should be centered like other items */
    nav #user-widget {
        margin-left: 0;
        margin-right: 0;
        padding: 10px 0;
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    nav .user-avatar-container {
        margin: 0 auto;
    }
    
    nav .user-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .menu-icon {
        display: block;
    }

    header img {
        height: 50px;
        position: static;
    }

    header {
        padding: 10px;
    }

    header h1 {
        padding-left: 0px;
        font-size: 20px;
    }

    .subtitle-off {
        display: none;
    }

    header.shrink {
        padding: 0px;
    }

    header.shrink h1 {
        padding: 0px;
        font-size: 20px;
    }

    #content {
        padding-bottom: 10px;
    }

    .time {
        position: unset;
        width: 100%;
        top: 60px; /* Höhe des Headers */
    }

    .field {
        font-size: 16px ;
    }

    footer {
        position: unset;
        flex-direction: column;
        text-align: center;
    }

    .services-container {
        flex-direction: column;
    }

    .service {
        width: 100%;
    }

    #about img, #about p, #home img, #home p {
        width: 100%;
        text-align: center;
    }
    
    table {
        width: 100%;
    }

    table, .tab table {
        /*width: 100vw;*/
        min-width: 0;
        max-width: 100vw;
        overflow-x: auto;
        /*display: block;*/
    }

    .tab td, .tab th {
        font-size: 16px;
        padding: 6px;
    }
    .service-links {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .service-links a {
        text-align: center;
    }

    /* Stack single service layout on small screens */
    .service-single-inner { flex-direction: column; }
    .service-single .service-media, .service-single .service-detail-list { flex: 1 1 100%; }

    /* Make sure stacked children fill the same width and include borders/padding
       so the image and service list align exactly */
    .service-single-inner, .service-single .service-media, .service-single .service-detail-list {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }
    .service-single .service-detail-list ul { width: 100%; }
    .service-single .service-detail-list li { box-sizing: border-box; }
}

/* User Widget Styles */
#user-widget {
    margin-left: auto;
    padding: 0 20px;
}

.login-link {
    color: var(--wald);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid var(--wald);
    border-radius: 5px;
    transition: all 0.3s;
}

.login-link:hover {
    background: var(--wald);
    color: var(--gold);
}

.user-avatar-container {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wald);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.admin-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #D4AF37;
    color: var(--wald);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1001;
}

.user-menu.show {
    display: block;
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    color: var(--wald);
}

.user-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--wald);
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu a:hover {
    background: #f5f5f5;
}