/* ============================================================
   CiCC Theme 4.1.0 — Gutenberg Editor Styles
   Frontend = Backend visual parity
   ============================================================ */

/* Import design tokens */
@import url('variables.css');
@import url('base.css');
@import url('components.css');

/* ============================================================
   EDITOR WRAPPER
   ============================================================ */

.editor-styles-wrapper {
  max-width: 1200px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
}

/* ============================================================
   BLOCK: Core/Heading
   ============================================================ */

.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--navy);
}

.editor-styles-wrapper h1 { 
  font-size: var(--wp--preset--font-size--hero); 
  font-weight: 800; 
}
.editor-styles-wrapper h2 { 
  font-size: var(--wp--preset--font-size--xx-large); 
  font-weight: 800; 
}
.editor-styles-wrapper h3 { 
  font-size: var(--wp--preset--font-size--x-large); 
  font-weight: 700; 
}

/* ============================================================
   BLOCK: Core/Paragraph
   ============================================================ */

.editor-styles-wrapper p {
  font-family: var(--font-body);
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.6;
  color: var(--gray-900);
}

/* ============================================================
   BLOCK: Core/Buttons
   ============================================================ */

.editor-styles-wrapper .wp-block-button__link {
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.editor-styles-wrapper .wp-block-button__link:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Button color variants */
.editor-styles-wrapper .has-blue-background-color .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-fill.has-blue-background-color {
  background-color: var(--blue);
  color: var(--white);
}

.editor-styles-wrapper .has-green-background-color .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-fill.has-green-background-color {
  background-color: var(--green);
  color: var(--white);
}

.editor-styles-wrapper .has-orange-background-color .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-fill.has-orange-background-color {
  background-color: var(--orange);
  color: var(--white);
}

.editor-styles-wrapper .has-purple-background-color .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-fill.has-purple-background-color {
  background-color: var(--purple);
  color: var(--white);
}

.editor-styles-wrapper .has-navy-background-color .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-fill.has-navy-background-color {
  background-color: var(--navy);
  color: var(--white);
}

/* ============================================================
   BLOCK: Core/Group (Container)
   ============================================================ */

.editor-styles-wrapper .wp-block-group {
  padding: var(--space-6) var(--space-4);
}

/* ============================================================
   BLOCK: Core/Cover
   ============================================================ */

.editor-styles-wrapper .wp-block-cover {
  min-height: 400px;
}

/* ============================================================
   BLOCK: Core/Columns
   ============================================================ */

.editor-styles-wrapper .wp-block-columns {
  gap: var(--space-6);
}

/* ============================================================
   BLOCK: Core/Image
   ============================================================ */

.editor-styles-wrapper .wp-block-image img {
  border-radius: var(--radius-lg);
}

/* ============================================================
   BLOCK: Core/Quote
   ============================================================ */

.editor-styles-wrapper .wp-block-quote {
  border-left: 4px solid var(--blue);
  padding-left: var(--space-5);
  font-style: italic;
  color: var(--gray-500);
}

/* ============================================================
   CUSTOM COLOR SUPPORT
   ============================================================ */

/* Text colors */
.editor-styles-wrapper .has-navy-color { color: var(--navy) !important; }
.editor-styles-wrapper .has-blue-color { color: var(--blue) !important; }
.editor-styles-wrapper .has-green-color { color: var(--green) !important; }
.editor-styles-wrapper .has-orange-color { color: var(--orange) !important; }
.editor-styles-wrapper .has-purple-color { color: var(--purple) !important; }
.editor-styles-wrapper .has-cyan-color { color: var(--cyan) !important; }
.editor-styles-wrapper .has-red-color { color: var(--red) !important; }
.editor-styles-wrapper .has-white-color { color: var(--white) !important; }
.editor-styles-wrapper .has-gray-900-color { color: var(--gray-900) !important; }
.editor-styles-wrapper .has-gray-500-color { color: var(--gray-500) !important; }

/* Background colors */
.editor-styles-wrapper .has-navy-background-color { background-color: var(--navy) !important; }
.editor-styles-wrapper .has-blue-background-color { background-color: var(--blue) !important; }
.editor-styles-wrapper .has-green-background-color { background-color: var(--green) !important; }
.editor-styles-wrapper .has-orange-background-color { background-color: var(--orange) !important; }
.editor-styles-wrapper .has-purple-background-color { background-color: var(--purple) !important; }
.editor-styles-wrapper .has-cyan-background-color { background-color: var(--cyan) !important; }
.editor-styles-wrapper .has-red-background-color { background-color: var(--red) !important; }
.editor-styles-wrapper .has-white-background-color { background-color: var(--white) !important; }
.editor-styles-wrapper .has-gray-50-background-color { background-color: var(--gray-50) !important; }
.editor-styles-wrapper .has-gray-100-background-color { background-color: var(--gray-100) !important; }
.editor-styles-wrapper .has-gray-200-background-color { background-color: var(--gray-200) !important; }
.editor-styles-wrapper .has-gray-900-background-color { background-color: var(--gray-900) !important; }

/* ============================================================
   WIDE / FULL ALIGN
   ============================================================ */

.editor-styles-wrapper .alignwide {
  margin-left: calc(50% - 600px);
  margin-right: calc(50% - 600px);
  max-width: 1200px;
}

.editor-styles-wrapper .alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100%;
}

