/*
 Theme Name:   Astra Promotie
 Theme URI:    https://www.svpromotie.nl
 Description:  Child theme voor Schaakvereniging Promotie Zoetermeer
 Author:       SV Promotie
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-promotie
*/

/* ── Gedeelde CSS-variabelen ── */
:root {
    --svpromotie-header-height: 90px;       /* hoogte van de sticky header; pas hier aan bij themawijziging */
    --ast-normal-container-width: 1400px;   /* overschrijft Astra's standaard van 1200px */
    --svpromotie-brand-green: #99cc00;      /* huisstijlkleur groen */
    --svpromotie-brand-green-dark: #7aaa00; /* hover-variant */
}

/* ── Zijmarges ── */
/* Child theme laadt na parent theme CSS — geen !important nodig tegen statische Astra CSS */
.ast-container,
.ast-container-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

/* ── Sticky header ── [ASTRA-SPECIFIC: #masthead] ── */
/* overflow-x:clip allows position:sticky to work; clip is not supported on iOS<16 so
   we also add a -webkit-sticky fallback for old Safari. On browsers that don't support
   clip the header degrades gracefully to non-sticky. */
body {
    overflow-x: clip;
}
#masthead {
    position: -webkit-sticky; /* iOS < 13 */
    position: sticky;
    top: 0;
    z-index: 999;
}

/* ── Compacte tabellen in post-content ── */
.entry-content table {
    table-layout: auto;
    width: auto;
    border-collapse: collapse;
}
.entry-content td,
.entry-content th {
    padding: 3px 6px;
    vertical-align: top;
}
.entry-content td p,
.entry-content th p {
    margin: 0;
}

/* ── Reduce top padding on mobile ── */
@media (max-width: 700px) {
    .ast-separate-container #primary {
        padding-top: 3rem;
    }
}

/* ── Columns page: full-width, no sidebar ── */
.page-template-page-columns-blog #secondary { display: none; }
.page-template-page-columns-blog #primary   { width: 100%; }

/* ── Sticky sidebar (positie) ── */
/* Afmetingen en padding worden via svPromotie-Core inline CSS gezet,
   na Astra's dynamische CSS — zie svPromotie-Core.php wp_enqueue_scripts@100 */
@media (min-width: 922px) {
    #secondary.widget-area {
        position: sticky;
        top: var(--svpromotie-header-height);
        align-self: flex-start;
        max-height: calc(100vh - var(--svpromotie-header-height) - 20px);
        overflow-y: auto;
    }
}
