/*
Theme Name: Textual
Theme URI: https://example.com/textual
Author: Antigravity
Author URI: https://example.com
Description: A minimalist, typography-focused block theme where text is the design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Tags: one-column, custom-colors, custom-menu, editor-style, sticky-post, threaded-comments, translation-ready, wide-blocks, block-templates
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: textual
*/

/* ==========================================================================
   RESET & BASELINE
   ========================================================================== */

html {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: var(--textual-site-padding, 2rem);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

/* ==========================================================================
   TYPOGRAPHIC FLOURISHES
   ========================================================================== */

/* Drop Caps - First letter of first paragraph in posts */
.single .wp-block-post-content > p:first-of-type::first-letter,
.page .wp-block-post-content > p:first-of-type::first-letter,
.entry-content > p:first-of-type::first-letter {
  font-family: var(--wp--preset--font-family--display);
  font-size: 4.5em;
  font-weight: 900;
  float: left;
  line-height: 0.8;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--wp--preset--color--contrast);
}

/* Decorative text dividers */
.wp-block-separator.is-style-dots::before {
  content: "⁂";
  font-size: 1.5rem;
  letter-spacing: 0.5em;
}

/* Alternative asterism divider */
.wp-block-separator.is-style-asterism::before {
  content: "* * *";
  font-size: 1rem;
  letter-spacing: 1em;
  font-weight: 300;
}

/* ==========================================================================
   SELECTION STYLING
   ========================================================================== */

::selection {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

::-moz-selection {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* ==========================================================================
   LINK UNDERLINE ANIMATION
   ========================================================================== */

.wp-block-post-content a:not(.wp-block-button__link),
.entry-content a:not(.wp-block-button__link) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: text-decoration-thickness 0.2s ease;
}

.wp-block-post-content a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):hover {
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   TYPOGRAPHIC UTILITIES
   ========================================================================== */

/* Large lead paragraph */
.has-large-font-size:first-of-type,
.is-style-lead {
  font-size: var(--wp--preset--font-size--large);
  line-height: 1.5;
}

/* Small caps utility */
.is-style-small-caps {
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* Monospaced inline code */
code, kbd, pre {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* Block code styling */
pre.wp-block-code {
  background: var(--wp--preset--color--light-gray);
  border: 1px solid var(--wp--preset--color--contrast);
  padding: var(--wp--preset--spacing--30);
  overflow-x: auto;
}

/* Inline code */
:not(pre) > code {
  background: var(--wp--preset--color--light-gray);
  padding: 0.15em 0.35em;
  border-radius: 2px;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

/* Clean header spacing */
header.wp-block-template-part {
  padding-top: var(--wp--preset--spacing--40);
  padding-bottom: var(--wp--preset--spacing--40);
  margin-bottom: var(--wp--preset--spacing--50);
  border-bottom: 1px solid var(--wp--preset--color--contrast);
}

/* Navigation link styling */
.wp-block-navigation a {
  text-decoration: none;
}

.wp-block-navigation a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer.wp-block-template-part {
  margin-top: var(--wp--preset--spacing--70);
  padding-top: var(--wp--preset--spacing--40);
  padding-bottom: var(--wp--preset--spacing--40);
  border-top: 1px solid var(--wp--preset--color--contrast);
}

/* ==========================================================================
   POST META STYLING
   ========================================================================== */

.wp-block-post-date,
.wp-block-post-author {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--dark-gray);
}

/* ==========================================================================
   BLOCKQUOTE ENHANCEMENTS
   ========================================================================== */

blockquote.wp-block-quote {
  margin-left: 0;
  margin-right: 0;
}

blockquote.wp-block-quote cite,
.wp-block-pullquote cite {
  font-size: var(--wp--preset--font-size--small);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-top: var(--wp--preset--spacing--20);
}

blockquote.wp-block-quote cite::before,
.wp-block-pullquote cite::before {
  content: "— ";
}

/* ==========================================================================
   FOCUS STATES (Accessibility)
   ========================================================================== */

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 2px;
}

/* ==========================================================================
   COMMENT SECTION
   ========================================================================== */

/* Comment section wrapper */
.comments-area {
  margin-top: var(--wp--preset--spacing--70);
  padding-top: var(--wp--preset--spacing--50);
  border-top: 1px solid var(--wp--preset--color--contrast);
}

/* Comments title */
.comments-title,
.comment-reply-title {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--large);
  font-weight: 700;
  margin-bottom: var(--wp--preset--spacing--40);
  letter-spacing: -0.02em;
}

/* Comment list */
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list li {
  margin-bottom: var(--wp--preset--spacing--40);
  padding-bottom: var(--wp--preset--spacing--40);
  border-bottom: 1px solid var(--wp--preset--color--light-gray);
}

.comment-list li:last-child {
  border-bottom: none;
}

/* Comment author */
.comment-author {
  font-weight: 600;
  margin-bottom: var(--wp--preset--spacing--10);
}

.comment-author .fn {
  font-style: normal;
}

.comment-author .says {
  display: none;
}

/* Comment metadata */
.comment-metadata {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--dark-gray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--wp--preset--spacing--20);
}

