/*
Theme Name: Wittinghof
Theme URI: https://wittinghof.at/
Author: Wittinghof
Description: Editierbares Block-Theme für den Wittinghof im Mühlviertel.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wittinghof-theme
Tags: block-patterns, full-site-editing, custom-colors, custom-logo, featured-images
*/

/**
 * Wittinghof block-theme integration layer.
 *
 * Responsibility: adapts the proven static-site styles to semantic core blocks
 * without making editorial content depend on custom HTML. The visual source is
 * assets/css/site.css; this file only handles Gutenberg's wrapper elements.
 *
 * Gotcha: pattern images start as theme assets. Replacing an image in Gutenberg
 * moves that content to the Media Library and must keep working without a theme
 * file path or attachment ID.
 */

body {
    margin: 0;
}

.wp-site-blocks {
    padding: 0;
}

.wp-site-blocks > * {
    margin-block-start: 0;
}

main.wp-block-group,
main.wp-block-post-content,
.wp-block-post-content {
    margin: 0;
}

.wp-block-post-content > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

/* Header: the Page List preserves correct WordPress permalinks on root and subdirectory installs. */
.wth-header.navbar {
    align-items: stretch;
    display: flex;
}

.wth-header .nav-container {
    width: 100%;
}

.wth-header .nav-logo {
    margin: 0;
}

.wth-header .nav-logo img {
    height: 38px;
    width: auto;
}

.wth-header .wp-block-navigation {
    font-family: var(--font-sans);
    margin-left: auto;
}