/* ============================================================
   BLOCK: Core/Separator
   ============================================================ */

.editor-styles-wrapper .wp-block-separator {
  border-color: var(--gray-200);
}

.editor-styles-wrapper .wp-block-separator.has-background {
  border: none;
}

/* ============================================================
   BLOCK: Core/List
   ============================================================ */

.editor-styles-wrapper .wp-block-list {
  padding-left: var(--space-5);
}

.editor-styles-wrapper .wp-block-list li {
  margin-bottom: var(--space-2);
}

/* ============================================================
   BLOCK: Core/Table
   ============================================================ */

.editor-styles-wrapper .wp-block-table {
  border-collapse: collapse;
  width: 100%;
}

.editor-styles-wrapper .wp-block-table th,
.editor-styles-wrapper .wp-block-table td {
  border: 1px solid var(--gray-200);
  padding: var(--space-3);
}

.editor-styles-wrapper .wp-block-table th {
  background: var(--gray-50);
  font-weight: 600;
}

/* ============================================================
   BLOCK: Core/Spacer
   ============================================================ */

.editor-styles-wrapper .wp-block-spacer {
  clear: both;
}

/* ============================================================
   BLOCK: Core/Media-Text
   ============================================================ */

.editor-styles-wrapper .wp-block-media-text {
  gap: var(--space-6);
}

/* ============================================================
   BLOCK: Core/Column
   ============================================================ */

.editor-styles-wrapper .wp-block-column {
  padding: var(--space-4);
}

/* ============================================================
   BLOCK: Core/Gallery
   ============================================================ */

.editor-styles-wrapper .wp-block-gallery {
  gap: var(--space-4);
}

.editor-styles-wrapper .wp-block-gallery img {
  border-radius: var(--radius-md);
}

/* ============================================================
   BLOCK: Core/Audio & Video
   ============================================================ */

.editor-styles-wrapper .wp-block-audio,
.editor-styles-wrapper .wp-block-video {
  margin: var(--space-6) 0;
}

/* ============================================================
   BLOCK: Core/Details (Accordion)
   ============================================================ */

.editor-styles-wrapper .wp-block-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  padding: var(--space-3) 0;
}

.editor-styles-wrapper .wp-block-details > div {
  padding-top: var(--space-3);
  border-top: 1px solid var(--gray-100);
  color: var(--gray-700);
}

/* ============================================================
   BLOCK: Core/Code
   ============================================================ */

.editor-styles-wrapper .wp-block-code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--gray-100);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ============================================================
   BLOCK: Core/Preformatted
   ============================================================ */

.editor-styles-wrapper .wp-block-preformatted {
  font-family: var(--font-mono);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

/* ============================================================
   BLOCK: Core/Verse
   ============================================================ */

.editor-styles-wrapper .wp-block-verse {
  font-style: italic;
  color: var(--gray-600);
  padding-left: var(--space-5);
  border-left: 3px solid var(--blue);
}

/* ============================================================
   BLOCK: Core/Archives, Categories, Latest Posts
   ============================================================ */

.editor-styles-wrapper .wp-block-archives,
.editor-styles-wrapper .wp-block-categories,
.editor-styles-wrapper .wp-block-latest-posts {
  line-height: 1.8;
}

.editor-styles-wrapper .wp-block-archives a,
.editor-styles-wrapper .wp-block-categories a,
.editor-styles-wrapper .wp-block-latest-posts a {
  color: var(--blue);
}

.editor-styles-wrapper .wp-block-archives a:hover,
.editor-styles-wrapper .wp-block-categories a:hover,
.editor-styles-wrapper .wp-block-latest-posts a:hover {
  color: var(--blue-600);
  text-decoration: underline;
}

/* ============================================================
   BLOCK: Core/Calendar
   ============================================================ */

.editor-styles-wrapper .wp-block-calendar {
  border-collapse: collapse;
  width: 100%;
}

.editor-styles-wrapper .wp-block-calendar th,
.editor-styles-wrapper .wp-block-calendar td {
  padding: var(--space-2);
  text-align: center;
  border: 1px solid var(--gray-200);
}

.editor-styles-wrapper .wp-block-calendar caption {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

/* ============================================================
   BLOCK: Core/Tag Cloud
   ============================================================ */

.editor-styles-wrapper .wp-block-tag-cloud a {
  display: inline-block;
  margin: var(--space-1) var(--space-2) var(--space-1) 0;
  padding: var(--space-1) var(--space-3);
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--gray-700);
  transition: all var(--transition-fast);
}

.editor-styles-wrapper .wp-block-tag-cloud a:hover {
  background: var(--blue);
  color: var(--white);
}

/* ============================================================
   BLOCK: Core/RSS
   ============================================================ */

.editor-styles-wrapper .wp-block-rss li {
  margin-bottom: var(--space-3);
}

.editor-styles-wrapper .wp-block-rss .wp-block-rss__item-title {
  font-weight: 600;
  color: var(--gray-900);
}

.editor-styles-wrapper .wp-block-rss .wp-block-rss__item-publish-date {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

/* ============================================================
   CUSTOM: CiCC Specific Blocks (if any)
   ============================================================ */

/* CiCC Card styles in editor */
.editor-styles-wrapper .cicc-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--white);
  transition: all var(--transition-spring);
}

