/**
 * Cake Club Footer block - frontend styles.
 *
 * Re-creates the exact look-and-feel of the previous composite
 * footer (parts/footer.html + .site-footer rules in style.css).
 */

.wp-block-cakeclub-footer.site-footer {
    background-color: var(--cc-footer-bg, #ff0000);
    color: var(--cc-footer-text, #ffffff);
    width: 100%;
    margin: 0;
    border-top: var(--cc-footer-top-border-width, 0) solid var(--cc-footer-top-border-color, transparent);
}

/* Inset shadow at the top edge implies the footer sits beneath page content. */
.wp-block-cakeclub-footer.site-footer.has-top-shadow {
    box-shadow: inset 0 11px 16px -12px rgba(0, 0, 0, 0.4);
}

.wp-block-cakeclub-footer .site-footer-inner {
    max-width: var(--cc-footer-max-width, 1200px);
    margin: 0 auto;
    padding: var(--cc-footer-padding-y, 40px) var(--cc-footer-padding-x, 20px);
    box-sizing: border-box;
}

.wp-block-cakeclub-footer .site-footer-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--cc-footer-column-gap, 32px);
    align-items: flex-start;
}

.wp-block-cakeclub-footer .site-footer-column {
    flex-grow: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 0;
}

/* Heading alignment helpers */
.wp-block-cakeclub-footer .site-footer-column.heading-align-left .site-footer-heading {
    text-align: left;
}
.wp-block-cakeclub-footer .site-footer-column.heading-align-center .site-footer-heading {
    text-align: center;
}
.wp-block-cakeclub-footer .site-footer-column.heading-align-right .site-footer-heading {
    text-align: right;
}

/* Content alignment helpers */
.wp-block-cakeclub-footer .site-footer-column.content-align-left {
    text-align: left;
}
.wp-block-cakeclub-footer .site-footer-column.content-align-center {
    text-align: center;
}
.wp-block-cakeclub-footer .site-footer-column.content-align-right {
    text-align: right;
}

