/*
 * custom.css — ALCS Ghost Theme Overrides
 * Loaded after screen.css via default.hbs:
 *   <link rel="stylesheet" href="{{asset "css/custom.css"}}">
 *
 * Sections:
 *   1. Fonts
 *   1.5 Fonts
 *   2. Navigation
 *   3. Global footer — top row
 *   4. Global footer — accent band
 *   5. Tag template layout
 *   6. Share buttons
 *   7. Utility
 */


/* ============================================================
   1. Fonts
   ============================================================ */

@font-face {
    font-family: "Roboto Slab VF";
    src: url("../fonts/RobotoSlab-VariableFont.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --gh-font-heading: "Roboto Slab VF", serif;
}




/* ============================================================
   1.5 Headr  didt oet dnieks
   ============================================================ */


/* Space between notification bar and the rest of the page */
.gh-viewport {
    margin-top: 1.5rem;
}

/* Space between nav and first content section */
.gh-navigation {
    margin-bottom: 1.5rem;
}


/* ============================================================
   2. Navigation
   ============================================================ */

/* Slightly larger, bolder nav text */
.gh-nav {
    font-size: 1.65rem;
    font-weight: 700;
}

/* Mobile: prevent scroll when nav is open */
@media (max-width: 767px) {
    body.nav-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Nav background on scroll */
.gh-nav.is-open {
    background-color: var(--background-color);
}

/* Nav links inherit white background from parent when open */
.gh-nav-inner {
    background-color: inherit;
    padding: 1rem;
}

/* Hide main content when nav is open on mobile */
@media (max-width: 767px) {
    .is-open #gh-main {
        opacity: 0;
        pointer-events: none;
    }
}


/* ============================================================
   3. Global footer — top row
   ============================================================ */

.global-footer {
    overflow-x: clip;
}

/* Show the SERVICE heading */
.global-footer .gh-container-title {
    display: block !important;
    margin-bottom: 0;
}

/* Remove the double divider — gh-container-title already has border-bottom,
   so we remove the border-top from the card row and tighten spacing */
.global-footer-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap, 42px);
    padding-top: calc(var(--grid-gap, 42px) / 2);
    padding-bottom: var(--grid-gap, 42px);
}

@media (min-width: 901px) {
    .global-footer-top .gh-card:nth-child(-n+4)::before {
        display: none;
    }
}

@media (max-width: 900px) {
    .global-footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
    .global-footer-top .gh-card:nth-child(-n+2)::before {
        display: none;
    }
    .global-footer-top .gh-card:nth-child(n+3)::before {
        display: block;
    }
    .global-footer-top .gh-card:nth-child(odd)::after {
        display: none;
    }
}

@media (max-width: 540px) {
    .global-footer-top {
        grid-template-columns: 1fr;
    }
    .global-footer-top .gh-card:nth-child(-n+1)::before {
        display: none;
    }
    .global-footer-top .gh-card:nth-child(n+2)::before {
        display: block !important;
    }
    .global-footer-top .gh-card::after {
        display: none;
    }
}

/* Tighten recommendation list spacing inside footer cards */
.global-footer-top .gh-recommendations {
    margin-top: 12px;
}

.global-footer-top .gh-recommendations .recommendations {
    gap: 14px;
}
.global-footer-top .gh-card {
    position: relative;
}

.global-footer-top .gh-card::before {
    position: absolute;
    top: calc(var(--grid-gap, 42px) / -2);
    right: calc(var(--grid-gap, 42px) / -2);
    left: calc(var(--grid-gap, 42px) / -2);
    content: "";
    height: 1px;
    background-color: var(--color-border);
}

/* Hide top border on first row at 4-col — SERVICE heading already provides one */
@media (min-width: 901px) {
    .global-footer-top .gh-card:nth-child(-n+4)::before {
        display: none;
    }
}

/* Hide top border on first row at 2-col */
@media (max-width: 900px) {
    .global-footer-top .gh-card:nth-child(-n+2)::before {
        display: none;
    }
}

/* Hide top border on first row at 1-col */
@media (max-width: 540px) {
    .global-footer-top .gh-card:first-child::before {
        display: none;
    }
}

/* Hide vertical divider on first card — nothing to its left */
.global-footer-top .gh-card:first-child::after {
    display: none;
}

.global-footer-top .gh-card::after {
    position: absolute;
    top: 0;
    left: calc(var(--grid-gap, 42px) / -2);
    content: "";
    width: 1px;
    height: 100%;
    background-color: var(--color-border);
}

/* Remove line-clamp truncation on excerpts in both footer rows */
.global-footer-accent .gh-card-excerpt,
.global-footer-top .gh-card-excerpt {
    display: block;
    overflow-y: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}


/* ============================================================
   4. Global footer — accent band (full-bleed coloured row)
   ============================================================ */

