/*
Theme Name: Twenty Twenty-Five Child
Template: twentytwentyfive
Description: Child theme of Twenty Twenty-Five
Version: 1.0.0
*/

/* Featured image on single posts: match 1200x630 OG aspect (1.905:1)
   Parent theme single.html hardcodes aspectRatio:3/2 which crops the sides
   of our OG images ("DDV BLOG" + title get cut). Override to match actual image. */
body.single-post .wp-block-post-featured-image,
body.single-post figure.wp-block-post-featured-image,
body.single-post .wp-block-post-featured-image img {
    aspect-ratio: 1200 / 630 !important;
}

body.single-post .wp-block-post-featured-image img {
    object-fit: contain !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* Single post: gradient border + subtle background */
body.single-post main.wp-block-group > .wp-block-group.alignfull:first-child {
    position: relative;
    background: rgba(139, 92, 246, 0.03) !important;
    border-radius: 16px;
    margin-left: clamp(1rem, 5vw, calc(50% - 520px)) !important;
    margin-right: clamp(1rem, 5vw, calc(50% - 520px)) !important;
}

body.single-post main.wp-block-group > .wp-block-group.alignfull:first-child::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        135deg,
        #6366f1 0%,
        #8b5cf6 20%,
        #a855f7 40%,
        #06b6d4 60%,
        #3b82f6 80%,
        #6366f1 100%
    ) !important;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* Highlighter effect on hyperlinks inside blog post content */
body.single-post .wp-block-post-content a {
    text-decoration: none !important;
    position: relative;
    background: linear-gradient(104deg, rgba(255, 220, 100, 0) 0.9%, rgba(255, 220, 100, 1.25) 2.4%, rgba(255, 220, 100, 0.5) 5.8%, rgba(255, 220, 100, 0.1) 93%, rgba(255, 220, 100, 0.7) 96%, rgba(255, 220, 100, 0) 98%), linear-gradient(183deg, rgba(255, 220, 100, 0) 0%, rgba(255, 220, 100, 0.3) 7.9%, rgba(255, 220, 100, 0) 15%);
    padding: 0.1em 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    border-radius: 7.5px;
    text-shadow: -12px 12px 9.8px rgba(255, 220, 100, 0.7), 21px -18.1px 7.3px rgba(255, 255, 255, 1), -18.1px -27.3px 30px rgba(255, 255, 255, 1);
}

body.single-post .wp-block-post-content a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    border-radius: 7.5px;
    background: linear-gradient(104deg, rgba(130, 255, 173, 0) 0.9%, rgba(130, 255, 173, 1.25) 2.4%, rgba(130, 255, 173, 0.5) 5.8%, rgba(130, 255, 173, 0.1) 93%, rgba(130, 255, 173, 0.7) 96%, rgba(130, 255, 173, 0) 98%), linear-gradient(183deg, rgba(130, 255, 173, 0) 0%, rgba(130, 255, 173, 0.3) 7.9%, rgba(130, 255, 173, 0) 15%);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.4s ease;
    pointer-events: none;
}

body.single-post .wp-block-post-content a:hover::after {
    clip-path: inset(0 0 0 0);
}

body.single-post .wp-block-post-content a:hover {
    text-shadow: -12px 12px 9.8px rgba(130, 255, 173, 0.7), 21px -18.1px 7.3px rgba(255, 255, 255, 1), -18.1px -27.3px 30px rgba(255, 255, 255, 1);
}

