/* ==========================================================================
   Sun & Grid — tokyotourism.org
   1964 "total design" modernism: sun disc, gold rules, strict grid, warm paper.
   --------------------------------------------------------------------------
   CONTRAST NOTE — two deliberate deviations from the handoff palette.

   The design tokens --muted (#8A8A86) and --gold (#B8963E) are used in the
   mock for *text* (meta lines, kickers, the "01 —" H2 numbers, the info-box
   label). Measured against --paper they are 3.32:1 and 2.69:1 — both below
   the 4.5:1 WCAG AA threshold for text this size (10.5–16px).

   So each has a text-safe twin, and the original stays for everything that
   is not read as words:
     --muted  #8A8A86  hairline discs, bullets, decorative rules   (unchanged)
     --meta   #6A6A66  any muted *text*        5.20:1 paper / 4.72:1 panel
     --gold   #B8963E  3px section rules, borders, tiles           (unchanged)
     --gold-d #856620  any gold *text* + focus ring  5.13:1 paper / 3.44:1 ink

   Visually the shift is a half-step in value; the geometry, hue and hierarchy
   of the design are untouched.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted — no third-party request, GDPR-clean)
   -------------------------------------------------------------------------- */

/* Jost is served by Google as a variable font: one file covers 400–700. */
@font-face {
	font-family: 'Jost';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/jost-var-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Jost';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/jost-var-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Jost';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/jost-400-italic-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Jost';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/jost-400-italic-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-700-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/ibm-plex-mono-700-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
	/* Palette — the five Customizer colours feed --sun/--gold/--ink/--paper/--panel */
	--paper: #fbfaf7;
	--panel: #f1efe7;
	--zebra: #f6f4ec;
	--hairline: #d9d7cf;
	--muted: #8a8a86;   /* decorative only — see contrast note */
	--meta: #6a6a66;    /* muted text */
	--gray: #4c4c4c;
	--body: #2e2e2c;
	--ink: #141414;
	--sun: #d8261a;
	--gold: #b8963e;    /* rules and borders only — see contrast note */
	--gold-d: #856620;  /* gold text + focus ring */

	/* Derived */
	--ink-rule: #2c2c2a;      /* hairline inside the ink footer */
	--on-ink: #fbfaf7;
	--on-ink-soft: #dcdcd6;
	--on-ink-quiet: #a9a9a4;
	--bullet: #b6b4ac;

	/* Type */
	--ui: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	--mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	/* JP accents use the reader's own Japanese face: shipping a CJK webfont
	   would cost megabytes, and a subset breaks the moment an editor types a
	   glyph it does not contain. These are decorative accents, never body copy. */
	--jp: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic Medium', 'Yu Gothic', 'Noto Sans JP', 'Noto Sans CJK JP', Meiryo, sans-serif;

	/* Layout */
	--content: 1200px;
	--gutter: 40px;
	--article: 720px;
	--toc: 260px;

	/* Spacing scale — 4 8 12 16 24 32 48 64 96 */
	--s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
	--s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

	--motion: 150ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
	:root { --motion: 1ms linear; }
	html { scroll-behavior: auto !important; }
	*, *::before, *::after {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 1ms !important;
	}
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--body);
	font-family: var(--ui);
	font-size: 17px;
	line-height: 1.75;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
}

/* A [hidden] element must stay hidden even when a media query sets display. */
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ui);
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 var(--s4);
	text-wrap: pretty;
}

h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.5px; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.5px; }
h3 { font-size: 19px; line-height: 1.35; }
h4 { font-size: 17px; line-height: 1.4; }
h5, h6 { font-size: 15px; line-height: 1.4; }

p { margin: 0 0 var(--s5); }

a { color: inherit; text-decoration: none; transition: color var(--motion), border-color var(--motion); }
a:hover { color: var(--sun); }

img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }

hr {
	border: 0;
	border-top: 1px solid var(--hairline);
	margin: var(--s7) 0;
}

/* Focus — 2px gold ring, darkened to clear 3:1 on both paper and ink. */
:focus-visible {
	outline: 2px solid var(--gold-d);
	outline-offset: 2px;
}
.sg-ink :focus-visible,
.sg-footer :focus-visible,
.sg-announce :focus-visible { outline-color: var(--gold); }

::selection { background: var(--sun); color: var(--paper); }

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	white-space: nowrap;
}
.screen-reader-text:focus {
	background: var(--paper);
	clip-path: none;
	color: var(--ink);
	display: block;
	font-family: var(--mono);
	font-size: 12px;
	height: auto;
	left: var(--s5);
	letter-spacing: 2px;
	line-height: 1;
	padding: var(--s4) var(--s5);
	text-transform: uppercase;
	top: var(--s5);
	width: auto;
	z-index: 100000;
	border: 1px solid var(--ink);
}

.sg-skip-link:focus { outline: 2px solid var(--gold-d); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   4. Layout helpers
   -------------------------------------------------------------------------- */

.sg-wrap {
	max-width: var(--content);
	margin-inline: auto;
	padding-inline: var(--gutter);
	width: 100%;
}

.sg-narrow { max-width: 680px; margin-inline: auto; }

/* Mono label — the workhorse of the system */
.sg-label {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--meta);
	line-height: 1.5;
	margin: 0;
}
.sg-label--wide { letter-spacing: 3px; }
.sg-label--rule {
	border-top: 3px solid var(--gold);
	padding-top: var(--s2);
	letter-spacing: 3px;
	display: block;
	margin-bottom: var(--s4);
}

.sg-jp { font-family: var(--jp); letter-spacing: 3px; }

/* The disc — the brand's only curve */
.sg-disc {
	background: var(--sun);
	border-radius: 50%;
	flex: none;
	display: block;
}

/* Section head: 1px ink rule, title left, mono link right */
.sg-sectionhead {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--s5);
	border-top: 1px solid var(--ink);
	padding-top: 18px;
	margin-bottom: var(--s5);
	flex-wrap: wrap;
}
.sg-sectionhead h2 { margin: 0; font-size: 26px; }
.sg-sectionhead__more {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	/* No nowrap: a long category name ("All Tokyo Culture & Traditions →")
	   is wider than a 320px viewport and would push the whole page sideways. */
	max-width: 100%;
	padding-block: 3px;
	display: inline-block;
}

