/**
 * Base styles — reset, body, typography.
 *
 * @package GraceTheme
 */

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

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-body);
	background: var(--cream);
	color: var(--text);
	overflow-x: hidden;
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.2;
}

a {
	color: var(--terracotta);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

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

/* ------------------------------------------------------------
 * Screen-reader only utility (required by WCAG)
 * ------------------------------------------------------------ */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--cream, #fdfaf6);
	clip: auto !important;
	clip-path: none;
	color: var(--espresso, #2c1810);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 8px;
	line-height: normal;
	padding: 10px 20px;
	text-decoration: none;
	top: 8px;
	width: auto;
	z-index: 100000;
}

/* ------------------------------------------------------------
 * Global :focus-visible — visible keyboard focus for all
 * interactive elements that don't set their own outline.
 * This is the WCAG 2.4.7 / 2.4.11 safety net.
 * ------------------------------------------------------------ */
:focus-visible {
	outline: 3px solid var(--terracotta, #c1694f);
	outline-offset: 3px;
}

/* Remove default outline only when :focus-visible is supported
   (browsers that don't support it fall back to :focus) */
:focus:not(:focus-visible) {
	outline: none;
}

/* ------------------------------------------------------------
 * WordPress required alignment classes
 * ------------------------------------------------------------ */
.alignleft {
	float: left;
	margin: 0 var(--space-4, 1.5rem) var(--space-4, 1.5rem) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--space-4, 1.5rem) var(--space-4, 1.5rem);
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.alignnone {
	margin: 0;
}

/* ------------------------------------------------------------
 * WordPress image caption
 * ------------------------------------------------------------ */
.wp-caption {
	max-width: 100%;
}

.wp-caption img {
	display: block;
}

.wp-caption-text,
.wp-caption figcaption {
	font-size: 0.875rem;
	color: #666;
	text-align: center;
	margin-top: 0.5rem;
}

/* ------------------------------------------------------------
 * Sticky post indicator
 * ------------------------------------------------------------ */
.sticky .gt-entry-header::before {
	content: attr(data-sticky-label);
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--gt-terracotta, #b55a3a);
	color: #fff;
	padding: 2px 8px;
	border-radius: 3px;
	margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------
 * Content typography — headings, blockquotes, tables, code
 * ------------------------------------------------------------ */
.gt-entry-content h1,
.gt-entry-content h2,
.gt-entry-content h3,
.gt-entry-content h4,
.gt-entry-content h5,
.gt-entry-content h6 {
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

.gt-entry-content p,
.gt-entry-content ul,
.gt-entry-content ol,
.gt-entry-content dl {
	margin-bottom: 1.25em;
}

.gt-entry-content ul,
.gt-entry-content ol {
	padding-left: 1.5em;
}

.gt-entry-content ul { list-style: disc; }
.gt-entry-content ol { list-style: decimal; }

.gt-entry-content dl dt {
	font-weight: 600;
}

.gt-entry-content dl dd {
	margin-left: 1.5em;
	margin-bottom: 0.5em;
}

.gt-entry-content blockquote {
	border-left: 4px solid var(--gt-terracotta, #b55a3a);
	margin: 1.5em 0;
	padding: 0.75em 1.25em;
	color: #555;
	font-style: italic;
}

.gt-entry-content blockquote cite {
	display: block;
	font-size: 0.875rem;
	font-style: normal;
	margin-top: 0.5em;
}

.gt-entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.25em;
	font-size: 0.9375rem;
}

.gt-entry-content table th,
.gt-entry-content table td {
	border: 1px solid #ddd;
	padding: 0.5em 0.75em;
	text-align: left;
}

.gt-entry-content table th {
	background: #f5f5f5;
	font-weight: 600;
}

.gt-entry-content pre {
	background: #f4f4f4;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 1em;
	overflow-x: auto;
	font-family: monospace;
	font-size: 0.875rem;
	line-height: 1.6;
	margin-bottom: 1.25em;
}

.gt-entry-content code {
	background: #f4f4f4;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 0.125em 0.375em;
	font-family: monospace;
	font-size: 0.875em;
}

.gt-entry-content pre code {
	background: none;
	border: none;
	padding: 0;
}

.gt-entry-content address {
	font-style: italic;
	margin-bottom: 1.25em;
}

/* ------------------------------------------------------------
 * Post navigation (prev / next)
 * ------------------------------------------------------------ */
.post-navigation {
	display: flex;
	gap: 1rem;
	margin: 2rem 0;
	padding: 1rem 0;
	border-top: 1px solid #ddd;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	flex: 1;
}

.post-navigation .nav-next {
	text-align: right;
}

.post-navigation .nav-subtitle {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
}

.post-navigation .nav-title {
	font-weight: 600;
}

/* ------------------------------------------------------------
 * Multi-page post links
 * ------------------------------------------------------------ */
.gt-page-links {
	margin: 1.5rem 0;
	font-size: 0.9375rem;
}

.gt-page-links a {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid var(--gt-terracotta, #b55a3a);
	border-radius: 3px;
	margin: 0 2px;
}

/* ------------------------------------------------------------
 * Archive description
 * ------------------------------------------------------------ */
.gt-archive-description {
	margin-top: 0.5rem;
	margin-bottom: 1.5rem;
	color: #555;
}

/* ------------------------------------------------------------
 * Passwords-protected post form
 * ------------------------------------------------------------ */
.post-password-form label {
	display: block;
	margin-bottom: 0.5rem;
}

.post-password-form input[type="password"] {
	padding: 0.4em 0.75em;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-right: 0.5rem;
}

/* ------------------------------------------------------------
 * Gallery
 * ------------------------------------------------------------ */
.gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25em;
}

.gallery-item {
	flex: 1 0 calc(33.333% - 0.5rem);
	min-width: 150px;
}

.gallery-item img {
	width: 100%;
	height: auto;
}

.gallery-caption {
	font-size: 0.8125rem;
	color: #666;
	text-align: center;
}
