/* =========================================
   GLOBAL RESET
   ========================================= */

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

:root {
  --warm-yellow: #F59E0B;
  --warm-yellow-soft: #FEF3C7;
  --light-black: #1C1917;
  --light-black-soft: #44403C;
  --surface: #FFFFFF;
  --border: #E7E5E4;
  --background: #FFFBF0;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--light-black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: var(--background);
  background-image:
    radial-gradient(at 15% 20%, rgba(253,186,116,.3) 0, transparent 50%),
    radial-gradient(at 85% 15%, rgba(252,211,77,.3) 0, transparent 50%),
    radial-gradient(at 80% 85%, rgba(254,202,202,.25) 0, transparent 50%),
    radial-gradient(at 10% 90%, rgba(167,243,208,.2) 0, transparent 50%),
    radial-gradient(circle, rgba(28,25,23,.06) 1.5px, transparent 1.5px);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    24px 24px;
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}


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

header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  background: var(--warm-yellow);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--light-black-soft);
  transition: var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--light-black);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--warm-yellow);
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--light-black);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* =========================================
   HOMEPAGE
   ========================================= */

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

.page-intro {
  max-width: 720px;
  margin-bottom: 48px;
}

.page-intro h1 {
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.page-intro p {
  font-size: 1.1rem;
  color: var(--light-black-soft);
  line-height: 1.7;
}


/* =========================================
   CONTENT LAYOUT
   ========================================= */

.content-layout,
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.content-layout {
  max-width: none;
  padding: 0;
}

.section-heading h2,
.related-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.section-heading h2::before,
.related-section h3::before,
.widget-title::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--warm-yellow);
  border-radius: 2px;
  flex: 0 0 auto;
}


/* =========================================
   POST CARDS
   ========================================= */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}

.post-card:hover,
.related-card:hover,
.post-nav-item:hover {
  border-color: var(--warm-yellow);
  transform: translateY(-2px);
}

.post-category {
  display: inline-block;
  background: var(--warm-yellow-soft);
  color: #B45309;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.post-card h3 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.post-card:hover h3 {
  color: var(--warm-yellow);
}

.excerpt {
  color: var(--light-black-soft);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.post-meta,
.post-meta-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--light-black-soft);
  font-size: .8rem;
}

.post-meta-inline {
  font-size: .9rem;
  gap: 12px;
}

.dot {
  width: 3px;
  height: 3px;
  background: var(--light-black-soft);
  border-radius: 50%;
}


/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
  align-self: start;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.widget-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--light-black-soft);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-list {
  list-style: none;
}

.recent-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.recent-list li:first-child {
  padding-top: 0;
}

.recent-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recent-list a {
  display: block;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  transition: var(--transition);
}

.recent-list a:hover {
  color: var(--warm-yellow);
}

.recent-list .date {
  font-size: .78rem;
  color: var(--light-black-soft);
}


/* =========================================
   BREADCRUMBS
   ========================================= */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--light-black-soft);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--warm-yellow);
}

.separator {
  color: var(--border);
}

.current {
  color: var(--light-black);
  font-weight: 500;
}


/* =========================================
   POST PAGE
   ========================================= */

article.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}


/* =========================================
   POST CONTENT
   ========================================= */

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--light-black-soft);
  overflow-wrap: break-word;
}

.post-content p {
  margin: 0 0 1.5rem;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--light-black);
  font-weight: 700;
}

.post-content h2 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 3rem 0 1.25rem;
}

.post-content h3 {
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 2.25rem 0 1rem;
}

.post-content h4 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 2rem 0 .75rem;
}

.post-content h2:first-child,
.post-content h3:first-child,
.post-content h4:first-child {
  margin-top: 0;
}

.post-content strong {
  color: var(--light-black);
  font-weight: 700;
}

.post-content em {
  font-style: italic;
}

.post-content u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content s {
  text-decoration: line-through;
}

.post-content a {
  color: #B45309;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content a:hover {
  color: var(--warm-yellow);
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem;
  padding-left: 1.75rem;
}

