/* Feuer & Flamme – rules that theme.json cannot express. */

/* Header: logo left, navigation right; the active page is underlined like on the old site. */
.ff-header .ff-logo img {
    display: block;
    width: clamp(84px, 11vw, 130px);
    height: auto;
}

.ff-nav .wp-block-navigation-item__content {
    position: relative;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
}

.ff-nav .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    bottom: 0.35rem;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.ff-nav .current-menu-item > .wp-block-navigation-item__content::after,
.ff-nav .wp-block-navigation-item__content:hover::after,
.ff-nav .wp-block-navigation-item__content:focus-visible::after {
    transform: scaleX(1);
}

.ff-nav .wp-block-navigation-item__content:hover {
    color: inherit;
}

/* Mobile menu: large, centred entries. */
.ff-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    align-items: center;
    padding-top: 4rem;
}

.ff-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
    font-size: 1.5rem;
}

.ff-nav .wp-block-navigation__responsive-container-open svg,
.ff-nav .wp-block-navigation__responsive-container-close svg {
    width: 32px;
    height: 32px;
}

/* Pages with a title: no gap above the first block below it. */
.ff-main .wp-block-post-content > :first-child {
    margin-block-start: 0;
}

.ff-main .wp-block-post-title {
    margin-block-end: var(--wp--preset--spacing--40);
}

/* Full-width sections follow each other without gaps. */
.ff-main .wp-block-post-content > .alignfull {
    margin-block-start: 0;
    margin-block-end: 0;
}

/*
 * Hero: photos at their own proportions (nothing cut off) that fade into each other, like the slider of the old site.
 * The text lies on the photos on wide screens and below them on narrow ones.
 */
.ff-hero {
    position: relative;
    background: var(--wp--preset--color--black);
}

.ff-hero-media {
    position: relative;
    aspect-ratio: 1920 / 697;
    overflow: hidden;
}

.ff-hero .ff-hero-media > .wp-block-image {
    position: absolute;
    inset: 0;
    margin: 0;
}

.ff-hero .ff-hero-media > .wp-block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The first photo stays as the base; the others fade in one after the other (6 s each). */
.ff-hero-media > .wp-block-image:nth-child(n + 2) {
    opacity: 0;
    animation: ff-hero-2 12s ease-in-out infinite;
}

.ff-hero-media:has(> :nth-child(3)) > .wp-block-image:nth-child(n + 2) {
    animation-name: ff-hero-3;
    animation-duration: 18s;
}

.ff-hero-media:has(> :nth-child(4)) > .wp-block-image:nth-child(n + 2) {
    animation-name: ff-hero-4;
    animation-duration: 24s;
}

.ff-hero-media > .wp-block-image:nth-child(3) {
    animation-delay: 6s;
}

.ff-hero-media > .wp-block-image:nth-child(4) {
    animation-delay: 12s;
}

@keyframes ff-hero-2 {
    0%, 42% { opacity: 0; }
    50%, 92% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes ff-hero-3 {
    0%, 28% { opacity: 0; }
    33%, 61% { opacity: 1; }
    67%, 100% { opacity: 0; }
}

@keyframes ff-hero-4 {
    0%, 21% { opacity: 0; }
    25%, 46% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ff-hero-media > .wp-block-image:nth-child(n + 2) {
        animation: none;
    }
}

.ff-hero-text {
    padding-top: var(--wp--preset--spacing--40);
    padding-bottom: var(--wp--preset--spacing--40);
}

.ff-hero-text h1,
.ff-hero-text h2 {
    font-size: var(--wp--preset--font-size--xx-large);
    line-height: 1.1;
}

@media (min-width: 1100px) {
    .ff-hero-media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0));
        pointer-events: none;
    }

    .ff-hero-text {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1;
    }
}

/* Offer sections: large photo, black text column (7/12 to 5/12 like on the old site). */
.ff-offer.wp-block-media-text {
    background: var(--wp--preset--color--black);
}

.ff-offer.wp-block-media-text > .wp-block-media-text__content {
    padding: clamp(2rem, 6vw, 6.25rem) clamp(1.25rem, 3.5vw, 2.5rem);
}

.ff-offer.wp-block-media-text .wp-block-media-text__media {
    min-height: clamp(260px, 45vw, 640px);
}

@media (max-width: 600px) {
    .ff-offer.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
        min-height: 62vw;
    }
}

/* Quote between the sections. */
.ff-quote {
    text-align: center;
}

.ff-quote p {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-style: italic;
}

/* Gallery: square tiles, slight zoom on hover. */
.ff-gallery.wp-block-gallery .wp-block-image {
    overflow: hidden;
}

.ff-gallery.wp-block-gallery .wp-block-image img {
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ff-gallery.wp-block-gallery .wp-block-image:hover img {
    transform: scale(1.04);
}

/* Footer links without underline until hover. */
.ff-footer a {
    text-decoration: none;
}

.ff-footer a:hover,
.ff-footer a:focus-visible {
    text-decoration: underline;
}

.ff-footer p {
    margin: 0;
}

/* Contact form (plugin "Feuer & Flamme – Seiteneinstellungen"): white fields on black like on the old site. */
.ff-contact {
    display: grid;
    gap: 1rem;
    max-width: 640px;
}

.ff-contact p {
    margin: 0;
}

.ff-contact-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.ff-contact input[type="text"],
.ff-contact input[type="email"],
.ff-contact input[type="tel"],
.ff-contact textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d9d6d6;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
}

.ff-contact input:focus-visible,
.ff-contact textarea:focus-visible {
    outline: 2px solid var(--wp--preset--color--flame);
    outline-offset: 2px;
}

.ff-contact-website {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ff-contact-privacy {
    color: var(--wp--preset--color--grey);
    font-size: var(--wp--preset--font-size--small);
}

.ff-contact-result {
    padding: 1rem 1.25rem;
    border-left: 4px solid currentColor;
    background: #161616;
}

.ff-contact-result.is-error {
    border-color: var(--wp--preset--color--flame);
}

.ff-contact-result ul {
    margin: 0;
    padding-left: 1.2rem;
}
