/* OhMyKajo footer.
   Editorial link columns over an oversized brand lockup.
   Written with logical properties only, so Arabic/RTL mirrors automatically
   from dir="rtl" without a second set of flipped rules. */

.kajo-footer {
    --kajo-footer-bg: #344232;
    --kajo-footer-cream: #f7f3ea;
    --kajo-footer-muted: rgba(250, 247, 239, .48);
    --kajo-footer-rule: rgba(156, 175, 136, .28);
    --kajo-footer-accent: #f58634;

    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(56px, 6vw, 96px) 0 clamp(24px, 2.6vw, 40px);
    background: var(--kajo-footer-bg);
    color: var(--kajo-footer-cream);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Very subtle depth at the top edge, no heavy gradient. */
.kajo-footer:before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: 1px;
    background: var(--kajo-footer-rule);
    opacity: .6;
}

.kajo-footer-inner {
    width: min(1560px, 100% - clamp(32px, 5vw, 96px));
    margin-inline: auto;
}

/* ---------- top: link columns + action rail ---------- */

.kajo-footer-top {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(260px, 360px);
    gap: clamp(24px, 2.4vw, 44px);
    align-items: start;
    padding-block-end: clamp(26px, 2.8vw, 44px);
}

.kajo-footer-cols {
    display: contents;
}

.kajo-footer-col {
    min-width: 0;
    padding-inline-start: clamp(16px, 1.8vw, 32px);
    border-inline-start: 1px solid var(--kajo-footer-rule);
}

.kajo-footer-col:first-child {
    padding-inline-start: 0;
    border-inline-start: 0;
}

/* These are <h2> elements; Woodmart ships responsive heading sizes that beat a
   single class at narrow widths, so the label scale is stated explicitly. */
.kajo-footer .kajo-footer-col-label {
    margin: 0 0 clamp(18px, 1.8vw, 26px) !important;
    padding: 0 !important;
    color: var(--kajo-footer-muted);
    font-family: inherit !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.kajo-footer-col ul,
.kajo-footer-legal {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kajo-footer-col li {
    margin: 0 0 clamp(10px, 1.1vw, 15px);
    line-height: 1.3;
}

.kajo-footer-col li:last-child {
    margin-block-end: 0;
}

.kajo-footer-col a {
    display: inline-block;
    color: var(--kajo-footer-cream);
    font-size: clamp(15px, 1.05vw, 17px);
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    transition: color .22s ease, transform .22s ease;
}

.kajo-footer-col a:hover,
.kajo-footer-col a:focus-visible {
    color: var(--kajo-footer-accent);
}

/* ---------- action rail ---------- */

.kajo-footer-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding-inline-start: clamp(16px, 1.8vw, 32px);
    border-inline-start: 1px solid var(--kajo-footer-rule);
}

.kajo-footer-signup {
    width: 100%;
}

.kajo-footer-signup .wpcf7 {
    margin: 0;
}

.kajo-footer-signup form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kajo-footer-signup form > p {
    display: contents;
    margin: 0;
}

.kajo-footer-signup form br {
    display: none;
}

.kajo-footer-signup .wpcf7-form-control-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.kajo-footer-signup input[type="email"],
.kajo-footer-signup input[type="text"] {
    width: 100%;
    min-height: 42px;
    padding-inline: 14px;
    border: 1px solid var(--kajo-footer-rule);
    border-radius: 999px;
    background: rgba(250, 247, 239, .06);
    color: var(--kajo-footer-cream);
    font-size: 13px;
    line-height: 1.3;
    transition: border-color .22s ease, background .22s ease;
}

.kajo-footer-signup input::placeholder {
    color: var(--kajo-footer-muted);
}

.kajo-footer-signup input[type="email"]:focus,
.kajo-footer-signup input[type="text"]:focus {
    border-color: rgba(156, 175, 136, .7);
    background: rgba(250, 247, 239, .1);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Woodmart/CF7 ship their own .wpcf7-submit colours at higher specificity, so
   the accent has to be stated explicitly here. */
.kajo-footer .kajo-footer-signup input[type="submit"],
.kajo-footer .kajo-footer-signup .wpcf7-submit,
.kajo-footer .kajo-footer-signup button[type="submit"] {
    flex: 0 0 auto;
    min-height: 42px;
    padding-inline: 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--kajo-footer-accent) !important;
    background-image: none !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: none !important;
    cursor: pointer;
    transition: filter .22s ease;
}

.kajo-footer .kajo-footer-signup input[type="submit"]:hover,
.kajo-footer .kajo-footer-signup .wpcf7-submit:hover,
.kajo-footer .kajo-footer-signup button[type="submit"]:hover {
    filter: brightness(1.08);
}

.kajo-footer-signup .wpcf7-spinner {
    margin: 0;
}

.kajo-footer-signup .wpcf7-response-output,
.kajo-footer-signup .wpcf7-not-valid-tip {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    color: var(--kajo-footer-cream);
    font-size: 12px;
    line-height: 1.4;
}

.kajo-footer-socials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-block-start: 2px;
}