/* Heading */
.wp-block-cakeclub-footer .site-footer-heading {
    font-family: var(--font-heading, 'Mindset', sans-serif);
    color: var(--cc-footer-heading, #ffffff);
    font-size: var(--cc-footer-heading-size, 20px);
    margin: 0 0 20px 0;
    white-space: nowrap;
    line-height: 1.2;
}

/* Items */
.wp-block-cakeclub-footer .site-footer-item {
    margin: 0 0 var(--cc-footer-item-spacing, 6px) 0;
    color: var(--cc-footer-text, #ffffff);
    font-family: var(--font-body, inherit);
    font-size: var(--cc-footer-body-size, 16px);
    line-height: 1.5;
}

.wp-block-cakeclub-footer .site-footer-item:last-child {
    margin-bottom: 0;
}

.wp-block-cakeclub-footer .site-footer-item a {
    color: var(--cc-footer-link, #ffffff);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.wp-block-cakeclub-footer .site-footer-item a:hover,
.wp-block-cakeclub-footer .site-footer-item a:focus {
    color: var(--cc-footer-link-hover, #ffffff);
    text-decoration: underline;
}

/* Social icons */
.wp-block-cakeclub-footer .site-footer-social {
    list-style: none;
    padding: 0;
    margin: 14px 0 var(--cc-footer-item-spacing, 6px) 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-center .site-footer-social {
    justify-content: center;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-right .site-footer-social {
    justify-content: flex-end;
}

.wp-block-cakeclub-footer .site-footer-social.is-stacked {
    flex-direction: column;
    align-items: flex-start;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-center .site-footer-social.is-stacked {
    align-items: center;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-right .site-footer-social.is-stacked {
    align-items: flex-end;
}

.wp-block-cakeclub-footer .site-footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    line-height: 0;
}

.wp-block-cakeclub-footer .site-footer-social-link:hover,
.wp-block-cakeclub-footer .site-footer-social-link:focus {
    color: #ffffff;
    transform: translateY(-2px);
    opacity: 0.9;
}

.wp-block-cakeclub-footer .site-footer-social-link svg {
    fill: currentColor;
    display: block;
}

/* Brand colours for the icon circles - mirrors the live site's vivid icons
   rather than flat monochrome glyphs. */
.wp-block-cakeclub-footer .site-footer-social-link.platform-facebook {
    background-color: #1977f3;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-instagram {
    background-color: #f00075;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-twitter,
.wp-block-cakeclub-footer .site-footer-social-link.platform-x {
    background-color: #000000;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-youtube {
    background-color: #ff0000;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-tiktok {
    background-color: #010101;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-linkedin {
    background-color: #0d66c2;
}
.wp-block-cakeclub-footer .site-footer-social-link.platform-pinterest {
    background-color: #e60023;
}

/* Latest blog posts */
.wp-block-cakeclub-footer .site-footer-posts {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
}

.wp-block-cakeclub-footer .site-footer-post {
    margin: 0 0 14px 0;
}

.wp-block-cakeclub-footer .site-footer-post:last-child {
    margin-bottom: 0;
}

.wp-block-cakeclub-footer .site-footer-post.has-thumb {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wp-block-cakeclub-footer .site-footer-post-thumb {
    flex: 0 0 auto;
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
}

.wp-block-cakeclub-footer .site-footer-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wp-block-cakeclub-footer .site-footer-post-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wp-block-cakeclub-footer .site-footer-post-title {
    display: block;
    color: var(--cc-footer-link, #ffffff);
    font-family: var(--font-body, inherit);
    font-size: var(--cc-footer-body-size, 16px);
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: text-decoration-color 0.2s ease, opacity 0.2s ease;
}

.wp-block-cakeclub-footer .site-footer-post-title:hover,
.wp-block-cakeclub-footer .site-footer-post-title:focus {
    text-decoration: underline;
}

.wp-block-cakeclub-footer .site-footer-post-excerpt {
    display: block;
    margin-top: 4px;
    color: var(--cc-footer-text, #ffffff);
    font-family: var(--font-body, inherit);
    font-size: calc(var(--cc-footer-body-size, 16px) - 2px);
    line-height: 1.45;
    opacity: 0.92;
}

.wp-block-cakeclub-footer .site-footer-readmore {
    margin-top: 4px;
}

.wp-block-cakeclub-footer .site-footer-readmore a {
    font-weight: 700;
    text-decoration: underline;
}

/* Image item */
.wp-block-cakeclub-footer .site-footer-image {
    margin: 16px 0 0 0;
    display: inline-block;
    max-width: 100%;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-right .site-footer-image {
    margin-left: auto;
}

.wp-block-cakeclub-footer .site-footer-column.content-align-center .site-footer-image {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.wp-block-cakeclub-footer .site-footer-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Trust line - a centred, muted closing note */
.wp-block-cakeclub-footer .site-footer-trust {
    margin: 32px 0 0 0;
    text-align: center;
    color: var(--cc-footer-text, #ffffff);
    font-family: var(--font-body, inherit);
    font-size: calc(var(--cc-footer-body-size, 16px) - 2px);
    letter-spacing: 0.04em;
    opacity: 0.82;
}

/* Sub-footer bar - copyright + legal links, divided from the columns */
.wp-block-cakeclub-footer .site-footer-subfooter {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid color-mix(in srgb, var(--cc-footer-text, #ffffff) 22%, transparent);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    font-family: var(--font-body, inherit);
    font-size: calc(var(--cc-footer-body-size, 16px) - 3px);
}

.wp-block-cakeclub-footer .site-footer-copyright {
    margin: 0;
    color: var(--cc-footer-text, #ffffff);
    opacity: 0.85;
}

.wp-block-cakeclub-footer .site-footer-subfooter-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
}

.wp-block-cakeclub-footer .site-footer-subfooter-links a {
    color: var(--cc-footer-link, #ffffff);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wp-block-cakeclub-footer .site-footer-subfooter-links a:hover,
.wp-block-cakeclub-footer .site-footer-subfooter-links a:focus {
    color: var(--cc-footer-link-hover, #ffffff);
    text-decoration: underline;
}

/* -------------------------------------------------------------------
   Responsive layout - 2x2 (cols 1+2) then col 3, then col 4.
   Mirrors the previous behaviour in style.css.
   ------------------------------------------------------------------- */
@media (max-width: 768px) {
    .wp-block-cakeclub-footer .site-footer-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 20px;
    }

    .wp-block-cakeclub-footer .site-footer-subfooter {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .wp-block-cakeclub-footer .site-footer-subfooter-links {
        justify-content: center;
    }

    .wp-block-cakeclub-footer .site-footer-column {
        flex-basis: auto !important;
        max-width: none !important;
        width: auto;
        min-width: 0;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(2) {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(3) {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
        text-align: center;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(3) .site-footer-heading {
        text-align: center;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(3) .site-footer-image {
        margin: 0 auto;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(4) {
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        text-align: center;
    }

    .wp-block-cakeclub-footer .site-footer-column:nth-child(4) .site-footer-image {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .wp-block-cakeclub-footer .site-footer-heading {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .wp-block-cakeclub-footer .site-footer-item,
    .wp-block-cakeclub-footer .site-footer-item a {
        font-size: 14px;
    }
}
