/*!
 * Pulsraum – minimal custom stylesheet.
 *
 * Layout, spacing, typography, components and responsiveness come entirely
 * from Bootstrap 5. This file only covers what Bootstrap has no equivalent
 * for: the brand palette, the brand mark, the image placeholder, and the
 * typography of the rich HTML stored in the database.
 */

/* ---------------------------------------------------------------------------
 * Brand palette
 * ------------------------------------------------------------------------ */
:root {
    --pulsraum-900: #0f2e29;
    --pulsraum-800: #14403a;
    --pulsraum-700: #1c5149;
    --pulsraum-600: #236559;
    --pulsraum-100: #e3efec;
    --pulsraum-050: #f2f8f6;

    --pulsraum-sand: #f7f4ee;
    --pulsraum-clay: #b4653f;

    --bs-primary: #1c5149;
    --bs-primary-rgb: 28, 81, 73;
    --bs-primary-text-emphasis: #10352f;
    --bs-primary-bg-subtle: #e3efec;
    --bs-primary-border-subtle: #bcd8d2;

    --bs-body-color: #1f2a28;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
}

.btn-primary {
    --bs-btn-bg: #1c5149;
    --bs-btn-border-color: #1c5149;
    --bs-btn-hover-bg: #14403a;
    --bs-btn-hover-border-color: #14403a;
    --bs-btn-active-bg: #0f2e29;
    --bs-btn-active-border-color: #0f2e29;
    --bs-btn-disabled-bg: #1c5149;
    --bs-btn-disabled-border-color: #1c5149;
    --bs-btn-focus-shadow-rgb: 28, 81, 73;
}

.btn-outline-primary {
    --bs-btn-color: #1c5149;
    --bs-btn-border-color: #1c5149;
    --bs-btn-hover-bg: #1c5149;
    --bs-btn-hover-border-color: #1c5149;
    --bs-btn-active-bg: #14403a;
    --bs-btn-active-border-color: #14403a;
    --bs-btn-disabled-color: #1c5149;
    --bs-btn-disabled-border-color: #1c5149;
}

.text-bg-primary {
    background-color: #1c5149 !important;
}

.link-primary {
    color: #1c5149;
}

.link-primary:hover,
.link-primary:focus {
    color: #14403a;
}

.nav-tabs {
    --bs-nav-tabs-link-active-color: #1c5149;
}

/* ---------------------------------------------------------------------------
 * Brand mark
 * ------------------------------------------------------------------------ */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 0.6rem;
    background: #1c5149;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
}

.brand-mark-light {
    background: #fff;
    color: #14403a;
}

/* ---------------------------------------------------------------------------
 * Image placeholder
 *
 * Used wherever a database-referenced image is unavailable, so the grid and
 * the aspect ratios stay intact.
 * ------------------------------------------------------------------------ */
.pulsraum-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    width: 100%;
    border-radius: var(--bs-border-radius-lg);
    background: linear-gradient(135deg, var(--ph-from), var(--ph-to));
    overflow: hidden;
}

.pulsraum-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.07) 0 2px,
        transparent 2px 14px
    );
}