.kajo-footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(247, 243, 234, .34);
    border-radius: 999px;
    background: rgba(247, 243, 234, .08);
    color: var(--kajo-footer-cream);
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .08);
    transition: background .22s ease, border-color .22s ease, color .22s ease, transform .22s ease;
}

.kajo-footer-social svg {
    display: block;
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.kajo-footer-social:hover,
.kajo-footer-social:focus-visible {
    border-color: var(--kajo-footer-accent);
    background: var(--kajo-footer-accent);
    color: #fff;
    transform: translateY(-2px);
}

/* The inner node is an <a> until the child-theme mailto obfuscator swaps it for
   a .wd-email-link span, so both are styled. */
.kajo-footer-email {
    display: block;
    margin-block-start: 12px;
}

.kajo-footer-email a,
.kajo-footer-email .wd-email-link {
    display: inline-block;
    padding-block-end: 2px;
    border-block-end: 1px solid var(--kajo-footer-rule);
    color: var(--kajo-footer-cream);
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    word-break: break-word;
    cursor: pointer;
    transition: color .22s ease, border-color .22s ease;
}

.kajo-footer-email a:hover,
.kajo-footer-email a:focus-visible,
.kajo-footer-email .wd-email-link:hover,
.kajo-footer-email .wd-email-link:focus-visible {
    color: var(--kajo-footer-accent);
    border-color: var(--kajo-footer-accent);
}

/* Low bar under the brand lockup: legal links and copyright, pushed to the
   lower/outer edge. */
.kajo-footer-base {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px clamp(16px, 2vw, 28px);
    margin-block-start: clamp(18px, 2vw, 30px);
    padding-block-start: clamp(14px, 1.6vw, 22px);
    border-block-start: 1px solid var(--kajo-footer-rule);
}

.kajo-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px clamp(14px, 1.8vw, 26px);
    margin: 0;
}

.kajo-footer-legal li {
    margin: 0;
    line-height: 1.3;
}