.global-footer-accent-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background: var(--ghost-accent-color);
    padding: calc(var(--gap, 2rem) * 2) max(4vmin, 20px);
}

/* Matches gh-outer + gh-inner chain of top row exactly */
.global-footer-accent {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap, 42px);
    color: #fff;
    max-width: var(--container-width, 1320px);
    margin: 0 auto;
}

@media (max-width: 900px) {
    .global-footer-accent {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .global-footer-accent {
        grid-template-columns: 1fr;
    }
}

.global-footer-accent .gh-card {
    border: none;
}

.global-footer-accent a {
    color: inherit;
}

/* Reduce the huge gap between accent band and secondary nav */
.global-footer ~ .gh-footer {
    margin-top: 0vw;
}

.gh-footer-logo,
.gh-footer-copyright {
    display: none !important;
}

.gh-footer-signup {
    display: none !important;
}

.gh-footer-bar {
    display: flex !important; 
    justify-content: center !important;
}

/* ============================================================
   5. Tag template layout
   ============================================================ */

/* Force grid children to span full width */
.gh-container.is-grid .gh-container-inner > .gh-container-title,
.gh-container.is-grid .gh-container-inner > .gh-feed,
.gh-container.is-grid .gh-container-inner > .gh-container-footer {
    grid-column: 1 / -1 !important;
}

/* Spacing below the grid */
.gh-container.is-grid .gh-container-footer {
    margin-top: 2rem;
}

/* Show "Older Posts" title */
.tag-template .gh-container.is-grid .gh-container-title {
    display: block !important;
}

/* Gap above Older Posts section */
.tag-template .gh-container.is-grid {
    margin-top: 120px;
}

/* Gap between Older Posts and footer */
.tag-template .gh-container.is-grid + .gh-footer {
    margin-top: 120px;
}

@media (max-width: 768px) {
    .tag-template .gh-container.is-grid,
    .tag-template .gh-container.is-grid + .gh-footer {
        margin-top: 60px;
    }
}

/* Always show "See all" link */
.gh-container .gh-more.is-title {
    display: block !important;
}

/* "See all" link alignment in featured block */
.tag-featured-block .gh-more {
    display: block;
    grid-column: 1 / -1;
    justify-self: start;
}

.tag-featured-block .gh-container-inner > .gh-more.is-title {
    grid-column: 1 / -1;
    margin-left: 0;
}


/* ============================================================
   6. Share buttons
   ============================================================ */

.share-block {
    display: flex;
    gap: 20px;
    align-items: center;
}

.share-btn {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    text-decoration: none;
}


.share-btn--jisc {
    background: #e85e13;
}

.share-btn--facebook {
    background: #1877F2;
}

.share-btn svg {
    width: 70%;
    height: 70%;
}

@media screen and (min-width: 960px) {
    .share-btn,
    .backtotop {
        transition: opacity 0.3s ease, filter 50ms linear, transform 0.15s ease-out;
    }

    .share-btn:hover,
    .backtotop:hover {
        transform: translateY(-2px);
        filter: drop-shadow(0 3px 1px rgba(0, 0, 0, .2));
    }
}

/* ============================================================
   7. Utility
   ============================================================ */

.gh-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 4rem auto;
    max-width: var(--content-width);
}

.has-divider {
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
    padding-top: 2rem;
}



/* ============================================================
   8. Back to Top button
   ============================================================ */


.backtotop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    outline: 2px solid var(--background-color);
    border: none;
    background: var(--ghost-accent-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.backtotop.is-visible {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================================
   9. Tag featured block spacing
   ============================================================ */

/* Reduce gap below tag header */
.tag-featured-block .gh-archive-inner {
    padding-bottom: 30px;
}

.tag-featured-block .gh-article-header {
    margin-block: 40px 32px !important;
}

.tag-featured-block .gh-content > *:last-child:not(.kg-width-full) {
    margin-bottom: 1vw !important;
 }   

/* ============================================================
   9. Stuff middle column
   ============================================================ */

    
    
    
/* Expand left column when middle is hidden */
.gh-header.is-highlight .gh-header-left--wide {
    grid-column: span 12;
}

@media (max-width: 1199px) {
    .gh-header.is-highlight .gh-header-left--wide {
        grid-column: span 6;
    }
}    


/* Wide left column — let card fill the full 12 columns */
.gh-header.is-highlight .gh-header-left--wide .gh-card {
    grid-column: span 12;
}

.gh-header.is-highlight .gh-header-left--wide {
    grid-column: span 12 !important;
}



/* ============================================================
   15. Massive middle CTA homepage
   ============================================================ */



.gh-cta-inner {
    padding-block: clamp(24px, 1.82vw + 16.73px, 40px) !important;
}