/* --------------------------------------------------------------------------
   5. Buttons, tags, forms
   -------------------------------------------------------------------------- */

.sg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s2);
	background: var(--ink);
	color: var(--on-ink);
	border: 1px solid var(--ink);
	padding: 14px 30px;
	font-family: var(--ui);
	font-weight: 500;
	font-size: 13.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	line-height: 1.2;
	cursor: pointer;
	transition: background var(--motion), border-color var(--motion), color var(--motion);
	border-radius: 0;
	text-align: center;
}
.sg-btn:hover { background: var(--sun); border-color: var(--sun); color: var(--on-ink); }

.sg-btn--outline {
	background: transparent;
	color: var(--ink);
	border-color: var(--ink);
	padding: 13px 26px;
}
.sg-btn--outline:hover { background: transparent; border-color: var(--sun); color: var(--sun); }

.sg-textlink {
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 1px;
	border-bottom: 2px solid var(--sun);
	padding-bottom: 2px;
	display: inline-block;
}

/* Tags / chips */
.sg-tag {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 5px 10px;
	line-height: 1.5;
	color: var(--body);
}
.sg-tag--panel { background: var(--panel); }
.sg-tag--ink { background: var(--ink); color: var(--on-ink); }
.sg-tag--outline { border: 1px solid var(--hairline); }
.sg-tag--outline:hover { border-color: var(--ink); }

.sg-chip {
	display: inline-flex;
	align-items: center;
	font-family: var(--mono);
	font-size: 11.5px;
	letter-spacing: 1px;
	text-transform: uppercase;
	border: 1px solid var(--hairline);
	padding: 7px 14px;
	min-height: 30px;
	line-height: 1.3;
	color: var(--body);
	transition: border-color var(--motion), color var(--motion);
}
.sg-chip:hover { border-color: var(--ink); color: var(--ink); }
.sg-chip[aria-current='page'],
.sg-chip.is-active {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--on-ink);
}
.sg-chip.is-active:hover { color: var(--on-ink); }

/* Joined field + button, used by search and the newsletter */
.sg-field {
	display: flex;
	max-width: 420px;
	width: 100%;
}
.sg-field input[type='search'],
.sg-field input[type='text'],
.sg-field input[type='email'] {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--ink);
	border-right: none;
	background: var(--paper);
	color: var(--ink);
	padding: 13px 16px;
	font-family: var(--ui);
	font-size: 15px;
	line-height: 1.4;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}
.sg-field input::placeholder { color: var(--meta); opacity: 1; }
.sg-field input:focus-visible { outline-offset: -2px; }
.sg-field button,
.sg-field .sg-field__go {
	background: var(--ink);
	color: var(--on-ink);
	border: 1px solid var(--ink);
	display: grid;
	place-items: center;
	padding: 0 18px;
	font-family: var(--ui);
	font-size: 13px;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 500;
	cursor: pointer;
	border-radius: 0;
	transition: background var(--motion), border-color var(--motion);
	white-space: nowrap;
}
.sg-field button:hover { background: var(--sun); border-color: var(--sun); }
.sg-field--wide { max-width: none; }
.sg-field--wide input { padding: 15px 18px; }
.sg-field--wide button { padding: 0 26px; }

input[type='text'], input[type='email'], input[type='url'], input[type='password'],
input[type='search'], input[type='number'], input[type='tel'], input[type='date'],
textarea, select {
	border: 1px solid var(--hairline);
	background: var(--paper);
	color: var(--ink);
	font-family: var(--ui);
	font-size: 16px;
	padding: 12px 14px;
	border-radius: 0;
	max-width: 100%;
}
textarea { line-height: 1.6; }

/* --------------------------------------------------------------------------
   6. Category pictograms
   -------------------------------------------------------------------------- */

.sg-picto {
	display: block;
	flex: none;
	color: var(--ink);
}
.sg-picto--sun { color: var(--sun); }
.sg-picto--gold { color: var(--gold); }

/* --------------------------------------------------------------------------
   7. Announcement bar
   -------------------------------------------------------------------------- */

.sg-announce {
	background: var(--ink);
	color: var(--on-ink);
	text-align: center;
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	padding: 7px var(--s4);
	line-height: 1.6;
}
.sg-announce .sg-jp { text-transform: none; letter-spacing: 3px; }
.sg-announce a { color: var(--on-ink); border-bottom: 1px solid var(--ink-rule); }
.sg-announce a:hover { color: var(--paper); border-color: var(--sun); }

/* --------------------------------------------------------------------------
   8. Masthead
   -------------------------------------------------------------------------- */

.sg-masthead {
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
}
.sg-masthead__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s5);
	padding: 20px var(--gutter);
	max-width: var(--content);
	margin-inline: auto;
}

.sg-logo {
	display: inline-flex;
	align-items: center;
	gap: 13px;
	color: var(--ink);
	flex: none;
}
.sg-logo:hover { color: var(--ink); }
.sg-logo__disc { width: 30px; height: 30px; }
.sg-logo__text {
	font-weight: 600;
	font-size: 18px;
	letter-spacing: 6px;
	line-height: 1;
	text-transform: lowercase;
	white-space: nowrap;
}
.sg-logo img { max-height: 44px; width: auto; }

.sg-nav { display: flex; align-items: center; gap: 30px; }
.sg-nav ul {
	display: flex;
	align-items: center;
	gap: 30px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.sg-nav li { position: relative; }
.sg-nav a {
	display: inline-block;
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--ink);
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	line-height: 1.4;
}
.sg-nav a:hover { color: var(--sun); }
.sg-nav .current-menu-item > a,
.sg-nav .current-menu-ancestor > a,
.sg-nav .current-menu-parent > a,
.sg-nav .current_page_item > a,
.sg-nav .sg-nav__item--current > a { border-bottom-color: var(--sun); }

