/*
Theme Name: Delitto e castigo
Theme URI: https://www.delittoecastigo.it
Author: DelittoECastigo.it
Description: Delitto e castigo
Version: 1.7.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: literary-classics
*/

:root {
  --lc-paper: #f5f0e7;
  --lc-paper-deep: #ece4d8;
  --lc-surface: #fbf8f2;
  --lc-surface-strong: #fffdf9;
  --lc-ink: #1f2530;
  --lc-text: #353b43;
  --lc-muted: #77746f;
  --lc-accent: #3e5c74;
  --lc-accent-dark: #263f55;
  --lc-line: rgba(75,65,51,.16);
  --lc-line-strong: rgba(75,65,51,.28);
  --lc-shadow: 0 18px 48px rgba(69,55,39,.08);
  --lc-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --lc-serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--lc-paper);
  color: var(--lc-text);
  font-family: var(--lc-sans);
  font-size: 17px;
  line-height: 1.66;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.lc-container {
  width: min(1160px, calc(100% - 38px));
  margin: 0 auto;
}

/* Masthead */
.lc-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(251,248,242,.97);
  backdrop-filter: blur(10px);
}
.admin-bar .lc-header { top: 32px; }

.lc-topline {
  border-bottom: 1px solid var(--lc-line);
  background: rgba(255,253,249,.68);
}
.lc-topline-inner {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.lc-topline-copy {
  margin: 0;
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-size: .82rem;
  font-style: italic;
}
.lc-header-search {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--lc-line);
}
.lc-header-search input {
  width: 92px;
  border: 0;
  outline: 0;
  padding: 6px 8px 6px 12px;
  background: transparent;
  color: var(--lc-ink);
  font: inherit;
  font-size: .78rem;
  transition: width .18s ease;
}
.lc-header-search input:focus { width: 170px; }
.lc-header-search button {
  border: 0;
  background: transparent;
  color: var(--lc-accent);
  cursor: pointer;
  font-size: 1rem;
}
.lc-masthead {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.lc-brand {
  color: var(--lc-ink);
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  font-weight: 820;
  letter-spacing: -.075em;
  text-align: center;
}
.lc-menu-toggle {
  display: none;
  position: absolute;
  right: 0;
  appearance: none;
  padding: 8px 11px;
  border: 1px solid var(--lc-line);
  border-radius: 7px;
  background: var(--lc-surface-strong);
  color: var(--lc-ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
}

/* Editorial navigation and dropdowns */
.lc-nav-wrap {
  border-top: 1px solid var(--lc-line);
  border-bottom: 1px solid var(--lc-line);
  background: rgba(255,253,249,.88);
}
.lc-nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lc-nav li { position: relative; }
.lc-nav a {
  display: block;
  padding: 14px 0;
  color: var(--lc-ink);
  font-size: .82rem;
  font-weight: 820;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.lc-nav li.menu-item-has-children > a::after,
.lc-nav li.page_item_has_children > a::after {
  content: "⌄";
  display: inline-block;
  margin-left: 7px;
  color: var(--lc-muted);
  font-size: .9em;
}
.lc-nav ul ul,
.lc-nav .sub-menu,
.lc-nav .children {
  position: absolute;
  z-index: 90;
  top: 100%;
  left: -13px;
  min-width: 235px;
  display: none;
  padding: 7px;
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  background: var(--lc-surface-strong);
  box-shadow: var(--lc-shadow);
}
.lc-nav ul ul ul,
.lc-nav .sub-menu .sub-menu,
.lc-nav .children .children {
  top: -7px;
  left: calc(100% + 6px);
}
.lc-nav ul ul li,
.lc-nav .sub-menu li,
.lc-nav .children li { width: 100%; }
.lc-nav ul ul a,
.lc-nav .sub-menu a,
.lc-nav .children a {
  padding: 9px 10px;
  border-radius: 5px;
  color: var(--lc-ink);
  font-size: .79rem;
  letter-spacing: .06em;
  white-space: nowrap;
}
.lc-nav ul ul a:hover,
.lc-nav .sub-menu a:hover,
.lc-nav .children a:hover {
  background: #f1ebe1;
  color: var(--lc-accent-dark);
}
.lc-nav li:hover > ul,
.lc-nav li:hover > .sub-menu,
.lc-nav li:hover > .children,
.lc-nav li:focus-within > ul,
.lc-nav li:focus-within > .sub-menu,
.lc-nav li:focus-within > .children {
  display: block;
}

/* Homepage editorial layout */
.lc-editorial-hero {
  padding: clamp(56px, 8vw, 92px) 0 58px;
  border-bottom: 1px solid var(--lc-line);
  background:
    radial-gradient(circle at 72% 24%, rgba(255,255,255,.56), transparent 34%),
    linear-gradient(180deg, #fbf8f2 0%, var(--lc-paper) 100%);
}
.lc-eyebrow,
.lc-kicker {
  margin: 0 0 11px;
  color: var(--lc-accent);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.lc-hero-title {
  max-width: 980px;
  margin: 0;
  color: var(--lc-ink);
  font-size: clamp(3.15rem, 7vw, 6.6rem);
  line-height: .97;
  letter-spacing: -.082em;
  font-weight: 820;
}
.lc-hero-copy {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-size: clamp(1.13rem, 2vw, 1.36rem);
  line-height: 1.62;
}
.lc-home-section { padding: 50px 0; }
.lc-home-section + .lc-home-section { padding-top: 8px; }

.lc-rule-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.lc-rule-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--lc-line-strong);
}
.lc-rule-heading h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.lc-featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .72fr);
  gap: 34px;
}
.lc-featured-main {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  gap: 24px;
  align-items: start;
  padding-right: 28px;
  border-right: 1px solid var(--lc-line);
}
.lc-featured-main:not(:has(.lc-featured-image)) {
  grid-template-columns: 1fr;
}
.lc-featured-image img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: cover;
}
.lc-featured-copy h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.065em;
}
.lc-featured-copy p:not(.lc-kicker) {
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-size: 1.04rem;
  line-height: 1.65;
}
.lc-text-link {
  color: var(--lc-accent-dark);
  font-size: .82rem;
  font-weight: 820;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.lc-featured-aside h3 {
  margin: 0 0 8px;
  color: var(--lc-ink);
  font-size: 1.18rem;
  letter-spacing: -.035em;
}
.lc-featured-aside ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--lc-line);
}
.lc-featured-aside li { border-bottom: 1px solid var(--lc-line); }
.lc-featured-aside a {
  display: block;
  padding: 12px 0;
}
.lc-featured-aside span {
  display: block;
  color: var(--lc-ink);
  font-size: .95rem;
  font-weight: 760;
}
.lc-featured-aside small {
  display: block;
  margin-top: 4px;
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-style: italic;
}
.lc-muted-copy { color: var(--lc-muted); }

