/**
 * Editor-specific styles supplement.
 *
 * main.css is loaded via add_editor_style for base Tailwind/BEM styles.
 * This file handles editor-wrapper specifics and block style mappings.
 */

/* Load theme fonts in editor */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&display=swap');

/* Editor wrapper: match theme body */
.editor-styles-wrapper {
  --color-primary: #ab8b73;
  --color-primary-hover: #b58d6c;
  --color-primary-text: #fff;
  --color-secondary: #ab8b73;
  --color-secondary-hover: #b58d6c;
  --color-secondary-text: #fff;

  font-family: 'Montserrat', sans-serif;
  color: #111827;
  background-color: #fafaf9;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Content width — match max-w-6xl (1152px) from theme templates */
.editor-styles-wrapper .is-root-container > * {
  max-width: 1152px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Wide alignment — match max-w-7xl (1280px) */
.editor-styles-wrapper .is-root-container > .alignwide {
  max-width: 1280px !important;
}

/* Full width */
.editor-styles-wrapper .is-root-container > .alignfull {
  max-width: none !important;
}

/* =============================================
   Headings — match theme typography
   ============================================= */

.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4 {
  font-family: 'Playfair Display', serif;
  color: #111827;
  line-height: 1.2;
  margin-top: 0;
}

.editor-styles-wrapper h1 {
  font-size: 2.25rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.editor-styles-wrapper h2 {
  font-size: 1.875rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.editor-styles-wrapper h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.editor-styles-wrapper h4 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.editor-styles-wrapper h5 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #111827;
  margin-bottom: 0.75rem;
}

.editor-styles-wrapper h6 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ab8b73;
  margin-bottom: 0.5rem;
}

/* =============================================
   Paragraph
   ============================================= */

.editor-styles-wrapper p {
  font-size: 1rem;
  line-height: 1.625;
  color: #4b5563;
  margin-bottom: 1.25rem;
}

/* =============================================
   Links
   ============================================= */

.editor-styles-wrapper a {
  color: #96631b;
  text-decoration: underline;
  text-decoration-color: #efd474;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}
.editor-styles-wrapper a:hover {
  text-decoration-color: #b8841e;
}

/* =============================================
   Lists — Unordered & Ordered
   ============================================= */

.editor-styles-wrapper ul,
.editor-styles-wrapper .wp-block-list:not(.wp-block-navigation__container) {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: #4b5563;
}

.editor-styles-wrapper ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: #4b5563;
}

.editor-styles-wrapper ul li,
.editor-styles-wrapper ol li {
  font-size: 1rem;
  line-height: 1.625;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

/* List markers — gold color */
.editor-styles-wrapper ul li::marker {
  color: #ab8b73;
}
.editor-styles-wrapper ol li::marker {
  color: #ab8b73;
  font-weight: 600;
}

/* Nested lists */
.editor-styles-wrapper ul ul,
.editor-styles-wrapper ol ol,
.editor-styles-wrapper ul ol,
.editor-styles-wrapper ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* =============================================
   Blockquote
   ============================================= */

.editor-styles-wrapper blockquote,
.editor-styles-wrapper .wp-block-quote {
  border-left: 4px solid #ab8b73;
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin: 2rem 0;
  background-color: rgba(253, 250, 241, 0.3);
}
.editor-styles-wrapper blockquote p,
.editor-styles-wrapper .wp-block-quote p {
  font-size: 1.125rem;
  color: #374151;
  font-style: italic;
  font-family: 'Playfair Display', serif;
  margin-bottom: 0;
}
.editor-styles-wrapper blockquote cite,
.editor-styles-wrapper .wp-block-quote cite {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  font-style: normal;
  margin-top: 0.75rem;
}

/* =============================================
   Table
   ============================================= */

.editor-styles-wrapper table,
.editor-styles-wrapper .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.875rem;
}
.editor-styles-wrapper table thead,
.editor-styles-wrapper .wp-block-table thead {
  border-bottom: 2px solid #d6d3d1;
}
.editor-styles-wrapper table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.editor-styles-wrapper table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #4b5563;
}
.editor-styles-wrapper table tbody tr:hover {
  background-color: #fafaf9;
}

/* =============================================
   Code
   ============================================= */

.editor-styles-wrapper code {
  background-color: #f5f5f4;
  color: #7b4f1d;
  font-size: 0.875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.125rem;
  font-family: ui-monospace, monospace;
}
.editor-styles-wrapper pre,
.editor-styles-wrapper .wp-block-code {
  background-color: #1c1917;
  color: #e7e5e4;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.625;
}
.editor-styles-wrapper pre code,
.editor-styles-wrapper .wp-block-code code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* =============================================
   Horizontal Rule / Separator
   ============================================= */

.editor-styles-wrapper hr,
.editor-styles-wrapper .wp-block-separator {
  border-top: 1px solid #e7e5e4;
  margin: 2.5rem 0;
}

.wp-block-separator.is-style-gold {
  border-color: #ab8b73;
  border-top-width: 2px;
}

/* =============================================
   Images & Figures
   ============================================= */

.editor-styles-wrapper figure {
  margin: 2rem 0;
}
.editor-styles-wrapper figcaption,
.editor-styles-wrapper .wp-element-caption {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* =============================================
   Block Style: Buttons
   ============================================= */

/* Base button block reset */
.wp-block-button__link {
  border-radius: 0;
  font-family: 'Montserrat', sans-serif;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Primary (default) */
.wp-block-button__link,
.wp-block-button.is-style-primary .wp-block-button__link {
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.75rem 1.5rem;
  border: none;
}
.wp-block-button__link:hover,
.wp-block-button.is-style-primary .wp-block-button__link:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-primary-text);
}

/* Ghost */
.wp-block-button.is-style-ghost .wp-block-button__link {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: calc(0.75rem - 1px) 1.5rem;
}
.wp-block-button.is-style-ghost .wp-block-button__link:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* Outline (dark bg variant) */
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  color: #dfd0c4;
  border: 1px solid #7b6152;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: calc(0.75rem - 1px) 1.5rem;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: #7b6152;
  color: #bb9f88;
}

/* White */
.wp-block-button.is-style-white .wp-block-button__link {
  background-color: #fff;
  color: #66421e;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.75rem 1.5rem;
  border: none;
}
.wp-block-button.is-style-white .wp-block-button__link:hover {
  background-color: #fdfaf1;
}

/* Large button modifier */
.wp-block-button.is-style-large .wp-block-button__link {
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 1rem 2.5rem;
  border: none;
}
.wp-block-button.is-style-large .wp-block-button__link:hover {
  background-color: var(--color-primary-hover);
}

/* =============================================
   Block Style: Heading — Label
   ============================================= */

.wp-block-heading.is-style-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #ab8b73;
}