.comment-metadata a {
  color: inherit;
  text-decoration: none;
}

.comment-metadata a:hover {
  text-decoration: underline;
}

/* Comment content */
.comment-content {
  line-height: 1.7;
}

.comment-content p {
  margin: 0 0 1em;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* Reply link */
.reply {
  margin-top: var(--wp--preset--spacing--20);
}

.comment-reply-link {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: opacity 0.2s ease;
}

.comment-reply-link:hover {
  opacity: 0.7;
}

/* Nested comments (replies) */
.comment-list .children {
  list-style: none;
  margin: var(--wp--preset--spacing--40) 0 0 var(--wp--preset--spacing--40);
  padding-left: var(--wp--preset--spacing--40);
  border-left: 2px solid var(--wp--preset--color--light-gray);
}

/* ==========================================================================
   COMMENT FORM
   ========================================================================== */

.comment-respond {
  margin-top: var(--wp--preset--spacing--50);
}

/* Required fields note */
.comment-notes,
.logged-in-as {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--dark-gray);
  margin-bottom: var(--wp--preset--spacing--30);
}

/* Form fields wrapper */
.comment-form p {
  margin-bottom: var(--wp--preset--spacing--30);
}

/* Labels */
.comment-form label {
  display: block;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--wp--preset--spacing--10);
  color: var(--wp--preset--color--contrast);
}

/* Required asterisk */
.comment-form .required {
  color: var(--wp--preset--color--contrast);
  font-weight: 400;
}

/* Text inputs and textarea */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  max-width: 32rem;
  padding: var(--wp--preset--spacing--20);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.5;
  color: var(--wp--preset--color--contrast);
  background-color: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  border-color: var(--wp--preset--color--contrast);
  box-shadow: 0 0 0 1px var(--wp--preset--color--contrast);
  outline: none;
}

.comment-form textarea {
  max-width: 100%;
  min-height: 10rem;
  resize: vertical;
}

/* Checkbox styling */
.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--wp--preset--spacing--10);
}

.comment-form-cookies-consent input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15em;
  accent-color: var(--wp--preset--color--contrast);
  cursor: pointer;
}

.comment-form-cookies-consent label {
  display: inline;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--wp--preset--color--dark-gray);
  cursor: pointer;
}

/* Submit button */
.comment-form .form-submit {
  margin-top: var(--wp--preset--spacing--40);
}

.comment-form input[type="submit"] {
  display: inline-block;
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.comment-form input[type="submit"]:hover {
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
}

.comment-form input[type="submit"]:focus {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 2px;
}

/* No comments message */
.no-comments {
  font-style: italic;
  color: var(--wp--preset--color--dark-gray);
}

/* ==========================================================================
   SEARCH FORM
   ========================================================================== */

.wp-block-search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--20);
}