.editor-styles-wrapper .cicc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* CiCC Hero styles in editor */
.editor-styles-wrapper .cicc-hero {
  padding: var(--space-20) 0;
  text-align: center;
}

.editor-styles-wrapper .cicc-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--cicc-blue-100);
  color: var(--cicc-blue);
  margin-bottom: var(--space-5);
}

.editor-styles-wrapper .cicc-hero h1 {
  font-size: var(--wp--preset--font-size--hero);
  font-weight: 800;
}

/* CiCC Section styles in editor */
.editor-styles-wrapper .cicc-section {
  padding: var(--space-16) 0;
}

.editor-styles-wrapper .cicc-section__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.editor-styles-wrapper .cicc-section__header h2 {
  font-size: var(--wp--preset--font-size--xx-large);
  font-weight: 800;
}

/* CiCC Grid in editor */
.editor-styles-wrapper .cicc-grid {
  display: grid;
  gap: var(--space-6);
}

.editor-styles-wrapper .cicc-grid--2 { grid-template-columns: repeat(2, 1fr); }
.editor-styles-wrapper .cicc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.editor-styles-wrapper .cicc-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .editor-styles-wrapper .cicc-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .editor-styles-wrapper .cicc-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .editor-styles-wrapper .cicc-grid--2,
  .editor-styles-wrapper .cicc-grid--3,
  .editor-styles-wrapper .cicc-grid--4 { grid-template-columns: 1fr; }
}

/* CiCC Buttons in editor */
.editor-styles-wrapper .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}

.editor-styles-wrapper .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   FONT SIZE PRESETS (match theme.json)
   ============================================================ */

.editor-styles-wrapper .has-small-font-size { font-size: var(--wp--preset--font-size--small); }
.editor-styles-wrapper .has-medium-font-size { font-size: var(--wp--preset--font-size--medium); }
.editor-styles-wrapper .has-large-font-size { font-size: var(--wp--preset--font-size--large); }
.editor-styles-wrapper .has-x-large-font-size { font-size: var(--wp--preset--font-size--x-large); }
.editor-styles-wrapper .has-xx-large-font-size { font-size: var(--wp--preset--font-size--xx-large); }
.editor-styles-wrapper .has-hero-font-size { font-size: var(--wp--preset--font-size--hero); }

/* ============================================================
   SPACING PRESETS (match theme.json)
   ============================================================ */

.editor-styles-wrapper .has-10-spacing-size { padding: var(--wp--preset--spacing--10); }
.editor-styles-wrapper .has-20-spacing-size { padding: var(--wp--preset--spacing--20); }
.editor-styles-wrapper .has-30-spacing-size { padding: var(--wp--preset--spacing--30); }
.editor-styles-wrapper .has-40-spacing-size { padding: var(--wp--preset--spacing--40); }
.editor-styles-wrapper .has-50-spacing-size { padding: var(--wp--preset--spacing--50); }
.editor-styles-wrapper .has-60-spacing-size { padding: var(--wp--preset--spacing--60); }
.editor-styles-wrapper .has-80-spacing-size { padding: var(--wp--preset--spacing--80); }
.editor-styles-wrapper .has-100-spacing-size { padding: var(--wp--preset--spacing--100); }

/* ============================================================
   BORDER RADIUS PRESETS
   ============================================================ */

.editor-styles-wrapper .has-sm-radius { border-radius: var(--radius-sm); }
.editor-styles-wrapper .has-md-radius { border-radius: var(--radius-md); }
.editor-styles-wrapper .has-lg-radius { border-radius: var(--radius-lg); }
.editor-styles-wrapper .has-xl-radius { border-radius: var(--radius-xl); }
.editor-styles-wrapper .has-full-radius { border-radius: var(--radius-full); }

/* ============================================================
   SHADOW PRESETS
   ============================================================ */

.editor-styles-wrapper .has-sm-shadow { box-shadow: var(--shadow-sm); }
.editor-styles-wrapper .has-md-shadow { box-shadow: var(--shadow-md); }
.editor-styles-wrapper .has-lg-shadow { box-shadow: var(--shadow-lg); }
.editor-styles-wrapper .has-xl-shadow { box-shadow: var(--shadow-xl); }

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

@media (max-width: 768px) {
  .editor-styles-wrapper {
    padding: var(--space-4);
  }
  
  .editor-styles-wrapper .alignwide,
  .editor-styles-wrapper .alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  
  .editor-styles-wrapper .cicc-grid--2,
  .editor-styles-wrapper .cicc-grid--3,
  .editor-styles-wrapper .cicc-grid--4 {
    grid-template-columns: 1fr;
  }
}