/* ========================================================================
 * Version 0.41.0-test.2
 * Scoped refinements for Saison-Planer and knowledge pages.
 * Existing pages intentionally keep their pre-0.41 typography.
 * ======================================================================== */

/* ------------------------------------------------------------------------
 * Homepage navigation: all three entry buttons belong to one button row.
 * Keeping them inside the same Gutenberg .wp-block-buttons group also makes
 * them inherit exactly the same existing button colours and hover styling.
 * ------------------------------------------------------------------------ */
.dsa-home-nav-buttons {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem !important;
    margin-top: 1.25rem;
}
.dsa-home-nav-buttons > .wp-block-button {
    margin: 0 !important;
}
.dsa-home-nav-buttons .wp-block-button__link {
    min-height: 0;
}

/* Shortcode-generated homepage uses the same compact row semantics. */
.dsa-homepage .dsa-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

/* ------------------------------------------------------------------------
 * Saison-Planer: compact, aligned with the established Astrofotos filters.
 * These rules are deliberately scoped and do not change buttons or text on
 * existing pages.
 * ------------------------------------------------------------------------ */
.dsa-season-planner { font-size: .92rem; }
.dsa-season-top-actions { gap: .55rem; margin-bottom: .9rem; }
.dsa-season-top-actions .dsa-primary-button,
.dsa-season-top-actions .dsa-secondary-button,
.dsa-season-planner .dsa-season-filter-actions .dsa-primary-button,
.dsa-season-planner .dsa-season-filter-actions .dsa-secondary-button {
    min-height: 2.35rem;
    padding: .45rem .7rem;
    border-radius: .45rem;
    font-size: .84rem;
    line-height: 1.15;
}
.dsa-season-filter-form {
    gap: .68rem;
    padding: .82rem;
    border-radius: .7rem;
}
.dsa-season-filter-field > span,
.dsa-season-location-field > span,
.dsa-season-filter-field .dsa-filter-label,
.dsa-season-location-field .dsa-filter-label {
    font-size: .7rem;
    letter-spacing: .045em;
}
.dsa-season-filter-field select,
.dsa-season-location-search input {
    min-height: 2.35rem;
    padding: .42rem .55rem;
    font-size: .84rem;
}
.dsa-season-location-search { gap: .36rem; margin-top: .26rem; }
.dsa-season-location-search button {
    min-height: 2.35rem;
    padding: .4rem .66rem;
    font-size: .82rem;
}
.dsa-season-location-field small,
.dsa-season-method-note { font-size: .76rem; line-height: 1.4; }
.dsa-season-status { margin: .72rem 0; font-size: .86rem; }
.dsa-season-month { margin: 1.6rem 0 2.25rem; }
.dsa-season-month-head h2 { font-size: clamp(1.3rem, 2vw, 1.75rem); }

/* ------------------------------------------------------------------------
 * Knowledge overview/detail pages.
 * Typography is intentionally smaller than the first 0.41 test and is scoped
 * to the new knowledge area so no older page becomes larger than before.
 * ------------------------------------------------------------------------ */
body.dsa-knowledge-detail-page .dsa-page-hero h1,
body.dsa-knowledge-overview-page .dsa-page-hero h1 {
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    line-height: 1.05;
}
body.dsa-knowledge-detail-page .dsa-page-content,
body.dsa-knowledge-overview-page .dsa-page-content {
    font-size: .98rem;
    line-height: 1.58;
}
body.dsa-knowledge-detail-page .dsa-page-content > h2,
body.dsa-knowledge-detail-page .dsa-page-content > .wp-block-heading,
body.dsa-knowledge-overview-page .dsa-page-content > h2,
body.dsa-knowledge-overview-page .dsa-page-content > .wp-block-heading {
    font-size: clamp(1.45rem, 2.1vw, 1.8rem);
    line-height: 1.2;
    margin-top: 1.65rem;
    margin-bottom: .7rem;
    scroll-margin-top: 7rem;
}
body.dsa-knowledge-detail-page .dsa-page-content h3,
body.dsa-knowledge-overview-page .dsa-page-content h3 {
    font-size: 1.08rem;
    line-height: 1.25;
}
.dsa-knowledge-lead {
    max-width: 76rem;
    font-size: 1rem;
    line-height: 1.58;
    color: var(--dsa-text);
}

.dsa-knowledge-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: .9rem;
    margin: .9rem 0 1.8rem;
}
.dsa-knowledge-grid-palettes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dsa-knowledge-grid-technique { grid-template-columns: minmax(0, 1fr); max-width: 54rem; }

/* Gutenberg's generic block-gap rule adds margin to every child after the
 * first one. In a CSS grid that made the first knowledge card appear higher.
 * Reset child margins so every card starts on the same baseline. */
