/*
Theme Name: Θεματοφύλακας
Description: Θέμα blocks για τον Θεματοφύλακα του Ελληνικού Ποδοσφαίρου.
Version: 0.6.1
Requires at least: 6.6
Text Domain: thematofylakas
*/

.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
    min-block-size: 100dvh;
}

.wp-site-blocks > .thematofylakas-content {
    flex: 1;
}

.thematofylakas-header {
    border-block-end: 3px solid var(--wp--preset--color--gold);
}

.thematofylakas-footer {
    border-block-start: 3px solid var(--wp--preset--color--gold);
}

.thematofylakas-masthead {
    min-block-size: 100px;
    padding-block: 1rem;
    gap: 1rem;
}

.thematofylakas-masthead {
    position: relative;
}

.thematofylakas-header-controls {
    flex: none;
    gap: .55rem;
}

.thematofylakas-header-search {
    inline-size: 44px;
    min-block-size: 44px;
}

.thematofylakas-search-form .wp-block-search__inside-wrapper {
    gap: .5rem;
}

.thematofylakas-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
    position: absolute;
    z-index: 10;
    inset-block-start: calc(100% + 3px);
    inset-inline-end: 0;
    inline-size: min(100%, 30rem);
    box-sizing: border-box;
    gap: .5rem;
    padding: .75rem;
    color: var(--wp--preset--color--light);
    background: var(--wp--preset--color--ink);
    border-block-end: 3px solid var(--wp--preset--color--gold);
}

.thematofylakas-header-search .wp-block-search__button,
.thematofylakas-search-form .wp-block-search__button {
    margin-inline-start: 0;
    min-block-size: 44px;
}

.thematofylakas-header-search .wp-block-search__button {
    inline-size: 44px;
    min-inline-size: 44px;
    padding: .5rem;
    color: var(--wp--preset--color--light);
    background: transparent;
    border: 1px solid #77786c;
}

.thematofylakas-search-form {
    max-inline-size: 36rem;
}

.thematofylakas-search-form .wp-block-search__button {
    flex: none;
    padding: .5rem .85rem;
    white-space: nowrap;
    color: var(--wp--preset--color--light);
    background: var(--wp--preset--color--ink);
}

.thematofylakas-header-search .wp-block-search__input,
.thematofylakas-search-form .wp-block-search__input {
    min-inline-size: 0;
    color: var(--wp--preset--color--ink);
    background: var(--wp--preset--color--light);
    border: 1px solid #77786c;
}

.thematofylakas-header-search .wp-block-search__input::placeholder,
.thematofylakas-search-form .wp-block-search__input::placeholder {
    color: var(--wp--preset--color--muted);
    opacity: 1;
}

.thematofylakas-brand {
    min-inline-size: 0;
    gap: .75rem;
}

.thematofylakas-brand .thematofylakas-crest {
    flex: none;
    inline-size: 62px;
    margin: 0;
}

.thematofylakas-crest img {
    display: block;
    max-inline-size: 100%;
    height: auto;
    border-radius: 50%;
}

.thematofylakas-footer-row .thematofylakas-crest {
    inline-size: 50px;
}

.thematofylakas-footer-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1.5rem 2rem;
    padding-block: 1.5rem;
}

.thematofylakas-footer-row > * {
    min-inline-size: 0;
    margin-block: 0;
}

.thematofylakas-footer-row .thematofylakas-footer-heading {
    font: 700 1rem/1.4 var(--wp--preset--font-family--sans);
    margin-block: 0 .65rem;
}

.thematofylakas-footer-row > .wp-block-group > * + * {
    margin-block-start: .65rem;
}

.thematofylakas-footer-programme {
    display: block;
    background: #fff;
    padding: .5rem;
}

.thematofylakas-footer-programme img {
    display: block;
    inline-size: 100%;
    block-size: auto;
}

.thematofylakas-footer-funding-text {
    font-size: .875rem;
    line-height: 1.45;
}

.thematofylakas-footer-social .wp-social-link {
    color: var(--wp--preset--color--light);
}

.thematofylakas-footer-social .wp-social-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.75rem;
    min-inline-size: 2.75rem;
}

.thematofylakas-footer-credits {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 1.25rem;
    padding-block: .5rem;
    border-block-start: 1px solid var(--wp--preset--color--muted);
    font-size: .875rem;
}

.thematofylakas-footer .thematofylakas-footer-credits p {
    margin: 0;
}

.thematofylakas-footer-credits a {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
}

