/*
Theme Name: Indie Films 2026
Theme URI:
Author: Indie Films
Description: IF goes WP
Version: 3
Text Domain: indiefilms
*/

/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: >0.3%,last 3 versions,not dead
*/

:root {
    --font-size-h1: clamp(1.375rem, 1.375rem + 1.5vw, 2.5rem);
    --font-size-h2: clamp(1.325rem, 1.325rem + 0.9vw, 2rem);
    --font-size-h3: clamp(1.3rem, 1.3rem + 0.6vw, 1.75rem);
    --font-size-h4: clamp(1.275rem, 1.275rem + 0.3vw, 1.5rem);
    --font-size-h5: 1.25rem;
    --font-size-h6: 1rem;
    --title-font-weight: 900;

    --box-shadow-sm: .15rem .25rem .5rem var(--body-bg-50);
    --box-shadow-lg: .5rem 1rem 1rem var(--body-bg-50);
}

@view-transition {
    navigation: auto;
}

img,
figure,
iframe {
    max-width: 100%;
    border-radius: .15rem;
}

figure,
iframe {
    padding-top: 1rem;
}

a {
    padding: 1px;
    color: var(--primary-color);
    font-weight: 600;
    border-radius: .15rem;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
    font-weight: var(--title-font-weight);
    text-transform: uppercase;
    letter-spacing: -.05rem;
    transform: translateX(-.1ch);

    & a {
        font-weight: var(--title-font-weight);
    }
}

h1,
.h1 {
    font-size: var(--font-size-h1);
}

h2,
.h2 {
    font-size: var(--font-size-h2);
}

h3,
.h3 {
    font-size: var(--font-size-h3);
}

h4,
.h4 {
    font-size: var(--font-size-h4);
}

h5,
.h5 {
    font-size: var(--font-size-h5);
}

h6,
.h6 {
    font-size: var(--font-size-h6);
}

body {
    min-height: 100vh;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;

    background: var(--body-bg) url('img/default-big.jpg') fixed repeat 90% 0;
    background-size: 100%;
}

.screen-reader-text,
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    -webkit-clip-path: rect(0 0 0 0);
    clip-path: rect(0 0 0 0);
    white-space: nowrap;
    border: 0
}

