@charset "UTF-8";
/* BRENDAN WINTER — Tufte-inspired stylesheet
   Fonts • Foundations and typography • Editorial elements • Tufte layout
   Notes and figures • Links • Accessibility • Shared navigation/footer
   Writing and essay components • Responsive adjustments
*/


/* Cormorant Garamond — locally hosted variable fonts
   Expected folder: /fonts/ next to this stylesheet */

@font-face {
    font-family: "Cormorant Garamond";
    src: url("fonts/CormorantGaramond-VariableFont_wght.ttf") format("truetype-variations");
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("fonts/CormorantGaramond-Italic-VariableFont_wght.ttf") format("truetype-variations");
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
}

/* Tufte CSS styles */
html {
    /* Fluid type scaling: grows smoothly with viewport width, with sensible caps.
   Range: 18px up to ~800px wide, then scales gradually up to ~21.5px at ~1500px wide. */
    font-size: clamp(14px, 0.5vw + 14px, 21px);
}
body {
    width: 87.5%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12.5%;
    font-family: "Cormorant Garamond", Garamond, Georgia, serif;
    font-weight: 425; /* Slightly fuller body text on desktop */
    background-color: #fffff8;
    color: #111;
    max-width: 1400px;
    counter-reset: sidenote-counter;

    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Cormorant Garamond", Garamond, Georgia, serif;
    font-weight: 500;
    text-wrap: balance;
}

h1 {
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
    line-height: 1;
}

h2 {
    font-style: italic;
    font-weight: 500;
    margin-top: 2.1rem;
    margin-bottom: 1.4rem;
    font-size: 2.2rem;
    line-height: 1.05;
}