/* Sub-menus */
.sg-nav ul ul {
	position: absolute;
	top: 100%;
	left: 0;
	display: none;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	background: var(--paper);
	border: 1px solid var(--ink);
	min-width: 220px;
	padding: var(--s2) 0;
	z-index: 60;
}
.sg-nav li:hover > ul,
.sg-nav li:focus-within > ul { display: flex; }
.sg-nav ul ul a { padding: var(--s2) var(--s4); border-bottom: none; letter-spacing: 1.5px; }
.sg-nav ul ul a:hover { background: var(--panel); }

.sg-searchtoggle {
	width: 34px;
	height: 34px;
	border: 1px solid var(--ink);
	display: grid;
	place-items: center;
	font-family: var(--mono);
	font-size: 13px;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	padding: 0;
	flex: none;
	transition: background var(--motion), color var(--motion), border-color var(--motion);
}
.sg-searchtoggle:hover { border-color: var(--sun); color: var(--sun); }
.sg-searchtoggle[aria-expanded='true'] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.sg-navtoggle {
	display: none;
	width: 40px;
	height: 34px;
	border: 1px solid var(--ink);
	background: transparent;
	cursor: pointer;
	padding: 0;
	place-items: center;
	flex: none;
}
.sg-navtoggle__bars { display: block; width: 18px; height: 12px; position: relative; }
.sg-navtoggle__bars::before,
.sg-navtoggle__bars::after,
.sg-navtoggle__bars span {
	content: '';
	position: absolute;
	left: 0;
	width: 18px;
	height: 2px;
	background: var(--ink);
	transition: transform var(--motion), opacity var(--motion);
}
.sg-navtoggle__bars::before { top: 0; }
.sg-navtoggle__bars span { top: 5px; }
.sg-navtoggle__bars::after { top: 10px; }
.sg-navtoggle[aria-expanded='true'] .sg-navtoggle__bars::before { transform: translateY(5px) rotate(45deg); }
.sg-navtoggle[aria-expanded='true'] .sg-navtoggle__bars span { opacity: 0; }
.sg-navtoggle[aria-expanded='true'] .sg-navtoggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* Inline search drawer under the masthead — no modal */
.sg-searchbar {
	border-bottom: 1px solid var(--ink);
	background: var(--panel);
}
.sg-searchbar__inner {
	max-width: var(--content);
	margin-inline: auto;
	padding: var(--s5) var(--gutter);
	display: flex;
	justify-content: flex-end;
}
.sg-searchbar .sg-field { max-width: 480px; }
.sg-searchbar .sg-field input { background: var(--paper); }

/* --------------------------------------------------------------------------
   9. Hero (front page)
   -------------------------------------------------------------------------- */

.sg-hero {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: var(--s7);
	padding-block: var(--s8) 56px;
	align-items: start;
}
.sg-hero__disc { width: 150px; height: 150px; margin-bottom: 36px; }
.sg-hero__title {
	margin: 0 0 18px;
	font-size: 52px;
	line-height: 1.04;
	letter-spacing: -1px;
	font-weight: 600;
}
.sg-hero__dek {
	margin: 0 0 30px;
	font-size: 17px;
	line-height: 1.7;
	color: var(--gray);
	max-width: 50ch;
}
.sg-hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.sg-hero__aside { align-self: center; }

/* Category tiles */
.sg-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.sg-tile {
	border: 1px solid var(--hairline);
	padding: 22px 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	color: var(--ink);
	transition: border-color var(--motion);
	min-height: 118px;
}
.sg-tile:hover { border-color: var(--ink); color: var(--ink); }
.sg-tile:hover .sg-tile__name { color: var(--sun); }
.sg-tile__figure { display: flex; align-items: flex-end; height: 26px; }
.sg-tile__name {
	display: block;
	font-weight: 600;
	font-size: 14.5px;
	letter-spacing: 1px;
	text-transform: uppercase;
	transition: color var(--motion);
}
.sg-tile__count {
	display: block;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--meta);
	margin-top: 2px;
}

/* --------------------------------------------------------------------------
   10. Guide card (front page + archives + search)
   -------------------------------------------------------------------------- */

.sg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--s6);
}
.sg-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sg-card {
	border-top: 1px solid var(--ink);
	padding-top: var(--s4);
	display: flex;
	flex-direction: column;
	position: relative;
}
.sg-card__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--s3);
	margin-bottom: 14px;
}
.sg-card__kicker {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--meta);
	line-height: 1.4;
}
.sg-card__dot { width: 10px; height: 10px; }
.sg-card__media {
	display: block;
	margin-bottom: 14px;
	background: var(--panel);
	aspect-ratio: 3 / 2;
	overflow: hidden;
}
.sg-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity var(--motion);
}
.sg-card:hover .sg-card__media img { opacity: 0.88; }
.sg-card__title {
	margin: 0 0 var(--s2);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.35;
	/* The card renders as h2 or h3 depending on where it sits in the outline,
	   so the tracking must be pinned rather than inherited from either. */
	letter-spacing: 0;
}
/* Whole card clickable, without nesting interactive elements */
.sg-card__title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}
.sg-card__meta {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--meta);
	margin-top: auto;
	padding-top: 2px;
}

/* Image-less variant used by "Related guides" */
.sg-card--slim { padding-top: 14px; }
.sg-card--slim .sg-card__title { font-size: 17px; margin: 10px 0 6px; }

/* --------------------------------------------------------------------------
   11. Start here (pillar list)
   -------------------------------------------------------------------------- */

.sg-starthere {
	background: var(--panel);
	border-top: 1px solid var(--hairline);
	border-bottom: 1px solid var(--hairline);
}
.sg-starthere__inner {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: 56px;
	align-items: center;
	padding-block: var(--s7);
}
.sg-starthere__title { margin: 0 0 14px; font-size: 32px; line-height: 1.15; letter-spacing: -0.5px; }
.sg-starthere__dek { margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--gray); }