.wp-block-search__label {
  width: 100%;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--wp--preset--spacing--10);
}

.wp-block-search__input {
  flex: 1;
  min-width: 200px;
  padding: var(--wp--preset--spacing--20);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--medium);
  color: var(--wp--preset--color--contrast);
  background-color: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 0.2s ease;
}

.wp-block-search__input:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--wp--preset--color--contrast);
}

.wp-block-search__input::placeholder {
  color: var(--wp--preset--color--dark-gray);
}

.wp-block-search__button {
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.wp-block-search__button:hover {
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
}

.wp-block-search__button:focus {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 2px;
}

/* Icon-only search button */
.wp-block-search__button.has-icon {
  padding: var(--wp--preset--spacing--20);
}

.wp-block-search__button svg {
  fill: currentColor;
  width: 1.25em;
  height: 1.25em;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.wp-block-query-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--20);
  align-items: center;
  margin-top: var(--wp--preset--spacing--60);
  padding-top: var(--wp--preset--spacing--40);
  border-top: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: opacity 0.2s ease;
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  opacity: 0.7;
}

.wp-block-query-pagination-numbers {
  display: flex;
  gap: var(--wp--preset--spacing--10);
}

.wp-block-query-pagination-numbers .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 500;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-numbers .page-numbers.current {
  background-color: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

.wp-block-query-pagination-numbers .page-numbers.dots {
  border: none;
}

/* Single post navigation */
.post-navigation-link {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.post-navigation-link a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.post-navigation-link a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.wp-block-table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--wp--preset--spacing--40) 0;
}

.wp-block-table table {
  width: 100%;
}

.wp-block-table th,
.wp-block-table td,
th, td {
  padding: var(--wp--preset--spacing--20);
  text-align: left;
  border-bottom: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-table th,
th {
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--wp--preset--color--contrast);
}

.wp-block-table tbody tr:hover,
tbody tr:hover {
  background-color: var(--wp--preset--color--light-gray);
}

/* Striped table style */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background-color: var(--wp--preset--color--light-gray);
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd):hover {
  background-color: var(--wp--preset--color--light-gray);
}

/* Table caption */
.wp-block-table figcaption,
table caption {
  font-size: var(--wp--preset--font-size--small);
  font-style: italic;
  color: var(--wp--preset--color--dark-gray);
  margin-top: var(--wp--preset--spacing--20);
  text-align: center;
}

/* ==========================================================================
   LISTS
   ========================================================================== */

.wp-block-post-content ul,
.wp-block-post-content ol,
.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
  margin: var(--wp--preset--spacing--30) 0;
}

.wp-block-post-content li,
.entry-content li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.wp-block-post-content li::marker,
.entry-content li::marker {
  color: var(--wp--preset--color--dark-gray);
}

/* Nested lists */
.wp-block-post-content ul ul,
.wp-block-post-content ol ol,
.wp-block-post-content ul ol,
.wp-block-post-content ol ul,
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
  margin-top: 0.5em;
  margin-bottom: 0;
}

/* List block specific */
.wp-block-list {
  padding-left: 1.5em;
}

/* ==========================================================================
   CATEGORIES & TAGS
   ========================================================================== */

.wp-block-post-terms {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wp-block-post-terms a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: opacity 0.2s ease;
}

.wp-block-post-terms a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Tag cloud */
.wp-block-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--10);
}