.lc-editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  border-top: 1px solid var(--lc-line);
  border-left: 1px solid var(--lc-line);
}
.lc-editorial-item {
  padding: 20px;
  border-right: 1px solid var(--lc-line);
  border-bottom: 1px solid var(--lc-line);
  background: rgba(255,253,249,.34);
}
.lc-editorial-item h3 {
  margin: 0;
  color: var(--lc-ink);
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -.045em;
}
.lc-editorial-item p:not(.lc-kicker) {
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  line-height: 1.58;
}
.lc-latest-list {
  border-top: 1px solid var(--lc-line);
}
.lc-latest-list article {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lc-line);
}
.lc-latest-list h3 {
  margin: 0;
  color: var(--lc-ink);
  font-size: 1.22rem;
  letter-spacing: -.035em;
}


/* Latest posts on the homepage */
.lc-posts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .78fr);
  gap: 32px;
}
.lc-post-lead {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
  padding-right: 28px;
  border-right: 1px solid var(--lc-line);
}
.lc-post-lead:not(:has(.lc-post-image)) {
  grid-template-columns: 1fr;
}
.lc-post-image img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}
.lc-post-lead h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: -.065em;
}
.lc-post-lead p:not(.lc-kicker) {
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-size: 1.04rem;
  line-height: 1.65;
}
.lc-posts-aside {
  border-top: 1px solid var(--lc-line);
}
.lc-posts-aside article {
  padding: 13px 0;
  border-bottom: 1px solid var(--lc-line);
}
.lc-posts-aside h3 {
  margin: 0 0 8px;
  color: var(--lc-ink);
  font-size: 1.08rem;
  line-height: 1.18;
  letter-spacing: -.035em;
}