.sg-pillars { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.sg-pillars li { display: block; }
.sg-pillars li + li { border-top: 1px solid var(--hairline); }
.sg-pillar {
	display: flex;
	gap: 18px;
	align-items: center;
	padding: 13px 0;
	color: var(--ink);
}
.sg-pillar__num {
	width: 26px;
	height: 26px;
	background: var(--ink);
	color: var(--on-ink);
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 12px;
	font-weight: 600;
	flex: none;
	font-variant-numeric: tabular-nums;
	transition: background var(--motion);
}
.sg-pillar:hover .sg-pillar__num { background: var(--sun); }
.sg-pillar__title { flex: 1; font-weight: 600; font-size: 16.5px; line-height: 1.4; }
.sg-pillar__time {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--meta);
	flex: none;
}

/* --------------------------------------------------------------------------
   12. Newsletter
   -------------------------------------------------------------------------- */

.sg-newsletter {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s8);
	align-items: center;
	padding-block: 56px;
}
.sg-newsletter__title { margin: 0 0 12px; font-size: 28px; letter-spacing: -0.5px; line-height: 1.2; }
.sg-newsletter__dek { margin: 0; font-size: 15px; line-height: 1.7; color: var(--gray); }
.sg-newsletter__note {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 1px;
	color: var(--meta);
	margin: var(--s3) 0 0;
	line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.sg-footer { background: var(--ink); color: var(--on-ink); }
.sg-footer a { color: var(--on-ink-soft); }
.sg-footer a:hover { color: var(--sun); }
.sg-footer__cols {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: var(--s7);
	padding-block: 56px 0;
}
.sg-footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--on-ink); }
.sg-footer__brand:hover { color: var(--on-ink); }
.sg-footer__brand .sg-logo__disc { width: 26px; height: 26px; }
.sg-footer__brand .sg-logo__text { font-size: 16px; letter-spacing: 5px; }
.sg-footer__mission {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.8;
	color: var(--on-ink-quiet);
	max-width: 34ch;
}
.sg-footer__heading {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 var(--s4);
	font-weight: 400;
}
.sg-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 13.5px;
}
.sg-footer__list a { display: inline-block; line-height: 1.5; padding: 3px 0; }
.sg-footer__bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--s5);
	border-top: 1px solid var(--ink-rule);
	margin-top: 44px;
	padding-block: 28px 30px;
	flex-wrap: wrap;
}
.sg-footer__copy {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
	letter-spacing: 1px;
	text-transform: uppercase;
}
.sg-footer__jp { font-family: var(--jp); font-size: 11px; color: var(--muted); letter-spacing: 4px; }

/* Footer widget area (optional, sits above the four columns) */
.sg-footer__widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--s7);
	padding-block: var(--s7);
	border-bottom: 1px solid var(--ink-rule);
}
.sg-footer__widgets .widget-title,
.sg-footer__widgets h2 {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 400;
	margin: 0 0 var(--s4);
}
.sg-footer__widgets ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }

/* --------------------------------------------------------------------------
   14. Single guide
   -------------------------------------------------------------------------- */

.sg-single__head { padding-block: 44px 0; }

.sg-breadcrumb {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--meta);
	margin-bottom: 22px;
	line-height: 1.7;
}
.sg-breadcrumb a {
	color: var(--meta);
	display: inline-block;
	padding-block: 3px;
}
.sg-breadcrumb a:hover { color: var(--sun); }
.sg-breadcrumb [aria-current='page'] { color: var(--gray); }
.sg-breadcrumb__sep { padding: 0 4px; }

.sg-kicker {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}
.sg-kicker__text {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--gray);
	line-height: 1.5;
}
.sg-kicker__text .sg-jp { text-transform: none; }

.sg-single__title {
	margin: 0 0 var(--s4);
	font-size: 44px;
	line-height: 1.1;
	letter-spacing: -1px;
	max-width: 24ch;
}
.sg-single__dek {
	margin: 0 0 var(--s5);
	font-size: 19px;
	line-height: 1.6;
	color: var(--gray);
	max-width: 58ch;
}

.sg-byline {
	display: flex;
	align-items: center;
	gap: 20px;
	padding-bottom: 22px;
	border-bottom: 3px solid var(--gold);
	flex-wrap: wrap;
	row-gap: 12px;
}
.sg-byline__author { display: flex; align-items: center; gap: 10px; }
.sg-byline__name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.sg-byline__date {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--meta);
}
.sg-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--hairline);
	display: grid;
	place-items: center;
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 500;
	color: var(--gray);
	flex: none;
	overflow: hidden;
	letter-spacing: 0;
}
.sg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.sg-featured { margin: 28px 0 0; }
.sg-featured img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.sg-featured figcaption,
.sg-caption {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--meta);
	padding-top: var(--s2);
	padding-bottom: 10px;
	border-bottom: 1px solid var(--hairline);
	line-height: 1.6;
	margin: 0;
}

/* Article grid: sticky TOC + article */
.sg-article-grid {
	display: grid;
	grid-template-columns: var(--toc) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
	padding-block: 44px 56px;
}
.sg-article-grid--notoc { grid-template-columns: minmax(0, 1fr); }
.sg-article { max-width: var(--article); min-width: 0; }
.sg-article-grid--notoc .sg-article { max-width: var(--article); margin-inline: auto; }

/* --------------------------------------------------------------------------
   15. Table of contents
   -------------------------------------------------------------------------- */

.sg-toc {
	border: 1px solid var(--hairline);
	padding: 22px 24px;
	position: sticky;
	top: 24px;
	font-size: 13.5px;
}
.sg-toc__title {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--meta);
	margin: 0 0 var(--s4);
	font-weight: 400;
}
.sg-toc__title .sg-jp { text-transform: none; }
.sg-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sg-toc__link {
	display: flex;
	gap: 10px;
	align-items: baseline;
	font-weight: 500;
	line-height: 1.4;
	color: var(--body);
}
.sg-toc__link::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1.5px solid var(--bullet);
	flex: none;
	position: relative;
	top: 1px;
	transition: background var(--motion), border-color var(--motion);
}
.sg-toc__link:hover { color: var(--sun); }
.sg-toc__link[aria-current='true'] { color: var(--sun); }
.sg-toc__link[aria-current='true']::before { background: var(--sun); border-color: var(--sun); }
.sg-toc__foot { border-top: 1px solid var(--hairline); margin-top: 20px; padding-top: var(--s4); }
.sg-toc__top {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	display: inline-block;
	padding-block: 3px;
}

