/*
Theme Name: The Reflected Screen
Theme URI: https://thereflectedscreen.com/
Author: Vincenzo Nuzzarello / OpenAI
Description: A cinematic bilingual editorial theme for The Reflected Screen / Lo schermo riflesso. Dark, responsive, Gutenberg-ready, with automatic English/Italian navigation, language-safe post navigation, SEO metadata, structured data, social previews, and legal-page support.
Version: 2.3.1
Requires at least: 6.5
Tested up to: 6.8
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: reflected-screen
Tags: blog, custom-logo, custom-menu, featured-images, translation-ready, block-styles, wide-blocks, accessibility-ready, two-columns
*/

:root {
  --trs-bg: #050608;
  --trs-bg-soft: #0d0e11;
  --trs-panel: #141519;
  --trs-panel-2: #18191e;
  --trs-text: #f6f5f3;
  --trs-muted: #aaa8b0;
  --trs-muted-2: #777680;
  --trs-accent: #e22b2f;
  --trs-accent-dark: #9f191d;
  --trs-line: rgba(255,255,255,.13);
  --trs-line-red: rgba(226,43,47,.42);
  --trs-shadow: 0 30px 90px rgba(0,0,0,.55);
  --trs-radius: 26px;
  --trs-radius-sm: 14px;
  --trs-content: 780px;
  --trs-wide: 1440px;
  --trs-header: 112px;
  --trs-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--trs-text);
  background:
    radial-gradient(circle at 72% 18%, rgba(153,16,20,.18), transparent 27rem),
    linear-gradient(180deg, #050608 0%, #090a0d 52%, #050608 100%);
  font-family: var(--trs-font);
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
figure { margin: 0; }
button, input, textarea, select { font: inherit; }
::selection { background: var(--trs-accent); color: #fff; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto !important; width: auto; height: auto; margin: 0;
  left: 1rem; top: 1rem; z-index: 100000; padding: .8rem 1rem;
  color: #111; background: #fff; border-radius: 8px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(5,6,8,.94);
  border-bottom: 1px solid var(--trs-line-red);
  backdrop-filter: blur(18px);
}
body.admin-bar .site-header { top: 32px; }
.site-header__inner {
  width: min(calc(100% - 48px), var(--trs-wide));
  min-height: var(--trs-header);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  color: var(--trs-accent);
  text-decoration: none;
}
.brand-mark__icon { width: 34px; height: 34px; flex: 0 0 auto; }
.brand-mark__title {
  color: var(--trs-accent);
  font-size: clamp(1.1rem, 2vw, 1.72rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 2.6rem; }
.desktop-nav a {
  color: var(--trs-muted);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .18s ease, transform .18s ease;
}
.desktop-nav a:hover, .desktop-nav a:focus-visible, .desktop-nav a[aria-current="page"] { color: var(--trs-accent); }
.desktop-nav .nav-buy {
  padding: 1rem 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, #b31e23, #8f1519);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(179,30,35,.24);
}
.desktop-nav .nav-buy:hover { color: #fff; transform: translateY(-2px); }
.lang-switch { opacity: .72; }
.menu-toggle {
  display: none;
  margin-left: auto;
  width: 50px; height: 50px;
  border: 1px solid var(--trs-line);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block; width: 22px; height: 2px; margin: auto;
  position: relative; content: ""; background: currentColor;
  transition: .2s ease;
}
.menu-toggle span::before { position: absolute; top: -7px; }
.menu-toggle span::after { position: absolute; top: 7px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
.mobile-nav {
  position: fixed; inset: 0; z-index: 990;
  display: grid; place-items: center;
  padding: 7rem 1.5rem 2rem;
  background: rgba(5,6,8,.98);
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: .22s ease;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-nav__inner { display: grid; gap: .8rem; text-align: center; }
.mobile-nav a {
  padding: .2rem 0;
  font-size: clamp(1.8rem, 9vw, 4rem);
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: -.03em;
  text-decoration: none;
}
.mobile-nav a:hover, .mobile-nav a:focus-visible { color: var(--trs-accent); }
.mobile-nav .nav-buy { margin-top: 1rem; color: var(--trs-accent); }

/* Global containers */
.site-main { min-height: 70vh; }
.trs-shell { width: min(calc(100% - 48px), var(--trs-wide)); margin-inline: auto; }
.trs-section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.trs-panel {
  background: linear-gradient(145deg, rgba(24,25,30,.96), rgba(13,14,17,.98));
  border: 1px solid var(--trs-line);
  border-radius: var(--trs-radius);
  box-shadow: var(--trs-shadow);
}
.trs-kicker {
  margin: 0 0 1.2rem;
  color: var(--trs-accent);
  font-size: .83rem;
  font-weight: 900;
  letter-spacing: .25em;
  text-transform: uppercase;
}
.trs-section-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.trs-section-intro { margin: 1rem 0 0; color: var(--trs-muted); font-size: clamp(1rem, 1.6vw, 1.25rem); }
.trs-link-arrow {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--trs-text); font-size: .82rem; font-weight: 900;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
}
.trs-link-arrow::after { content: "→"; color: var(--trs-accent); font-size: 1.15em; }
.trs-link-arrow:hover { color: var(--trs-accent); }

/* Hero */
.trs-hero {
  width: min(calc(100% - 48px), var(--trs-wide));
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9.5rem) 0 clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, .85fr);
  gap: clamp(3rem, 7vw, 8rem);
  align-items: center;
}
.trs-hero__title {
  margin: 0;
  font-size: clamp(3.25rem, 7.3vw, 7.5rem);
  line-height: .89;
  font-weight: 950;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.trs-hero__title span { display: block; }
.trs-hero__title .accent { color: var(--trs-accent); }
.trs-hero__subtitle {
  margin: 2.3rem 0 0;
  color: #dedde1;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.45;
  font-style: italic;
  letter-spacing: -.02em;
}
.trs-hero__quote {
  max-width: 650px;
  margin: 3rem 0 0;
  padding: 0;
  border: 0;
  color: var(--trs-muted);
  font-size: clamp(1.05rem, 1.7vw, 1.34rem);
  line-height: 1.72;
}
.trs-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.trs-button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .85rem 1.25rem;
  border: 1px solid var(--trs-line);
  border-radius: 7px;
  color: #fff;
  background: var(--trs-panel);
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.trs-button:hover, .wp-block-button__link:hover { color: #fff; transform: translateY(-2px); border-color: var(--trs-accent); }
.trs-button--accent { background: linear-gradient(135deg, #bd2025, #8d1418); border-color: rgba(255,255,255,.1); }
.trs-hero__visual { min-width: 0; perspective: 1500px; }
.book-stage {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  border-radius: var(--trs-radius);
  background:
    radial-gradient(circle at 62% 50%, rgba(198,28,33,.30), transparent 42%),
    linear-gradient(145deg, rgba(20,21,25,.94), rgba(10,11,13,.98));
  border: 1px solid var(--trs-line);
  overflow: hidden;
}
.book-stage::before {
  content: "";
  position: absolute; inset: auto 10% 5% 10%; height: 18%;
  background: radial-gradient(ellipse, rgba(0,0,0,.85), transparent 70%);
  filter: blur(18px);
}
.book-mockup {
  position: relative;
  z-index: 1;
  width: min(68%, 430px);
  transform: rotateY(-9deg) rotateX(1deg);
  transform-style: preserve-3d;
  filter: drop-shadow(38px 34px 38px rgba(0,0,0,.65));
  transition: transform .35s ease;
}
.book-mockup:hover { transform: rotateY(-3deg) rotateX(0) translateY(-8px); }
.book-mockup::before {
  content: "";
  position: absolute; top: 2%; right: -4.5%; width: 5%; height: 96%;
  background: repeating-linear-gradient(90deg,#c9c2b8 0 2px,#ece5da 2px 4px);
  transform: translateZ(-1px);
  border-radius: 0 3px 3px 0;
}
.book-mockup img {
  display: block; width: 100%;
  border-radius: 2px 5px 5px 2px;
  box-shadow: inset -10px 0 20px rgba(0,0,0,.25);
}
.book-placeholder {
  aspect-ratio: .675;
  display: grid; place-items: center;
  padding: 2rem;
  text-align: center;
  background: #15161a;
  border: 1px solid var(--trs-line);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Home panels */
.home-section { width: min(calc(100% - 48px), var(--trs-wide)); margin: 0 auto 1.5rem; padding: clamp(2rem, 4vw, 3.2rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-head .trs-section-title { font-size: clamp(1.7rem, 3vw, 2.55rem); }
.post-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.5rem; }
.post-card {
  min-width: 0;
  padding: clamp(1.5rem, 3vw, 2.35rem);
  background: linear-gradient(145deg, rgba(26,27,32,.98), rgba(16,17,20,.98));
  border: 1px solid var(--trs-line);
  border-radius: var(--trs-radius-sm);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(226,43,47,.5); box-shadow: 0 22px 50px rgba(0,0,0,.32); }
.post-card__image { display: block; margin: -1rem -1rem 1.5rem; overflow: hidden; border-radius: 10px; aspect-ratio: 16/9; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__image img { transform: scale(1.035); }
.post-card__date { color: var(--trs-accent); font-size: .8rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.post-card__title { margin: 1.25rem 0 1rem; font-size: clamp(1.45rem, 2.4vw, 2.15rem); line-height: 1.18; letter-spacing: -.025em; }
.post-card__title a { text-decoration: none; }
.post-card__excerpt { color: var(--trs-muted); font-size: 1rem; }
.post-card__excerpt p { margin: 0; }
.post-card__read { margin-top: 1.6rem; }
.architecture { text-align: center; }
.architecture .trs-section-intro { max-width: 920px; margin-inline: auto; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.25rem; margin-top: 3rem; text-align: left; }
.feature-card { padding: clamp(1.6rem, 3vw, 2.4rem); background: rgba(15,16,19,.72); border: 1px solid var(--trs-line); border-radius: var(--trs-radius-sm); }
.feature-icon { width: 56px; height: 56px; margin-bottom: 1.6rem; color: var(--trs-accent); }
.feature-card h3 { margin: 0 0 1rem; font-size: clamp(1.35rem, 2.2vw, 1.85rem); line-height: 1.25; }
.feature-card p { margin: 0; color: var(--trs-muted); }
.author-strip { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: clamp(2rem,5vw,5rem); align-items: center; }
.author-strip__image { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 1px solid var(--trs-line); background: #222329; }
.author-strip__image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(18%); }
.author-strip__placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #666772; }
.author-strip__placeholder svg { width: 42%; }
.author-strip__name { margin: 0; font-size: clamp(2rem,4vw,3.5rem); line-height: 1; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.author-strip__label { margin: .8rem 0 2rem; color: var(--trs-accent); font-size: .82rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.author-strip__copy { color: var(--trs-muted); }
.author-strip__copy p { margin: 0 0 1rem; }

/* Standard pages and posts */
.entry-shell { width: min(calc(100% - 48px), 1160px); margin: 0 auto; padding: clamp(4rem,9vw,8rem) 0; }
.entry-card { padding: clamp(2rem,5vw,5rem); }
.entry-header { max-width: 980px; margin-bottom: 3rem; }
.entry-kicker { margin: 0 0 1rem; color: var(--trs-accent); font-size: .82rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.entry-title { margin: 0; font-size: clamp(2.6rem,7vw,6.2rem); line-height: .96; letter-spacing: -.05em; font-weight: 950; }
.entry-subtitle { margin: 1.4rem 0 0; color: var(--trs-muted); font-size: clamp(1.2rem,2.2vw,1.8rem); font-style: italic; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .65rem 1.35rem; margin-top: 1.6rem; color: var(--trs-muted); font-size: .86rem; }
.entry-meta a { color: var(--trs-accent); text-decoration: none; }
.entry-content { max-width: var(--trs-content); margin-inline: auto; color: #dddce1; }
.entry-content > * { margin-block: 0 1.45rem; }
.entry-content > .alignwide { width: min(100vw - 48px, 1160px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content > .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 2.4em; color: #fff; line-height: 1.14; }
.entry-content h2 { font-size: clamp(2rem,4vw,3.2rem); }
.entry-content h3 { font-size: clamp(1.5rem,3vw,2.25rem); }
.entry-content p, .entry-content li { color: #d1d0d6; }
.entry-content a { color: #fff; text-decoration-color: var(--trs-accent); }
.entry-content blockquote { margin: 2.5rem 0; padding: 1.5rem 0 1.5rem 1.6rem; border-left: 4px solid var(--trs-accent); color: #fff; font-size: 1.25rem; }
.entry-content img { border-radius: 10px; }
.entry-content .wp-block-columns { gap: 2rem; }
.entry-content .wp-block-button__link { color: #fff; }
.single-featured-image { max-width: 1120px; margin: 0 auto 3.5rem; border-radius: var(--trs-radius-sm); overflow: hidden; border: 1px solid var(--trs-line); }
.single-featured-image img { width: 100%; max-height: 660px; object-fit: cover; display: block; }
.post-taxonomies { max-width: var(--trs-content); margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--trs-line); color: var(--trs-muted); font-size: .9rem; }
.post-taxonomies a { color: #fff; }
.post-navigation { width: min(calc(100% - 48px),1160px); margin: 0 auto 5rem; }
.post-navigation__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.post-navigation__item { min-height: 170px; padding: 1.6rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--trs-line); border-radius: var(--trs-radius-sm); background: var(--trs-panel); text-decoration: none; }
.post-navigation__item:hover { border-color: var(--trs-accent); }
.post-navigation__label { color: var(--trs-accent); font-size: .76rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.post-navigation__title { font-size: 1.25rem; font-weight: 800; }

/* Book page */
.book-page-hero { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(340px,.72fr); gap: clamp(3rem,7vw,7rem); align-items: center; }
.book-page-copy .entry-title { font-size: clamp(3rem,7vw,6.5rem); text-transform: none; }
.book-page-copy p { color: var(--trs-muted); font-size: 1.06rem; }
.book-page-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.book-page-cover { min-height: 560px; }
.explore-panel { margin-top: 2rem; padding: clamp(2rem,4vw,3.4rem); }
.explore-panel h2 { margin: 0 0 2rem; font-size: clamp(2rem,4vw,3.2rem); }
.explore-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.explore-list li { padding: 1.35rem; border: 1px solid var(--trs-line); border-radius: 10px; color: #d4d3d8; background: rgba(255,255,255,.025); }
.explore-list li::before { content: "▸"; margin-right: .65rem; color: var(--trs-accent); }

/* Author page */
.author-page { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.5fr); gap: clamp(2.5rem,7vw,7rem); align-items: start; }
.author-page__portrait { position: sticky; top: calc(var(--trs-header) + 2rem); border-radius: var(--trs-radius); overflow: hidden; border: 1px solid var(--trs-line); background: var(--trs-panel); }
.author-page__portrait img { width: 100%; display: block; }
.author-page__content .entry-title { font-size: clamp(2.5rem,5vw,4.7rem); letter-spacing: .06em; text-transform: uppercase; }
.author-page__content h2 { color: var(--trs-accent); font-size: .9rem; letter-spacing: .18em; text-transform: uppercase; }

/* Blog/archive */
.blog-hero { padding-bottom: 2.5rem; border-bottom: 1px solid var(--trs-line); }
.blog-hero .entry-title { text-transform: uppercase; letter-spacing: .05em; }
.blog-grid { margin-top: 4rem; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.5rem; }
.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.pagination a, .pagination span { min-width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--trs-line); border-radius: 8px; text-decoration: none; }
.pagination .current, .pagination a:hover { border-color: var(--trs-accent); color: var(--trs-accent); }

/* Search/forms/comments */
.search-form { display: flex; gap: .6rem; max-width: 680px; }
.search-field, input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; padding: .85rem 1rem; color: #fff; background: var(--trs-panel); border: 1px solid var(--trs-line); border-radius: 8px;
}
.search-submit, input[type="submit"] { padding: .8rem 1.1rem; color: #fff; background: var(--trs-accent-dark); border: 0; border-radius: 8px; cursor: pointer; }
.comments-area { max-width: var(--trs-content); margin: 4rem auto 0; }

/* Footer */
.site-footer { margin-top: 2rem; border-top: 1px solid var(--trs-line); background: #050608; }
.site-footer__inner { width: min(calc(100% - 48px),var(--trs-wide)); margin-inline: auto; padding: 2rem 0 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; color: var(--trs-muted); font-size: .85rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer a { color: #fff; text-decoration: none; }

/* Utility / WordPress */
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption, .gallery-caption { color: var(--trs-muted); }
.sticky { outline: 1px solid var(--trs-accent); }
.bypostauthor { }
.no-results { padding: 2rem; color: var(--trs-muted); border: 1px solid var(--trs-line); border-radius: var(--trs-radius-sm); }

@media (max-width: 1050px) {
  .desktop-nav { gap: 1.4rem; }
  .desktop-nav a { font-size: .78rem; }
  .trs-hero { grid-template-columns: 1fr 420px; gap: 3rem; }
  .book-stage { min-height: 520px; }
}
@media (max-width: 860px) {
  :root { --trs-header: 88px; }
  body.admin-bar .site-header { top: 46px; }
  .site-header__inner { width: min(calc(100% - 28px),var(--trs-wide)); min-height: var(--trs-header); }
  .desktop-nav { display: none; }
  .menu-toggle { display: grid; place-items: center; }
  .brand-mark__title { font-size: clamp(.88rem,4vw,1.25rem); white-space: normal; }
  .trs-shell, .trs-hero, .home-section, .entry-shell, .post-navigation, .site-footer__inner { width: min(calc(100% - 28px),var(--trs-wide)); }
  .trs-hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .trs-hero__visual { max-width: 620px; width: 100%; margin-inline: auto; }
  .book-stage { min-height: 560px; }
  .post-grid, .blog-grid, .feature-grid, .explore-list { grid-template-columns: 1fr; }
  .author-strip, .author-page, .book-page-hero { grid-template-columns: 1fr; }
  .author-strip__image { max-width: 280px; }
  .author-page__portrait { position: static; max-width: 460px; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-mark { gap: .7rem; }
  .brand-mark__icon { width: 27px; height: 27px; }
  .trs-hero__title { font-size: clamp(3.1rem,17vw,5rem); }
  .trs-hero__subtitle { font-size: 1.25rem; }
  .trs-hero__actions, .book-page-actions { display: grid; }
  .trs-button { width: 100%; }
  .book-stage { min-height: 430px; }
  .book-mockup { width: 72%; }
  .home-section, .entry-card { padding: 1.35rem; border-radius: 18px; }
  .post-navigation__grid { grid-template-columns: 1fr; }
  .site-footer__inner { align-items: flex-start; flex-direction: column; }
}

/* --------------------------------------------------------------------------
 * 2.1.0 refinements: clean cards, localized archives, compact short pages,
 * single-item grids, and a resilient mobile header.
 * -------------------------------------------------------------------------- */
.mobile-buy { display: none; }

/* Short pages should end naturally instead of creating an artificial empty
   screen before the footer. */
.site-main { min-height: 0; }
.entry-shell { padding-top: clamp(3rem, 6vw, 6rem); padding-bottom: clamp(3rem, 6vw, 6rem); }
.site-footer { margin-top: clamp(1.5rem, 4vw, 3rem); }

/* A single article is presented as an intentional feature, not as half of an
   empty two-column grid. */
.post-grid--single,
.blog-grid--single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

/* Jetpack may attach sharing UI to excerpts. It belongs on a single article,
   never inside editorial cards. */
.post-card .sharedaddy,
.post-card .sd-sharing-enabled,
.post-card .sd-block,
.post-card .sd-content,
.post-card .sd-title,
.post-card .jp-relatedposts,
.post-card .robots-nocontent {
  display: none !important;
}
.post-card__excerpt { margin: 0; color: var(--trs-muted); font-size: 1rem; }

@media (max-width: 1024px) {
  :root { --trs-header: 82px; }
  body.admin-bar .site-header { top: 46px; }
  .site-header__inner {
    width: min(calc(100% - 28px), var(--trs-wide));
    min-height: var(--trs-header);
    gap: .7rem;
  }
  .desktop-nav { display: none; }
  .mobile-buy {
    margin-left: auto;
    min-height: 40px;
    padding: .58rem .82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #b31e23, #8f1519);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
  }
  .menu-toggle { margin-left: 0; display: grid; place-items: center; width: 42px; height: 42px; }
  .brand-mark__title { font-size: clamp(.82rem, 2.4vw, 1.15rem); white-space: normal; }
  .brand-mark__icon { width: 28px; height: 28px; }
  .trs-shell, .trs-hero, .home-section, .entry-shell, .post-navigation, .site-footer__inner {
    width: min(calc(100% - 28px), var(--trs-wide));
  }
  .trs-hero,
  .book-page-hero,
  .author-page,
  .author-strip { grid-template-columns: 1fr; }
  .trs-hero { padding-top: 4rem; }
  .trs-hero__visual { width: min(100%, 680px); margin-inline: auto; }
  .book-stage { min-height: 500px; }
  .book-page-cover { min-height: 0; width: min(100%, 620px); margin-inline: auto; }
  .author-page__portrait { position: static; width: min(100%, 430px); }
  .post-grid, .blog-grid, .feature-grid, .explore-list { grid-template-columns: 1fr; }
  .post-grid--single, .blog-grid--single { grid-template-columns: minmax(0, 100%); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .book-page-copy .entry-title { font-size: clamp(2.55rem, 9vw, 4.6rem); }
}

@media (max-width: 560px) {
  .site-header__inner { gap: .48rem; }
  .brand-mark { gap: .55rem; }
  .brand-mark__title { max-width: 12.5rem; font-size: .76rem; letter-spacing: .09em; }
  .mobile-buy { min-height: 37px; padding: .5rem .62rem; font-size: .63rem; letter-spacing: .08em; }
  .menu-toggle { width: 38px; height: 38px; }
  .entry-shell { padding-top: 2.5rem; padding-bottom: 2.8rem; }
  .book-page-copy .entry-title { font-size: clamp(2.35rem, 12vw, 3.5rem); line-height: .98; }
}


/* --------------------------------------------------------------------------
 * 2.2.0 desktop polish: calmer hero typography, more compact featured post,
 * improved author portrait crop, and more generous hero separation.
 * Mobile layouts retain the proportions introduced in 2.1.0.
 * -------------------------------------------------------------------------- */
.author-strip__image img {
  object-position: center 12%;
}

@media (min-width: 1025px) {
  .trs-hero {
    padding-bottom: clamp(5.5rem, 9vw, 8rem);
  }

  .trs-hero__title {
    font-size: clamp(3rem, 6.55vw, 6.75rem);
  }

  .architecture .trs-section-title {
    max-width: 1320px;
    margin-inline: auto;
    font-size: clamp(2rem, 3.6vw, 3.4rem);
    letter-spacing: .075em;
  }

  .post-grid--single,
  .blog-grid--single {
    grid-template-columns: minmax(0, 680px);
  }

  .post-grid--single .post-card__image,
  .blog-grid--single .post-card__image {
    height: clamp(300px, 21vw, 360px);
    aspect-ratio: auto;
  }
}

@media (max-width: 1024px) {
  .author-strip__image img {
    object-position: center 10%;
  }
}

/* --------------------------------------------------------------------------
 * 2.2.1 mobile hotfix: prevent the long bilingual architecture headings from
 * overflowing narrow screens while preserving the desktop/tablet composition.
 * -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .architecture.home-section {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
    overflow: hidden;
  }

  .architecture .trs-section-title {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(1.62rem, 7.4vw, 1.9rem);
    line-height: 1.06;
    letter-spacing: .035em;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    text-wrap: balance;
  }

  .architecture .trs-section-intro {
    max-width: 100%;
    font-size: .98rem;
    line-height: 1.7;
  }

  .architecture .feature-grid,
  .architecture .feature-card {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .architecture.home-section {
    padding-left: 1.05rem;
    padding-right: 1.05rem;
  }

  .architecture .trs-section-title {
    font-size: 1.5rem;
    letter-spacing: .025em;
  }
}


/* --------------------------------------------------------------------------
 * 2.3.0 editorial infrastructure: legal/contact footer, sample CTA and small
 * accessibility refinements. SEO/social metadata is emitted in the document
 * head and does not alter the visual composition.
 * -------------------------------------------------------------------------- */
.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .7rem 1.2rem;
}
.site-footer__links a { white-space: nowrap; }
.author-contact { margin-top: 2rem; }
.book-page-actions .trs-button { margin-bottom: .35rem; }

@media (max-width: 720px) {
  .site-footer__inner { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .site-footer__links { justify-content: flex-start; }
}

/* --------------------------------------------------------------------------
 * 2.3.1 — tighter article paragraph rhythm.
 * Paragraphs remain separate semantic blocks, but no longer resemble a full
 * blank line between each other. Headings retain more generous breathing room.
 * -------------------------------------------------------------------------- */
.trs-single-post .entry-content > p {
  margin-block: 0 .72rem;
}
.trs-single-post .entry-content > p:last-child {
  margin-bottom: 0;
}
.trs-single-post .entry-content > p + h2,
.trs-single-post .entry-content > p + h3,
.trs-single-post .entry-content > p + h4 {
  margin-top: 2.15em;
}

@media (max-width: 720px) {
  .trs-single-post .entry-content > p {
    margin-bottom: .62rem;
  }
}

