/**
 * WordPress Gutenberg Blocks - Shopify Theme CSS
 * Add this to your Shopify theme's assets folder and include in article template.
 *
 * Usage in article.liquid:
 * {{ 'shopify-wp-blocks.css' | asset_url | stylesheet_tag }}
 */

/* ==========================================================================
   CSS Variables (customize to match your theme)
   ========================================================================== */

:root {
  --wp-primary-color: #000;
  --wp-secondary-color: #666;
  --wp-accent-color: #0073aa;
  --wp-border-color: #e0e0e0;
  --wp-background-light: #f8f9fa;
  --wp-background-dark: #1e1e1e;
  --wp-text-color: #333;
  --wp-text-light: #fff;
  --wp-font-family: inherit;
  --wp-border-radius: 4px;
  --wp-spacing: 1.5rem;
  --wp-max-width: 1200px;
}

/* ==========================================================================
   Typography - Font Sizes
   ========================================================================== */

.has-small-font-size { font-size: 0.875rem; }
.has-normal-font-size { font-size: 1rem; }
.has-medium-font-size { font-size: 1.25rem; }
.has-large-font-size { font-size: 1.5rem; }
.has-x-large-font-size { font-size: 2rem; }
.has-xx-large-font-size { font-size: 2.5rem; }
.has-huge-font-size { font-size: 3rem; }

/* ==========================================================================
   Typography - Text Alignment
   ========================================================================== */

.has-text-align-left { text-align: left; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.has-text-align-justify { text-align: justify; }

/* ==========================================================================
   Headings
   ========================================================================== */

.wp-block-heading {
  font-family: var(--wp-font-family);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: var(--wp-primary-color);
}

h2.wp-block-heading { font-size: 1.75rem; }
h3.wp-block-heading { font-size: 1.5rem; }
h4.wp-block-heading { font-size: 1.25rem; }
h5.wp-block-heading { font-size: 1.1rem; }
h6.wp-block-heading { font-size: 1rem; }

/* ==========================================================================
   Images
   ========================================================================== */

.wp-block-image {
  margin: var(--wp-spacing) 0;
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--wp-border-radius);
}

.wp-block-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--wp-secondary-color);
  text-align: center;
}

.wp-block-image.size-full img {
  width: 100%;
}

.wp-block-image.aligncenter {
  text-align: center;
}

.wp-block-image.alignleft {
  float: left;
  margin-right: var(--wp-spacing);
  max-width: 50%;
}

.wp-block-image.alignright {
  float: right;
  margin-left: var(--wp-spacing);
  max-width: 50%;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.wp-block-gallery {
  display: grid;
  gap: 1rem;
  margin: var(--wp-spacing) 0;
}

.wp-block-gallery.columns-1 { grid-template-columns: 1fr; }
.wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.wp-block-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.wp-block-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }
.wp-block-gallery.columns-5 { grid-template-columns: repeat(5, 1fr); }
.wp-block-gallery.columns-6 { grid-template-columns: repeat(6, 1fr); }

.wp-block-gallery.has-nested-images .wp-block-image {
  margin: 0;
}

.wp-block-gallery.is-cropped .wp-block-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.wp-block-gallery figcaption {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.875rem;
  color: var(--wp-secondary-color);
}

@media (max-width: 768px) {
  .wp-block-gallery.columns-3,
  .wp-block-gallery.columns-4,
  .wp-block-gallery.columns-5,
  .wp-block-gallery.columns-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .wp-block-gallery {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Cover Block
   ========================================================================== */

.wp-block-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem;
  margin: var(--wp-spacing) 0;
  border-radius: var(--wp-border-radius);
  overflow: hidden;
  background-color: var(--wp-background-dark);
}

.wp-block-cover__image-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.wp-block-cover__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.wp-block-cover__background.has-background-dim {
  background-color: rgba(0, 0, 0, 0.5);
}

.wp-block-cover.is-light .wp-block-cover__background.has-background-dim {
  background-color: rgba(255, 255, 255, 0.5);
}

.wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
  max-width: var(--wp-max-width);
  width: 100%;
  text-align: center;
  color: var(--wp-text-light);
}

.wp-block-cover.is-light .wp-block-cover__inner-container {
  color: var(--wp-primary-color);
}

.wp-block-cover__inner-container .wp-block-heading {
  color: inherit;
  margin-top: 0;
}

.wp-block-cover__inner-container p {
  color: inherit;
  margin-bottom: 0;
}

/* ==========================================================================
   Columns
   ========================================================================== */

.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp-spacing);
  margin: var(--wp-spacing) 0;
}

.wp-block-column {
  flex: 1;
  min-width: 0;
}

.wp-block-column .wp-block-heading:first-child {
  margin-top: 0;
}

.wp-block-column .wp-block-image {
  margin: 1rem 0;
}

@media (max-width: 768px) {
  .wp-block-columns {
    flex-direction: column;
  }

  .wp-block-column {
    flex-basis: 100%;
  }
}

/* ==========================================================================
   List
   ========================================================================== */