/* Reading pages */
.lc-page-wrap { padding: 46px 0 68px; }
.lc-page {
  padding: clamp(24px, 4.5vw, 50px);
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  background: rgba(255,253,249,.86);
  box-shadow: var(--lc-shadow);
}
.lc-page-title,
.lc-chapter-title {
  max-width: 980px;
  margin: 0;
  color: var(--lc-ink);
  font-size: clamp(2.45rem, 5vw, 4.85rem);
  line-height: .99;
  letter-spacing: -.07em;
}
.lc-page-intro { max-width: 830px; margin-top: 22px; }
.lc-reading {
  color: #2e3236;
  font-family: var(--lc-serif);
  font-size: 1.13rem;
  line-height: 1.8;
}
.lc-reading p { margin: 0 0 1.08em; }
.lc-reading blockquote {
  margin: 1.4em 0;
  padding-left: 1.1em;
  border-left: 3px solid var(--lc-line-strong);
  color: #5b5c5a;
}
.lc-reading h2,
.lc-reading h3 {
  color: var(--lc-ink);
  font-family: var(--lc-sans);
  letter-spacing: -.04em;
}
.lc-contents-list {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--lc-line);
}
.lc-contents-list li { border-bottom: 1px solid var(--lc-line); }
.lc-contents-list a {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  color: var(--lc-ink);
  font-weight: 740;
}
.lc-contents-list a:hover { color: var(--lc-accent-dark); }
.lc-contents-list small { color: var(--lc-muted); font-weight: 620; }

.lc-chapter-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 25px 0;
  padding: 12px 0;
  border-top: 1px solid var(--lc-line);
  border-bottom: 1px solid var(--lc-line);
  color: var(--lc-muted);
  font-size: .92rem;
  font-weight: 740;
}
.lc-chapter-nav .lc-prev { justify-self: start; }
.lc-chapter-nav .lc-contents { justify-self: center; color: var(--lc-accent); }
.lc-chapter-nav .lc-next { justify-self: end; text-align: right; }
.lc-disabled { opacity: .42; }
.lc-bilingual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 40px;
}
.lc-bilingual section + section {
  border-left: 1px solid var(--lc-line);
  padding-left: 40px;
}
.lc-column-label {
  margin: 0 0 17px;
  color: var(--lc-accent);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Generic fallback */
.lc-empty {
  padding: 20px;
  border: 1px dashed var(--lc-line-strong);
  background: rgba(255,255,255,.3);
  color: var(--lc-muted);
}
.lc-post-list { display: grid; gap: 14px; }
.lc-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--lc-line);
  background: rgba(255,253,249,.54);
}
.lc-card-title { margin: 0; color: var(--lc-ink); }
.lc-card-copy { color: var(--lc-muted); }

.lc-footer {
  padding: 25px 0;
  border-top: 1px solid var(--lc-line);
  background: rgba(251,248,242,.8);
  color: var(--lc-muted);
  font-size: .88rem;
}

.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;
}

@media (max-width: 900px) {
  .lc-menu-toggle { display: inline-flex; }
  .lc-masthead { min-height: 72px; justify-content: flex-start; }
  .lc-brand { font-size: 2rem; }
  .lc-nav-wrap { position: relative; }
  .lc-nav { display: none; position: absolute; z-index: 100; top: 0; right: 14px; left: 14px; }
  .lc-nav.is-open { display: block; }
  .lc-nav ul {
    display: block;
    padding: 8px;
    border: 1px solid var(--lc-line);
    border-radius: 8px;
    background: var(--lc-surface-strong);
    box-shadow: var(--lc-shadow);
  }
  .lc-nav a { padding: 10px 12px; border-radius: 5px; }
  .lc-nav ul ul,
  .lc-nav .sub-menu,
  .lc-nav .children {
    position: static;
    display: none;
    min-width: 0;
    margin: 0 0 4px 14px;
    padding: 0 0 0 10px;
    border: 0;
    border-left: 1px solid var(--lc-line);
    border-radius: 0;
    box-shadow: none;
  }
  .lc-nav li.is-submenu-open > ul,
  .lc-nav li.is-submenu-open > .sub-menu,
  .lc-nav li.is-submenu-open > .children { display: block; }

  .lc-featured-layout { grid-template-columns: 1fr; gap: 24px; }
  .lc-featured-main { padding-right: 0; border-right: 0; }
  .lc-editorial-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .lc-container { width: min(100% - 24px, 1160px); }
  .lc-topline-copy { display: none; }
  .lc-topline-inner { justify-content: flex-end; }
  .lc-header-search input:focus { width: 145px; }
  .lc-editorial-hero { padding-top: 48px; }
  .lc-hero-title { font-size: clamp(3rem, 14vw, 5rem); }
  .lc-featured-main { grid-template-columns: 1fr; }
  .lc-editorial-grid { grid-template-columns: 1fr; }
  .lc-bilingual { grid-template-columns: 1fr; gap: 30px; }
  .lc-bilingual section + section {
    border-top: 1px solid var(--lc-line);
    border-left: 0;
    padding: 25px 0 0;
  }
  .lc-chapter-nav { grid-template-columns: 1fr; text-align: center; }
  .lc-chapter-nav .lc-prev,
  .lc-chapter-nav .lc-contents,
  .lc-chapter-nav .lc-next { justify-self: center; }
}