/* Mobile: edge-to-edge card, tighter padding, smaller title/body/byline */
@media (max-width: 600px) {
    body.single-post main.wp-block-group > .wp-block-group.alignfull:first-child {
        /* Cancel parent's global padding so card sits 1px from viewport edges */
        margin-left: calc(var(--wp--preset--spacing--50) * -1 + 1px) !important;
        margin-right: calc(var(--wp--preset--spacing--50) * -1 + 1px) !important;
        padding: 1rem !important;
        border-radius: 12px;
    }

    body.single-post .wp-block-post-title {
        font-size: clamp(1.5rem, 5.5vw, 1.9rem) !important;
        line-height: 1.2 !important;
    }

    body.single-post .wp-block-post-content p,
    body.single-post .wp-block-post-content li {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    body.single-post .wp-block-post-content ul,
    body.single-post .wp-block-post-content ol {
        padding-left: 1.25rem !important;
    }

    body.single-post .wp-block-post-content li {
        margin-bottom: 0.4rem;
    }

    /* Tables: horizontal scroll + smaller type. Targets both Gutenberg
       figure.wp-block-table and bare <table> elements pasted as raw HTML. */
    body.single-post .wp-block-post-content figure.wp-block-table,
    body.single-post .wp-block-post-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    body.single-post .wp-block-post-content table {
        font-size: 0.85rem;
        line-height: 1.45;
    }

    body.single-post .wp-block-post-content table thead,
    body.single-post .wp-block-post-content table tbody {
        display: table;
        width: 100%;
        min-width: 540px;
    }

    body.single-post .wp-block-post-content th,
    body.single-post .wp-block-post-content td {
        padding: 0.5rem 0.6rem;
    }

    .ddv-editorial-byline {
        margin: 0 0 1.25rem;
        padding: 0.65rem 0.85rem;
    }

    .ddv-editorial-byline__meta {
        font-size: 0.8125rem;
        margin-bottom: 0.35rem;
    }

    .ddv-editorial-byline__note {
        font-size: 0.75rem;
        line-height: 1.5;
    }
}

/* Date icon on homepage blog list */
.date-icon-box {
    flex-shrink: 0;
    width: 54px;
    height: 58px;
    background: #fcfcfc;
    background: linear-gradient(to bottom, #fcfcfc 0%, #ececec 100%);
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: default;
    position: relative;
}

.date-icon-day {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: #444;
    padding-top: 2px;
}

.date-icon-month {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(to bottom, #c0392b 0%, #962d22 100%);
    width: 100%;
    text-align: center;
    padding: 3px 0;
    margin-top: auto;
}

/* Full date tooltip on hover */
.date-icon-box::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.date-icon-box:hover::after {
    opacity: 1;
}

/* Post row layout */
.post-row-with-date-icon {
    align-items: center !important;
}

.post-row-with-date-icon .wp-block-post-terms.category-label {
    flex-shrink: 0;
}

/* Category labels */
.cat-label {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

/* Desktop: wrapper is transparent — title and label remain direct flex siblings */
.title-label-col {
    display: contents;
}

/* Desktop: restore original visual order (label to the right of title) */
.post-row-with-date-icon .wp-block-post-title { order: 2; }
.post-row-with-date-icon .wp-block-post-terms { order: 3; }

/* Mobile: wrapper becomes a flex column — label (first in DOM) sits above title */
@media (max-width: 768px) {
    .post-row-with-date-icon {
        align-items: flex-start !important;
    }

    .title-label-col {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        gap: 2px;
    }

    .title-label-col .wp-block-post-terms.category-label {
        margin: 0 !important;
        line-height: 0;
        font-size: 0;
    }

    .title-label-col .wp-block-post-terms.category-label .cat-label {
        font-size: 0.55rem;
        line-height: 1.4;
        padding: 2px 7px;
    }

    .title-label-col .wp-block-post-title {
        margin: 0 !important;
    }
}

/* Header brand: DDV logo + Blog */
.ddv-blog-brand {
    margin: 0;
}

.ddv-blog-brand__link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none !important;
}

.ddv-blog-brand__logo {
    display: block;
    width: auto;
    height: clamp(1.75rem, 3vw, 2.35rem);
}

.ddv-blog-brand__text {
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

@media (max-width: 600px) {
    .ddv-blog-brand__link {
        gap: 0.65rem;
    }

    .ddv-blog-brand__logo {
        height: 1.55rem;
    }

    .ddv-blog-brand__text {
        font-size: 1.1rem;
    }
}

/* Homepage pagination: center controls and show arrow-only previous/next links. */
body.home.blog .wp-block-query-pagination {
    justify-content: center !important;
    align-items: center;
    gap: 0.9rem;
}

body.home.blog .wp-block-query-pagination.is-content-justification-space-between > .wp-block-query-pagination-previous:first-child,
body.home.blog .wp-block-query-pagination.is-content-justification-space-between > .wp-block-query-pagination-next:last-of-type {
    margin-inline: 0;
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-next,
body.home.blog .wp-block-query-pagination .wp-block-query-pagination-previous {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 0;
    line-height: 1;
    text-decoration: none !important;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-next-arrow,
body.home.blog .wp-block-query-pagination .wp-block-query-pagination-previous-arrow {
    display: none;
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-previous::before,
body.home.blog .wp-block-query-pagination .wp-block-query-pagination-next::after {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-previous::before {
    content: "\2190";
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-next::after {
    content: "\2192";
}

body.home.blog .wp-block-query-pagination .wp-block-query-pagination-next:hover,
body.home.blog .wp-block-query-pagination .wp-block-query-pagination-previous:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.26);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

/* Continue reading button on single posts — matches homepage pagination pill. */
.ddv-continue-reading {
    margin: 2.5rem 0 1.5rem;
    text-align: center;
}

.ddv-continue-reading__link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.4rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ddv-continue-reading__link:hover,
.ddv-continue-reading__link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.26);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.ddv-continue-reading__arrow {
    font-weight: 600;
    line-height: 1;
    font-size: 1.1rem;
}

/* Editorial byline on single posts (SEO authorship + publication signal) */
.ddv-editorial-byline {
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    border-left: 3px solid rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.04);
    border-radius: 0 8px 8px 0;
}

.ddv-editorial-byline__meta {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    color: rgba(15, 23, 42, 0.75);
}

.ddv-editorial-byline__author {
    font-weight: 600;
    color: rgba(15, 23, 42, 0.9);
}

.ddv-editorial-byline__sep {
    margin: 0 0.35rem;
    color: rgba(15, 23, 42, 0.4);
}

.ddv-editorial-byline__note {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(15, 23, 42, 0.65);
}

/* Related posts block — appended to single-post content, category-aware. */
.ddv-related-posts {
    margin: 3rem 0 0;
    padding: 1.75rem 1.5rem 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.ddv-related-posts__heading {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.65);
}

.ddv-related-posts__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ddv-related-posts__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ddv-related-posts__item:last-child {
    border-bottom: none;
}

/* Override the inherited highlighter effect from .wp-block-post-content a */
body.single-post .wp-block-post-content .ddv-related-posts__link {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    color: #0f172a;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-shadow: none !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

body.single-post .wp-block-post-content .ddv-related-posts__link::after {
    content: none !important;
}

body.single-post .wp-block-post-content .ddv-related-posts__link:hover {
    color: #6366f1;
    text-shadow: none !important;
}

.ddv-related-posts__cat {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.5);
}

@media (max-width: 600px) {
    .ddv-related-posts {
        padding: 1.5rem 0.25rem 0.75rem;
    }

    .ddv-related-posts__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    body.single-post .wp-block-post-content .ddv-related-posts__link {
        font-size: 0.98rem;
    }
}

/* =========================================================================
   Per-app site footer (rendered by [ddv_footer] shortcode from functions.php)
   Mirrors the Next.js site-footer layout: brand column + Links / Community /
   Legal columns, followed by an optional small-text regulatory disclaimer.
   ========================================================================= */
.ddv-footer {
    margin-top: 4rem;
    padding: 3.5rem 1.25rem 2.5rem;
    background: #0f172a;
    color: rgba(248, 250, 252, 0.72);
    font-size: 0.9rem;
    line-height: 1.55;
}

.ddv-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.ddv-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.ddv-footer__brand-link {
    text-decoration: none !important;
    color: inherit;
    background: none !important;
    text-shadow: none !important;
    padding: 0 !important;
}

.ddv-footer__brand-link::after {
    content: none !important;
}

.ddv-footer__brand-name {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f8fafc;
}

.ddv-footer__tagline {
    margin: 0.75rem 0 1rem;
    max-width: 34rem;
    font-size: 0.875rem;
    color: rgba(248, 250, 252, 0.65);
}

.ddv-footer__copyright {
    margin: 0;
    font-size: 0.8125rem;
    color: rgba(248, 250, 252, 0.5);
}

.ddv-footer__ddv-link {
    color: rgba(248, 250, 252, 0.7);
    text-decoration: none !important;
    border-bottom: 1px solid rgba(248, 250, 252, 0.25);
}

.ddv-footer__ddv-link:hover {
    color: #f8fafc;
    border-bottom-color: rgba(248, 250, 252, 0.6);
}

.ddv-footer__heading {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.55);
}

.ddv-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ddv-footer__list a {
    color: rgba(248, 250, 252, 0.75);
    text-decoration: none !important;
    font-size: 0.875rem;
    transition: color 0.15s ease;
    /* Neutralize the single-post highlighter effect inherited elsewhere */
    background: none !important;
    text-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.ddv-footer__list a::after {
    content: none !important;
}

.ddv-footer__list a:hover {
    color: #f8fafc;
}

.ddv-footer__disclaimer {
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(248, 250, 252, 0.08);
    font-size: 0.75rem;
    line-height: 1.55;
    color: rgba(248, 250, 252, 0.45);
}

/* Tablet: brand on its own row, three equal columns below */
@media (max-width: 900px) {
    .ddv-footer__grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 2rem;
    }

    .ddv-footer__brand {
        grid-column: 1 / -1;
    }
}

/* Mobile: stacked */
@media (max-width: 600px) {
    .ddv-footer {
        padding: 2.5rem 1rem 2rem;
        margin-top: 2.5rem;
    }

    .ddv-footer__grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}