.thematofylakas-wordmark {
    max-inline-size: 20rem;
    font-size: clamp(1.0625rem, 1.8vw, 1.55rem);
    font-weight: 700;
    line-height: 1.18;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.thematofylakas-header a,
.thematofylakas-footer a {
    color: inherit;
}

.thematofylakas-wordmark a {
    text-decoration: none;
}

.thematofylakas-info-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
}

.thematofylakas-info-links a {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    text-underline-offset: .2em;
}

.thematofylakas-navigation {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .025em;
}

.thematofylakas-navigation .wp-block-navigation__container {
    gap: clamp(.75rem, 2.4vw, 2rem);
}

.thematofylakas-navigation a:hover {
    color: var(--wp--preset--color--gold);
}

.thematofylakas-navigation .wp-block-navigation__responsive-container-open,
.thematofylakas-navigation .wp-block-navigation__responsive-container-close {
    min-inline-size: 44px;
    min-block-size: 44px;
    align-items: center;
    justify-content: center;
}

.thematofylakas-content {
    min-block-size: 45vh;
    padding-block: clamp(1.5rem, 5vw, 4rem);
    overflow-wrap: anywhere;
}

.thematofylakas-posts > li + li {
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--wp--preset--color--line);
}

.thematofylakas-list-page > .thematofylakas-query-results {
    margin-block-start: 2.5rem;
}

.thematofylakas-query-results .thematofylakas-pagination {
    padding-block-start: 1rem;
}

.thematofylakas-pagination .wp-block-query-pagination-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.thematofylakas-pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-inline-size: 2rem;
    min-block-size: 2rem;
}

.thematofylakas-pagination .page-numbers.current {
    font-weight: 700;
    border: 1px solid var(--wp--preset--color--muted);
}

.thematofylakas-recovery-link a {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.thematofylakas-home,
.thematofylakas-article-page {
    padding-block-start: clamp(1.25rem, 3.25vw, 3rem);
}

.thematofylakas-funding {
    box-sizing: border-box;
    max-inline-size: var(--wp--style--global--wide-size);
    margin-inline: auto;
    padding: .75rem clamp(.65rem, 2vw, 1.5rem) .5rem;
    background: #fff;
    color: var(--wp--preset--color--ink);
}

.thematofylakas-funding-banner {
    display: block;
    width: 100%;
    height: auto;
}

.thematofylakas-funding-programme {
    display: block;
}

.thematofylakas-funding > .thematofylakas-funding-text {
    margin-block: .35rem 0;
    font-size: .875rem;
    line-height: 1.45;
}

@media (min-width: 62rem) {
    .thematofylakas-funding-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

.thematofylakas-lead {
    display: grid;
    color: var(--wp--preset--color--light);
    background: var(--wp--preset--color--dark);
}

.thematofylakas-lead:has(> .thematofylakas-lead-image) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.48fr);
}

.thematofylakas-lead-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: .85rem;
    padding: clamp(1.5rem, 3.7vw, 3.75rem);
}

.thematofylakas-lead > .thematofylakas-lead-image {
    position: relative;
    min-block-size: 30rem;
}

.thematofylakas-lead-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 52% 58%;
}

.thematofylakas-lead-copy > *,
.thematofylakas-lead > .thematofylakas-lead-image,
.thematofylakas-story-meta > * {
    margin: 0;
}

.thematofylakas-lead h1 {
    max-inline-size: 22ch;
    font-size: clamp(2rem, 3.6vw, 3.45rem);
    letter-spacing: -.04em;
    text-wrap: balance;
}

.thematofylakas-lead .wp-block-post-excerpt {
    max-inline-size: 38ch;
}

.thematofylakas-category-label {
    color: var(--wp--preset--color--gold-ink);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.thematofylakas-category-label a {
    color: inherit;
    text-decoration: none;
}

.thematofylakas-category-label a:hover {
    text-decoration: underline;
    text-underline-offset: .18em;
}

.thematofylakas-lead .thematofylakas-category-label {
    padding-block-start: .45rem;
    border-block-start: 2px solid currentColor;
}

.thematofylakas-lead .thematofylakas-category-label,
.thematofylakas-lead .thematofylakas-lead-link {
    color: var(--wp--preset--color--gold);
}

.thematofylakas-lead .thematofylakas-lead-link {
    margin-block-start: .75rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .25em;
}

.thematofylakas-lead-link::after {
    margin-inline-start: .45rem;
    content: "→" / "";
}

.thematofylakas-home > .thematofylakas-home-section {
    margin-block-start: clamp(2.5rem, 5vw, 4.5rem);
}

.thematofylakas-section-heading {
    padding-block-start: .6rem;
    border-block-start: 2px solid var(--wp--preset--color--ink);
    letter-spacing: -.025em;
}

.thematofylakas-latest,
.thematofylakas-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.15rem, 2.7vw, 2rem);
}

