/* =========================================================================
   Henkst Footer — hf-style.css v1.1
   ========================================================================= */

/* ── Sticky footer — push to bottom of viewport ────────────────────────── */

/* wp-site-blocks is the real root — make it fill the viewport vertically */
.wp-site-blocks {
    display:        flex;
    flex-direction: column;
    min-height:     100vh;
}

/* The content row (middle sibling) grows to fill available space.
   Header row and footer row stay their natural height. */
.wp-site-blocks > .wp-block-group:has( .entry-content ),
.wp-site-blocks > .wp-block-group:has( .wp-block-post-content ) {
    flex: 1 0 auto;
}

/* ── Variables & base ───────────────────────────────────────────────────── */
.hf-footer {
    --hf-bg:         #1a1a1a;
    --hf-text:       #888888;
    --hf-accent:     #ffffff;
    --hf-teaser:     #ffffff;
    --hf-ease:       cubic-bezier(0.4, 0, 0.2, 1);

    background:  var(--hf-bg);
    color:       var(--hf-text);
    font-family: inherit;
    width:       100%;
    box-sizing:  border-box;
    display:     block;
}

/* ── Full width — break out of TwentyTwentyFive row containers ─────────── */
.wp-block-henkst-footer.alignfull,
.hf-footer.alignfull {
    max-width:    none !important;
    width:        100% !important;
    margin-left:  0 !important;
    margin-right: 0 !important;
}

/* TwentyTwentyFive wraps blocks in .wp-block-template-part and
   .wp-block-group rows that constrain width — override them */
.wp-block-template-part:has( .hf-footer ),
.wp-block-group:has( .hf-footer ) {
    max-width:    none !important;
    padding-left:  0 !important;
    padding-right: 0 !important;
    margin-left:   0 !important;
    margin-right:  0 !important;
    width:         100% !important;
}

/* Fallback for browsers without :has() support */
.hf-footer {
    margin-left:  calc( -1 * var(--wp--style--root--padding-left, 0px) ) !important;
    margin-right: calc( -1 * var(--wp--style--root--padding-right, 0px) ) !important;
    width:        calc( 100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px) ) !important;
}

/* ── Teaser text ────────────────────────────────────────────────────────── */
.hf-teaser-wrap {
    max-width:   1200px;
    margin:      0 auto;
    padding:     64px 48px 0;
    box-sizing:  border-box;
}

.hf-teaser {
    font-size:      clamp( 0.95rem, 1.6vw, 1.3rem );
    font-weight:    300;
    line-height:    1.2;
    letter-spacing: -0.02em;
    color:          var(--hf-teaser);
    margin:         0;
    font-style:     italic;
    font-family:    Georgia, 'Times New Roman', serif;
    max-width:      820px;
}

.hf-teaser em {
    font-style: normal;
    font-weight: 600;
}

/* ── Inner columns grid ─────────────────────────────────────────────────── */
.hf-inner {
    display:               grid;
    grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
    gap:                   40px 48px;
    max-width:             1200px;
    margin:                0 auto;
    padding:               48px 48px 40px;
    box-sizing:            border-box;
}

/* ── Column titles ──────────────────────────────────────────────────────── */
.hf-col-title {
    font-size:      0.68rem;
    font-weight:    600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color:          var(--hf-accent);
    margin:         0 0 14px;
    padding:        0;
}

/* ── Lists ──────────────────────────────────────────────────────────────── */
.hf-list {
    list-style: none;
    margin:     0;
    padding:    0;
    display:    flex;
    flex-direction: column;
    gap:        5px;
}

/* ── Links ──────────────────────────────────────────────────────────────── */
.hf-link {
    font-size:       0.82rem;
    color:           var(--hf-text);
    text-decoration: none;
    line-height:     1.4;
    display:         inline-block;
    transition:      color 180ms var(--hf-ease),
                     padding-left 180ms var(--hf-ease);
}

.hf-link:hover {
    color:        var(--hf-accent);
    padding-left: 4px;
}

.hf-item.hf-child .hf-link {
    padding-left: 10px;
    font-size:    0.76rem;
    opacity:      0.75;
}

.hf-item.hf-child .hf-link:hover {
    opacity:      1;
    padding-left: 14px;
}

/* ── Address & contact info ─────────────────────────────────────────────── */
.hf-address {
    margin-top:    20px;
    padding-top:   16px;
    border-top:    1px solid rgba(255,255,255,0.25);
    display:       flex;
    flex-direction: column;
    gap:           12px;
}

/* Robot-safe mailto link (assembled via JS) */
.hf-mailto,
.hf-tel {
    color:           var(--hf-accent);
    text-decoration: none;
    opacity:         0.8;
    font-size:       0.78rem;
    transition:      opacity 180ms;
    cursor:          pointer;
}
.hf-mailto:hover,
.hf-tel:hover { opacity: 1; }

.hf-address-block,
.hf-contact-info {
    font-size:   0.78rem;
    line-height: 1.75;
    color:       var(--hf-text);
    font-style:  normal;
    opacity:     0.75;
}

.hf-contact-info a {
    color:           var(--hf-accent);
    text-decoration: none;
    opacity:         0.8;
    transition:      opacity 180ms;
}