.wp-block-tag-cloud a {
  display: inline-block;
  padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--20);
  font-size: var(--wp--preset--font-size--small) !important;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-tag-cloud a:hover {
  background-color: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* Categories list widget */
.wp-block-categories-list,
.wp-block-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wp-block-categories-list li,
.wp-block-categories li {
  padding: var(--wp--preset--spacing--10) 0;
  border-bottom: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-categories-list li:last-child,
.wp-block-categories li:last-child {
  border-bottom: none;
}

.wp-block-categories-list a,
.wp-block-categories a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.wp-block-categories-list a:hover,
.wp-block-categories a:hover {
  text-decoration: underline;
}

/* Post count */
.wp-block-categories-list .count,
.wp-block-categories .count {
  color: var(--wp--preset--color--dark-gray);
  font-size: var(--wp--preset--font-size--small);
}

/* ==========================================================================
   POST EXCERPT
   ========================================================================== */

.wp-block-post-excerpt {
  color: var(--wp--preset--color--dark-gray);
  line-height: 1.6;
}

.wp-block-post-excerpt__excerpt {
  margin: 0;
}

.wp-block-post-excerpt__more-text,
.wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: var(--wp--preset--spacing--20);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.wp-block-post-excerpt__more-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.wp-block-button__link {
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Fill style (default) */
.wp-block-button.is-style-fill .wp-block-button__link,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-fill .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  color: var(--wp--preset--color--contrast);
  background-color: var(--wp--preset--color--base);
}

/* Outline style */
.wp-block-button.is-style-outline .wp-block-button__link {
  color: var(--wp--preset--color--contrast);
  background-color: transparent;
  border: 1px solid var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
}

/* ==========================================================================
   IMAGE CAPTIONS
   ========================================================================== */

.wp-block-image figcaption,
.wp-block-gallery figcaption,
figure figcaption {
  font-size: var(--wp--preset--font-size--small);
  font-style: italic;
  color: var(--wp--preset--color--dark-gray);
  text-align: center;
  margin-top: var(--wp--preset--spacing--20);
  line-height: 1.5;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

.wp-block-gallery {
  gap: var(--wp--preset--spacing--20);
}

.wp-block-gallery .wp-block-image {
  margin: 0;
}

.wp-block-gallery .wp-block-image img {
  transition: opacity 0.2s ease;
}

.wp-block-gallery .wp-block-image:hover img {
  opacity: 0.9;
}

/* Gallery with captions overlay */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--wp--preset--color--base);
  font-style: normal;
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20) var(--wp--preset--spacing--20);
}

/* ==========================================================================
   ARCHIVE HEADERS
   ========================================================================== */

.wp-block-query-title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* Archive description */
.wp-block-term-description {
  font-size: var(--wp--preset--font-size--large);
  color: var(--wp--preset--color--dark-gray);
  max-width: 65ch;
}

/* ==========================================================================
   PASSWORD PROTECTED POSTS
   ========================================================================== */

.post-password-form {
  max-width: 400px;
  margin: var(--wp--preset--spacing--50) auto;
  text-align: center;
}

.post-password-form p:first-child {
  font-size: var(--wp--preset--font-size--large);
  margin-bottom: var(--wp--preset--spacing--30);
  color: var(--wp--preset--color--dark-gray);
}

.post-password-form label {
  display: block;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--wp--preset--spacing--10);
}

.post-password-form input[type="password"] {
  width: 100%;
  padding: var(--wp--preset--spacing--20);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--medium);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  margin-bottom: var(--wp--preset--spacing--20);
  -webkit-appearance: none;
  appearance: none;
}

.post-password-form input[type="password"]:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--wp--preset--color--contrast);
}

.post-password-form input[type="submit"] {
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.post-password-form input[type="submit"]:hover {
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
}

/* ==========================================================================
   STICKY POSTS
   ========================================================================== */

.post.sticky,
.wp-block-post.is-sticky {
  position: relative;
}

.post.sticky::before,
.sticky-label {
  content: "Featured";
  display: inline-block;
  font-size: var(--wp--preset--font-size--tiny);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--wp--preset--color--base);
  background-color: var(--wp--preset--color--contrast);
  padding: 0.25em 0.75em;
  margin-bottom: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   READ MORE LINKS
   ========================================================================== */

.more-link,
a.more-link {
  display: inline-block;
  margin-top: var(--wp--preset--spacing--20);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: opacity 0.2s ease;
}

.more-link:hover,
a.more-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.more-link::after,
a.more-link::after {
  content: " →";
}

/* ==========================================================================
   EMBEDS
   ========================================================================== */

.wp-block-embed {
  margin: var(--wp--preset--spacing--50) 0;
}

.wp-block-embed figcaption {
  font-size: var(--wp--preset--font-size--small);
  font-style: italic;
  color: var(--wp--preset--color--dark-gray);
  text-align: center;
  margin-top: var(--wp--preset--spacing--20);
}

.wp-block-embed__wrapper {
  position: relative;
}

/* Video embeds aspect ratio */
.wp-block-embed.is-type-video .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.wp-block-embed.is-type-video .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   404 ERROR PAGE
   ========================================================================== */

.error-404,
.not-found {
  text-align: center;
  padding: var(--wp--preset--spacing--70) 0;
}

.error-404 .page-title,
.not-found .page-title {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--gigantic);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: var(--wp--preset--spacing--20);
}