.post-content ul {
  list-style-type: disc;
}

.post-content ol {
  list-style-type: decimal;
}

.post-content li {
  margin-bottom: .6rem;
  padding-left: .25rem;
}

.post-content li:last-child {
  margin-bottom: 0;
}

.post-content li::marker {
  color: var(--warm-yellow);
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 20px 28px;
  background: var(--warm-yellow-soft);
  border-left: 4px solid var(--warm-yellow);
  border-radius: 0 12px 12px 0;
  color: var(--light-black);
  font-size: 1.1rem;
  line-height: 1.7;
}

.post-content blockquote p {
  margin-bottom: .75rem;
}

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

.post-content blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: .9rem;
  font-style: normal;
  color: var(--light-black-soft);
}

.post-content code {
  background: #F5F5F4;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: Consolas, Monaco, monospace;
  font-size: .9em;
}

.post-content pre {
  margin: 2rem 0;
  padding: 20px;
  background: #1C1917;
  color: #fff;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
}

.post-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 12px;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  margin-top: -1rem;
  text-align: center;
  color: var(--light-black-soft);
  font-size: .85rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .95rem;
  overflow: hidden;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
}

.post-content th {
  background: var(--warm-yellow-soft);
  color: var(--light-black);
  font-weight: 700;
}

.post-content tr:nth-child(even) td {
  background: #FFFCF5;
}

.post-content .lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--light-black);
  margin-bottom: 2rem;
}


/* =========================================
   POST TAGS
   ========================================= */

.post-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-tags-label {
  font-size: .85rem;
  font-weight: 600;
  margin-right: 4px;
}

.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--light-black-soft);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
}

.tag:hover {
  border-color: var(--warm-yellow);
  color: var(--warm-yellow);
}


/* =========================================
   SOCIAL SHARE
   ========================================= */

.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.share-label {
  font-size: .85rem;
  font-weight: 600;
}

.share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-black-soft);
  cursor: pointer;
  transition: var(--transition);
}

.share-btn:hover {
  background: var(--warm-yellow);
  border-color: var(--warm-yellow);
  color: #fff;
  transform: translateY(-2px);
}


/* =========================================
   RELATED POSTS
   ========================================= */

.related-section {
  margin-top: 48px;
}

.related-section h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.related-card,
.post-nav-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.related-card h4 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.related-card .date {
  font-size: .8rem;
  color: var(--light-black-soft);
}


/* =========================================
   POST NAVIGATION
   ========================================= */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-nav-item.next {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--light-black-soft);
  font-weight: 600;
}

.post-nav-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}


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

footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: .9rem;
  color: var(--light-black-soft);
  margin-top: 48px;
}

footer strong {
  color: var(--light-black);
}


/* =========================================
   EMPTY / NOT FOUND
   ========================================= */

.empty-state,
.not-found {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--light-black-soft);
}

.not-found {
  max-width: 700px;
  margin: 100px auto;
}

.not-found h1 {
  color: var(--light-black);
  margin-bottom: 10px;
}

.not-found p {
  margin-bottom: 24px;
}


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

.form-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px;
}

.post-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.form-group {
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--light-black);
  background: #fff;
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--warm-yellow);
  box-shadow: 0 0 0 3px var(--warm-yellow-soft);
}

.form-group small {
  display: block;
  margin-top: 6px;
  color: var(--light-black-soft);
  font-size: .8rem;
}

.primary-button {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--warm-yellow);
  color: #fff;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(.95);
}

.primary-button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.form-message {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: .9rem;
}

.form-message.success {
  color: #166534;
}

.form-message.error {
  color: #B91C1C;
}

.publish-status {
  margin-top: 12px;
  font-size: .9rem;
  color: var(--light-black-soft);
}


/* =========================================
   CATEGORY PAGE
   ========================================= */

.category-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.category-card:hover {
  border-color: var(--warm-yellow);
  transform: translateY(-2px);
}

.category-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* =========================================
   POST EDITOR
   ========================================= */

