/* Deepskyastrophoto frontend additions – Version 0.18.0 */

.dsa-site-main > .dsa-system-page,
.dsa-site-main > article.dsa-system-page {
    width: min(calc(100% - 2rem), 1260px);
    margin-inline: auto;
}

.dsa-system-page .entry-content,
.dsa-system-page .dsa-page-content {
    min-width: 0;
}

.dsa-width-normal {
    width: min(100%, 860px);
    margin-inline: auto;
}
.dsa-width-wide,
.alignwide {
    width: min(100%, 1180px);
    margin-inline: auto;
}
.dsa-width-full,
.alignfull {
    width: 100%;
    max-width: none;
}

.dsa-page-content > * + *,
.dsa-editorial-content > * + * {
    margin-top: clamp(1rem, 2.2vw, 2rem);
}

.dsa-page-content .wp-block-group,
.dsa-page-content .wp-block-columns,
.dsa-page-content .wp-block-cover,
.dsa-page-content .wp-block-media-text,
.dsa-page-content .dsa-content-panel {
    box-sizing: border-box;
}

.dsa-page-content .dsa-content-panel,
.dsa-page-content .wp-block-group.dsa-content-panel,
.dsa-page-content .wp-block-columns.dsa-content-panel {
    padding: clamp(1.1rem, 2.5vw, 2rem);
    border: 1px solid var(--dsa-border);
    border-radius: .8rem;
    background: rgba(16, 29, 40, .82);
}

.dsa-page-content .wp-block-image,
.dsa-page-content figure {
    margin: 0;
}
.dsa-page-content .wp-block-image img,
.dsa-page-content .wp-block-gallery img,
.dsa-page-content .wp-block-media-text img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.dsa-editable-card-grid {
    display: grid;
    grid-template-columns: repeat(var(--dsa-grid-columns, 3), minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: stretch;
    margin-block: clamp(1.5rem, 3vw, 3rem);
}
.dsa-editable-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dsa-border);
    border-radius: .75rem;
    background: var(--dsa-panel);
}
.dsa-editable-card-image {
    display: block;
    padding: 0;
    background: transparent;
}
.dsa-editable-card-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: transparent;
}
.dsa-editable-card-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .8rem;
    padding: 1rem 1.1rem 1.15rem;
}
.dsa-editable-card-copy h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.2vw, 1.35rem);
}
.dsa-editable-card-copy h2 a {
    color: var(--dsa-heading);
    text-decoration: none;
}
.dsa-editable-card-text,
.dsa-editable-card-text p {
    margin: 0;
    color: var(--dsa-muted);
    line-height: 1.55;
}
.dsa-editable-card-copy .dsa-page-card-link {
    margin-top: auto;
}

.dsa-editable-image-row {
    display: grid;
    grid-template-columns: repeat(var(--dsa-grid-columns, 2), minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
    margin-block: clamp(1.3rem, 2.8vw, 2.6rem);
}
.dsa-editable-image-item {
    min-width: 0;
    margin: 0;
}
.dsa-editable-image-item a {
    display: block;
}
.dsa-editable-image-item img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border: 1px solid var(--dsa-border);
    border-radius: .65rem;
    background: transparent;
}
.dsa-editable-image-item figcaption {
    margin-top: .55rem;
    color: var(--dsa-muted);
    font-size: .88rem;
    line-height: 1.4;
}

.dsa-editable-constellation-intro {
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: start;
    margin-block: 1.5rem 2.5rem;
}
.dsa-editable-constellation-intro figure {
    margin: 0;
}
.dsa-editable-constellation-intro img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--dsa-border);
    border-radius: .7rem;
}
.dsa-editable-constellation-intro figcaption {
    margin-top: .5rem;
    color: var(--dsa-muted);
    font-size: .84rem;
}
.dsa-editable-constellation-copy {
    color: var(--dsa-text);
    line-height: 1.68;
}
.dsa-editable-constellation-copy > :first-child { margin-top: 0; }
.dsa-editable-constellation-copy > :last-child { margin-bottom: 0; }

.dsa-dynamic-block {
    margin-block: clamp(2rem, 4vw, 4rem);
}
.dsa-dynamic-block > .dsa-constellation-overview {
    margin-top: 0;
}

/* No fixed media box height: images remain in their natural aspect ratio. */
.dsa-telescope-image-row,
.dsa-telescope-image-row figure,
.dsa-telescope-image-row a,
.dsa-telescope-image-row img,
.dsa-telescope-editor-section .dsa-editable-image-row,
.dsa-telescope-editor-section .dsa-editable-image-item,
.dsa-telescope-editor-section .dsa-editable-image-item a,
.dsa-telescope-editor-section .dsa-editable-image-item img {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    background: transparent !important;
}
.dsa-telescope-editor-section h2 {
    margin-top: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}
.dsa-telescope-editor-section .dsa-telescope-subtitle {
    margin-top: -.3rem;
    color: var(--dsa-text);
    font-size: 1rem;
}
.dsa-telescope-editor-section .dsa-telescope-note {
    color: var(--dsa-muted);
    font-size: .94rem;
}

.dsa-constellation-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.4rem);
}
.dsa-constellation-overview .dsa-constellation-category:nth-child(n+4) {
    grid-column: span 1;
}
.dsa-constellation-category-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent;
}

.dsa-season-constellation {
    padding-block: 1rem 2.5rem;
    border-bottom: 1px solid var(--dsa-border);
}
.dsa-season-constellation:last-child { border-bottom: 0; }
.dsa-season-myth {
    width: min(100%, 520px);
    margin: 1rem 0 1.5rem;
}
.dsa-season-myth img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: .65rem;
}
.dsa-season-photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dsa-page-content .wp-block-button__link {
    border-radius: .45rem;
    background: var(--dsa-accent);
    color: #03101a;
    font-weight: 700;
    text-decoration: none;
}
.dsa-page-content .is-style-outline .wp-block-button__link {
    border: 1px solid var(--dsa-border);
    background: transparent;
    color: var(--dsa-accent);
}

@media (max-width: 980px) {
    .dsa-editable-card-grid,
    .dsa-editable-image-row,
    .dsa-constellation-overview,
    .dsa-season-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dsa-editable-constellation-intro {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 620px) {
    .dsa-editable-card-grid,
    .dsa-editable-image-row,
    .dsa-constellation-overview,
    .dsa-season-photo-grid {
        grid-template-columns: 1fr;
    }
}

/* Freely editable container and per-block spacing controls. */
.dsa-editable-content-container,
.dsa-editable-card-grid,
.dsa-editable-image-row,
.dsa-editable-constellation-intro,
.dsa-dynamic-block {
    margin-top: var(--dsa-space-top, 24px);
    margin-bottom: var(--dsa-space-bottom, 24px);
}
.dsa-editable-content-container {
    box-sizing: border-box;
    padding: 0;
}
.dsa-editable-content-container.is-panel {
    padding: var(--dsa-container-padding, 28px);
    border: 1px solid var(--dsa-border);
    border-radius: .8rem;
    background: rgba(16, 29, 40, .82);
}
.dsa-editable-content-container > :first-child { margin-top: 0; }
.dsa-editable-content-container > :last-child { margin-bottom: 0; }

.dsa-page-intro-container {
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}
.dsa-page-intro {
    max-width: none;
    margin: 0;
    color: var(--dsa-muted);
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.65;
}

/* Override earlier fixed gallery frames completely. */
.dsa-editable-image-row,
.dsa-editable-image-row figure,
.dsa-editable-image-row a,
.dsa-editable-image-row img {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    background: transparent !important;
}