.pulsraum-placeholder-label {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.card-room-media .pulsraum-placeholder,
.gallery-item .pulsraum-placeholder {
    min-height: 0;
    border-radius: 0;
}

.ph-1 { --ph-from: #1c5149; --ph-to: #2f7a6d; }
.ph-2 { --ph-from: #236559; --ph-to: #47917f; }
.ph-3 { --ph-from: #14403a; --ph-to: #1f5d52; }
.ph-4 { --ph-from: #2f7a6d; --ph-to: #6aa89a; }
.ph-5 { --ph-from: #0f2e29; --ph-to: #236559; }
.ph-6 { --ph-from: #47917f; --ph-to: #8bbdae; }

/* ---------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------ */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pulsraum-900), var(--pulsraum-700));
}

/* ---------------------------------------------------------------------------
 * Hero background photo
 * ------------------------------------------------------------------------ */
.hero-fixed {
    background-color: var(--pulsraum-900);
    background-image: url('../img/hero/pulsraum-hero.webp');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* The photo is now the hero backdrop, so the dynamic room image layer is
   hidden to avoid two overlapping pictures. */
.hero-fixed .hero-media {
    display: none;
}

.hero .hero-media {
    position: absolute;
    inset: 0;
    opacity: 0.28;
}

.hero .hero-media > * {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: relative;
    background: linear-gradient(90deg, rgba(15, 46, 41, 0.92) 0%, rgba(15, 46, 41, 0.7) 55%, rgba(15, 46, 41, 0.35) 100%);
}

@media (max-width: 767.98px) {
    .hero-overlay {
        background: rgba(15, 46, 41, 0.82);
    }
}

/* ---------------------------------------------------------------------------
 * Rich content from the database
 *
 * Stored page bodies are hand-written HTML, so Bootstrap's utility classes
 * cannot reach inside them. This block gives that HTML a readable,
 * accessible default.
 * ------------------------------------------------------------------------ */
.rich-content {
    line-height: 1.75;
}

.rich-content > * + * {
    margin-top: 1rem;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    scroll-margin-top: 5rem;
}

.rich-content h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.rich-content h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.rich-content h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }

/* Sub-headings inside a card keep close to body size so the card reads as
 * one block instead of a stack of oversized headings. */
.card-body.rich-content h3 {
    font-size: 1.125rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-body.rich-content > h3:first-child {
    margin-top: 0;
}

.rich-content h1:first-child,
.rich-content h2:first-child,
.rich-content h3:first-child {
    margin-top: 0;
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.rich-content li + li {
    margin-top: 0.35rem;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bs-border-radius-lg);
}

.rich-content blockquote {
    margin: 0;
    padding: 0.75rem 0 0.75rem 1rem;
    border-left: 4px solid var(--pulsraum-600);
    color: #4a5b57;
}

.rich-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.rich-content th,
.rich-content td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
    text-align: left;
}

.rich-content > .container,
.rich-content > .legal-page,
.rich-content > .about-page,
.rich-content > .seo-content {
    all: revert;
}

/* ---------------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------------ */
.card-room {
    border-radius: var(--bs-border-radius-xl);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 46, 41, 0.06), 0 8px 24px rgba(15, 46, 41, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-room:hover,
.card-room:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(15, 46, 41, 0.08), 0 18px 40px rgba(15, 46, 41, 0.14);
}

.card-room-media {
    overflow: hidden;
    background: var(--pulsraum-050);
}

.card-room .card-img-top {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    height: auto;
    transition: transform 0.4s ease;
}

.card-room:hover .card-img-top,
.card-room:focus-within .card-img-top {
    transform: scale(1.05);
}

.card-room-chips {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 2.5rem 0.75rem 0.75rem;
    background: linear-gradient(to top, rgba(15, 46, 41, 0.78), rgba(15, 46, 41, 0));
}

.card-room-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--pulsraum-800);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    backdrop-filter: blur(2px);
}

.badge-featured {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.card-room-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    line-height: 1.55;
}

.card-room-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--bs-primary-border-subtle);
    border-radius: 999px;
    background: var(--bs-primary-bg-subtle);
    color: var(--pulsraum-700);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-room-price {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--pulsraum-800);
}

/* ---------------------------------------------------------------------------
 * Gallery
 * ------------------------------------------------------------------------ */
.gallery-item {
    position: relative;
    overflow: hidden;
    height: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--bs-border-radius-lg);
    background: var(--pulsraum-050);
    box-shadow: 0 1px 2px rgba(15, 46, 41, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(15, 46, 41, 0.08), 0 14px 30px rgba(15, 46, 41, 0.14);
}

.gallery-item img,
.gallery-item .pulsraum-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img,
.gallery-item:hover .pulsraum-placeholder {
    transform: scale(1.06);
}

.gallery-modal-image {
    max-height: 80vh;
    object-fit: contain;
}

/* ---------------------------------------------------------------------------
 * Booking stages
 *
 * The enquiry form is walked through step by step. The step indicator shows
 * where the visitor is; the dots fill in as a stage is completed.
 * ------------------------------------------------------------------------ */
.booking-step {
    color: var(--bs-secondary-color);
}

.booking-step-dot {
    width: 2rem;
    height: 2rem;
    background: var(--pulsraum-100);
    color: var(--pulsraum-800);
    font-size: 0.875rem;
    font-weight: 600;
}

.booking-step.is-active {
    color: var(--bs-body-color);
    font-weight: 600;
}