.thematofylakas-latest > .wp-block-post,
.thematofylakas-categories > .thematofylakas-category {
    margin-block-start: 0;
}

.thematofylakas-card {
    padding-block-end: 1rem;
    border-block-end: 1px solid var(--wp--preset--color--line);
}

.thematofylakas-card > * + *,
.thematofylakas-category > * + * {
    margin-block-start: .5rem;
}

.thematofylakas-card .wp-block-post-title {
    font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.thematofylakas-card .wp-block-post-title a {
    text-decoration: none;
}

.thematofylakas-card .wp-block-post-title a:hover {
    text-decoration: underline;
}

.thematofylakas-category {
    padding-block: 1rem;
    border-block: 1px solid var(--wp--preset--color--line);
}

.thematofylakas-category h3 {
    font-size: 1.25rem;
}

.thematofylakas-category .wp-block-post + .wp-block-post {
    margin-block-start: .45rem;
}

.thematofylakas-article-layout {
    display: grid;
    gap: clamp(2rem, 5.5vw, 5rem);
}

.thematofylakas-article-layout:has(.thematofylakas-related .wp-block-post) {
    grid-template-columns: minmax(0, 3.25fr) minmax(0, 1fr);
}

.thematofylakas-article {
    min-inline-size: 0;
}

.thematofylakas-story-navigation {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--muted);
}

.thematofylakas-story-navigation .wp-block-home-link::before {
    margin-inline-end: .4rem;
    content: "←" / "";
}

.thematofylakas-story-header > * + * {
    margin-block-start: .8rem;
}

.thematofylakas-story-header h1 {
    font-size: clamp(2rem, 5.3vw, 4.8rem);
    letter-spacing: -.04em;
    text-wrap: balance;
}

.thematofylakas-story-deck {
    max-inline-size: 52ch;
    color: var(--wp--preset--color--muted);
    font-size: clamp(1rem, 2vw, 1.24rem);
}

.thematofylakas-story-meta {
    gap: .35rem .95rem;
    padding-block: .75rem;
    border-block: 1px solid var(--wp--preset--color--line);
    font-size: var(--wp--preset--font-size--small);
}

.thematofylakas-story-meta .wp-block-post-author-name {
    font-weight: 700;
}

.thematofylakas-article > .wp-block-post-content {
    max-inline-size: 65ch;
}

.thematofylakas-related {
    padding-block-start: 3rem;
}

.thematofylakas-related:not(:has(.wp-block-post)) {
    display: none;
}

.thematofylakas-related .thematofylakas-section-heading {
    font-size: 1.5rem;
}

.thematofylakas-related .thematofylakas-card .wp-block-post-title {
    font-size: 1.16rem;
}

.thematofylakas-related .wp-block-post + .wp-block-post {
    margin-block-start: 1.15rem;
}

:focus-visible {
    outline: 3px solid var(--wp--preset--color--gold-ink);
    outline-offset: 3px;
}

.thematofylakas-header :focus-visible,
.thematofylakas-footer :focus-visible,
.thematofylakas-lead :focus-visible {
    outline-color: var(--wp--preset--color--gold);
}

@media (max-width: 1024px) {
    .thematofylakas-masthead {
        min-block-size: 77px;
        padding-block: .75rem;
    }

    .thematofylakas-masthead .thematofylakas-crest {
        inline-size: 42px;
    }

    .thematofylakas-header-controls {
        gap: .25rem;
    }

    .thematofylakas-masthead .wp-block-navigation__responsive-container-open:not(.always-shown) {
        display: flex;
    }

    .thematofylakas-masthead .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none;
    }
}

@media (max-width: 360px) {
    .thematofylakas-masthead .thematofylakas-crest {
        display: none;
    }
}

@media (max-width: 800px) {
    .thematofylakas-lead:has(> .thematofylakas-lead-image),
    .thematofylakas-article-layout:has(.thematofylakas-related .wp-block-post) {
        grid-template-columns: minmax(0, 1fr);
    }

    .thematofylakas-lead > .thematofylakas-lead-image {
        grid-row: 1;
        min-block-size: 0;
        aspect-ratio: 16 / 9;
    }

    .thematofylakas-related {
        padding-block-start: 0;
    }

    .thematofylakas-related .wp-block-post-template {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .thematofylakas-related .wp-block-post + .wp-block-post {
        margin-block-start: 0;
    }
}

@media (max-width: 550px) {
    .thematofylakas-latest,
    .thematofylakas-categories {
        grid-template-columns: minmax(0, 1fr);
    }
}