.error-404 .page-content p,
.not-found .page-content p {
  font-size: var(--wp--preset--font-size--large);
  color: var(--wp--preset--color--dark-gray);
  margin-bottom: var(--wp--preset--spacing--40);
}

/* ==========================================================================
   WIDGET BLOCKS
   ========================================================================== */

/* Recent posts */
.wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wp-block-latest-posts li {
  padding: var(--wp--preset--spacing--20) 0;
  border-bottom: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-latest-posts li:last-child {
  border-bottom: none;
}

.wp-block-latest-posts a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  font-weight: 500;
}

.wp-block-latest-posts a:hover {
  text-decoration: underline;
}

.wp-block-latest-posts__post-date {
  display: block;
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--dark-gray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25em;
}

.wp-block-latest-posts__post-excerpt {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--dark-gray);
  margin-top: 0.5em;
}

/* Archives */
.wp-block-archives-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wp-block-archives-list li {
  padding: var(--wp--preset--spacing--10) 0;
  border-bottom: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-archives-list li:last-child {
  border-bottom: none;
}

.wp-block-archives-list a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.wp-block-archives-list a:hover {
  text-decoration: underline;
}

/* Calendar */
.wp-block-calendar {
  width: 100%;
}

.wp-block-calendar table {
  border-collapse: collapse;
  width: 100%;
}

.wp-block-calendar th,
.wp-block-calendar td {
  padding: var(--wp--preset--spacing--10);
  text-align: center;
  border: 1px solid var(--wp--preset--color--light-gray);
}

.wp-block-calendar th {
  background-color: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wp-block-calendar td a {
  font-weight: 700;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.wp-block-calendar td a:hover {
  text-decoration: underline;
}

.wp-block-calendar caption {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--wp--preset--spacing--20);
}

.wp-block-calendar nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--wp--preset--spacing--10);
  font-size: var(--wp--preset--font-size--small);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  body {
    font-size: 12pt;
  }
  
  a {
    text-decoration: none;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  header.wp-block-template-part,
  footer.wp-block-template-part {
    border: none;
  }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

/* Dark mode color variables */
:root {
  --textual-font-scale: 1;
}

[data-theme="dark"] {
  --wp--preset--color--base: #121212;
  --wp--preset--color--contrast: #e8e8e8;
  --wp--preset--color--light-gray: #2a2a2a;
  --wp--preset--color--dark-gray: #a0a0a0;
}

/* ==========================================================================
   DARK MODE: GLOBAL OVERRIDES
   Using !important to override WordPress inline styles and global styles
   ========================================================================== */

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #121212 !important;
  color: #e8e8e8 !important;
}

/* All text elements */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] figcaption {
  color: #e8e8e8 !important;
}

/* Headings - all levels */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .wp-block-post-title,
[data-theme="dark"] .wp-block-site-title,
[data-theme="dark"] .wp-block-site-title a {
  color: #e8e8e8 !important;
}

/* Links */
[data-theme="dark"] a {
  color: #e8e8e8 !important;
}

[data-theme="dark"] a:hover {
  color: #a0a0a0 !important;
}

/* Blockquotes and pullquotes */
[data-theme="dark"] blockquote,
[data-theme="dark"] .wp-block-quote,
[data-theme="dark"] .wp-block-pullquote {
  color: #e8e8e8 !important;
  border-color: #e8e8e8 !important;
}