.booking-step.is-active .booking-step-dot {
    background: var(--pulsraum-700);
    color: #fff;
}

.booking-step.is-complete .booking-step-dot {
    background: var(--pulsraum-600);
    color: #fff;
}

/* ---------------------------------------------------------------------------
 * Lists
 *
 * Bootstrap's reboot gives an unstyled <ul> the native disc marker; only the
 * marker colour needs help, and no utility class covers ::marker.
 * ------------------------------------------------------------------------ */
.transit-list {
    padding-left: 1.25rem;
}

.transit-list > li {
    margin-bottom: 0.25rem;
}

.transit-list > li::marker {
    color: var(--bs-primary);
}

/* ---------------------------------------------------------------------------
 * Room gallery carousel
 *
 * Both real photos and the placeholder block get the same 4:3 box so the
 * carousel never jumps between slides.
 * ------------------------------------------------------------------------ */
.carousel-photo,
.carousel-inner > .carousel-item > .pulsraum-placeholder {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 0;
}

/* Thumbnail strip below the carousel. Each button is also the carousel's own
   data-bs-slide-to control, so clicking a thumbnail jumps the slide. The strip
   scrolls sideways so a long gallery stays on one row. */
.gallery-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--pulsraum-100) transparent;
    /* Keep a horizontal swipe from triggering the browser's back gesture. */
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 0.5rem;
}

/* A mouse user gets a grab handle; touch users keep their native panning. */
@media (hover: hover) and (pointer: fine) {
    .gallery-strip {
        cursor: grab;
    }

    .gallery-strip.is-grabbing {
        cursor: grabbing;
        user-select: none;
    }

    .gallery-strip.is-grabbing .gallery-item,
    .gallery-strip.is-grabbing .gallery-thumb {
        pointer-events: none;
    }
}

.gallery-strip::-webkit-scrollbar {
    height: 6px;
}

.gallery-strip::-webkit-scrollbar-track {
    background: var(--pulsraum-050);
    border-radius: 999px;
}

.gallery-strip::-webkit-scrollbar-thumb {
    background: var(--pulsraum-100);
    border-radius: 999px;
}

.gallery-strip::-webkit-scrollbar-thumb:hover {
    background: var(--pulsraum-600);
}

/* Larger square tiles for the coworking intro gallery. */
.gallery-strip-wide .gallery-item {
    flex: 0 0 auto;
    width: 15rem;
    scroll-snap-align: start;
}

@media (max-width: 575.98px) {
    .gallery-strip-wide .gallery-item {
        width: 11rem;
    }
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 5rem;
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    opacity: 0.55;
    scroll-snap-align: start;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
    opacity: 0.85;
}

.gallery-thumb.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--pulsraum-600);
}

.gallery-thumb-img,
.gallery-thumb .pulsraum-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    height: auto;
    min-height: 0;
    border-radius: 0;
}

/* ---------------------------------------------------------------------------
 * Map facade
 * ------------------------------------------------------------------------ */
.map-facade {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    border-radius: var(--bs-border-radius-lg);
    background:
        repeating-linear-gradient(0deg, rgba(28, 81, 73, 0.06) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(28, 81, 73, 0.06) 0 1px, transparent 1px 28px),
        var(--pulsraum-050);
}

.map-facade iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--bs-border-radius-lg);
}

/* ---------------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------------ */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--pulsraum-600);
    box-shadow: 0 0 0 0.25rem rgba(35, 101, 89, 0.18);
}

.required-marker {
    color: var(--bs-danger);
}

/* ---------------------------------------------------------------------------
 * Back to top
 *
 * The floating button stays invisible until the visitor has scrolled down.
 * ------------------------------------------------------------------------ */
.go-top {
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.go-top.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ---------------------------------------------------------------------------
 * Accessibility – always keep a visible focus ring.
 * ------------------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--pulsraum-600);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .card-room,
    .card-room .card-img-top,
    .gallery-item img {
        transition: none;
    }

    .card-room:hover,
    .card-room:hover .card-img-top,
    .gallery-item:hover img {
        transform: none;
    }
}

/* ---------------------------------------------------------------------------
 * Print
 * ------------------------------------------------------------------------ */
@media print {
    header,
    footer,
    .position-fixed,
    #mainNav {
        display: none !important;
    }
}