/* Mobile: the same TOC as a collapsible box above the article */
.sg-toc--mobile { display: none; position: static; margin-bottom: var(--s6); }
.sg-toc--mobile > summary {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--meta);
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--s3);
	min-height: 24px;
}
.sg-toc--mobile > summary::-webkit-details-marker { display: none; }
.sg-toc--mobile > summary::after { content: '＋'; color: var(--sun); font-size: 14px; }
.sg-toc--mobile[open] > summary::after { content: '−'; }
.sg-toc--mobile[open] > summary { margin-bottom: var(--s4); }

/* --------------------------------------------------------------------------
   16. Article body — core block styling
   -------------------------------------------------------------------------- */

.sg-article > *:first-child { margin-top: 0; }

.sg-article p,
.sg-article ul,
.sg-article ol {
	font-size: 17px;
	line-height: 1.75;
	color: var(--body);
	margin: 0 0 var(--s5);
}

.sg-article h2 {
	font-size: 26px;
	line-height: 1.25;
	letter-spacing: -0.5px;
	margin: var(--s7) 0 var(--s4);
	scroll-margin-top: 24px;
}
.sg-article h2:first-child { margin-top: 0; }
.sg-h2__num {
	color: var(--gold-d);
	font-family: var(--mono);
	font-size: 16px;
	font-weight: 400;
	letter-spacing: 2px;
	margin-right: 12px;
	white-space: nowrap;
}
.sg-article h3 {
	font-size: 19px;
	margin: var(--s6) 0 var(--s3);
	scroll-margin-top: 24px;
}
.sg-article h4 { font-size: 17px; margin: var(--s5) 0 var(--s3); }

.sg-article a {
	color: var(--ink);
	border-bottom: 1px solid var(--gold);
}
.sg-article a:hover { color: var(--sun); border-color: var(--sun); }

.sg-article ul, .sg-article ol { padding-left: 22px; }
.sg-article li { margin-bottom: var(--s2); }
.sg-article li::marker { color: var(--sun); }
.sg-article ol li::marker { color: var(--gold-d); font-family: var(--mono); font-size: 15px; }

.sg-article strong { font-weight: 600; color: var(--ink); }

/* Figures + images */
.sg-article figure,
.sg-article .wp-block-image { margin: 0 0 28px; }
.sg-article figcaption,
.sg-article .wp-block-image figcaption {
	font-family: var(--mono);
	font-size: 11px;
	color: var(--meta);
	padding-top: var(--s2);
	padding-bottom: 10px;
	border-bottom: 1px solid var(--hairline);
	line-height: 1.6;
	text-align: left;
	margin: 0;
}
.sg-article img { width: 100%; }
.sg-article .alignwide { width: 100%; }
.sg-article .alignfull { width: 100%; }

/* Quote — sun disc, italic */
.sg-article blockquote,
.sg-article .wp-block-quote {
	display: flex;
	gap: 20px;
	margin: 0 0 28px;
	padding: 0;
	border: 0;
	background: none;
}
.sg-article blockquote::before,
.sg-article .wp-block-quote::before {
	content: '';
	width: 14px;
	height: 14px;
	background: var(--sun);
	border-radius: 50%;
	flex: none;
	margin-top: 8px;
}
.sg-article blockquote p,
.sg-article .wp-block-quote p {
	margin: 0 0 var(--s3);
	font-weight: 500;
	font-size: 22px;
	line-height: 1.5;
	font-style: italic;
	color: var(--ink);
}
.sg-article blockquote p:last-child,
.sg-article .wp-block-quote p:last-child { margin-bottom: 0; }
.sg-article blockquote cite,
.sg-article .wp-block-quote cite {
	display: block;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--meta);
	font-style: normal;
	margin-top: var(--s3);
}
/* "Plain" quote style — no disc, gold left rule */
.sg-article .wp-block-quote.is-style-sg-plain { display: block; border-left: 3px solid var(--gold); padding-left: var(--s5); }
.sg-article .wp-block-quote.is-style-sg-plain::before { display: none; }
.sg-article .wp-block-quote.is-style-sg-plain p { font-size: 18px; font-style: normal; }

.sg-article .wp-block-pullquote {
	border: 0;
	border-top: 3px solid var(--gold);
	border-bottom: 3px solid var(--gold);
	padding: var(--s6) 0;
	margin: 0 0 28px;
	text-align: left;
	background: none;
}
.sg-article .wp-block-pullquote p { font-size: 24px; font-style: italic; font-weight: 500; line-height: 1.45; color: var(--ink); }

/* Info box — "GOOD TO KNOW" */
.sg-info,
.sg-article .is-style-sg-info {
	border: 1px solid var(--gold);
	padding: 20px 24px;
	margin: 0 0 28px;
	background: none;
}
.sg-info__label,
.sg-article .is-style-sg-info > .sg-info__label {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--gold-d);
	margin: 0 0 var(--s2);
	font-weight: 500;
}
.sg-info__label .sg-jp { text-transform: none; letter-spacing: 2px; }
.sg-info p,
.sg-article .is-style-sg-info p {
	margin: 0 0 var(--s3);
	font-size: 15px;
	line-height: 1.7;
	color: var(--body);
}
.sg-info > *:last-child,
.sg-article .is-style-sg-info > *:last-child { margin-bottom: 0; }
.sg-info ul, .sg-info ol { font-size: 15px; margin-bottom: var(--s3); }