.editor-wrapper {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}


/* =========================================
   EDITOR TOOLBAR
   ========================================= */

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px;
  background: #F8F8F7;
  border-bottom: 1px solid var(--border);
}


/* =========================================
   EDITOR FORMAT SELECTOR
   ========================================= */

.editor-toolbar select {
  flex: 0 0 auto;
  width: auto;
  min-width: 145px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--light-black);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.editor-toolbar select:hover {
  border-color: #A8A29E;
}

.editor-toolbar select:focus {
  outline: none;
  border-color: var(--warm-yellow);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .1);
}


/* =========================================
   EDITOR TOOLBAR BUTTONS
   ========================================= */

.editor-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--light-black);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background .15s ease,
    border-color .15s ease,
    color .15s ease,
    box-shadow .15s ease;
}

.editor-toolbar button:hover {
  background: #F5F5F4;
  border-color: #A8A29E;
}

.editor-toolbar button:active {
  background: #E7E5E4;
}

.editor-toolbar button:focus-visible {
  outline: 2px solid var(--warm-yellow);
  outline-offset: 1px;
}

.editor-toolbar button.active {
  background: var(--warm-yellow-soft);
  border-color: var(--warm-yellow);
}


/* =========================================
   TEXT FORMATTING BUTTONS
   ========================================= */

.editor-toolbar button[data-command="bold"],
.editor-toolbar button[data-command="italic"],
.editor-toolbar button[data-command="underline"],
.editor-toolbar button[data-command="strikeThrough"] {
  font-size: 16px;
  font-weight: 700;
}

.editor-toolbar button[data-command="italic"] {
  font-style: italic;
}

.editor-toolbar button[data-command="underline"] {
  text-decoration: underline;
}

.editor-toolbar button[data-command="strikeThrough"] {
  text-decoration: line-through;
}


/* =========================================
   TOOLBAR SEPARATORS
   ========================================= */

.editor-toolbar .toolbar-separator {
  flex: 0 0 1px;
  width: 1px;
  height: 25px;
  margin: 0 4px;
  background: var(--border);
}


/* =========================================
   RICH TEXT EDITOR
   ========================================= */

#contentEditor {
  width: 100%;
  min-height: 500px;
  padding: 24px;
  border: 0;
  background: #fff;
  color: var(--light-black-soft);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  text-align: left;
  outline: none;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}


/* =========================================
   EDITOR PLACEHOLDER
   ========================================= */

#contentEditor:empty::before {
  content: attr(data-placeholder);
  color: #A8A29E;
  pointer-events: none;
}


/* =========================================
   EDITOR PARAGRAPHS
   ========================================= */

#contentEditor p {
  margin: 0 0 1.25rem;
  padding: 0;
}

#contentEditor p:last-child {
  margin-bottom: 0;
}


/* =========================================
   EDITOR HEADINGS
   ========================================= */

#contentEditor h1,
#contentEditor h2,
#contentEditor h3,
#contentEditor h4,
#contentEditor h5,
#contentEditor h6 {
  margin: 1.8rem 0 .75rem;
  padding: 0;
  color: var(--light-black);
  font-weight: 700;
  line-height: 1.25;
}

#contentEditor h1:first-child,
#contentEditor h2:first-child,
#contentEditor h3:first-child,
#contentEditor h4:first-child,
#contentEditor h5:first-child,
#contentEditor h6:first-child {
  margin-top: 0;
}

#contentEditor h1 {
  font-size: 2rem;
}

#contentEditor h2 {
  font-size: 1.65rem;
}

#contentEditor h3 {
  font-size: 1.4rem;
}

#contentEditor h4 {
  font-size: 1.2rem;
}

#contentEditor h5 {
  font-size: 1.05rem;
}

#contentEditor h6 {
  font-size: .95rem;
}


/* =========================================
   EDITOR TEXT FORMATTING
   ========================================= */

#contentEditor strong,
#contentEditor b {
  color: var(--light-black);
  font-weight: 700;
}