.wth-header .wp-block-navigation-item__content {
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wth-header.scrolled .wp-block-navigation-item__content {
    color: var(--text);
}

.wth-header .wp-block-navigation__responsive-container-open,
.wth-header .wp-block-navigation__responsive-container-close {
    color: currentColor;
}

.wth-header:not(.scrolled) .wp-block-navigation__responsive-container-open {
    color: var(--white);
}

.wth-header.scrolled .wp-block-navigation__responsive-container-open {
    color: var(--text);
}

/* Core image figures add one wrapper compared with the static reference. */
.hero > .hero-media,
.sp-hero > .sp-hero-media {
    height: 100%;
    inset: 0;
    margin: 0;
    position: absolute;
    width: 100%;
}

.hero > .hero-media img,
.sp-hero > .sp-hero-media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hero .hero-overlay,
.sp-hero .sp-hero-veil {
    margin: 0;
    pointer-events: none;
}

.hero .hero-content,
.sp-hero .sp-hero-inner {
    position: relative;
    z-index: 2;
}

.hero-scroll a,
.apt-body h3 a,
.apt-lnk a,
.sp-reg-card h3 a,
.sp-reg-link a {
    color: inherit;
}

.hero-actions.wp-block-buttons,
.anfahrt-btns.wp-block-buttons {
    gap: 1rem;
}

.wp-block-button.btn {
    padding: 0;
}

.wp-block-button.btn .wp-block-button__link,
.wp-block-button.btn-cta-white .wp-block-button__link,
.wp-block-button.sp-cta-btn .wp-block-button__link {
    background: inherit;
    border: inherit;
    border-radius: inherit;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    padding: inherit;
    text-transform: inherit;
}

.wp-block-button.btn .wp-block-button__link {
    padding: 0.85rem 2rem;
}

.wp-block-button.btn-cta-white,
.wp-block-button.sp-cta-btn {
    display: inline-block;
    padding: 0;
}

.wp-block-button.btn-cta-white .wp-block-button__link,
.wp-block-button.sp-cta-btn .wp-block-button__link {
    padding: 1rem 2.5rem;
}

.wp-block-button.insta-btn .wp-block-button__link {
    background: var(--white);
    color: var(--orange);
}

.hp-grid .g {
    margin: 0;
    min-height: 260px;
}

.hp-grid .g > .wp-block-image {
    height: 100%;
    inset: 0;
    margin: 0;
    position: absolute;
    width: 100%;
}

.hp-grid .g > .wp-block-image > a,
.apt-media .apt-img > a,
.sp-reg-img > .wp-block-image > a {
    display: block;
    height: 100%;
    width: 100%;
}

/* Gutenberg renders the split eyebrow as a paragraph. Keep the component's
   own typography instead of inheriting the larger editorial paragraph style. */
.hp-split-l > .eyebrow--split {
    color: var(--orange-light);
    font-family: var(--font-sans);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.4;
    margin: 0 0 2rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none;
    text-transform: uppercase;
    width: 100%;
}

/* Core's blockquote and constrained-layout styles must not add a border,
   indentation or paragraph typography to this full-bleed brand quote. */
.hp-split-r > .wp-block-quote {
    border: 0;
    margin: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none;
    padding: 0;
    width: 100%;
}

.hp-split-r > .wp-block-quote p {
    color: inherit;
    font: inherit;
    line-height: inherit;
    margin: 0;
}

/* Constrained Gutenberg groups cap every direct child at the global 780px
   content width. These components are the wide grids from the approved layout
   and must use their container's full content width instead. */
.hp-apts > .container > .apt-grid,
.hp-family > .container > .family-inner,
.hp-anfahrt > .container > .anfahrt-inner,
.sp-wrap > .sp-split,
.sp-wrap > .sp-gal,
.sp-wrap > .sp-cols,
.sp-wrap > .sp-tiles,
.sp-wrap > .sp-feat,
.sp-wrap > .sp-reg,
.buchen-widget > .container > .wth-booking {
    max-width: none;
    width: 100%;
}

/* Gutenberg's auto margins otherwise centre content that the component
   deliberately aligns with the left edge of its wide container. */
.hp-apts > .container > .section-header,
.sp-wrap > h2,
.sp-wrap > .sp-lead,
.sp-wrap > .sp-note,
.apt-body > .apt-lnk {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.sp-wrap > h2 {
    max-width: none;
    width: 100%;
}

.hp-grid .g > .wp-block-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hp-grid .g-cap {
    margin: 0;
    pointer-events: none;
}

.hp-grid .g-cap a {
    color: inherit;
    pointer-events: auto;
}

.apt {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}

.apt:hover {
    box-shadow: 0 16px 44px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.apt-media {
    margin: 0;
    min-height: 330px;
    overflow: hidden;
    position: relative;
}

.apt-media .apt-img {
    height: 100%;
    inset: 0;
    margin: 0;
    position: absolute;
    width: 100%;
}

.apt-media .apt-img img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    width: 100%;
}

.apt:hover .apt-img img {
    transform: scale(1.04);
}

.apt-media .apt-persons {
    bottom: auto;
    left: 1rem;
    margin: 0;
    position: absolute;
    top: 1rem;
    z-index: 2;
}

.fam-img .wp-block-image,
.anfahrt-map-wrap .wp-block-html,
.sp-gal-item .wp-block-image,
.sp-tile .wp-block-image,
.sp-feat-big .wp-block-image,
.sp-feat-sm .wp-block-image,
.sp-reg-img .wp-block-image {
    height: 100%;
    margin: 0;
    width: 100%;
}

.fam-img .wp-block-image img,
.sp-gal-item .wp-block-image img,
.sp-tile .wp-block-image img,
.sp-feat-big .wp-block-image img,
.sp-feat-sm .wp-block-image img,
.sp-reg-img .wp-block-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.anfahrt-map-wrap .wp-block-html,
.anfahrt-map-wrap iframe {
    display: block;
    height: 100%;
    width: 100%;
}

.sp-tile,
.sp-feat-big,
.sp-feat-sm,
.sp-reg-img {
    position: relative;
}

.sp-tile-cap,
.sp-fcap {
    margin: 0;
    pointer-events: none;
    z-index: 2;
}

.sp-reg-card {
    display: flex;
    flex-direction: column;
}

.sp-reg-card > .sp-reg-img,
.sp-reg-card > .sp-reg-body {
    margin: 0;
}

.sp-reg-body {
    flex: 1;
}

.sp-reg-card .sp-reg-link a {
    color: inherit;
}

.sp-facts .wp-block-list,
.sp-col .wp-block-list,
.legal-section .wp-block-list {
    margin: 0;
}

.sp-lb[hidden] {
    display: none;
}

.sp-lb.open {
    display: flex;
}

/* The companion plugin owns global contact data; this Site Editor fallback appears only without it. */
body.has-wittinghof-core-footer .wth-footer-fallback,
body:has(.wth-site-footer) .wth-footer-fallback {
    display: none;
}

.wth-footer-fallback.footer {
    margin: 0;
}

.wth-footer-fallback .wp-block-image {
    margin: 0 0 1rem;
}

.wth-footer-fallback .wp-block-image img {
    height: 28px;
    width: auto;
}

.wth-footer-fallback .uab-logo-footer img {
    height: 38px;
}

.wth-footer-fallback .wp-block-list {
    margin: 0;
    padding: 0;
}

/* Companion footer: mirror the static layout while its copy comes from central settings. */
.wth-site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.82);
    font-family: var(--font-serif);
    margin: 0;
    padding: 4rem clamp(1.25rem, 5vw, 3rem) 1.5rem;
}