.wp-block-list {
  margin: var(--wp-spacing) 0;
  padding-left: 1.5rem;
}

.wp-block-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.wp-block-list.has-background {
  padding: 1rem 1rem 1rem 2.5rem;
  border-radius: var(--wp-border-radius);
}

/* Ordered list styles */
ol.wp-block-list {
  list-style-type: decimal;
}

/* ==========================================================================
   Quote
   ========================================================================== */

.wp-block-quote {
  margin: var(--wp-spacing) 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-left: 4px solid var(--wp-accent-color);
  background: var(--wp-background-light);
  border-radius: 0 var(--wp-border-radius) var(--wp-border-radius) 0;
  font-style: italic;
}

.wp-block-quote p {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.wp-block-quote p:last-of-type {
  margin-bottom: 0;
}

.wp-block-quote cite {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-style: normal;
  color: var(--wp-secondary-color);
}

.wp-block-quote cite::before {
  content: "— ";
}

/* Pullquote */
.wp-block-pullquote {
  margin: 2rem 0;
  padding: 2rem;
  text-align: center;
  border-top: 4px solid var(--wp-primary-color);
  border-bottom: 4px solid var(--wp-primary-color);
}

.wp-block-pullquote blockquote {
  margin: 0;
  border: none;
  padding: 0;
  background: none;
}

.wp-block-pullquote p {
  font-size: 1.5rem;
  font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: var(--wp-spacing) 0;
}

.wp-block-button {
  display: inline-block;
}

.wp-block-button__link,
a.wp-block-button__link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--wp-primary-color);
  color: var(--wp-text-light);
  text-decoration: none;
  border-radius: var(--wp-border-radius);
  font-weight: 500;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wp-block-button__link:hover,
a.wp-block-button__link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: var(--wp-text-light);
  text-decoration: none;
}

/* Outline style */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--wp-primary-color);
  border: 2px solid var(--wp-primary-color);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp-primary-color);
  color: var(--wp-text-light);
}

/* ==========================================================================
   Separator
   ========================================================================== */

.wp-block-separator {
  border: none;
  border-top: 2px solid var(--wp-border-color);
  margin: 2rem 0;
  width: 100%;
}

.wp-block-separator.has-alpha-channel-opacity {
  opacity: 1;
}

.wp-block-separator.is-style-wide {
  width: 100%;
}

.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
  background: none;
}

.wp-block-separator.is-style-dots::before {
  content: "···";
  font-size: 1.5rem;
  letter-spacing: 1rem;
  color: var(--wp-secondary-color);
}

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

.wp-block-table {
  margin: var(--wp-spacing) 0;
  overflow-x: auto;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--wp-border-color);
  text-align: left;
}

.wp-block-table thead th {
  background: var(--wp-background-light);
  font-weight: 600;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: var(--wp-background-light);
}

.wp-block-table figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--wp-secondary-color);
  text-align: center;
}

/* ==========================================================================
   Embed (YouTube, Vimeo, etc.)
   ========================================================================== */

.wp-block-embed {
  margin: var(--wp-spacing) 0;
}

.wp-block-embed__wrapper {
  position: relative;
  width: 100%;
}

/* 16:9 aspect ratio */
.wp-embed-aspect-16-9 .wp-block-embed__wrapper {
  padding-bottom: 56.25%;
}

/* 4:3 aspect ratio */
.wp-embed-aspect-4-3 .wp-block-embed__wrapper {
  padding-bottom: 75%;
}

/* 21:9 aspect ratio */
.wp-embed-aspect-21-9 .wp-block-embed__wrapper {
  padding-bottom: 42.86%;
}

.wp-has-aspect-ratio .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--wp-border-radius);
}

.wp-block-embed figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--wp-secondary-color);
  text-align: center;
}

/* ==========================================================================
   Code & Preformatted
   ========================================================================== */

.wp-block-code {
  margin: var(--wp-spacing) 0;
  padding: 1rem 1.5rem;
  background: var(--wp-background-dark);
  border-radius: var(--wp-border-radius);
  overflow-x: auto;
}

.wp-block-code code {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875rem;
  color: #f8f8f2;
  white-space: pre;
  line-height: 1.5;
}

.wp-block-preformatted {
  margin: var(--wp-spacing) 0;
  padding: 1rem 1.5rem;
  background: var(--wp-background-light);
  border-radius: var(--wp-border-radius);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ==========================================================================
   Group
   ========================================================================== */

.wp-block-group {
  margin: var(--wp-spacing) 0;
}

.wp-block-group.has-background {
  padding: var(--wp-spacing);
  border-radius: var(--wp-border-radius);
}

/* ==========================================================================
   Media & Text
   ========================================================================== */

.wp-block-media-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wp-spacing);
  align-items: center;
  margin: var(--wp-spacing) 0;
}

.wp-block-media-text.has-media-on-the-right {
  direction: rtl;
}

.wp-block-media-text.has-media-on-the-right > * {
  direction: ltr;
}

.wp-block-media-text__media {
  margin: 0;
}