[data-theme="dark"] blockquote p,
[data-theme="dark"] .wp-block-quote p,
[data-theme="dark"] .wp-block-pullquote p {
  color: #e8e8e8 !important;
}

[data-theme="dark"] blockquote cite,
[data-theme="dark"] .wp-block-quote cite,
[data-theme="dark"] .wp-block-pullquote cite {
  color: #a0a0a0 !important;
}

/* Code blocks */
[data-theme="dark"] pre,
[data-theme="dark"] pre.wp-block-code,
[data-theme="dark"] .wp-block-code {
  background-color: #1a1a1a !important;
  color: #e8e8e8 !important;
  border-color: #3a3a3a !important;
}

[data-theme="dark"] pre code,
[data-theme="dark"] .wp-block-code code {
  color: #e8e8e8 !important;
  background: transparent !important;
}

/* Inline code */
[data-theme="dark"] :not(pre) > code,
[data-theme="dark"] code {
  background-color: #2a2a2a !important;
  color: #e8e8e8 !important;
}

/* Selection */
[data-theme="dark"] ::selection {
  background: #e8e8e8 !important;
  color: #121212 !important;
}

[data-theme="dark"] ::-moz-selection {
  background: #e8e8e8 !important;
  color: #121212 !important;
}

/* Drop cap */
[data-theme="dark"] .wp-block-post-content > p:first-of-type::first-letter,
[data-theme="dark"] .entry-content > p:first-of-type::first-letter {
  color: #e8e8e8 !important;
}

/* Post meta (date, author, reading time) */
[data-theme="dark"] .wp-block-post-date,
[data-theme="dark"] .wp-block-post-author,
[data-theme="dark"] .textual-reading-time {
  color: #a0a0a0 !important;
}

/* ==========================================================================
   DARK MODE: BORDERS & SEPARATORS
   ========================================================================== */

[data-theme="dark"] header.wp-block-template-part {
  border-bottom-color: #3a3a3a !important;
}

[data-theme="dark"] footer.wp-block-template-part {
  border-top-color: #3a3a3a !important;
}

[data-theme="dark"] .wp-block-separator,
[data-theme="dark"] hr {
  border-color: #3a3a3a !important;
  background-color: #3a3a3a !important;
}

/* Comment section borders */
[data-theme="dark"] .comments-area {
  border-top-color: #3a3a3a !important;
}

[data-theme="dark"] .comment-list li {
  border-bottom-color: #2a2a2a !important;
}

/* ==========================================================================
   DARK MODE: TABLES
   ========================================================================== */

[data-theme="dark"] table,
[data-theme="dark"] .wp-block-table {
  color: #e8e8e8 !important;
}

[data-theme="dark"] th {
  border-bottom-color: #e8e8e8 !important;
}

[data-theme="dark"] td {
  border-bottom-color: #2a2a2a !important;
}

[data-theme="dark"] tbody tr:hover {
  background-color: #1a1a1a !important;
}

/* ==========================================================================
   DARK MODE: FORM ELEMENTS
   ========================================================================== */

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  color: #e8e8e8 !important;
  background-color: #1a1a1a !important;
  border-color: #3a3a3a !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #666666 !important;
}

[data-theme="dark"] input[type="submit"],
[data-theme="dark"] button[type="submit"] {
  color: #121212 !important;
  background-color: #e8e8e8 !important;
  border-color: #e8e8e8 !important;
}

[data-theme="dark"] input[type="submit"]:hover,
[data-theme="dark"] button[type="submit"]:hover {
  color: #e8e8e8 !important;
  background-color: transparent !important;
}

/* ==========================================================================
   DARK MODE: NAVIGATION & PAGINATION
   ========================================================================== */