/* Fact table — ink border, ink header, zebra rows */
.sg-tablewrap { overflow-x: auto; margin: 0 0 28px; }
.sg-article table,
.sg-article .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--ink);
	font-size: 14px;
	background: var(--paper);
}
.sg-article .wp-block-table { margin: 0 0 28px; overflow-x: auto; }
.sg-article .wp-block-table figcaption { border-bottom: none; }
.sg-article th {
	background: var(--ink);
	color: var(--on-ink);
	font-family: var(--mono);
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	text-align: left;
	padding: 10px 16px;
	border: 0;
}
.sg-article td {
	padding: 12px 16px;
	border: 0;
	border-top: 1px solid var(--hairline);
	vertical-align: top;
	line-height: 1.6;
}
.sg-article tbody tr:nth-child(even) { background: var(--zebra); }
.sg-article tbody td:first-child { font-weight: 500; color: var(--ink); }
/* Numerals read as data, not prose */
.sg-article td { font-variant-numeric: tabular-nums; }

/* "Plain" table alternative */
.sg-article .wp-block-table.is-style-sg-plain table { border: 0; border-top: 1px solid var(--ink); }
.sg-article .wp-block-table.is-style-sg-plain th { background: none; color: var(--ink); border-bottom: 1px solid var(--ink); }
.sg-article .wp-block-table.is-style-sg-plain tbody tr:nth-child(even) { background: none; }

/* Code / preformatted */
.sg-article code, .sg-article kbd, .sg-article samp {
	font-family: var(--mono);
	font-size: 0.88em;
	background: var(--panel);
	padding: 2px 6px;
}
.sg-article pre {
	font-family: var(--mono);
	font-size: 13.5px;
	line-height: 1.7;
	background: var(--panel);
	border-left: 3px solid var(--gold);
	padding: var(--s5);
	overflow-x: auto;
	margin: 0 0 28px;
}
.sg-article pre code { background: none; padding: 0; }

/* Separator */
.sg-article hr,
.sg-article .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--hairline);
	margin: var(--s7) 0;
	height: 0;
	opacity: 1;
	width: 100%;
	max-width: none;
}
.sg-article .wp-block-separator.is-style-sg-gold { border-top: 3px solid var(--gold); }
.sg-article .wp-block-separator.is-style-sg-disc {
	border: 0;
	height: 12px;
	background: none;
	position: relative;
	text-align: center;
}
.sg-article .wp-block-separator.is-style-sg-disc::before {
	content: '';
	width: 12px;
	height: 12px;
	background: var(--sun);
	border-radius: 50%;
	display: inline-block;
}

/* Details / disclosure */
.sg-article details {
	border-top: 1px solid var(--hairline);
	padding: var(--s4) 0;
}
.sg-article details > summary {
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 20px;
	color: var(--ink);
	line-height: 1.5;
}
.sg-article details > summary::-webkit-details-marker { display: none; }
.sg-article details > summary::after { content: '＋'; color: var(--meta); flex: none; transition: color var(--motion); }
.sg-article details[open] > summary::after { color: var(--sun); }
.sg-article details > summary:hover { color: var(--sun); }

/* Embeds */
.sg-article .wp-block-embed { margin: 0 0 28px; }
.sg-article .wp-block-embed__wrapper { position: relative; }

/* Buttons inside content */
.sg-article .wp-block-button__link {
	background: var(--ink);
	color: var(--on-ink);
	border-radius: 0;
	font-family: var(--ui);
	font-weight: 500;
	font-size: 13.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	padding: 14px 30px;
	border: 1px solid var(--ink);
}
.sg-article .wp-block-button__link:hover { background: var(--sun); border-color: var(--sun); color: var(--on-ink); }
.sg-article .is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--ink);
	border-color: var(--ink);
}
.sg-article .is-style-outline .wp-block-button__link:hover { color: var(--sun); border-color: var(--sun); background: transparent; }

/* --------------------------------------------------------------------------
   17. FAQ (derived from content, or authored)
   -------------------------------------------------------------------------- */

.sg-faq { border-top: 1px solid var(--ink); margin: 0 0 34px; }
.sg-faq__item {
	border-bottom: 1px solid var(--hairline);
	padding: var(--s4) 0;
}
.sg-faq__q {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink);
	cursor: pointer;
	list-style: none;
	min-height: 24px;
	align-items: baseline;
}
.sg-faq__q::-webkit-details-marker { display: none; }
.sg-faq__q::after {
	content: '＋';
	color: var(--meta);
	flex: none;
	font-weight: 400;
	transition: color var(--motion), transform var(--motion);
	transform-origin: center;
}
.sg-faq__item[open] > .sg-faq__q::after { color: var(--sun); transform: rotate(45deg); }
.sg-faq__q:hover { color: var(--sun); }
.sg-faq__q:hover::after { color: var(--sun); }
.sg-faq__a { padding-top: 10px; }
.sg-faq__a > *:last-child { margin-bottom: 0; }
.sg-faq__a p, .sg-faq__a li {
	margin: 0 0 var(--s3);
	font-size: 15px;
	line-height: 1.7;
	color: var(--gray);
	max-width: 60ch;
}

/* --------------------------------------------------------------------------
   18. Author box
   -------------------------------------------------------------------------- */

.sg-authorbox {
	background: var(--panel);
	padding: 26px 28px;
	display: flex;
	gap: 22px;
	align-items: center;
	margin-top: var(--s7);
}
.sg-authorbox .sg-avatar { width: 64px; height: 64px; font-size: 16px; }
.sg-authorbox__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 6px;
	flex-wrap: wrap;
}
.sg-authorbox__name { font-weight: 600; font-size: 16px; color: var(--ink); }
.sg-authorbox__bio {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.65;
	color: var(--gray);
	max-width: 62ch;
}
.sg-authorbox__bio a { border-bottom: 1px solid var(--gold); }

/* --------------------------------------------------------------------------
   19. Related + prev/next
   -------------------------------------------------------------------------- */

.sg-related { border-top: 1px solid var(--ink); }
.sg-related__inner { padding-block: 40px 52px; }
.sg-related__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--s5);
	margin-bottom: 22px;
	flex-wrap: wrap;
}
.sg-related__head h2 { margin: 0; font-size: 22px; letter-spacing: -0.5px; }