.skip-link {
    background-color: var(--secondary-color);
    color: var(--body-bg);
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(-100%);
    transform: translateY(-100%);
    transition: -webkit-transform ease .25s;
    transition: transform ease .25s;
    transition: transform ease .25s, -webkit-transform ease .25s;

    &:where(:focus, :focus-within, :focus-visible) {
        position: fixed !important;
        inset: 0;
        z-index: 10100;
        box-sizing: border-box;
        display: block;
        width: 100%;
        height: 2rem;
        padding: .15rem .25rem;
        margin: 0;
        -webkit-clip-path: none;
        clip-path: none;
        opacity: 1;
        visibility: visible;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

.container:not(.section) {
    max-width: 1400px;
    margin: 0 auto;
    padding-inline: 1rem;
}

.wp-singular:not(.home) main .container {
    max-width: 65ch;
    margin-inline: auto;

    @media (width > 768px) {
        padding-inline: 0;
    }
}

.container-md {
    max-width: 65ch;
    margin-inline: auto;
}

header {
    position: relative;
    min-height: max(25vh, 200px);

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    @media (width > 992px) {
        & .navbar-toggler {
            display: none;
        }
    }

    &::after {
        content: '';
        width: 100%;
        height: 1rem;
        background: transparent url('img/perforations.svg') repeat-x 50% 100%;
        background-size: contain;
        z-index: 2;
    }
}

.navbar {
    position: fixed;
    inset: 0 0 auto;
    margin: 0 auto;
    z-index: 10;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: start;
    justify-content: space-between;

    & .site-title {
        position: absolute;
        inset: 0 auto auto 1rem;
        z-index: 10;
        padding: 0 1rem;
        line-height: 1;
        visibility: hidden;
        opacity: 0;
        box-shadow: var(--box-shadow-sm);
        border-radius: 0 0 .15rem .15rem;
        transform: translateY(-50%);
        transition: transform ease-in .5s;

        & .navbar-brand {
            display: block;
            padding: 0;
            background: none;
        }

        & img {
            width: 4rem;
            height: auto;
            padding: 1rem 0.25rem;
            background-color: var(--body-bg);
            border-radius: 0;

            @media (width > 768px) {
                width: 5rem;
            }
        }

        .fixed & {
            visibility: visible;
            opacity: 1;
            z-index: 1;
            transform: translateY(0);
        }
    }

    & .navbar-toggler {
        margin-top: 1rem;
        margin-left: auto;
        width: 2.2rem;
        height: 2.2rem;
        padding: .25rem;
        border: 0;
        align-content: center;
        background-color: var(--body-bg-50);

        border-radius: 100%;
        transition: all ease .25s;

        anchor-name: --toggler;

        &:where(:hover, :focus, :focus-within, :focus-visible) {
            -webkit-transform: scale(1.1);
            transform: scale(1.1);
        }

        & .hamburger-icon {
            width: clamp(1rem, 1rem + 1vw, 1.2rem);
            height: clamp(1rem, 1rem + 1vw, 1.2rem);
            fill: var(--body-color);

            & .top,
            & .bottom {
                transition: all .25s ease;
            }
        }

        & .navbar-toggler:where(:hover, :active, :focus, :focus-within, :focus-visible) {
            @media (hover: hover) {
                -webkit-transform: scale(1.15);
                transform: scale(1.15);
            }

            & .top,
            & .bottom {
                -webkit-transform-origin: center;
                transform-origin: center;
            }
        }

        @media (width >=576px) {
            display: none;
        }
    }
}

.navbar-toggler[aria-expanded="true"] {

    & .top {
        -webkit-transform: rotate(45deg) translate(4px, -5px);
        transform: rotate(45deg) translate(4px, -5px);
    }

    & .bottom {
        -webkit-transform: rotate(-45deg) translate(-10px, -2px);
        transform: rotate(-45deg) translate(-10px, -2px);
    }

    & .middle {
        opacity: 0;
    }
}

.no-js .site-title {
    visibility: visible;
    opacity: 1;
    z-index: 1;
}

.navmenu {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-left: auto;

    @media (width < 576px) {
        display: none;

        &.collapsed {
            position: absolute;
            position-anchor: --article-figure;
            top: anchor(--toggler bottom);
            right: anchor(--toggler right);
            display: flex;
            flex-direction: column;
            padding-inline: 1rem;
            border-radius: .15rem;
            -webkit-animation: navitranslate .5s cubic-bezier(0.390, 0.575, 0.565, 1.000) forwards;
            animation: navitranslate .5s cubic-bezier(0.390, 0.575, 0.565, 1.000) forwards;
        }
    }

    & ul {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;

        .collapsed & {
            flex-direction: column;
            align-items: end;
            box-shadow: var(--box-shadow-lg);
        }
    }

    & a {
        --gradient-1: var(--primary-color);
        --gradient-2: var(--body-bg-10);
        display: block;
        padding-inline: 0.15rem;
        font-size: clamp(.75rem, .75rem + .5vw, .875rem);
        line-height: 3;
        background-color: transparent;
        color: var(--body-bg);
        text-transform: uppercase;
        font-weight: 900;
        border-radius: 0;

        @media (width >=768px) {
            padding-inline: .5rem;
            font-size: 1rem;
        }

        .highlight-img-darker & {
            color: var(--body-color);
            --gradient-2: var(--body-bg-25);
        }

        .fixed & {
            --gradient-2: var(--body-bg);
            color: var(--body-color);
        }

        &:where(:hover, :active, :focus) {
            color: var(--body-color);
        }

        .collapsed & {
            display: block;
            width: 100%;
            min-width: 8rem;
            padding-inline: .5rem;
            text-align: right;
            background-color: var(--body-bg);
            color: var(--body-color);
            --gradient-2: var(--body-bg);
        }
    }

    @media (width >=768px) {
        & li:first-child a {
            border-bottom-left-radius: .15rem;

            .collapsed & {
                border-radius: .15rem .15rem 0 0;
            }
        }

        & ul+ul li:first-child a {
            border-radius: 0;
        }

        & ul+ul li a {
            border-radius: 0 0 .15rem 0;
        }
    }
}

@-webkit-keyframes navitranslate {
    0% {
        opacity: 0;
        -webkit-transform: translateY(-10%);
        transform: translateY(-10%);
    }

    10% {
        opacity: 0;
        -webkit-transform: translateY(-10%);
        transform: translateY(-10%);
    }

    100% {
        opacity: 1;
        -webkit-transform: translateY(0%);
        transform: translateY(0%);
    }
}

@keyframes navitranslate {
    0% {
        opacity: 0;
        -webkit-transform: translateY(-10%);
        transform: translateY(-10%);
    }

    10% {
        opacity: 0;
        -webkit-transform: translateY(-10%);
        transform: translateY(-10%);
    }

    100% {
        opacity: 1;
        -webkit-transform: translateY(0%);
        transform: translateY(0%);
    }
}

.hero {
    position: relative;
    z-index: 1;
    margin-block: auto 0;

    & .hero-caption {
        display: flex;
        flex-direction: column;
        justify-content: end;
        margin-bottom: .5rem;
    }

    & .hero-headline {
        display: block;
        width: -webkit-fit-content;
        width: -moz-fit-content;
        width: fit-content;
        margin-block: 0;
        line-height: 1;
        font-size: clamp(2rem, 2rem + 2.5vw, 5rem);
        color: var(--body-bg);
        letter-spacing: -.05rem;
        transition: background-position ease .5s;

        .highlight-img-darker & {
            color: var(--body-color);
        }

        & a {
            color: var(--body-bg);
            --gradient-1: var(--primary-color);
            --gradient-2: var(--body-bg);

            .highlight-img-darker & {
                color: var(--body-color);
                --gradient-1: var(--primary-color);
                --gradient-2: var(--body-color);
            }
        }
    }

    & .hero-desc {
        margin-bottom: 0;
        line-height: 1;
        color: var(--body-bg);

        .highlight-img-darker & {
            color: inherit;
        }

    }
}

.header-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    background-color: var(--body-color-50);
    -webkit-filter: blur(1rem);
    filter: blur(1rem);
}

@supports (-webkit-backdrop-filter: blur(1rem)) or (backdrop-filter: blur(1rem)) {
    .header-bg {
        position: fixed;
        -webkit-filter: none;
        filter: none;
        background-color: transparent;
        -webkit-backdrop-filter: blur(1rem);
        backdrop-filter: blur(1rem);
    }
}

#content,
main [id] {
    scroll-margin-top: 4rem;
}

main {
    position: relative;
    background-color: var(--body-bg);
    background-image: url('img/ssscribble.svg');
    margin-bottom: 1rem;
    z-index: 1;

    &::after {
        content: '';
        position: absolute;
        inset: auto 0 -1rem;
        display: block;
        width: 100%;
        height: 1rem;
        height: 1rem;
        background: transparent url('img/perforations.svg') repeat-x 50% 100%;
        background-size: contain;
    }

    & ul {
        list-style: square outside url('img/gray.svg');
        padding-left: 1rem;

        & ul {
            list-style: square outside;
        }

        & ol {
            margin-top: .5rem;
        }
    }

    & ol {
        padding-left: 0;
        counter-reset: item;
    }

    & li {
        line-height: 1.4;
        margin-bottom: .5rem;
        padding-left: .5rem;
    }

    & ol ul {
        padding-left: 2.5rem;
    }

    & ol>li {
        display: block;

        &::before {
            content: counters(item, ".") ". ";
            counter-increment: item;
        }
    }

    & figcaption {
        margin-top: 0 !important;
        padding: .5rem;
        line-height: 1.4;
        text-align: center;
        font-size: .9rem;
        font-style: italic;
        z-index: 1;
    }
}

section,
.section {
    padding-block: 1.5rem;

    @media (width > 768px) {
        padding-block: 3rem;
    }

    & .section-title {
        margin-bottom: 1.5rem;

        & a {
            --gradient-1: var(--body-color);
            --gradient-2: var(--primary-color);
        }
    }
}

.article-grid {
    display: grid;
    grid-template-rows: repeat(1, 1fr);
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    row-gap: 1.5rem;

    @media (width > 768px) {
        gap: 1.5rem;
        row-gap: 3rem;
    }
}

.article-grid article {
    grid-column: auto/span 12;

    position: relative;
    overflow: hidden;
    border-radius: .15rem;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    @media (width > 568px) {
        grid-column: auto/span 6;
    }

    @media (width > 768px) {
        grid-column: auto/span 4;
    }

    @media (width > 1400px) {
        grid-column: auto/span 3;
    }

    @media (prefers-reduced-motion: no-preference) {
        transition: all calc(var(--transition-speed) * 2) var(--transition-style);
    }

    & .article-link {
        padding: 0;
    }

    & .article-headline {
        position: absolute;
        inset: auto 0 0;
        margin: 0;
        padding: .5rem;
        background-color: var(--body-bg-50);
        font-size: var(--font-size-h6);
        transform: none;
    }

    & img {
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 10;
        -o-object-fit: cover;
        object-fit: cover;
        -o-object-position: 50% 0;
        object-position: 50% 0;
    }
}

.news article,
.error404 article {
    display: grid;
    grid-template-rows: auto;
    gap: 2cqw;
    row-gap: 1rem;

    &+article {
        margin-top: 3rem;
    }

    @media (width > 768px) {
        grid-template-columns: 40% 1fr;
        grid-template-rows: 1fr;
    }

    & .news-headline {
        padding-top: 0;
    }

    & p {
        margin-bottom: 0;
    }

    & .news-img {
        position: relative;
        height: 100%;

        & img {
            inset: 0;
            width: 100%;
            height: 100%;
            -o-object-fit: cover;
            object-fit: cover;
            -o-object-position: 50% 0;
            object-position: 50% 0;

            @media (width > 768px) {
                position: absolute;
            }
        }
    }

    & .has-default-img {
        width: 100%;
        height: 100%;

        & a {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }

        & .default-img {
            position: relative;
            width: 50%;
            height: 50%;
            -o-object-fit: contain;
            object-fit: contain;
            -o-object-position: 50% 50%;
            object-position: 50% 50%;
        }

    }
}

article h2:not(.article-title) {
    padding-top: 3rem;
}

article h3:not(.article-title) {
    padding-top: 1.5rem;
}

article h4:not(.article-title) {
    padding-top: .75rem;
}

time {
    font-size: .9rem;
}

.navigation {
    margin-top: 3rem;

    .section-title+& {
        margin-block: 0 3rem;
    }

    .page-numbers:not(.prev, .next) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.6rem;
        height: 100%;
        aspect-ratio: 1 / 1;
        background-color: var(--primary-color);
        color: var(--body-color);
        font-size: 90%;
        border-radius: 100%;

        --gradient-1: var(--body-color);

        &:where(:hover, :active, :focus) {
            color: var(--body-bg);
        }

        &.current {
            color: var(--body-bg);
            background-color: var(--body-color);
        }
    }
}