.wth-site-footer__inner {
    gap: 2.5rem;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    max-width: 1200px;
}

.wth-site-footer__title a {
    background: url("assets/images/wittinghof-white.svg") left center / contain no-repeat;
    display: block;
    font-size: 0;
    height: 28px;
    margin-bottom: 1rem;
    width: 170px;
}

.wth-site-footer__brand > p:not(.wth-site-footer__title),
.wth-site-footer address,
.wth-site-footer li {
    color: rgba(255,255,255,0.72);
    font-size: 0.88rem;
    line-height: 1.85;
}

.wth-site-footer__social {
    color: rgba(255,255,255,0.72);
    display: inline-block;
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

.wth-site-footer__brand::after {
    background: url("assets/images/logo/uab_logo.webp") left center / contain no-repeat;
    content: "";
    display: block;
    height: 38px;
    margin-top: 1.25rem;
    opacity: 0.65;
    width: 110px;
}

.wth-site-footer h2 {
    color: var(--orange-light);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    margin: 0 0 1.25rem;
    text-transform: uppercase;
}

.wth-site-footer__bottom {
    border-top-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    max-width: 1200px;
    text-align: center;
}

.wth-booking__load-button {
    background: var(--orange);
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 800;
}

/* Booking page framing; the reservation UI itself is rendered by wittinghof-core. */
.buchen-hero {
    background: var(--text);
    padding: clamp(7rem, 12vw, 10rem) 2rem clamp(3rem, 6vw, 4.5rem);
    text-align: center;
}

.buchen-hero .eyebrow {
    color: rgba(255,255,255,0.55);
}

.buchen-hero h1 {
    color: var(--white);
    font-size: clamp(2.4rem, 6vw, 4rem);
    margin: 0.4rem 0 0.75rem;
}

.buchen-hero h1 em {
    color: var(--orange-light);
    font-style: italic;
}

.buchen-hero p {
    color: rgba(255,255,255,0.6);
    margin: 0 auto;
    max-width: 480px;
}

.buchen-widget {
    background: var(--cream);
    padding: clamp(3rem, 6vw, 5rem) 2rem clamp(4rem, 8vw, 6rem);
}

.buchen-widget > .wp-block-group__inner-container,
.buchen-widget .container {
    margin: 0 auto;
    max-width: 1020px;
}

.buchen-contact {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: clamp(2.5rem, 5vw, 4rem) 2rem;
    text-align: center;
}

.buchen-contact p {
    margin: 0.3rem 0;
}

.buchen-contact a {
    color: var(--orange);
    font-weight: 700;
}

.wth-default-page {
    min-height: 65vh;
    padding: 8rem clamp(1.25rem, 5vw, 3rem) 5rem;
}

@media (max-width: 781px) {
    .wth-header .nav-menu {
        background: transparent;
        box-shadow: none;
        height: auto;
        overflow: visible;
        padding: 0;
        position: static;
        width: auto;
    }

    .wth-header .wp-block-navigation__responsive-container.is-menu-open {
        background: var(--white);
        color: var(--text);
        padding: 5rem 1.5rem 2rem;
    }

    .wth-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
        color: var(--text);
        font-size: 1rem;
    }

    .apt-media {
        min-height: 260px;
    }

    .wth-site-footer__inner {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
