/* Reset, element defaults, the grid container, the page rhythm (acts and flow),
   headings and rich text in pages. */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Reset WordPress default block spacing for our custom layout */
:where(.wp-block-group.is-layout-flow)> :where(section) {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

html {
    font-family: var(--font-sans);
    font-size: 100%;
    line-height: 1.6;
    background-color: var(--ink);
    color: var(--paper);
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* An <img> that fills its box like background-size: cover with a centred focus. */
.cover-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-normal) ease;
}

ul,
ol {
    list-style: none;
}

p {
    margin-bottom: var(--space-sm);
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 2000;
    padding: var(--space-xs) var(--space-sm);
    background: var(--gold);
    color: var(--ink);
    font-weight: 600;
}

.skip-link:focus {
    top: var(--space-xs);
}

/* The grid container: the same outer edge on every page, header and footer included. */
.container {
    width: min(100% - 2 * var(--gutter), var(--content-max));
    margin-inline: auto;
}

/* ---------- Page rhythm (docs/redesign.md §3.7) ----------
   A page has three acts: the curtain (photo hero), the stage (content on one
   surface) and the foyer (footer.php). The background only changes between acts.
   Inside an act, .flow spaces its sections; sections carry no vertical padding. */

.act {
    padding-block: var(--section);
    /* Photos may bleed to the edge of the screen, never beyond it. */
    overflow-x: clip;
}

.act--paper {
    background-color: var(--paper);
    color: var(--ink);
}

.act--ink {
    background-color: var(--ink);
    color: var(--paper);
}

.flow > * + * {
    margin-block-start: var(--section);
}

/* Section heading: belongs to its content, on the left edge. */
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-md);
    margin-bottom: var(--heading-gap);
}

.section-heading {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-style: italic;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: var(--heading-gap);
}

/* The gold rule: the signature under every section heading. */
.section-heading::after {
    content: '';
    display: block;
    width: 3rem;
    height: 2px;
    margin-top: var(--space-sm);
    background-color: var(--gold);
}

.section-head .section-heading {
    margin-bottom: 0;
}

.section-link {
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.3em;
    text-decoration-thickness: 1px;
}

.section-link {
    text-decoration-color: var(--gold);
}

.section-link:hover {
    color: var(--gold-ink);
}

.act--ink .section-link:hover {
    color: var(--gold);
}

@media (min-width: 1024px) {
    .section-heading {
        font-size: var(--text-4xl);
    }
}

.page-lead {
    max-width: var(--measure);
    font-size: var(--text-lg);
    color: var(--smoke);
}

/* Running text: one measure, always left-aligned. */
.prose {
    max-width: var(--measure);
}

/* ---------- Rich text in pages and show descriptions ---------- */

.entry-text-style {
    max-width: var(--measure);
    font-size: var(--text-base);
    line-height: 1.7;
}

.entry-text-style--full {
    max-width: none;
}

.entry-text-style p,
.entry-text-style ul,
.entry-text-style ol {
    margin-bottom: var(--space-sm);
}

.entry-text-style ul,
.entry-text-style ol {
    padding-left: var(--space-md);
}

.entry-text-style ul {
    list-style-type: disc;
}

.entry-text-style ol {
    list-style-type: decimal;
}

.entry-text-style li {
    margin-bottom: var(--space-2xs);
}

.entry-text-style strong,
.entry-text-style b {
    font-weight: 600;
}

.entry-text-style a {
    text-decoration: underline;
    text-underline-offset: 0.25em;
    text-decoration-thickness: 1px;
}

.entry-text-style a {
    text-decoration-color: var(--gold);
}

.entry-text-style a:hover {
    color: var(--gold-ink);
}

.entry-text-style h1,
.entry-text-style h2,
.entry-text-style h3 {
    font-family: var(--font-sans);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.entry-text-style > :first-child {
    margin-top: 0;
}

.entry-text-style h1,
.entry-text-style h2 {
    font-size: var(--text-xl);
}

.entry-text-style h3 {
    font-size: var(--text-lg);
}

.post-date {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--smoke);
}


.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md) var(--space-lg);
    margin-top: var(--space-xl);
}

/* A photo across the full width (template-parts: .photo-fill with --fill from
   derf_photo_fill()). On a very wide screen it stops at --photo-max and its
   sides fade into a blurred, darker copy of itself, so the gradients laid
   over it still run the full width. Its container is positioned and clipped
   by its section; [src] outweighs a design's own `.x img` width. 150rem is
   --photo-max. */
@media (min-width: 150rem) {
    .photo-fill::before {
        content: '';
        position: absolute;
        inset: -3rem;
        background: var(--fill) center / cover;
        filter: blur(2.5rem) brightness(0.75);
    }

    .photo-fill > img[src] {
        position: relative;
        display: block;
        width: var(--photo-max);
        margin-inline: auto;
        mask-image: var(--photo-fade);
    }
}