.post-navigation .nav-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2ch;
    line-height: 1.2;
    -webkit-hyphens: none;
    hyphens: none;
    text-wrap: balance;

    & a {
        display: inline-block;
        padding: .5rem .5rem .5rem 3rem;
        color: var(--body-color);

        corner-shape: bevel round round bevel;
        border-radius: 3rem .15rem .15rem 3rem / 50% .15rem .15rem 50%;
    }

    & .nav-previous a {
        background-image: linear-gradient(to left, var(--gradient-1), var(--gradient-1) 50%, var(--gradient-2) 50%);
        background-position: 0;

        &:hover {
            background-position: 100%;
        }
    }

    & .nav-next a {
        text-align: end;
        padding: .5rem 3rem .5rem .5rem;
        corner-shape: round bevel bevel round;
        border-radius: .15rem 3rem 3rem .15rem / .15rem 50% 50% .15rem;
    }
}

footer {
    position: relative;
    z-index: 1;
    padding: 3rem 1rem;
    display: flex;
    justify-content: center;
    align-items: start;
    gap: .75rem;
    color: var(--body-bg);
    font-size: .9rem;

    .highlight-img-darker & {
        color: inherit;
    }

    & .section-headline {
        color: var(--body-bg);
        margin-bottom: 0;

        .highlight-img-darker & {
            color: inherit;
        }
    }

    & .footer-img {
        position: relative;
        padding-inline: .75rem;
    }

    & img {
        width: 6rem;
        height: auto;
        padding: 1rem .5rem;
        background-color: var(--body-bg);
        border: .25rem solid #000;
        border-inline: none;
        border-radius: 0;
    }

    & ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    & li {
        margin: 0;
        line-height: 1.7;
        white-space: nowrap;
    }

    & a {
        display: block;
        /* padding-block: .25rem; */
    }
}