.dsa-knowledge-grid > .dsa-knowledge-card,
.dsa-knowledge-grid > .wp-block-group.dsa-knowledge-card {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    align-self: stretch;
}
.dsa-knowledge-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    padding: .92rem !important;
    border: 1px solid var(--dsa-border);
    border-radius: .72rem;
    background: rgba(16,29,40,.78);
}
.dsa-knowledge-card h3 { margin: 0 0 .5rem; font-size: 1.04rem; line-height: 1.22; }
.dsa-knowledge-card p { margin: 0 0 .75rem; color: var(--dsa-muted); font-size: .84rem; line-height: 1.5; }
.dsa-knowledge-card .wp-block-buttons { margin-top: auto; }
.dsa-knowledge-card .wp-block-button__link {
    min-height: 2.1rem;
    padding: .38rem .58rem;
    font-size: .76rem;
    line-height: 1.15;
}
.dsa-knowledge-examples { margin: .9rem 0 1.6rem; }
.dsa-knowledge-example-grid .dsa-photo-card h3 { font-size: .94rem; }
.dsa-knowledge-research { margin-top: 1.25rem; }

/* Third-level knowledge navigation. */
@media (min-width: 1501px) {
    .dsa-site-nav .dsa-nav-knowledge { position: relative; }
    .dsa-site-nav .dsa-nav-knowledge > .sub-menu {
        top: -.42rem;
        left: calc(100% + .35rem);
        width: min(49rem, 58vw);
        min-width: 42rem;
        padding: .7rem;
        display: none;
        grid-template-columns: 1.4fr .8fr 1.05fr;
        gap: .55rem;
        white-space: normal;
    }
    .dsa-site-nav .dsa-nav-knowledge:hover > .sub-menu,
    .dsa-site-nav .dsa-nav-knowledge:focus-within > .sub-menu { display: grid; }
    .dsa-site-nav .dsa-nav-knowledge > .sub-menu > li:first-child { grid-column: 1 / -1; }
    .dsa-site-nav .dsa-menu-group { padding: .2rem .28rem .35rem; }
    .dsa-site-nav .dsa-menu-group-label {
        display: block;
        padding: .3rem .42rem .4rem;
        color: #8facc0;
        font-size: .68rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .07em;
    }
    .dsa-site-nav .dsa-menu-group-list {
        position: static !important;
        display: block !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .dsa-site-nav .dsa-menu-group-list a {
        padding: .38rem .42rem;
        white-space: normal;
        font-size: .82rem;
        line-height: 1.22;
    }
}

@media (max-width: 1500px) {
    .dsa-mobile-nav nav .dsa-nav-knowledge > .sub-menu {
        margin-left: .65rem;
        padding-left: .6rem;
    }
    .dsa-mobile-nav nav .dsa-menu-group { margin: .25rem 0 .45rem; }
    .dsa-mobile-nav nav .dsa-menu-group-label {
        display: block;
        padding: .28rem .35rem;
        color: #8facc0;
        font-size: .67rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .065em;
    }
    .dsa-mobile-nav nav .dsa-menu-group-list {
        display: block !important;
        position: static !important;
        margin: 0 0 0 .35rem !important;
        padding: 0 0 0 .45rem !important;
        border: 0 !important;
        border-left: 1px solid rgba(139,205,255,.14) !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .dsa-mobile-nav nav .dsa-menu-group-list a { font-size: .82rem; padding-block: .38rem; }
}

@media (max-width: 900px) {
    body.dsa-knowledge-detail-page .dsa-page-hero h1,
    body.dsa-knowledge-overview-page .dsa-page-hero h1 {
        font-size: clamp(1.8rem, 7vw, 2.45rem);
    }
    body.dsa-knowledge-detail-page .dsa-page-content,
    body.dsa-knowledge-overview-page .dsa-page-content { font-size: .94rem; }
    .dsa-knowledge-grid,
    .dsa-knowledge-grid-palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .dsa-home-nav-buttons { gap: .5rem !important; }
    .dsa-home-nav-buttons > .wp-block-button {
        flex: 1 1 calc(50% - .5rem);
        min-width: 8rem;
    }
    .dsa-home-nav-buttons .wp-block-button__link { width: 100%; }
    .dsa-season-top-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .dsa-season-top-actions a { width: auto; max-width: 100%; }
    .dsa-season-filter-form { padding: .7rem; gap: .58rem; }
    .dsa-knowledge-grid,
    .dsa-knowledge-grid-palettes { grid-template-columns: 1fr; }
    .dsa-knowledge-card { padding: .8rem !important; }
    body.dsa-knowledge-detail-page .dsa-page-content,
    body.dsa-knowledge-overview-page .dsa-page-content { font-size: .91rem; }
}

.dsa-menu-group-list { list-style: none; }