h3 {
    font-weight: 600;
    font-size: 1.7rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

h4 {
    font-weight: 600;
    font-size: 1.45rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    line-height: 1.15;
}

h5 {
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 1.6rem;
    margin-bottom: 0.7rem;
    line-height: 1.2;
    font-variant-caps: small-caps;
    letter-spacing: 0.04em;
}

h6 {
    font-weight: 500;
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
    font-style: italic;
}

hr {
    display: block;
    height: 1px;
    width: 55%;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

p.subtitle {
    font-style: italic;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    display: block;
    line-height: 1;
}

.numeral {
    font-family: "Cormorant Garamond", Garamond, Georgia, serif;
    font-variant-numeric: oldstyle-nums;
}

.danger {
    color: red;
}

article {
    padding: 5rem 0rem;
}

section {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

p,
dl,
ol,
ul {
    font-size: 1.4rem;
    line-height: 2rem;
}

p {
    margin-top: 1.4rem;
    margin-bottom: 1.4rem;
    padding-right: 0;
    vertical-align: baseline;
}

/* Chapter Epigraphs */
div.epigraph {
    margin: 5em 0;
}

div.epigraph > blockquote {
    margin-top: 3em;
    margin-bottom: 3em;
}

div.epigraph > blockquote,
div.epigraph > blockquote > p {
    font-style: italic;
}

div.epigraph > blockquote > footer {
    font-style: normal;
}

div.epigraph > blockquote > footer > cite {
    font-style: italic;
}
/* end chapter epigraphs styles */

/* Blockquotes stay within the 55% Tufte reading column. */
blockquote {
    box-sizing: border-box;
    width: 55%;
    margin: 2rem 0;
    padding-left: 2.5%;
    font-size: 1.4rem;
    line-height: 2rem;
}

blockquote p {
    width: 100%;
    margin: 0 0 0.8rem;
}

blockquote footer {
    width: 100%;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: right;
}

section > p,
section > footer,
section > table {
    width: 55%;
}

/* 50 + 5 == 55, to be the same width as paragraph */
section > dl,
section > ol,
section > ul {
    width: 50%;
    -webkit-padding-start: 5%;
}

dt:not(:first-child),
li:not(:first-child) {
    margin-top: 0.25rem;
}

figure {
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    max-width: 55%;
    -webkit-margin-start: 0;
    -webkit-margin-end: 0;
    margin: 0 0 3em 0;
}

/* Captions sit beneath images, aligned to the right without a narrow width cap. */
figcaption {
    display: block;
    float: none;
    clear: none;
    width: max-content;
    max-width: 100%;
    margin: 0 0 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: right;
}

/* Links: replicate underline that clears descenders */
a:link,
a:visited {
    color: inherit;
}

.no-tufte-underline:link {
    background: unset;
    text-shadow: unset;
}

a:link, .tufte-underline, .hover-tufte-underline:hover {
    text-decoration: none;
    background: -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(currentColor, currentColor);
    background: linear-gradient(#fffff8, #fffff8), linear-gradient(#fffff8, #fffff8), linear-gradient(currentColor, currentColor);
    -webkit-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    -moz-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    background-repeat: no-repeat, no-repeat, repeat-x;
    text-shadow: 0.03em 0 #fffff8, -0.03em 0 #fffff8, 0 0.03em #fffff8, 0 -0.03em #fffff8, 0.06em 0 #fffff8, -0.06em 0 #fffff8, 0.09em 0 #fffff8, -0.09em 0 #fffff8, 0.12em 0 #fffff8, -0.12em 0 #fffff8, 0.15em 0 #fffff8, -0.15em 0 #fffff8;
    background-position: 0% 93%, 100% 93%, 0% 93%;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    a:link, .tufte-underline, .hover-tufte-underline:hover {
        background-position-y: 87%, 87%, 87%;
    }
}

a:link::selection,
a:link::-moz-selection {
    text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
    background: #b4d5fe;
}

/* Sidenotes, margin notes, figures, captions */
img {
    max-width: 100%;
}

.sidenote,
.marginnote {
    float: right;
    clear: right;
    margin-right: -60%;
    width: 50%;
    margin-top: 0.3rem;
    margin-bottom: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
}

.sidenote-number {
    counter-increment: sidenote-counter;
}

.sidenote-number:after,
.sidenote:before {
    font-family: "Cormorant Garamond", Garamond, Georgia, serif;
    font-variant-numeric: oldstyle-nums;
    position: relative;
    vertical-align: baseline;
}

.sidenote-number:after {
    content: counter(sidenote-counter);
    font-size: 1rem;
    top: -0.5rem;
    left: 0.1rem;
}

.sidenote:before {
    content: counter(sidenote-counter) " ";
    font-size: 1rem;
    top: -0.5rem;
}

blockquote .sidenote,
blockquote .marginnote {
    margin-right: -82%;
    min-width: 59%;
    text-align: left;
}

div.fullwidth,
table.fullwidth {
    width: 100%;
}

div.table-wrapper {
    overflow-x: auto;
    font-family: "Trebuchet MS", "Gill Sans", "Gill Sans MT", sans-serif;
}

.sans {
    font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
    letter-spacing: .03em;
}

code, pre > code {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 1.0rem;
    line-height: 1.42;
    -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */
}

.sans > code {
    font-size: 1.2rem;
}

h1 > code,
h2 > code,
h3 > code,
h4 > code,
h5 > code,
h6 > code {
    font-size: 0.80em;
}

.marginnote > code,
.sidenote > code {
    font-size: 1rem;
}

pre > code {
    font-size: 0.9rem;
    width: 52.5%;
    margin-left: 2.5%;
    overflow-x: auto;
    display: block;
}

pre.fullwidth > code {
    width: 90%;
}

.fullwidth {
    max-width: 90%;
    clear:both;
}

span.newthought,
.smallcaps,
.small-caps {
    font-variant-caps: small-caps;
    font-feature-settings: "smcp" 1;
    letter-spacing: 0.035em;
}

span.newthought {
    font-size: 1.2em;
}

.all-small-caps {
    font-variant-caps: all-small-caps;
    font-feature-settings: "c2sc" 1, "smcp" 1;
    letter-spacing: 0.045em;
}

.oldstyle-nums {
    font-variant-numeric: oldstyle-nums;
}

.lining-nums {
    font-variant-numeric: lining-nums;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

input.margin-toggle {
    display: none;
}

label.sidenote-number {
    display: inline;
}

label.margin-toggle:not(.sidenote-number) {
    display: none;
}

.iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}



/* ============================================================
   ACCESSIBILITY & BOX SIZING
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
/* Preserve existing Tufte body geometry. */
body { box-sizing: content-box; }
.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fffff8; padding: 0.5rem 1rem; border: 1px solid #111; z-index: 1000; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header logo: prevent Tufte-style underline backgrounds on the site title link */
.header .logo a {
  text-decoration: none;
  background: none !important;
  text-shadow: none !important;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 0;
}

/* Section-break logo image (line_logo.png) should never scale to full width */
.section-break {
  text-align: center;
}

.section-break__img {
  display: block;
  margin: 2rem auto;
  max-width: 80px;
  width: 100%;
  height: auto;
}

/* === HAMBURGER MENU STYLES === */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
  position: relative;
  z-index: 100;
}

.logo {
  font-weight: bold;
  font-size: 1.25rem;
}

/* Hamburger icon: 2 lines */
.hamburger {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
  z-index: 101;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background-color: currentColor;
  display: block;
}

/* Hide hamburger when menu is open */
body.menu-open .hamburger {
  display: none;
}

/* Fullscreen overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: 100vw;
  overflow-y: auto;
  padding: 2rem;
  background-color: #fffff8;
  color: #111;
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.menu-overlay.active {
  display: flex;
}

/* Menu content styling */
.menu-content {
  text-align: center;
  font-size: 2rem;
  line-height: 1.15;
  gap: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Menu links — no Tufte underlines, only hover underline */
.menu-content a {
  text-decoration: none;
  position: relative;
  background: none !important;
  text-shadow: none !important;
  color: inherit;
}

.menu-content a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.menu-content a:hover::after {
  transform: scaleX(1);
}

/* Close button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 2rem;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  font-weight: bold;
}


/* Navigation state, keyboard controls and shared footer */
.hamburger, .close-btn { border: 0; background: transparent; color: inherit; font-family: inherit; }
.hamburger:focus-visible, .close-btn:focus-visible, .menu-content a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.menu-content a[aria-current="page"]::after { transform: scaleX(1); }
body.menu-open { overflow: hidden; }
.site-footer { margin-top: 1rem; padding: 1rem 0 2rem; color: #555; font-size: 1.1rem; }
.site-footer p { font-size: 1.1rem; line-height: 1.6; margin: 0; }
.site-footer a { color: inherit; }

/* ============================================================
   WRITING INDEX & ARTICLE METADATA
   Index: title and compact metadata on the same line.
   Article: metadata sits under the article title.
   ============================================================ */

/* Writing index: compact entries, without changing general headings. */
.writing-entry {
    padding-top: 0.25rem;
    padding-bottom: 0.8rem;
}

.writing-entry h3 {
    margin-top: 1.1rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.writing-entry h3 .writing-meta {
    display: inline;
    margin-left: 0.5em;
    font-size: 0.58em;
    font-weight: 400;
    font-style: normal;
    line-height: 1.3;
    letter-spacing: 0.035em;
    color: #666;
    white-space: nowrap;
}

.writing-entry > p {
    margin-top: 0.3rem;
    margin-bottom: 0.6rem;
}

/* Article pages: smaller, muted metadata beneath the H1. */
.article-meta {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: -0.25rem;
    margin-bottom: 2rem;
    font-weight: 400;
    font-style: normal;
    color: #666;
}


/* Individual essays: introductory editorial standfirst. */
.standfirst {
    width: 55%;
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Intermediate layout: tablets / small laptops
   Keep margin notes/images in the margin, but rebalance proportions so the main text
   column is less narrow and the margin content is less dominant. */
@media (min-width: 761px) and (max-width: 1099px) {
    body {
        width: 90%;
        padding-left: 5%;
        padding-right: 5%;
    }

    hr,
    section > p,
    section > footer,
    section > table {
        width: 62%;
    }

    .sidenote,
    .marginnote {
        width: 42%;
        margin-right: -48%;
    }

    /* Ensure images used as margin content scale safely in this mid-range band */
    .sidenote img,
    .marginnote img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .standfirst { width: 62%; }
    blockquote { width: 62%; }
}

/* Tablet in portrait: use a comfortable single reading column rather than
   reserving nearly half the screen for Tufte marginalia. Landscape tablets
   and narrow laptops retain the intermediate two-column proportions above. */
@media (min-width: 761px) and (max-width: 1099px) and (orientation: portrait) {
    body {
        width: 90%;
        max-width: 800px;
        padding-left: 0;
        padding-right: 0;
        margin-left: auto;
        margin-right: auto;
    }

    hr,
    section > p,
    section > footer,
    section > table,
    .standfirst,
    blockquote {
        width: 100%;
    }

    section > dl,
    section > ol,
    section > ul {
        width: 100%;
        padding-left: 1.5rem;
    }

    figure {
        max-width: 100%;
    }

    blockquote {
        padding-left: 0.75rem;
    }

    /* Margin notes move into the reading column on portrait tablets.
       Reuse the existing mobile tap-to-reveal pattern instead of sending
       notes and their images into the right-hand viewport edge. */
    label.margin-toggle:not(.sidenote-number) {
        display: inline;
    }

    .sidenote,
    .marginnote {
        display: none;
    }

    .margin-toggle:checked + .sidenote,
    .margin-toggle:checked + .marginnote {
        display: block;
        float: none;
        clear: both;
        left: auto;
        width: 100%;
        margin: 1rem 0;
    }

    .margin-toggle:checked + .sidenote img,
    .margin-toggle:checked + .marginnote img {
        display: block;
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 760px) {
    body {
        font-weight: 450; /* Improved body-text presence on mobile */
        width: 84%;
        padding-left: 8%;
        padding-right: 8%;
    }

    hr,
    section > p,
    section > footer,
    section > table {
        width: 100%;
    }

    pre > code {
        width: 97%;
    }

    section > dl,
    section > ol,
    section > ul {
        width: 90%;
    }

    figure {
        max-width: 90%;
    }

    /* Keep quotations inside the narrow reading column. */
    blockquote {
        box-sizing: border-box;
        width: 100%;
        margin: 2rem 0;
        padding-left: 0.75rem;
        padding-right: 0;
    }

    blockquote p,
    blockquote footer {
        width: 100%;
    }

    label.margin-toggle:not(.sidenote-number) {
        display: inline;
    }

    .sidenote,
    .marginnote {
        display: none;
    }

    .margin-toggle:checked + .sidenote,
    .margin-toggle:checked + .marginnote {
        display: block;
        float: left;
        left: 1rem;
        clear: both;
        width: 95%;
        margin: 1rem 2.5%;
        vertical-align: baseline;
        position: relative;
    }

    label {
        cursor: pointer;
    }

    div.table-wrapper,
    table {
        width: 85%;
    }

    /* Only content images should expand to the column width on mobile.
       (Avoid blowing up header icons and the line-logo separators.) */
    figure img {
        width: 100%;
        height: auto;
    }

    .margin-toggle:checked + .sidenote img,
    .margin-toggle:checked + .marginnote img {
        width: 100%;
        height: auto;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .section-break__img {
        width: 140px;
        max-width: 70%;
    }
    /* Reading column and ornament behaviour on narrow screens */
    .standfirst { width: 100%; }
    .standfirst { font-size: 1.45rem; }
}



/* Responsive navigation */
@media (max-width: 760px) {
  .menu-overlay.active { align-items: center; padding-top: 0; }
  .menu-content { font-size: 1.8rem; margin-top: 0; text-align: center; align-items: center; }
  .close-btn { font-size: 2.4rem; top: 1.5rem; right: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-content a::after { transition: none; }
}