a,
.linkhover,
.article-headline {
    --gradient-2: transparent;
    --gradient-1: var(--primary-color);

    background-image: linear-gradient(to right, var(--gradient-1), var(--gradient-1) 50%, var(--gradient-2) 50%);
    background-size: 300%;
    background-position: 100%;

    .article-link & {
        --gradient-1: var(--primary-color);
        --gradient-2: var(--body-bg-10);
    }

    @media (prefers-reduced-motion: no-preference) {
        transition: all .5s ease-out;
    }

    @media (hover: hover) {

        .article-link:where(:hover, :active, :focus, :focus-within) &,
        &:where(:hover, :active, :focus, :focus-within, :focus-visible) {
            background-position: 0;
        }
    }

    & a,
    &.textfill {
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.site-title,
.navmenu.collapsed,
.footer-img {

    &::before,
    &::after {
        content: '';
        display: inline-block;
        position: absolute;
        inset: 0 auto 0 0;
        width: 1rem;
        background: url('img/perforations-y.svg') repeat 50% 0;
        background-size: 74%;
        border-radius: 0 0 0 .15rem;
    }

    &::after {
        inset: 0 0 0 auto;
        border-radius: 0 0 .15rem 0;
        z-index: -1;
    }
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;

    width: -webkit-fit-content;

    width: -moz-fit-content;

    width: fit-content;
    margin-top: 3rem;
    background-color: var(--body-color);
    border-radius: .15rem;

    & input {
        min-width: 30ch;
        padding: .5rem;
        background-color: transparent;
        border: none;
        outline-color: transparent;

        &.search-submit {
            min-width: 1ch;
            background-color: var(--primary-color);
            border-radius: 0 .15rem .15rem 0;
        }
    }

    & label {
        position: absolute;
        inset: .5rem 0 0 .5rem;
        width: -webkit-fit-content;
        width: -moz-fit-content;
        width: fit-content;
        height: -webkit-fit-content;
        height: -moz-fit-content;
        height: fit-content;
        color: var(--body-bg-50);
        transition: all ease-in-out .5s;
    }

    & .search-field:where(:focus, :focus-within, :focus-visible) {
        color: var(--body-bg);
        border-radius: .1rem 0 0 .1rem;
        outline-offset: 0;
    }

    & .search-field:where(:focus, :focus-within)+label {
        inset: -1.5rem 0 0 .5rem;
        font-size: .875rem;
        color: var(--body-color);
    }
}

/* WP */
.wp-block-media-text {
    margin-block: 1rem;
}

.wp-embed-aspect-16-9 iframe {
    height: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    object-fit: cover;
}

/* Plugins */

.bogo-language-switcher {

    & .current,
    span.bogo-language-name {
        display: none;
    }
}