/* Open chapter spread: no enclosing card */
.lc-reading-page {
  width: min(1460px, calc(100vw - 48px));
  margin-left: 50%;
  transform: translateX(-50%);
  padding: 10px 0 4px;
}
.lc-reading-header {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}
.lc-reading-page .lc-chapter-nav {
  width: min(1160px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}
.lc-reading-page .lc-bilingual {
  gap: clamp(34px, 4vw, 72px);
  padding: 8px 0;
}
.lc-reading-page .lc-bilingual > section {
  min-width: 0;
}
.lc-reading-page .lc-bilingual section + section {
  padding-left: clamp(34px, 4vw, 72px);
}
.lc-reading-page .lc-reading {
  font-size: clamp(1.08rem, 1.35vw, 1.25rem);
  line-height: 1.82;
}

@media (max-width: 900px) {
  .lc-posts-layout { grid-template-columns: 1fr; gap: 24px; }
  .lc-post-lead { padding-right: 0; border-right: 0; }
}

@media (max-width: 680px) {
  .lc-post-lead { grid-template-columns: 1fr; }
  .lc-reading-page {
    width: min(100% - 24px, 1460px);
  }
  .lc-reading-header,
  .lc-reading-page .lc-chapter-nav {
    width: 100%;
  }
}


/* Wider chapter panel: restored box without the cramped card feeling */
.lc-reading-page {
  width: min(1500px, calc(100vw - 34px));
  margin-left: 50%;
  transform: translateX(-50%);
  padding: clamp(22px, 3vw, 42px);
  border: 1px solid var(--lc-line);
  border-radius: 10px;
  background: rgba(255,253,249,.88);
  box-shadow: 0 20px 52px rgba(69,55,39,.07);
}

.lc-reading-header {
  width: 100%;
  margin: 0;
}

.lc-reading-page .lc-chapter-nav {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.lc-reading-page .lc-bilingual {
  gap: clamp(36px, 4.5vw, 78px);
  padding: 8px 0;
}

.lc-reading-page .lc-bilingual section + section {
  padding-left: clamp(36px, 4.5vw, 78px);
}

.lc-reading-page .lc-reading {
  font-size: clamp(1.08rem, 1.25vw, 1.22rem);
  line-height: 1.84;
}

@media (max-width: 900px) {
  .lc-reading-page {
    width: min(100% - 22px, 1500px);
    padding: 22px;
  }
}

@media (max-width: 680px) {
  .lc-reading-page {
    width: min(100% - 16px, 1500px);
    padding: 18px;
    border-radius: 8px;
  }
}


/* Header portrait image */
.lc-brand-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-brand-image img {
  display: block;
  width: min(520px, 72vw);
  height: auto;
  max-height: 108px;
  object-fit: contain;
}

/* Homepage welcome text */
.lc-welcome-panel {
  max-width: 860px;
  padding: 6px 0 2px;
}

.lc-welcome-panel p {
  margin: 0 0 1em;
  color: var(--lc-muted);
  font-family: var(--lc-serif);
  font-size: 1.08rem;
  line-height: 1.72;
}

@media (max-width: 900px) {
  .lc-brand-image img {
    width: min(360px, 68vw);
    max-height: 82px;
  }
}

@media (max-width: 680px) {
  .lc-brand-image img {
    width: min(280px, 62vw);
    max-height: 64px;
  }
}


/* Equal-width bilingual columns — divider sits in the gap */
.lc-reading-page .lc-bilingual {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(38px, 5vw, 84px);
}

.lc-reading-page .lc-bilingual::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--lc-line);
  transform: translateX(-.5px);
  pointer-events: none;
}

.lc-reading-page .lc-bilingual section + section {
  border-left: 0;
  padding-left: 0;
}

@media (max-width: 680px) {
  .lc-reading-page .lc-bilingual::before {
    display: none;
  }
}