.hf-contact-info a:hover { opacity: 1; }

/* ── Bottom bar ─────────────────────────────────────────────────────────── */
.hf-bottom {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    max-width:       1200px;
    margin:          0 auto;
    padding:         18px 48px 32px;
    border-top:      1px solid rgba(255,255,255,0.07);
    box-sizing:      border-box;
}

.hf-copy {
    font-size: 0.72rem;
    opacity:   0.35;
    color:     var(--hf-accent);
}

/* ── Scroll to top ──────────────────────────────────────────────────────── */
.hf-totop {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           34px;
    height:          34px;
    border:          1px solid rgba(255,255,255,0.18);
    border-radius:   50%;
    background:      transparent;
    color:           var(--hf-text);
    cursor:          pointer;
    opacity:         0;
    pointer-events:  none;
    transform:       translateY(6px);
    transition:      opacity      200ms var(--hf-ease),
                     transform    200ms var(--hf-ease),
                     border-color 200ms var(--hf-ease),
                     color        200ms var(--hf-ease);
}

.hf-totop.hf-totop-visible {
    opacity:        1;
    pointer-events: auto;
    transform:      translateY(0);
}

.hf-totop:hover {
    border-color: var(--hf-accent);
    color:        var(--hf-accent);
    transform:    translateY(-2px);
}

.hf-totop svg { width: 15px; height: 15px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hf-inner        { grid-template-columns: repeat(2, 1fr); padding: 40px 32px; }
    .hf-teaser-wrap  { padding: 48px 32px 0; }
    .hf-bottom       { padding: 16px 32px 28px; }
}

@media (max-width: 560px) {
    .hf-inner        { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding: 32px 20px; }
    .hf-teaser-wrap  { padding: 40px 20px 0; }
    .hf-teaser       { font-size: clamp(0.9rem, 4vw, 1.1rem); }
    .hf-bottom       { padding: 14px 20px 24px; }
    .hf-col-contact  { grid-column: 1 / -1; }
}

/* ── Slim footer (single project pages) ────────────────────────────────── */
.hf-footer-slim {
    padding-top: 0 !important;
}

.hf-footer-slim .hf-teaser-wrap {
    padding-top: 14px;
    padding-bottom: 8px;
}

.hf-footer-slim .hf-bottom-slim {
    display:     flex;
    align-items: baseline;
    flex-wrap:   wrap;
    gap:         16px 32px;
    max-width:   1200px;
    margin:      0 auto;
    padding:     10px 48px 20px;
    box-sizing:  border-box;
    border-top:  1px solid rgba(255,255,255,0.1);
}

.hf-footer-slim .hf-bottom-right {
    flex:       1;
    font-size:  0.75rem;
    line-height: 1.5;
    color:      var(--hf-text);
    opacity:    0.7;
    white-space: nowrap;
    overflow:   hidden;
    text-overflow: ellipsis;
}

.hf-address-inline {
    font-style: normal;
    font-size:  0.75rem;
    color:      var(--hf-text);
}

.hf-address-inline .hf-mailto {
    color:           var(--hf-accent);
    text-decoration: none;
    opacity:         0.85;
}

.hf-address-inline .hf-mailto:hover { opacity: 1; }

@media (max-width: 640px) {
    .hf-footer-slim .hf-bottom-slim {
        flex-direction: column;
        padding: 10px 20px 16px;
        gap: 8px;
    }
    .hf-footer-slim .hf-bottom-right {
        white-space: normal;
        overflow: visible;
    }
}

/* ── Tel link ────────────────────────────────────────────────────────────── */
/* In full footer: inherits .hf-link styles + adds hover colour */
.hf-tel {
    color:           var(--hf-text);
    text-decoration: none;
    font-size:       0.82rem;
    display:         inline-block;
    transition:      color 180ms, padding-left 180ms;
}
.hf-tel:hover {
    color:        var(--hf-accent);
    padding-left: 4px;
}
/* In slim footer the tel link is inline */
.hf-address-inline .hf-tel {
    color:   var(--hf-accent);
    opacity: 0.85;
}
.hf-address-inline .hf-tel:hover {
    opacity:      1;
    padding-left: 0;
}

/* ── Inline icons (mail / tel) ──────────────────────────────────────────── */
.hf-icon {
    width:          12px;
    height:         12px;
    display:        inline-block;
    vertical-align: middle;
    margin-right:   5px;
    margin-top:     -2px;
    color:          var(--hf-text);
    flex-shrink:    0;
    opacity:        0.7;
}

.hf-tel .hf-icon,
.hf-mailto .hf-icon {
    color: inherit;
    opacity: 1;
}

/* ── Teaser slider ──────────────────────────────────────────────────────── */
.hf-teaser-slider {
    position:   relative;
    min-height: 1.3em; /* prevent layout jump when switching */
}

/* All sentences hidden by default */
.hf-teaser-slider .hf-teaser {
    position:   absolute;
    top:        0;
    left:       0;
    width:      100%;
    opacity:    0;
    transition: opacity 600ms ease;
    margin:     0;
}

/* Active sentence visible */
.hf-teaser-slider .hf-teaser.hf-teaser-active {
    opacity:  1;
    position: relative; /* takes up space so container has height */
}
