/*
Theme Name: Rafael Hett
Theme URI: https://rafaelhett.com
Author: Rafael Hett
Description: Editorial block theme for rafaelhett.com: literature, fashion and teaching. Didone display type, ink and paper greys, violet accent, tape-measure dividers and soft panels.
Version: 1.0.3
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rafaelhett
*/

/* ------------------------------------------------------------
   Everything below is loaded on the site AND in the editor.
   Colours come from theme.json presets (var(--wp--preset--color--*)).
   ------------------------------------------------------------ */

:root {
	--rh-ink: var(--wp--preset--color--ink);
	--rh-paper: var(--wp--preset--color--paper);
	--rh-muted: var(--wp--preset--color--muted);
	--rh-rule: var(--wp--preset--color--rule);
	--rh-panel: var(--wp--preset--color--lavender);
	--rh-pill: var(--wp--preset--color--lilac);
	--rh-accent: var(--wp--preset--color--violet);
	--rh-accent-deep: var(--wp--preset--color--violet-deep);
	--rh-mono: var(--wp--preset--font-family--mono);
	--rh-display: var(--wp--preset--font-family--display);
}

/* Italic words inside display headings take the accent colour */
h1 em, h2 em, h3 em,
.rh-accent-em em { color: var(--rh-accent); }
.rh-band h1 em, .rh-band h2 em, .rh-band h3 em { color: inherit; }