#contentEditor em,
#contentEditor i {
  font-style: italic;
}

#contentEditor u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#contentEditor s,
#contentEditor strike {
  text-decoration: line-through;
}


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

#contentEditor ul,
#contentEditor ol {
  margin: 0 0 1.25rem;
  padding-left: 2rem;
}

#contentEditor ul {
  list-style-type: disc;
}

#contentEditor ol {
  list-style-type: decimal;
}

#contentEditor li {
  margin: 0 0 .45rem;
  padding: 0;
}

#contentEditor li:last-child {
  margin-bottom: 0;
}

#contentEditor li p {
  margin-bottom: .45rem;
}

#contentEditor ul ul,
#contentEditor ol ol,
#contentEditor ul ol,
#contentEditor ol ul {
  margin-top: .45rem;
  margin-bottom: .45rem;
}


/* =========================================
   EDITOR BLOCKQUOTE
   ========================================= */

#contentEditor blockquote {
  margin: 1.5rem 0;
  padding: 18px 22px;
  border-left: 4px solid var(--warm-yellow);
  border-radius: 0 10px 10px 0;
  background: var(--warm-yellow-soft);
  color: var(--light-black);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
}

#contentEditor blockquote p {
  margin: 0;
}

#contentEditor blockquote p + p {
  margin-top: 1rem;
}


/* =========================================
   EDITOR LINKS
   ========================================= */

#contentEditor a {
  color: #B45309;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

#contentEditor a:hover {
  color: #92400E;
}


/* =========================================
   EDITOR IMAGES
   ========================================= */

#contentEditor img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border: 0;
  border-radius: 10px;
}

#contentEditor img:first-child {
  margin-top: 0;
}

#contentEditor img:last-child {
  margin-bottom: 0;
}


/* =========================================
   EDITOR HORIZONTAL RULE
   ========================================= */

#contentEditor hr {
  width: 100%;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}


/* =========================================
   EDITOR ALIGNMENT
   ========================================= */

#contentEditor [align="left"] {
  text-align: left;
}

#contentEditor [align="center"] {
  text-align: center;
}

#contentEditor [align="right"] {
  text-align: right;
}


/* =========================================
   EDITOR SELECTION
   ========================================= */

#contentEditor ::selection {
  background: var(--warm-yellow-soft);
}


/* =========================================
   SLUG PREVIEW
   ========================================= */

.slug-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  background: #FAFAF9;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--light-black-soft);
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.slug-preview strong {
  color: var(--light-black);
}


/* =========================================
   EDITOR HELP
   ========================================= */

.editor-help {
  display: block;
  margin-top: 8px;
  color: var(--light-black-soft);
  font-size: .8rem;
}


/* =========================================
   IMAGE DIALOG
   ========================================= */

.editor-dialog {
  width: min(500px, calc(100% - 32px));
  max-width: 500px;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--light-black);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}

.editor-dialog::backdrop {
  background: rgba(0, 0, 0, .45);
}

.editor-dialog form {
  margin: 0;
  padding: 24px;
}

.editor-dialog h2 {
  margin: 0 0 20px;
  padding: 0;
  color: var(--light-black);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}


/* =========================================
   DIALOG FORM
   ========================================= */

.editor-dialog .form-group {
  margin-bottom: 16px;
}

.editor-dialog label {
  display: block;
  margin-bottom: 6px;
  color: var(--light-black);
  font-size: 14px;
  font-weight: 600;
}

.editor-dialog input {
  display: block;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--light-black);
  font-family: inherit;
  font-size: 15px;
  line-height: 42px;
}

.editor-dialog input:focus {
  outline: none;
  border-color: var(--warm-yellow);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .1);
}

.editor-dialog .editor-help {
  display: block;
  margin-top: 6px;
}


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

.editor-dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.editor-dialog-actions button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--light-black);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.editor-dialog-actions button:hover {
  background: #F5F5F4;
  border-color: #A8A29E;
}

.editor-dialog-actions button:focus-visible {
  outline: 2px solid var(--warm-yellow);
  outline-offset: 1px;
}