.wp-block-media-text__media img {
  width: 100%;
  height: auto;
  border-radius: var(--wp-border-radius);
}

.wp-block-media-text__content {
  padding: 0;
}

@media (max-width: 768px) {
  .wp-block-media-text {
    grid-template-columns: 1fr;
  }

  .wp-block-media-text.is-stacked-on-mobile {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Spacer
   ========================================================================== */

.wp-block-spacer {
  clear: both;
}

/* ==========================================================================
   Details (Accordion)
   ========================================================================== */

.wp-block-details {
  margin: var(--wp-spacing) 0;
  border: 1px solid var(--wp-border-color);
  border-radius: var(--wp-border-radius);
}

.wp-block-details summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 500;
  background: var(--wp-background-light);
  border-radius: var(--wp-border-radius);
  list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-block-details summary::before {
  content: "+";
  margin-right: 0.5rem;
  font-weight: bold;
}

.wp-block-details[open] summary::before {
  content: "−";
}

.wp-block-details[open] summary {
  border-radius: var(--wp-border-radius) var(--wp-border-radius) 0 0;
}

.wp-block-details > *:not(summary) {
  padding: 0 1rem 1rem;
}

/* ==========================================================================
   Rank Math FAQ Block (third-party)
   ========================================================================== */

.wp-block-rank-math-faq-block {
  margin: var(--wp-spacing) 0;
}

.rank-math-faq-item {
  margin-bottom: 1rem;
  border: 1px solid var(--wp-border-color);
  border-radius: var(--wp-border-radius);
  overflow: hidden;
}

.rank-math-question {
  margin: 0;
  padding: 1rem;
  background: var(--wp-background-light);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.rank-math-answer {
  padding: 1rem;
  line-height: 1.6;
}

/* ==========================================================================
   Wash Custom Blocks
   ========================================================================== */

/* Shopify Product Block */
.wash-shopify-product {
  margin: var(--wp-spacing) 0;
}

.wash-product--card {
  max-width: 400px;
  border: 1px solid var(--wp-border-color);
  border-radius: var(--wp-border-radius);
  overflow: hidden;
}

.wash-product-not-found {
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--wp-border-radius);
  color: #856404;
  font-style: italic;
}

/* Shopify Collection Block */
.wash-shopify-collection {
  display: grid;
  gap: var(--wp-spacing);
  margin: var(--wp-spacing) 0;
}

.wash-columns--2 { grid-template-columns: repeat(2, 1fr); }
.wash-columns--3 { grid-template-columns: repeat(3, 1fr); }
.wash-columns--4 { grid-template-columns: repeat(4, 1fr); }
.wash-columns--5 { grid-template-columns: repeat(5, 1fr); }
.wash-columns--6 { grid-template-columns: repeat(6, 1fr); }

.wash-collection-not-found {
  grid-column: 1 / -1;
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--wp-border-radius);
  color: #856404;
  font-style: italic;
}

@media (max-width: 1024px) {
  .wash-columns--5,
  .wash-columns--6 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .wash-shopify-collection {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .wash-shopify-collection {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Utility Classes - Colors (commonly used)
   ========================================================================== */

.has-background {
  padding: var(--wp-spacing);
}

.has-white-background-color { background-color: #fff; }
.has-black-background-color { background-color: #000; }
.has-pale-pink-background-color { background-color: #f78da7; }
.has-vivid-red-background-color { background-color: #cf2e2e; }
.has-luminous-vivid-orange-background-color { background-color: #ff6900; }
.has-luminous-vivid-amber-background-color { background-color: #fcb900; }
.has-light-green-cyan-background-color { background-color: #7bdcb5; }
.has-vivid-green-cyan-background-color { background-color: #00d084; }
.has-pale-cyan-blue-background-color { background-color: #8ed1fc; }
.has-vivid-cyan-blue-background-color { background-color: #0693e3; }
.has-vivid-purple-background-color { background-color: #9b51e0; }

.has-white-color { color: #fff; }
.has-black-color { color: #000; }
.has-pale-pink-color { color: #f78da7; }
.has-vivid-red-color { color: #cf2e2e; }
.has-luminous-vivid-orange-color { color: #ff6900; }
.has-luminous-vivid-amber-color { color: #fcb900; }
.has-light-green-cyan-color { color: #7bdcb5; }
.has-vivid-green-cyan-color { color: #00d084; }
.has-pale-cyan-blue-color { color: #8ed1fc; }
.has-vivid-cyan-blue-color { color: #0693e3; }
.has-vivid-purple-color { color: #9b51e0; }

/* ==========================================================================
   Clearfix & General Utilities
   ========================================================================== */

.wp-block-image.alignleft + *,
.wp-block-image.alignright + * {
  clear: none;
}

.wp-block-image.alignleft + .wp-block-image.alignleft,
.wp-block-image.alignright + .wp-block-image.alignright {
  clear: none;
}

/* Clear floats after aligned images */
.entry-content::after,
.article-content::after,
.rte::after {
  content: "";
  display: table;
  clear: both;
}
