/*
 * THEME: EDICT (IMPERIAL LEXICON)
 * Contemporary editorial serif — vellum, ink, and one crimson accent.
 * Designed for Holy Roman Empire Nouns; usable by any literary site.
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

:root {
  --bg-color: #f4efe6;
  --bg-elevated: #fbf7f0;
  --ink: #1c1612;
  --text-color: #2a241e;
  --text-secondary: #6a6158;
  --heading-color: #1c1612;
  --accent-color: #7a1f2b;
  --accent-hover: #5c171f;
  --rule-color: #c4b49a;
  --gold: #a6844a;
  --border-color: #ddd2c0;

  --display-font: 'Fraunces', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --body-font: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --ui-font: var(--body-font);

  --measure: 48rem;
  --image-measure: 38rem;
  --image-radius: 4px;
  --page-pad: clamp(1.25rem, 4vw, 2.5rem);
  --transition: 180ms ease;
}

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

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.theme-edict {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(1200px 500px at 50% -10%, rgba(166, 132, 74, 0.08), transparent 60%),
    linear-gradient(180deg, #f7f2ea 0%, var(--bg-color) 18%);
  color: var(--text-color);
  font-family: var(--body-font);
  font-optical-sizing: auto;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  margin: 0;
  min-height: 100vh;
}

body.theme-edict a {
  color: var(--accent-color);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

body.theme-edict a:hover {
  color: var(--accent-hover);
}

body.theme-edict h1,
body.theme-edict h2,
body.theme-edict h3,
body.theme-edict h4 {
  font-family: var(--display-font);
  font-optical-sizing: auto;
  font-weight: 500;
  color: var(--heading-color);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* --- FRAME --- */
body.theme-edict #site-header-container,
body.theme-edict main,
body.theme-edict footer {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

body.theme-edict main {
  min-height: calc(100vh - 16rem);
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* --- HEADER --- */
body.theme-edict #site-header-container {
  padding-top: 2.25rem;
}

body.theme-edict #site-header {
  margin: 0;
  padding: 0 0 1.75rem;
  border-bottom: none;
  background: transparent;
  max-width: none;
}

body.theme-edict #site-header::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 1.75rem;
  background: linear-gradient(90deg, var(--gold), var(--rule-color) 40%, transparent);
}

body.theme-edict #site-header nav {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  padding: 0;
  max-width: none;
}

body.theme-edict #site-header h1 {
  margin: 0;
  margin-right: auto;
  max-width: 14ch;
  font-family: var(--display-font);
  font-size: clamp(2.1rem, 5.5vw, 3.35rem);
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

body.theme-edict #site-header h1 a,
body.theme-edict nav h1 a {
  color: var(--ink);
  text-decoration: none;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

body.theme-edict #site-header h1 a:hover {
  color: var(--accent-color);
}

body.theme-edict #site-header .menu-links {
  align-items: center;
  gap: 1.35rem;
  font-family: var(--display-font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@media (min-width: 601px) {
  body.theme-edict #site-header .menu-links {
    display: flex;
  }
}

body.theme-edict #site-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 0;
  font-weight: 500;
}

body.theme-edict #site-header nav a:hover,
body.theme-edict #site-header .dropdown-toggle:hover {
  color: var(--accent-color);
}

body.theme-edict .hamburger {
  color: var(--ink);
  font-size: 1.6rem;
}

/* --- HOMEPAGE --- */
body.theme-edict .homepage > h2 {
  font-family: var(--display-font);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

body.theme-edict .site-dek {
  font-family: var(--display-font);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 400;
  font-style: italic;
  font-optical-sizing: auto;
  line-height: 1.35;
  color: var(--ink);
  max-width: 22em;
  margin: 0 0 3rem;
  text-align: left;
}

body.theme-edict .homepage-empty {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: left;
}

body.theme-edict .posts-list,
body.theme-edict .recent-posts {
  display: block;
  padding: 0;
}

body.theme-edict article.post-preview {
  display: block;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

body.theme-edict article.post-preview:first-of-type {
  padding-top: 0;
  border-top: none;
}

body.theme-edict .post-preview .featured-image-container {
  margin: 0 0 1.25rem;
}

body.theme-edict .post-preview .featured-image-preview {
  width: 100%;
  max-width: var(--image-measure);
  height: auto;
  border-radius: var(--image-radius);
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: saturate(0.85);
}

body.theme-edict .post-preview h3 {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 500;
}

body.theme-edict .post-preview h3 a {
  color: var(--ink);
  text-decoration: none;
}

body.theme-edict .post-preview h3 a:hover {
  color: var(--accent-color);
}

body.theme-edict .post-preview .meta,
body.theme-edict article > header .meta {
  font-family: var(--display-font);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

body.theme-edict .post-preview .summary,
body.theme-edict .post-preview .post-content > :not(h3):not(.meta) {
  color: var(--text-color);
}

/* --- ARTICLE --- */
body.theme-edict article > header {
  margin-bottom: 2.25rem;
}

body.theme-edict article > header h1,
body.theme-edict article h1 {
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  font-weight: 500;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

body.theme-edict .featured-image {
  width: 100%;
  max-width: var(--image-measure);
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: var(--image-radius);
  display: block;
  margin: 1.5rem auto 0;
}

body.theme-edict .content {
  font-size: 1.08rem;
  line-height: 1.75;
}

body.theme-edict .content p {
  margin: 0 0 1.15rem;
}

body.theme-edict .content p:first-of-type {
  font-size: 1.14rem;
}

body.theme-edict .content h2 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.7rem;
}

body.theme-edict .content h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.3rem;
}

body.theme-edict .content blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--gold);
  color: var(--ink);
  font-family: var(--display-font);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.45;
}

body.theme-edict .content img,
body.theme-edict .gallery-item img {
  width: 100%;
  max-width: var(--image-measure);
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--image-radius);
}

body.theme-edict .category,
body.theme-edict .tag {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-family: var(--display-font);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

body.theme-edict .category:hover,
body.theme-edict .tag:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  text-decoration: none;
}

/* --- FOOTER --- */
body.theme-edict footer {
  text-align: left;
  margin-top: 0;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--gold);
  background: transparent;
  font-family: var(--display-font);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  width: 100%;
  box-shadow: none;
}

body.theme-edict footer p {
  margin: 0;
}

/* --- SEARCH / DROPDOWN --- */
body.theme-edict .search-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(28, 22, 18, 0.08);
  border-radius: 0;
}

body.theme-edict .dropdown-menu {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

/* --- MOBILE --- */
@media (max-width: 600px) {
  body.theme-edict #site-header nav .menu-links {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 30px rgba(28, 22, 18, 0.08);
  }

  body.theme-edict #menu-toggle:checked + .menu-links {
    display: flex;
  }

  body.theme-edict #site-header nav .menu-links a {
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom-color: var(--border-color);
  }

  body.theme-edict #site-header h1 {
    max-width: 11ch;
  }
}