.sg-adjacent {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s6);
	margin-top: 36px;
}
.sg-adjacent__link {
	border: 1px solid var(--hairline);
	padding: 18px 22px;
	display: block;
	color: var(--ink);
	transition: border-color var(--motion);
}
.sg-adjacent__link:hover { border-color: var(--ink); }
.sg-adjacent__link:hover .sg-adjacent__title { color: var(--sun); }
.sg-adjacent__link--next { text-align: right; grid-column: 2; }
.sg-adjacent__dir {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--meta);
}
.sg-adjacent__title {
	display: block;
	font-weight: 600;
	font-size: 16px;
	margin-top: 6px;
	line-height: 1.4;
	transition: color var(--motion);
}

/* --------------------------------------------------------------------------
   20. Archive / category
   -------------------------------------------------------------------------- */

.sg-archivehead { border-bottom: 1px solid var(--ink); }
.sg-archivehead__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: var(--s7);
	align-items: center;
	padding-block: 52px 44px;
}
.sg-archivehead--plain .sg-archivehead__inner { grid-template-columns: minmax(0, 1fr); }
.sg-archivehead__eyebrow {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--meta);
	margin-bottom: 14px;
	line-height: 1.6;
}
.sg-archivehead__eyebrow .sg-jp { text-transform: none; }
.sg-archivehead__title { margin: 0 0 14px; font-size: 46px; letter-spacing: -1px; line-height: 1.1; }
.sg-archivehead__desc {
	margin: 0 0 var(--s5);
	font-size: 16.5px;
	line-height: 1.7;
	color: var(--gray);
	max-width: 56ch;
}
.sg-archivehead__desc > *:last-child { margin-bottom: 0; }
.sg-archivehead__figure { justify-self: end; }
.sg-chips { display: flex; gap: 10px; flex-wrap: wrap; }

.sg-archive__body { padding-block: 44px 20px; }

/* Pagination */
.sg-pagination {
	display: flex;
	gap: var(--s2);
	align-items: center;
	justify-content: center;
	padding-block: 40px 48px;
	flex-wrap: wrap;
}
.sg-pagination .page-numbers {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 1px solid var(--hairline);
	font-weight: 500;
	font-size: 13px;
	color: var(--ink);
	transition: border-color var(--motion), color var(--motion);
	font-variant-numeric: tabular-nums;
}
.sg-pagination a.page-numbers:hover { border-color: var(--ink); color: var(--sun); }
.sg-pagination .page-numbers.current {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--on-ink);
	font-weight: 600;
}
.sg-pagination .page-numbers.dots {
	border: 0;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--meta);
	width: auto;
	min-width: 24px;
}
.sg-pagination .next.page-numbers,
.sg-pagination .prev.page-numbers {
	width: auto;
	padding: 0 16px;
	border-color: var(--ink);
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
}
.sg-pagination .next.page-numbers:hover,
.sg-pagination .prev.page-numbers:hover { border-color: var(--sun); color: var(--sun); }

/* --------------------------------------------------------------------------
   21. Page template
   -------------------------------------------------------------------------- */

.sg-page__head { padding-block: 44px var(--s6); }
.sg-page__title { font-size: 38px; letter-spacing: -0.5px; margin: 0 0 var(--s4); }
.sg-page__rule { border-top: 3px solid var(--gold); margin-bottom: var(--s7); }
.sg-page__body { padding-bottom: var(--s8); }

/* --------------------------------------------------------------------------
   22. 404
   -------------------------------------------------------------------------- */

.sg-404 {
	max-width: 680px;
	margin-inline: auto;
	padding: 84px var(--gutter) var(--s9);
	text-align: center;
}
.sg-404__disc {
	width: 110px;
	height: 110px;
	background: var(--sun);
	border-radius: 50%;
	margin: 0 auto 30px;
	display: grid;
	place-items: center;
	color: var(--paper);
	font-weight: 600;
	font-size: 26px;
	letter-spacing: 2px;
}
.sg-404 h1 { margin: 0 0 14px; font-size: 38px; letter-spacing: -1px; }
.sg-404__dek { margin: 0 0 30px; font-size: 16px; line-height: 1.7; color: var(--gray); }
.sg-404 .sg-field { margin: 0 auto 26px; }
.sg-404 .sg-chips { justify-content: center; }

/* --------------------------------------------------------------------------
   23. Comments (styled but off by default on guides)
   -------------------------------------------------------------------------- */

.sg-comments { padding-block: var(--s7); border-top: 1px solid var(--ink); }
.sg-comments__title { font-size: 22px; margin-bottom: var(--s5); }
.sg-comments .comment-list { list-style: none; margin: 0; padding: 0; }
.sg-comments .comment-list li { border-top: 1px solid var(--hairline); padding: var(--s5) 0; }
.sg-comments .comment-list .children { list-style: none; padding-left: var(--s6); margin-top: var(--s5); }
.sg-comments .comment-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--meta); margin-bottom: var(--s3); }
.sg-comments .comment-author b { font-weight: 600; color: var(--ink); }
.sg-comments .comment-form label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--meta); margin-bottom: 6px; }
.sg-comments .comment-form p { margin-bottom: var(--s4); }
.sg-comments .comment-form input[type='text'],
.sg-comments .comment-form input[type='email'],
.sg-comments .comment-form input[type='url'],
.sg-comments .comment-form textarea { width: 100%; }
.sg-comments .form-submit input[type='submit'] {
	background: var(--ink);
	color: var(--on-ink);
	border: 1px solid var(--ink);
	padding: 14px 30px;
	font-family: var(--ui);
	font-weight: 500;
	font-size: 13.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
}
.sg-comments .form-submit input[type='submit']:hover { background: var(--sun); border-color: var(--sun); }

/* --------------------------------------------------------------------------
   24. Misc WordPress
   -------------------------------------------------------------------------- */

.sticky .sg-card__kicker::after { content: ' · PINNED'; }
.bypostauthor { }

