/*
===========================================================
 Governance Publishing
 Layout CSS
 Baseline 0.1
===========================================================
*/

.gp-workshop {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 3vh 1.5rem 6vh;
}

.gp-page {
    width: min(var(--gp-page-width), 94vw);
    background: var(--gp-paper);
    padding: clamp(2rem, 5vw, 4.5rem);
    box-shadow: var(--gp-shadow);
}

.gp-centered {
    text-align: center;
}

.gp-title {
    margin-top: 0;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
}

.gp-subtitle {
    font-size: 1.25rem;
    color: var(--gp-text-light);
    margin-bottom: 4rem;
}

.gp-quote {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.25rem;
}

.gp-action {
    display: inline-block;
    margin-top: 3rem;
    padding: 1rem 2.5rem;
    border: 1px solid var(--gp-accent);
    color: var(--gp-text);
}

.gp-action:hover {
    background: var(--gp-accent);
    color: white;
}

.gp-footer {
    margin-top: 1.75rem;
    text-align: center;
    color: var(--gp-text-light);
    font-size: .92rem;
}
/* =======================================================
   BOOK READER
   ======================================================= */

.book-page {
    min-height: 100vh;
    padding: 6vh 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-content {
    width: min(var(--gp-page-width), 90vw);
    background: var(--gp-paper);
    padding: clamp(2.5rem, 6vw, 5rem);
    box-shadow: var(--gp-shadow);
}

.book-content h1 {
    margin-top: 0;
    font-size: clamp(2.4rem, 6vw, 3.8rem);
}

.book-content h2 {
    color: var(--gp-text-light);
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.book-navigation {
    width: min(var(--gp-page-width), 90vw);
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    color: var(--gp-paper);
}

.book-navigation a {
    color: var(--gp-paper);
}
/* =======================================================
   GOVERNANCE HANDBOOK — BOOK COMPOSITION
   ======================================================= */

.gp-book-page {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
}

.gp-edition {
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gp-text-light);
    margin-bottom: 4rem;
}

.gp-book-content {
    flex: 1;
}

.gp-book-content h1 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    text-align: center;
}

.gp-book-content h2 {
    margin-top: 0;
    margin-bottom: 3.5rem;
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    text-align: center;
    color: var(--gp-text-light);
    font-weight: 400;
}

.gp-book-content p {
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

.gp-book-content blockquote {
    max-width: 680px;
    margin: 4rem auto;
    font-size: 1.25rem;
}

.gp-book-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-top: 4rem;
}

.gp-action-secondary {
    display: inline-block;
    padding: 1rem 0;
    color: var(--gp-text-light);
}
/* =======================================================
   COVER EXPERIENCE / LANDING PAGE
   ======================================================= */