/* Small uppercase label above headings */
.rh-eyebrow {
	font-family: var(--rh-mono);
	font-size: 13px !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rh-muted);
	margin-block: 0;
}
.rh-band .rh-eyebrow { color: #B7BBC6; }

/* Muted helper text */
.rh-muted { color: var(--rh-muted); }
.rh-band .rh-muted { color: #D5D8DF; }

/* Large intro paragraph */
.rh-lead { font-size: 20px; line-height: 1.55; max-width: 36em; }

/* Tape-measure divider (use a Separator block with class rh-tape) */
.wp-block-separator.rh-tape,
.wp-block-separator.is-style-rh-tape-style {
	border: 0 !important;
	border-top: 1px solid var(--rh-ink) !important;
	height: 16px !important;
	opacity: 1 !important;
	background-color: transparent !important;
	background-image:
		repeating-linear-gradient(90deg, var(--rh-ink) 0 1px, transparent 1px 50px),
		repeating-linear-gradient(90deg, var(--rh-muted) 0 1px, transparent 1px 10px);
	background-size: 100% 16px, 100% 8px;
	background-repeat: no-repeat;
	width: 100% !important;
	max-width: none !important;
}

/* Soft panel (cards, call-outs) */
.rh-card {
	background: var(--rh-panel);
	border-radius: 22px;
	padding: clamp(28px, 3vw, 40px) !important;
}
.rh-card.rh-card--large { border-radius: 28px; padding: clamp(28px, 5vw, 56px) !important; }
.rh-card > * { margin-block: 0; }
.rh-card > * + * { margin-block-start: 14px; }
.rh-card .wp-block-buttons { margin-block-start: 22px; }

/* Purple pill label */
.rh-pill {
	display: inline-block;
	width: fit-content;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--rh-pill);
	color: var(--rh-accent-deep);
	font-family: var(--rh-mono);
	font-size: 12px !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Dark band sections */
.rh-band { background: var(--rh-ink); color: var(--rh-paper); }
.rh-band a:where(:not(.wp-element-button)) { color: var(--rh-paper); }
.rh-band .wp-block-button__link { background: var(--rh-paper); color: var(--rh-ink); }
.rh-band .is-style-outline .wp-block-button__link { background: transparent; color: var(--rh-paper); border-color: var(--rh-paper); }

/* Hairline record lists: a Group (class rh-records) holding Groups (class rh-record),
   each with a first paragraph (year) and a second paragraph (text). */
.rh-records > .rh-record {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
	align-items: baseline;
	padding-block: 18px;
	border-top: 1px solid var(--rh-rule);
	margin-block: 0 !important;
}
.rh-records > .rh-record:first-child { border-top-color: var(--rh-ink); }
.rh-records > .rh-record:last-child { border-bottom: 1px solid var(--rh-rule); }
.rh-band .rh-records > .rh-record { border-color: #5C6170; }
.rh-records > .rh-record > p { margin: 0; }
.rh-records > .rh-record > p:first-child {
	flex: 0 0 110px;
	font-family: var(--rh-mono);
	font-size: 14px;
	color: var(--rh-muted);
}
.rh-band .rh-records > .rh-record > p:first-child { color: #B7BBC6; }
.rh-records > .rh-record > :nth-child(2) { flex: 1 1 320px; min-width: 0; margin: 0; }
.rh-records > .rh-record > .wp-block-group > * { margin: 0; }
.rh-records .rh-sub { font-size: 15px; color: var(--rh-muted); }
.rh-band .rh-records .rh-sub { color: #B7BBC6; }
.rh-records .rh-tag { font-family: var(--rh-mono); font-size: 12px; color: var(--rh-muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* Columns of short items with a top hairline */
.rh-ruled > .wp-block-column { border-top: 1px solid var(--rh-ink); padding-top: 20px; }
.rh-band .rh-ruled > .wp-block-column { border-top-color: #5C6170; }
.rh-ruled > .wp-block-column > * { margin-block: 0; }
.rh-ruled > .wp-block-column > * + * { margin-block-start: 12px; }

/* Rounded images */
.rh-rounded img, .rh-rounded.wp-block-cover { border-radius: 22px; }
.rh-portrait img { border-radius: 22px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

/* Header */
.rh-header .wp-block-navigation { font-size: 15px; font-weight: 500; }
.rh-header .wp-block-site-title a { font-family: var(--rh-display); font-style: italic; text-decoration: none; }
.rh-lang { font-family: var(--rh-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--rh-muted); }
.rh-lang a { color: var(--rh-muted); }

/* Category pills on the Notebook (Categories block with class rh-cat-pills) */
.rh-cat-pills ul, ul.rh-cat-pills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.rh-cat-pills li { margin: 0; }
.rh-cat-pills a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
	border: 1px solid var(--rh-rule); border-radius: 999px;
	font-size: 14px; font-weight: 600; text-decoration: none; color: var(--rh-ink);
}
.rh-cat-pills a:hover, .rh-cat-pills .current-cat a { background: var(--rh-accent); border-color: var(--rh-accent); color: #fff; }

/* Notebook list rows */
.rh-post-list .wp-block-post { border-top: 1px solid var(--rh-rule); padding-block: 28px; margin: 0; }
.rh-post-list .wp-block-post:last-child { border-bottom: 1px solid var(--rh-rule); }
.rh-post-list .wp-block-post-title a { text-decoration: none; }
.rh-post-list .wp-block-post-title a:hover { color: var(--rh-accent); }

/* Reading layout for posts */
.rh-prose { font-family: var(--wp--preset--font-family--reading); font-size: 21px; line-height: 1.65; }
.rh-prose h2, .rh-prose h3 { font-family: var(--rh-display); }
.rh-prose .has-drop-cap:not(:focus)::first-letter {
	font-family: var(--rh-display);
	color: var(--rh-accent);
	font-size: 4.2em;
	line-height: 0.8;
	margin: 0.08em 0.1em 0 0;
	font-weight: 500;
}
.rh-prose blockquote, .rh-prose .wp-block-quote {
	border-left: 2px solid var(--rh-accent);
	padding: 4px 0 4px 28px;
	margin-inline: 0;
	font-style: italic;
	font-size: 1.2em;
}
.rh-prose .wp-block-footnotes { font-family: var(--wp--preset--font-family--body); font-size: 15px; color: var(--rh-muted); border-top: 1px solid var(--rh-rule); padding-top: 20px; }
.rh-tags a {
	display: inline-block; padding: 6px 14px; border-radius: 999px;
	background: var(--rh-pill); color: var(--rh-ink); font-size: 14px; text-decoration: none; margin: 0 6px 6px 0;
}
.rh-tags .wp-block-post-terms__separator { display: none; }

/* Reading-circle books (Details blocks with class rh-book) */
.rh-book {
	background: var(--rh-panel);
	border-radius: 22px;
	padding: 6px clamp(20px, 3vw, 36px);
	margin-block: 12px 0 !important;
}
.rh-book > summary {
	cursor: pointer;
	padding-block: 22px;
	font-family: var(--rh-display);
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.2;
	list-style-position: outside;
}
.rh-book > summary::marker { color: var(--rh-accent); }
.rh-book[open] { padding-bottom: clamp(20px, 3vw, 36px); }
.rh-book > :not(summary) { margin-block: 0 0; }
.rh-book > :not(summary) + :not(summary) { margin-block-start: 14px; }
.rh-question { font-family: var(--rh-display); font-style: italic; font-size: 24px; line-height: 1.3; color: var(--rh-accent); }

/* File links (a Group with class rh-file holding a paragraph with a link) */
.rh-file {
	background: #fff;
	border-radius: 16px;
	padding: 14px 18px !important;
	display: flex; gap: 14px; align-items: center;
}
.rh-file > p { margin: 0 !important; }
.rh-file > p:first-child {
	flex: 0 0 44px; height: 52px; border-radius: 8px; background: var(--rh-pill); color: var(--rh-accent-deep);
	display: flex; align-items: center; justify-content: center; font-family: var(--rh-mono); font-size: 11px;
}
.rh-file a { font-weight: 600; text-decoration: none; }
.rh-file > .wp-block-group { flex: 1 1 auto; min-width: 0; }
.rh-file > .wp-block-group > * { margin: 0 !important; }
.rh-file .rh-sub { font-size: 13px; color: var(--rh-muted); }
.rh-files { display: flex; flex-direction: column; gap: 12px; }
.rh-files > * { margin: 0 !important; }

/* Rules list with purple square bullets (List block with class rh-rules) */
.rh-rules { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 18px; }
.rh-rules li { position: relative; padding-left: 28px; }
.rh-rules li::before {
	content: ""; position: absolute; left: 2px; top: 0.62em;
	width: 8px; height: 8px; background: var(--rh-accent); border-radius: 1px;
}

/* Contact Form 7 layout */
.wpcf7 form > p { margin: 0 0 18px; }
.wpcf7 label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.wpcf7 .wpcf7-form-control-wrap { display: block; font-weight: 400; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 select, .wpcf7 textarea { width: 100%; box-sizing: border-box; }
.wpcf7 .wpcf7-checkbox label, .wpcf7 .wpcf7-acceptance label { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 16px; }
.wpcf7 input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rh-accent); flex: 0 0 auto; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-not-valid-tip { font-size: 14px; color: #A3262A; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output { border-radius: 12px; margin: 16px 0 0; padding: 12px 16px; }
.wpcf7 form > p:last-of-type { font-size: 13px; color: var(--rh-muted); }

/* Forms from plugins (WPForms, Contact Form 7, Jetpack) pick up the site look */
.rh-form input[type="text"], .rh-form input[type="email"], .rh-form input[type="tel"], .rh-form textarea, .rh-form select,
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea, .wpcf7 select,
.wpforms-container input[type="text"], .wpforms-container input[type="email"], .wpforms-container textarea {
	border: 1px solid var(--rh-rule) !important;
	border-radius: 12px !important;
	background: #F7F7F8 !important;
	min-height: 48px;
	padding: 10px 14px !important;
	font: inherit;
}
.wpcf7 input[type="submit"], .wpforms-container button[type="submit"] {
	border-radius: 999px !important; background: var(--rh-ink) !important; color: var(--rh-paper) !important;
	min-height: 52px; padding: 0 30px !important; border: 0 !important; font-weight: 600;
}

/* Fig. 1 card on the home page */
.rh-figure { background: var(--rh-panel); border-radius: 22px; overflow: hidden; padding: 0 !important; }
.rh-figure::before {
	content: ""; display: block; height: 22px; border-bottom: 1px solid var(--rh-rule);
	background-image:
		repeating-linear-gradient(90deg, var(--rh-ink) 0 1px, transparent 1px 50px),
		repeating-linear-gradient(90deg, #A8842C 0 1px, transparent 1px 10px);
	background-size: 100% 14px, 100% 7px; background-repeat: no-repeat; background-position: 0 100%, 0 100%;
}
.rh-figure > .wp-block-group { padding: 28px; }

/* Stat list (dl-like) */
.rh-stats { border-top: 1px solid var(--rh-ink); padding-top: 20px; }
.rh-stats .rh-stat-value { font-family: var(--rh-display); font-size: 30px; line-height: 1.2; margin: 4px 0 0; }

/* Accessibility */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--rh-accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