#insertImageButton {
  border-color: var(--warm-yellow);
  background: var(--warm-yellow);
  color: #fff;
}

#insertImageButton:hover {
  border-color: #D97706;
  background: #D97706;
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {

  .layout,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .post-header h1 {
    font-size: 2.25rem;
  }

  .sidebar {
    width: 100%;
  }

  .category-list {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 768px) {

  /* Navigation */

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,.05);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
    z-index: 99;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    width: 100%;
    font-size: 1.05rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-links a.active::after {
    display: none;
  }


  /* Homepage */

  .home-container,
  .form-container {
    padding: 40px 16px;
  }

  .page-intro {
    margin-bottom: 36px;
  }

  .page-intro h1 {
    font-size: 2.25rem;
  }


  /* Layout */

  .layout {
    padding: 24px 16px;
  }


  /* Post */

  article.post {
    padding: 28px 20px;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }

  .post-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .post-content h2 {
    font-size: 1.45rem;
    margin-top: 2.25rem;
  }

  .post-content h3 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
  }

  .post-content h4 {
    font-size: 1.05rem;
  }

  .post-content .lead {
    font-size: 1.1rem;
  }

  .post-content blockquote {
    padding: 16px 18px;
    font-size: 1rem;
  }

  .post-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }


  /* Related / forms / categories */

  .related-grid,
  .post-nav,
  .form-row,
  .category-list {
    grid-template-columns: 1fr;
  }

  .post-nav-item.next {
    text-align: left;
    align-items: flex-start;
  }

  .post-form {
    padding: 24px 20px;
  }


  /* Editor */

  .editor-toolbar {
    gap: 4px;
    padding: 7px;
  }

  .editor-toolbar select {
    width: 100%;
    min-width: 0;
    margin-bottom: 3px;
  }

  .editor-toolbar button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
  }

  .editor-toolbar .toolbar-separator {
    height: 22px;
    margin: 0 2px;
  }

  #contentEditor {
    min-height: 400px;
    padding: 16px;
    font-size: 16px;
    line-height: 1.75;
  }

  #contentEditor h1 {
    font-size: 1.7rem;
  }

  #contentEditor h2 {
    font-size: 1.45rem;
  }

  #contentEditor h3 {
    font-size: 1.25rem;
  }

  #contentEditor h4 {
    font-size: 1.1rem;
  }

  #contentEditor h5 {
    font-size: 1rem;
  }

  #contentEditor h6 {
    font-size: .95rem;
  }

  .editor-dialog {
    width: calc(100% - 24px);
  }

  .editor-dialog form {
    padding: 20px;
  }

  .editor-dialog-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .editor-dialog-actions button {
    width: 100%;
  }
}


/* =========================================
   SMALL MOBILE
   ========================================= */

@media (max-width: 480px) {

  .nav-container {
    height: 64px;
    padding: 0 16px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .home-container,
  .form-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-intro h1 {
    font-size: 2rem;
  }

  .page-intro p {
    font-size: 1rem;
  }

  .post-card {
    padding: 22px 20px;
  }

  article.post {
    padding: 24px 18px;
  }

  .post-header {
    margin-bottom: 30px;
    padding-bottom: 24px;
  }

  .post-header h1 {
    font-size: 1.6rem;
  }

  .widget {
    padding: 22px;
  }

  .post-content h2 {
    font-size: 1.35rem;
  }

  .post-content h3 {
    font-size: 1.15rem;
  }

  #contentEditor {
    min-height: 350px;
    padding: 14px;
  }

  .editor-toolbar {
    padding: 6px;
  }

  .editor-toolbar button {
    min-width: 34px;
    height: 34px;
    padding: 0 7px;
    font-size: 13px;
  }

  .editor-toolbar button[data-command="bold"],
  .editor-toolbar button[data-command="italic"],
  .editor-toolbar button[data-command="underline"],
  .editor-toolbar button[data-command="strikeThrough"] {
    font-size: 15px;
  }
}