.sg-noresults { padding-block: var(--s8) var(--s9); }
.sg-noresults h1 { margin-bottom: var(--s4); }
.sg-noresults p { color: var(--gray); max-width: 60ch; }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-family: var(--mono); font-size: 11px; color: var(--meta); padding-top: var(--s2); }
.gallery-caption { font-family: var(--mono); font-size: 11px; color: var(--meta); }
.alignleft { float: left; margin: 0 var(--s5) var(--s4) 0; }
.alignright { float: right; margin: 0 0 var(--s4) var(--s5); }
.aligncenter { margin-inline: auto; }

.sg-article .wp-block-group.has-background { padding: var(--s5); }

/* --------------------------------------------------------------------------
   25. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	:root { --toc: 220px; }
	.sg-article-grid { gap: var(--s7); }
}

@media (max-width: 1024px) {
	:root { --gutter: 28px; }

	.sg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-hero { grid-template-columns: minmax(0, 1fr); gap: var(--s7); padding-block: var(--s7) var(--s7); }
	.sg-hero__disc { width: 110px; height: 110px; margin-bottom: var(--s5); }
	.sg-hero__title { font-size: 44px; }
	.sg-hero__aside { align-self: start; }
	.sg-starthere__inner { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
	.sg-newsletter { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
	.sg-newsletter .sg-field { max-width: 520px; }
	.sg-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }

	/* TOC becomes a collapsible box above the article */
	.sg-article-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.sg-toc--desktop { display: none; }
	.sg-toc--mobile { display: block; }
	.sg-article { max-width: none; }

	.sg-single__title { font-size: 36px; }
	.sg-archivehead__title { font-size: 38px; }
	.sg-archivehead__inner { padding-block: var(--s7) var(--s6); }
}

@media (max-width: 900px) {
	.sg-navtoggle { display: grid; }
	.sg-masthead__inner { position: relative; }
	.sg-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--paper);
		border-bottom: 1px solid var(--ink);
		border-top: 1px solid var(--hairline);
		padding: var(--s4) var(--gutter) var(--s5);
		z-index: 50;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}
	.sg-nav.is-open { display: flex; }
	.sg-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}
	.sg-nav li { border-bottom: 1px solid var(--hairline); }
	.sg-nav li:last-child { border-bottom: 0; }
	.sg-nav a { display: block; padding: var(--s3) 0; border-bottom: 2px solid transparent; }
	.sg-nav .current-menu-item > a,
	.sg-nav .sg-nav__item--current > a { color: var(--sun); border-bottom-color: transparent; }
	.sg-nav ul ul {
		position: static;
		display: flex;
		border: 0;
		padding: 0 0 var(--s3) var(--s4);
		min-width: 0;
	}
	.sg-nav ul ul a { padding: var(--s2) 0; }
	.sg-masthead__tools { display: flex; align-items: center; gap: var(--s3); }
	.sg-searchbar__inner { justify-content: stretch; }
	.sg-searchbar .sg-field { max-width: none; }
}

@media (max-width: 780px) {
	.sg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-adjacent { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
	.sg-adjacent__link--next { grid-column: 1; text-align: left; }
	.sg-featured img { aspect-ratio: 2 / 1; }
	.sg-authorbox { flex-direction: column; align-items: flex-start; gap: var(--s4); }
	.sg-archivehead__inner { grid-template-columns: minmax(0, 1fr); }
	.sg-archivehead__figure { justify-self: start; }
	.sg-archivehead__figure .sg-picto { width: 96px; height: 96px; }
}

@media (max-width: 640px) {
	:root { --gutter: 20px; }

	.sg-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
	.sg-tiles { grid-template-columns: minmax(0, 1fr); }
	.sg-hero__title { font-size: 34px; letter-spacing: -0.5px; }
	.sg-hero__actions { flex-direction: column; align-items: stretch; }
	.sg-btn { width: 100%; }
	.sg-single__title { font-size: 30px; letter-spacing: -0.5px; }
	.sg-single__dek { font-size: 17px; }
	.sg-archivehead__title { font-size: 32px; letter-spacing: -0.5px; }
	.sg-starthere__title { font-size: 26px; }
	.sg-newsletter__title { font-size: 24px; }
	.sg-article h2 { font-size: 23px; }
	.sg-h2__num { display: block; margin-right: 0; margin-bottom: 4px; font-size: 14px; }
	.sg-article blockquote p,
	.sg-article .wp-block-quote p { font-size: 19px; }
	.sg-footer__cols { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
	.sg-footer__bottom { flex-direction: column; align-items: flex-start; gap: var(--s3); }
	.sg-byline { gap: var(--s3); }
	.sg-404 { padding-block: var(--s7) var(--s8); }
	.sg-404__disc { width: 88px; height: 88px; font-size: 22px; }
	.sg-404 h1 { font-size: 30px; }
	.sg-pillar { gap: var(--s3); flex-wrap: wrap; }
	.sg-pillar__title { flex-basis: calc(100% - 44px); font-size: 15.5px; }
	.sg-pillar__time { margin-left: 44px; }
	.sg-announce { font-size: 10px; letter-spacing: 1.5px; }
	.sg-logo__text { font-size: 15px; letter-spacing: 4px; }
	.sg-logo__disc { width: 24px; height: 24px; }
	.sg-comments .comment-list .children { padding-left: var(--s4); }
}

@media (max-width: 400px) {
	.sg-logo__text { font-size: 13px; letter-spacing: 3px; }
	.sg-hero__title { font-size: 30px; }
	.sg-single__title { font-size: 26px; }
	.sg-article table { font-size: 13px; }
	.sg-article th, .sg-article td { padding: 10px 12px; }
}

/* --------------------------------------------------------------------------
   26. Print
   -------------------------------------------------------------------------- */

@media print {
	.sg-announce, .sg-masthead, .sg-footer, .sg-toc, .sg-related,
	.sg-newsletter, .sg-searchbar, .sg-pagination { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.sg-article { max-width: none; }
	a { color: inherit; border: 0 !important; }
	.sg-article a::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #666; }
}