.kajo-footer-legal a {
    color: var(--kajo-footer-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .22s ease;
}

.kajo-footer-legal a:hover,
.kajo-footer-legal a:focus-visible {
    color: var(--kajo-footer-cream);
}

.kajo-footer-copy {
    margin: 0;
    color: var(--kajo-footer-muted);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ---------- build credit ---------- */

/* Sits at the far left of the base bar while the legal links and the
   copyright stay right. order:-1 rather than DOM order, so the mobile column
   can put it last without a second markup path. */
.kajo-footer-credit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    order: -1;
    margin: 0;
    margin-inline-end: auto;
    color: var(--kajo-footer-muted);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.kajo-footer-credit__link {
    display: inline-flex;
    align-items: center;
    /* 2DU: the supplied white-on-transparent mark reads at a mean luminance of
       245/255, so it sits straight on the dark footer. The cream chip the dark
       version needed is gone, and the mark keeps its yellow accents. */
    line-height: 0;
    opacity: .92;
    transition: opacity .22s ease, transform .22s ease;
}

.kajo-footer-credit__link:hover,
.kajo-footer-credit__link:focus-visible {
    opacity: 1;
    transform: translateY(-1px);
}

.kajo-footer-credit__link:focus-visible {
    outline: 2px solid var(--kajo-footer-cream);
    outline-offset: 3px;
}

/* ---------- the flip ---------- */

/*
 * A two-faced card rather than a 360deg spin of one image: halfway through a
 * spin you are looking at the back of the artwork and the wordmark reads
 * backwards. Both faces carry the same logo, so it stays legible all the way
 * round.
 *
 * The card is sized rather than the images, because the faces are absolutely
 * positioned and would otherwise collapse the link to zero height.
 */
.kajo-footer-credit__flip {
    position: relative;
    display: block;
    height: 20px;
    aspect-ratio: 148 / 60;
    transform-style: preserve-3d;
    transition: transform .72s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

.kajo-footer-credit__face {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.kajo-footer-credit__face--back {
    transform: rotateY(180deg);
}

/* Desktop: hover. Only where a real hover exists, so a touch device does not
   latch the flipped state on first tap and keep it. */
@media (hover: hover) and (pointer: fine) {
    .kajo-footer-credit__link:hover .kajo-footer-credit__flip {
        transform: rotateY(180deg);
    }
}

/* Keyboard parity with hover. */
.kajo-footer-credit__link:focus-visible .kajo-footer-credit__flip {
    transform: rotateY(180deg);
}

/* Touch: the script toggles this on press. */
.kajo-footer-credit__flip.is-flipped {
    transform: rotateY(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .kajo-footer-credit__flip {
        transition: none;
        transform: none !important;
    }
}

.kajo-footer-credit__tag {
    text-transform: none;
    letter-spacing: .04em;
}

/* ---------- bottom: oversized brand lockup ---------- */

.kajo-footer-brand {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.8vw, 34px);
    padding-block-start: clamp(28px, 3vw, 48px);
    border-block-start: 1px solid var(--kajo-footer-rule);
}

.kajo-footer-mark {
    flex: 0 0 auto;
    display: block;
    width: clamp(64px, 8.4vw, 132px);
}

.kajo-footer-mark img {
    display: block;
    width: 100%;
    height: auto;
}

.kajo-footer-wordmark {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kajo-footer-wordmark-text {
    display: block;
    color: var(--kajo-footer-cream);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(56px, 15.5vw, 250px);
    font-weight: 500;
    line-height: .82;
    letter-spacing: -.02em;
    white-space: nowrap;
}

/* Shimmer sweep across the wordmark.

   A cream / sage / cream gradient is clipped to the glyphs and its position is
   animated, so a soft band travels through the letters. The sweep tone stays
   well above the footer background so the wordmark never reads as fading out.

   Wrapped in @supports because the effect relies on making the text itself
   transparent - without background-clip support that would leave an invisible
   wordmark, so unsupported browsers keep solid cream text instead. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .kajo-footer-wordmark-text {
        background-image: linear-gradient(
            90deg,
            var(--kajo-footer-cream) 0%,
            #8fa37e 50%,
            var(--kajo-footer-cream) 100%
        );
        /* Must tile: the sweep moves the gradient far outside the text box, and
           with no-repeat the uncovered glyphs would clip to nothing and vanish.
           The gradient starts and ends on the same cream, so tiling is seamless. */
        background-repeat: repeat;
        background-size: 200% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: kajo-footer-shimmer var(--kajo-footer-shimmer-duration, 3.2s) linear infinite;

        /* line-height .82 makes the box shorter than the glyphs, and clipped
           backgrounds only paint inside it - so the descenders of "y" and "j"
           would lose their fill and disappear. The padding grows the paint box
           past the ink; the matching negative margins keep layout identical. */
        padding-block: .22em .3em;
        margin-block: -.22em -.3em;
    }
}

@keyframes kajo-footer-shimmer {
    from {
        background-position: 200% center;
    }

    to {
        background-position: -200% center;
    }
}

.kajo-footer-tagline {
    display: block;
    margin-block-start: clamp(8px, 1vw, 16px);
    color: var(--kajo-footer-muted);
    font-size: clamp(11px, .9vw, 14px);
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
}

/* ---------- focus visibility ---------- */

.kajo-footer a:focus-visible,
.kajo-footer button:focus-visible,
.kajo-footer input:focus-visible {
    outline: 2px solid var(--kajo-footer-accent);
    outline-offset: 3px;
}

/* ---------- tablet ---------- */

@media (max-width: 1180px) {
    .kajo-footer-top {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: clamp(30px, 4vw, 46px);
    }

    /* display:contents would leave the columns as direct grid items, which is
       what we want on desktop; on tablet the rail moves to its own full row. */
    .kajo-footer-rail {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 18px;
        padding-inline-start: 0;
        padding-block-start: clamp(22px, 3vw, 34px);
        border-inline-start: 0;
        border-block-start: 1px solid var(--kajo-footer-rule);
    }

    .kajo-footer-signup {
        flex: 1 1 320px;
        margin-block-end: 0;
    }

    .kajo-footer-socials {
        flex: 0 1 auto;
        width: auto;
    }

    .kajo-footer-email {
        flex: 1 1 100%;
        margin-block-start: 0;
    }

    .kajo-footer-base {
        justify-content: flex-start;
    }
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
    .kajo-footer {
        padding-block-start: clamp(40px, 9vw, 56px);
    }

    .kajo-footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 18px;
        padding-block-end: 32px;
    }

    .kajo-footer-col {
        padding-inline-start: 0;
        border-inline-start: 0;
    }

    .kajo-footer .kajo-footer-col-label {
        margin-block-end: 12px !important;
    }

    .kajo-footer-col a {
        font-size: 14px;
    }

    .kajo-footer-rail {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .kajo-footer-signup {
        flex-basis: auto;
    }

    .kajo-footer-signup form {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }

    .kajo-footer-signup .wpcf7-form-control-wrap {
        width: 100%;
    }

    .kajo-footer .kajo-footer-signup input[type="submit"],
    .kajo-footer .kajo-footer-signup .wpcf7-submit,
    .kajo-footer .kajo-footer-signup button[type="submit"] {
        width: 100% !important;
        min-height: 44px;
    }

    .kajo-footer-socials {
        justify-content: flex-start;
        gap: 10px;
        margin-block-start: 4px;
    }

    .kajo-footer-social {
        width: 44px;
        height: 44px;
    }

    .kajo-footer-email {
        margin-block-start: 2px;
    }

    /* 2DR: the mark and the wordmark sit side by side, as they do on desktop.
       They were stacked here, which dropped "OhMyKajo" onto its own line and
       broke the lockup. */
    .kajo-footer-brand {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding-block-start: 30px;
    }

    .kajo-footer-mark {
        width: 54px;
    }

    /* Sized so the mark, the gap and the word all fit the narrowest phone we
       test (360px) without the word wrapping or the row overflowing. */
    .kajo-footer-wordmark-text {
        font-size: clamp(30px, 11.2vw, 56px);
        letter-spacing: -.04em;
    }

    .kajo-footer-tagline {
        white-space: normal;
    }

    .kajo-footer-base {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 12px;
    }

    /* Last in the column, where the original sat, with room above it - and
       centred, because it is the only item on its own line down here and
       everything above it is a left-aligned list. */
    .kajo-footer-credit {
        order: 0;
        gap: 7px;
        margin-inline-end: 0;
        padding-block-start: 14px;
        border-block-start: 1px solid var(--kajo-footer-rule);
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .kajo-footer-credit__flip {
        height: 18px;
    }

    .kajo-footer-legal {
        gap: 8px 14px;
    }

    .kajo-footer-copy {
        line-height: 1.45;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kajo-footer a,
    .kajo-footer input,
    .kajo-footer .kajo-footer-social {
        transition: none !important;
    }

    /* Stop the sweep and paint the wordmark solid, rather than freezing it
       mid-gradient. */
    .kajo-footer .kajo-footer-wordmark-text {
        animation: none !important;
        background-image: none !important;
        color: var(--kajo-footer-cream) !important;
        -webkit-text-fill-color: var(--kajo-footer-cream) !important;
    }
}