.landing {
    position: relative;
    width: 100%;
    height: 100vh;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.enter-book {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 2;
    cursor: pointer;
}

/*
 * Reading environment
 *
 * The book becomes visible either when #book is targeted
 * or when an element contained in the book is targeted.
 */

.book {
    display: none;
}

.book:target,
.book:has(:target) {
    display: block;
}


/*
 * Once the reader enters the book, the visual landing page
 * no longer participates in the reading flow.
 */

body:has(.book:target) .landing,
body:has(.book :target) .landing {
    display: none;
}


/*
 * Logical pages
 *
 * Only one logical reading page is visible at a time.
 */

.logical-page {
    display: none;
}


/*
 * Entering through #book displays the first logical page.
 */

.book:target .logical-page:first-child {
    display: block;
}


/*
 * A logical page is displayed when:
 *
 * - the page itself is targeted;
 * - or one of the elements contained in it is targeted.
 *
 * The second case allows table-of-contents links to target
 * chapters and blocks contained inside a logical page.
 */

.logical-page:target,
.logical-page:has(:target) {
    display: block;
}


/*
 * When a specific page or one of its descendants is targeted,
 * the first page must no longer remain visible.
 */

.book:has(.logical-page:target) .logical-page:first-child,
.book:has(.logical-page :target) .logical-page:first-child {
    display: none;
}


/*
 * Reading-page presentation.
 */

.logical-page {
    width: min(
        calc(100% - 2rem),
        var(--gp-page-width)
    );

    min-height: 100vh;
    margin: 0 auto;
    padding: 4rem 3rem;

    box-sizing: border-box;
}
/* =======================================================
   PUBLICATION SHELL
   ======================================================= */

.gp-book-header {
    margin-bottom: 4rem;
}

.gp-book-header .gp-edition {
    margin-bottom: 1.5rem;
}

.gp-table-of-contents {
    max-width: 660px;
    margin: 0 auto 5rem;
    padding: 2rem 0;
    border-top: none;
    border-bottom: none;
}

.gp-table-of-contents h2 {
    margin: 0 0 1.5rem;
    font-size: 1.35rem;
    text-align: center;
    color: var(--gp-text-light);
}

.gp-table-of-contents ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gp-table-of-contents li {
    margin: .6rem 0;
    text-align: center;
}

.gp-table-of-contents a {
    display: inline-block;
    padding: .2rem 0;
}

/*
 * Reading environment
 *
 * The book becomes visible either when #book is targeted
 * or when an element contained in the book is targeted.
 */

.book {
    display: none;
}

.book:target,
.book:has(:target) {
    display: block;
}


/*
 * Once the reader enters the book, the visual landing page
 * no longer participates in the reading flow.
 */

body:has(.book:target) .landing,
body:has(.book :target) .landing {
    display: none;
}


/*
 * Logical pages
 *
 * Only one logical reading page is visible at a time.
 */

.logical-page {
    display: none;
}


/*
 * Entering through #book displays the first logical page.
 */

.book:target .logical-page:first-child {
    display: block;
}


/*
 * A logical page is displayed when:
 *
 * - the page itself is targeted;
 * - or one of the elements contained in it is targeted.
 *
 * The second case allows table-of-contents links to target
 * chapters and blocks contained inside a logical page.
 */

.logical-page:target,
.logical-page:has(:target) {
    display: block;
}


/*
 * When a specific page or one of its descendants is targeted,
 * the first page must no longer remain visible.
 */

.book:has(.logical-page:target) .logical-page:first-child,
.book:has(.logical-page :target) .logical-page:first-child {
    display: none;
}


/*
 * Reading-page presentation.
 */

.logical-page {
    width: min(
        calc(100% - 2rem),
        var(--gp-page-width)
    );

    min-height: 100vh;
    margin: 0 auto;
    padding: 4rem 3rem;

    box-sizing: border-box;
}
/* =======================================================
   BOOK TABLE OF CONTENTS
   ======================================================= */

.gp-table-of-contents {
    max-width: 680px;
    margin: 0 auto 6rem;
    padding: 2.25rem 0 2.5rem;
    border-top: none;
    border-bottom: none;
}

.gp-table-of-contents h2 {
    margin: 0 0 2rem;
    font-size: 1.45rem;
    text-align: left;
    color: var(--gp-text);
}

.gp-table-of-contents ul {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: chapter;
}

.gp-table-of-contents .toc-item {
    margin: 0;
    padding: 0;
}

.gp-table-of-contents .toc-item + .toc-item {
    border-top: 1px solid rgba(36, 31, 26, .07);
}

.gp-table-of-contents .toc-item a {
    display: flex;
    align-items: baseline;
    width: 100%;
    padding: .62rem 0;
    border-bottom: none;
}

.gp-table-of-contents .toc-title {
    line-height: 1.35;
}

/* Front matter */

.gp-table-of-contents .toc-front_matter .toc-title {
    color: var(--gp-text-light);
    font-style: italic;
}

/* Chapters */

.gp-table-of-contents .toc-chapter {
    counter-increment: chapter;
}

.gp-table-of-contents .toc-chapter a::before {
    content: counter(chapter, decimal-leading-zero);
    flex: 0 0 3rem;
    margin-right: 1rem;
    color: var(--gp-accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: .9rem;
    letter-spacing: .04em;
}

.gp-table-of-contents .toc-chapter .toc-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}


/* =======================================================
   PUBLICATION TYPOGRAPHY
   ======================================================= */

.gp-publication {
    width: 100%;
}

.gp-publication .publication-document-title,
.gp-publication .publication-section-title,
.gp-publication .publication-subtitle,
.gp-publication .publication-paragraph,
.gp-publication .publication-epigraph {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.gp-publication .publication-document-title {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.gp-publication .publication-section-title {
    margin-top: 5rem;
    margin-bottom: 2.5rem;
}

.gp-publication .publication-document-title h1,
.gp-publication .publication-section-title h2 {
    margin: 0;
}

.gp-publication .publication-subtitle {
    margin-top: 0;
    margin-bottom: 2.75rem;
    text-align: center;
    color: var(--gp-text-light);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
}

.gp-publication .publication-paragraph {
    margin-top: 0;
    margin-bottom: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    line-height: 1.72;
    text-align: justify;
    hyphens: auto;
}

/*
Paragraphs belonging to the same textual sequence are composed
continuously, as in a printed book.
*/

.gp-publication .publication-paragraph + .publication-paragraph {
    margin-top: .15rem;
    text-indent: 1.5em;
}

/*
The first paragraph after a title, subtitle, epigraph or structural
break starts without indentation.
*/

.gp-publication .publication-section-title + .publication-paragraph,
.gp-publication .publication-subtitle + .publication-paragraph,
.gp-publication .publication-epigraph + .publication-paragraph,
.gp-publication .publication-drop-cap {
    text-indent: 0;
}

.gp-publication .publication-drop-cap .drop-cap {
    float: left;
    margin: .06em .08em 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.65em;
    line-height: .78;
    color: var(--gp-accent);
}

.gp-publication .publication-epigraph {
    margin-top: 4rem;
    margin-bottom: 5rem;
}

.gp-publication .publication-epigraph p {
    margin: .45rem 0;
}

.gp-publication .page {
    max-width: 680px;
    margin: 4rem auto 0;
}
/*
 * Reading-unit views
 *
 * Only one medium-independent reading unit is visible at a time.
 */

.reading-unit-view {
    display: none;

    width: min(
        calc(100% - 2rem),
        var(--gp-page-width)
    );

    margin: 0 auto;
    padding: 3rem 3rem 2rem;

    box-sizing: border-box;
    scroll-margin-top: 1rem;
}

/*
 * Opening the book through #book displays the first view.
 */

.book:target .reading-unit-view:first-child {
    display: block;
}


/*
 * A targeted view, or a view containing the targeted element,
 * becomes visible.
 */

.reading-unit-view:target,
.reading-unit-view:has(:target) {
    display: block;
}


/*
 * When another view is targeted, hide the first view.
 */

.book:has(.reading-unit-view:target)
.reading-unit-view:first-child,

.book:has(.reading-unit-view :target)
.reading-unit-view:first-child {
    display: none;
}

.reading-unit-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;

    margin-top: 2rem;
    padding-top: 1.5rem;

    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.reading-nav-link {
    text-decoration: none;
    font-size: 0.95rem;
}

.reading-nav-previous {
    justify-self: start;
}

.reading-nav-contents {
    justify-self: center;
}

.reading-nav-next {
    justify-self: end;
}

.reading-nav-placeholder {
    min-width: 1px;
}

/*
/*
 * Reading-unit selection.
 */

body.gp-reading-active .reading-unit-view {
    display: none;
}


/*
 * A direct reading-unit target displays the selected unit.
 */

body.gp-reading-active
.book:target
.reading-unit-view:first-child {
    display: flex;
}

/*
 * Entering through #book opens the first unit.
 */

body.gp-reading-active
.book:target
.reading-unit-view:first-child {
    display: flex;
}

/*
 * A direct reading-unit link opens exactly that unit.
 */

body.gp-reading-active
.reading-unit-view:target {
    display: block;
}


/*
 * Compatibility for links targeting a block contained in a unit.
 */

body.gp-reading-active
.reading-unit-view:has(:target) {
    display: block;
}
/*
 * The cover is both the first ReadingUnitView and a valid target.
 * It must remain visible when explicitly selected.
 */

body.gp-reading-active
.reading-unit-view:first-child:target {
    display: block;
}

/* ============================================================
   Continuous reading experience
   ============================================================ */

/*
 * A ReadingUnit is an editorial unit, not a fixed screen page.
 *
 * Short units occupy approximately one viewport.
 * Long units grow naturally and remain continuously scrollable.
 */
.reading-unit-view {
    min-height: 100vh;
    min-height: 100svh;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding-block:
        clamp(3rem, 8vh, 7rem);

    scroll-margin-top: 1rem;
}

/*
 * Keep the reading column comfortable without binding its
 * physical height to the viewport.
 */
.reading-unit-content {
    width: min(100%, 46rem);
    margin-inline: auto;
}

/*
 * On a short unit, auto margin pushes navigation toward the
 * bottom of the viewport.
 *
 * On a long unit, navigation simply follows the content.
 */
.reading-unit-navigation {
    width: min(100%, 46rem);

    margin-top: auto;
    margin-inline: auto;

    padding-top:
        clamp(3rem, 9vh, 7rem);
}

/*
 * Give consecutive editorial units a perceptible boundary
 * without recreating rigid pages.
 */
.reading-unit-view + .reading-unit-view {
    border-top:
        1px solid
        color-mix(
            in srgb,
            currentColor 10%,
            transparent
        );
}

/*
 * Optional and deliberately gentle.
 *
 * The browser may align a nearby unit boundary, but it must
 * never trap the reader inside viewport-sized pages.
 */
html {
    scroll-snap-type: y proximity;
}

.reading-unit-view {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/*
 * Small screens need less vertical ceremony and should retain
 * completely natural scrolling.
 */
@media (max-width: 700px) {
    html {
        scroll-snap-type: none;
    }

    .reading-unit-view {
        min-height: auto;

        padding-block:
            clamp(2.5rem, 7vh, 4rem);
    }

    .reading-unit-navigation {
        padding-top: 3rem;
    }
}

/*
 * Respect readers who request reduced motion.
 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
}

/* ============================================================
   Continuous reading experience
   ============================================================ */

.reading-unit-view {
    min-height: 100vh;
    min-height: 100svh;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    width: min(100%, 54rem);
    margin-inline: auto;

    padding:
        clamp(3rem, 8vh, 7rem)
        clamp(1.5rem, 5vw, 4rem);

    scroll-margin-top: 1rem;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.reading-unit-navigation {
    width: 100%;

    margin-top: auto;
    margin-inline: auto;

    padding-top:
        clamp(3rem, 9vh, 7rem);
}

.reading-unit-view + .reading-unit-view {
    border-top:
        1px solid
        color-mix(
            in srgb,
            currentColor 10%,
            transparent
        );
}

html {
    scroll-snap-type: y proximity;
}

@media (max-width: 700px) {
    html {
        scroll-snap-type: none;
    }

    .reading-unit-view {
        min-height: auto;

        padding:
            clamp(2.5rem, 7vh, 4rem)
            clamp(1.25rem, 5vw, 2rem);
    }

    .reading-unit-navigation {
        padding-top: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
}
/* Final explicit reading-state override */

body.gp-reading-active
.book
.reading-unit-view.reading-unit-view-current {
    display: flex !important;
}
/* ============================================================
   Reading comfort — compact header and stable reading origin
   ============================================================ */

body.gp-reading-active .gp-book-header {
    display: none;
}

body.gp-reading-active .reading-unit-view {
    width: min(100%, 54rem);
    margin-inline: auto;

    padding-top:
        clamp(4rem, 9vh, 6rem);
}
/* ============================================================
   Reading comfort — book-like text layout
   ============================================================ */

body.gp-reading-active .reading-unit-view {
    padding-top:
        clamp(1.75rem, 4vh, 3rem);
}

body.gp-reading-active
.reading-unit-view:not(.reading-unit-view-cover):not(.reading-unit-view-epigraph) {
    text-align: left;
}

body.gp-reading-active
.reading-unit-view:not(.reading-unit-view-cover):not(.reading-unit-view-epigraph)
.publication-section-title {
    text-align: center;

    margin-bottom:
        clamp(2rem, 5vh, 3.5rem);
}

body.gp-reading-active
.reading-unit-view:not(.reading-unit-view-cover):not(.reading-unit-view-epigraph)
.publication-paragraph {
    width: min(100%, 44rem);

    margin-left: auto;
    margin-right: auto;

    text-align: left;
    line-height: 1.7;
}

body.gp-reading-active
.reading-unit-view:not(.reading-unit-view-cover):not(.reading-unit-view-epigraph)
.publication-drop-cap {
    text-align: left;
}
/* ============================================================
   Reading comfort — higher reading origin, no empty top rule
   ============================================================ */

body.gp-reading-active .gp-page {
    padding-top: 0;
}

body.gp-reading-active .gp-book-header {
    display: none;
}

body.gp-reading-active .reading-unit-view {
    padding-top:
        clamp(1rem, 2.5vh, 2rem);
}

body.gp-reading-active
.reading-unit-view::before {
    content: none;
}

body.gp-reading-active
.reading-unit-view:first-child {
    border-top: none;
}

body.gp-reading-active
.reading-unit-view + .reading-unit-view {
    border-top: none;
}

body.gp-reading-active
.publication-section-title {
    margin-top: 0;
    margin-bottom:
        clamp(1.75rem, 4vh, 3rem);
}
body.gp-reading-active .reading-unit-view {
    scroll-margin-top: 2rem;
}
html {
    scroll-snap-type: none;
}

body.gp-reading-active .reading-unit-view {
    scroll-margin-top: 0;
}
/* ============================================================
   Reading surfaces — final viewport behaviour
   ============================================================ */

/*
 * No decorative rules between isolated reading views.
 */
body.gp-reading-active .reading-unit-view,
body.gp-reading-active
.reading-unit-view + .reading-unit-view {
    border-top: none;
}

/*
 * The navigation itself no longer needs a separator.
 */
body.gp-reading-active .reading-unit-navigation {
    border-top: none;
}

/*
 * Short front-matter views may occupy one viewport.
 */
body.gp-reading-active
.reading-unit-view-cover,
body.gp-reading-active
.reading-unit-view-epigraph {
    min-height: 100svh;
}

/*
 * Long views must grow naturally.
 */
body.gp-reading-active
.reading-unit-view-contents,
body.gp-reading-active
.reading-unit-view-preface,
body.gp-reading-active
.reading-unit-view-chapter {
    min-height: auto;
}

/*
 * Stable and relatively high reading origin.
 */
body.gp-reading-active .reading-unit-view {
    padding-top: clamp(2.5rem, 6vh, 4.5rem);
    padding-bottom: clamp(2rem, 5vh, 4rem);
}
/*
 * Avoid creating an artificial empty screen below long content.
 */
body.gp-reading-active
.reading-unit-view-contents
.reading-unit-navigation,
body.gp-reading-active
.reading-unit-view-preface
.reading-unit-navigation,
body.gp-reading-active
.reading-unit-view-chapter
.reading-unit-navigation {
    margin-top: clamp(3rem, 7vh, 6rem);
}
/* ============================================================
   Table of contents — book-like alignment
   ============================================================ */

body.gp-reading-active
.reading-unit-view-contents {
    border-top: none;
}

body.gp-reading-active
.gp-table-of-contents {
    width: min(100%, 42rem);
    margin-inline: auto;

    text-align: left;
}

body.gp-reading-active
.gp-table-of-contents h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

body.gp-reading-active
.gp-table-of-contents ul {
    margin: 0;
    padding: 0;
}

body.gp-reading-active
.gp-table-of-contents li {
    display: grid;
    grid-template-columns:
        2.5rem
        minmax(0, 1fr);

    align-items: baseline;
    column-gap: 1rem;

    text-align: left;
}

body.gp-reading-active
.gp-table-of-contents a {
    text-align: left;
}

body.gp-reading-active
.gp-table-of-contents .toc-number {
    text-align: right;
}
/* ============================================================
   Table of contents — centered heading, single-line labels
   ============================================================ */

body.gp-reading-active
.gp-table-of-contents {
    width: min(100%, 48rem);
    margin-inline: auto;
}

body.gp-reading-active
.gp-table-of-contents h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.75rem;
}

body.gp-reading-active
.gp-table-of-contents li {
    display: grid;
    grid-template-columns:
        2.5rem
        minmax(0, 1fr);

    column-gap: 1rem;
    align-items: baseline;
}

body.gp-reading-active
.gp-table-of-contents li a {
    display: block;
    width: 100%;
    max-width: none;

    white-space: nowrap;
    text-align: left;
}

body.gp-reading-active
.gp-table-of-contents .toc-number {
    width: auto;
    text-align: right;
}
/* ============================================================
   Compact end-of-view spacing
   ============================================================ */

body.gp-reading-active
.reading-unit-view-contents
.reading-unit-navigation,
body.gp-reading-active
.reading-unit-view-preface
.reading-unit-navigation,
body.gp-reading-active
.reading-unit-view-chapter
.reading-unit-navigation {
    margin-top: 2.5rem;
    padding-top: 0;
}

body.gp-reading-active .gp-footer {
    margin-top: 1.25rem;
    padding-top: 0;
}