[data-theme="dark"] .wp-block-navigation a {
  color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-query-pagination-previous,
[data-theme="dark"] .wp-block-query-pagination-next {
  color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers {
  color: #e8e8e8 !important;
  border-color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers:hover,
[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers.current {
  background-color: #e8e8e8 !important;
  color: #121212 !important;
}

/* ==========================================================================
   DARK MODE: POST TERMS, TAGS, CATEGORIES
   ========================================================================== */

[data-theme="dark"] .wp-block-post-terms a,
[data-theme="dark"] .wp-block-categories a,
[data-theme="dark"] .wp-block-tag-cloud a {
  color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-tag-cloud a {
  border-color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-tag-cloud a:hover {
  background-color: #e8e8e8 !important;
  color: #121212 !important;
}

/* ==========================================================================
   DARK MODE: FOOTER
   ========================================================================== */

[data-theme="dark"] footer,
[data-theme="dark"] footer p,
[data-theme="dark"] footer a {
  color: #a0a0a0 !important;
}

/* ==========================================================================
   DARK MODE: THEME CONTROLS (Header buttons)
   ========================================================================== */

[data-theme="dark"] .textual-controls button {
  color: #e8e8e8 !important;
  border-color: #e8e8e8 !important;
}

[data-theme="dark"] .textual-controls button:hover {
  background-color: #e8e8e8 !important;
  color: #121212 !important;
}

[data-theme="dark"] .textual-controls-divider {
  background-color: #3a3a3a !important;
}

/* ==========================================================================
   DARK MODE: FOCUS STATES
   ========================================================================== */

[data-theme="dark"] a:focus,
[data-theme="dark"] button:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
  outline-color: #e8e8e8 !important;
}

/* ==========================================================================
   DARK MODE: IMAGES & MEDIA
   ========================================================================== */

[data-theme="dark"] .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
  color: #e8e8e8 !important;
}

[data-theme="dark"] .wp-block-image figcaption {
  color: #a0a0a0 !important;
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

#textual-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--wp--preset--color--light-gray);
  z-index: 9999;
  pointer-events: none;
  --progress: 0%;
}

#textual-reading-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--progress);
  height: 100%;
  background: var(--wp--preset--color--contrast);
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   THEME CONTROLS (Header)
   ========================================================================== */

.textual-controls {
  display: flex;
  align-items: center;
  gap: var(--wp--preset--spacing--20);
}

.textual-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-family: inherit;
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 500;
  color: var(--wp--preset--color--contrast);
  background: transparent;
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.textual-controls button:hover {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

.textual-controls button:focus {
  outline: 2px solid var(--wp--preset--color--contrast);
  outline-offset: 2px;
}

/* Font controls group */
.textual-font-controls {
  display: flex;
  align-items: center;
  gap: 0;
}

.textual-font-controls button {
  border-radius: 0;
}

.textual-font-controls button:first-child {
  border-right: none;
}

/* Divider between control groups */
.textual-controls-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--wp--preset--color--light-gray);
}

[data-theme="dark"] .textual-controls-divider {
  background: var(--wp--preset--color--dark-gray);
}

/* Dark mode: Theme control buttons */
[data-theme="dark"] .textual-controls button {
  color: #e8e8e8;
  border-color: #e8e8e8;
}

[data-theme="dark"] .textual-controls button:hover {
  background: #e8e8e8;
  color: #121212;
}

[data-theme="dark"] .textual-controls button:focus {
  outline-color: #e8e8e8;
}

/* ==========================================================================
   READING TIME META
   ========================================================================== */

.textual-reading-time {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--dark-gray);
}

.textual-reading-time::before {
  content: "•";
  margin: 0 0.5em;
}

/* ==========================================================================
   FONT SCALING
   ========================================================================== */

.wp-block-post-content,
.entry-content {
  font-size: calc(var(--wp--preset--font-size--medium) * var(--textual-font-scale, 1));
}

.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4,
.wp-block-post-content h5,
.wp-block-post-content h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  /* Headings scale with base but less dramatically */
  font-size: calc(var(--original-heading-size, 1em) * var(--textual-font-scale, 1));
}
