/*
 * Block Pages CSS
 *
 * Styles WordPress block editor content on pages NOT using
 * Product Collection or Single Post templates.
 * Reuses --hs-* variables from brand.css / site.css.
 *
 * SAFE TO DELETE: once all pages are rebuilt with ACF templates,
 * remove this file + its enqueue in theme-settings.php.
 */

/* ==========================================================================
   0. LAYOUT — full-width wrapper, 1140px content, centered
   ========================================================================== */

body.page .inside-article {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

body.page .entry-content {
  width: min(100% - 40px, 1140px);
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding: 40px 0;
}

body.page.one-container .inside-article,
body.page.no-sidebar .inside-article {
  padding: 0;
}

/* ==========================================================================
   1. HEADINGS
   ========================================================================== */

body.page .entry-content h1 {
  font-size: 42px;
  color: var(--hs-title);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--hs-accent);
}

body.page .entry-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--hs-title);
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 50px 0 20px;
  padding-top: 40px;
  border-top: 1px solid var(--hs-border);
}

body.page .entry-content h2:first-child,
body.page .entry-content > :first-child + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

body.page .entry-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--hs-title);
  line-height: 1.3;
  margin: 32px 0 12px;
}

body.page .entry-content h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--hs-title);
  margin: 24px 0 10px;
}

/* ==========================================================================
   2. TEXT
   ========================================================================== */

body.page .entry-content p {
  color: var(--hs-text);
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 1em;
}

body.page .entry-content a {
  color: var(--hs-accent);
  text-decoration: none;
}

body.page .entry-content a:hover {
  color: var(--hs-accent-dark);
  text-decoration: underline;
}

body.page .entry-content strong {
  color: var(--hs-title);
  font-weight: 700;
}

body.page .entry-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--hs-accent);
  background: var(--hs-bg-alt);
  border-radius: 0 var(--hs-radius-btn) var(--hs-radius-btn) 0;
  color: var(--hs-text);
  font-style: italic;
}

body.page .entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   3. IMAGES
   ========================================================================== */

body.page .entry-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--hs-radius-card);
  box-shadow: var(--hs-shadow-card);
}

body.page .entry-content .wp-block-image {
  margin: 24px 0;
}

body.page .entry-content .wp-block-image figcaption {
  margin-top: 10px;
  color: var(--hs-text);
  font-size: 13px;
  text-align: center;
  font-style: italic;
}

body.page .entry-content .wp-block-columns img,
body.page .entry-content .wp-block-group img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   4. LISTS
   ========================================================================== */

body.page .entry-content ul,
body.page .entry-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.5em;
  color: var(--hs-text);
}

body.page .entry-content li {
  margin-bottom: 6px;
  line-height: 1.65;
}

body.page .entry-content ul li::marker {
  color: var(--hs-accent);
}

body.page .entry-content ol li::marker {
  color: var(--hs-accent);
  font-weight: 600;
}

/* ==========================================================================
   5. TABLES
   ========================================================================== */

body.page .entry-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius-card);
  overflow: hidden;
  font-size: 15px;
}

body.page .entry-content table th,
body.page .entry-content table td {
  padding: 12px 16px;
  border: 1px solid var(--hs-border);
  text-align: left;
  vertical-align: top;
}

body.page .entry-content table th {
  background: var(--hs-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

body.page .entry-content table tbody tr:nth-child(even) {
  background: var(--hs-bg-alt);
}

body.page .entry-content table tbody tr:hover {
  background: var(--hs-accent-soft);
}

body.page .entry-content .wp-block-table {
  margin: 24px 0;
  overflow-x: auto;
}

/* ==========================================================================
   6. COLUMNS — auto card when image present
   ========================================================================== */

body.page .entry-content .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 30px 0;
}

body.page .entry-content .wp-block-column {
  flex: 1 1 0;
  min-width: 0;
}

body.page .entry-content .wp-block-column:has(img) {
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius-card);
  overflow: hidden;
  box-shadow: var(--hs-shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.page .entry-content .wp-block-column:has(img):hover {
  transform: translateY(-3px);
  box-shadow: var(--hs-shadow-card-hover);
}

body.page .entry-content .wp-block-column:has(img) img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

body.page .entry-content .wp-block-column:has(img) :is(h3, h4) {
  padding: 0 16px;
  margin: 14px 0 6px;
  text-align: center;
  font-size: 17px;
}

body.page .entry-content .wp-block-column:has(img) p {
  padding: 0 16px 16px;
  font-size: 14px;
  text-align: center;
}

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */

body.page .entry-content .wp-block-button__link,
body.page .entry-content .wp-block-button a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  border: 1px solid var(--hs-accent);
  border-radius: var(--hs-radius-btn);
  background: #ffffff;
  color: var(--hs-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.22s ease, color 0.22s ease;
}

body.page .entry-content .wp-block-button__link:hover,
body.page .entry-content .wp-block-button a:hover {
  background: var(--hs-accent);
  color: #ffffff;
  text-decoration: none;
}

body.page .entry-content .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

body.page .entry-content .wp-block-button.is-style-fill .wp-block-button__link {
  background: var(--hs-accent);
  color: #ffffff;
}

body.page .entry-content .wp-block-button.is-style-fill .wp-block-button__link:hover {
  background: var(--hs-accent-dark);
}

/* ==========================================================================
   8. GROUPS
   ========================================================================== */

body.page .entry-content > .wp-block-group {
  margin: 30px 0;
}

body.page .entry-content > .wp-block-group.has-background {
  padding: 40px 36px;
  border-radius: var(--hs-radius-card);
}

body.page .entry-content .wp-block-group__inner-container > :last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   9. SEPARATOR
   ========================================================================== */

body.page .entry-content hr,
body.page .entry-content .wp-block-separator {
  border: 0;
  border-top: 1px solid var(--hs-border);
  margin: 36px auto;
  max-width: 100px;
}

body.page .entry-content .wp-block-separator.is-style-wide {
  max-width: none;
}

/* ==========================================================================
   10. GALLERY
   ========================================================================== */

body.page .entry-content .wp-block-gallery {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

body.page .entry-content .wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
body.page .entry-content .wp-block-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
body.page .entry-content .wp-block-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }

body.page .entry-content .wp-block-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   11. VIDEO EMBED
   ========================================================================== */

body.page .entry-content .wp-block-embed .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--hs-radius-card);
  box-shadow: var(--hs-shadow-card);
}

body.page .entry-content .wp-block-embed .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   12. DETAILS / ACCORDION
   ========================================================================== */

body.page .entry-content details {
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: border-color 0.22s ease;
}

body.page .entry-content details[open] {
  border-color: var(--hs-accent);
}

body.page .entry-content details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
  color: var(--hs-title);
  list-style: none;
}

body.page .entry-content details summary::-webkit-details-marker { display: none; }

body.page .entry-content details summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 24px;
  font-weight: 300;
  color: var(--hs-accent);
}

body.page .entry-content details[open] summary::after { content: "\2212"; }

body.page .entry-content details summary:hover,
body.page .entry-content details[open] summary {
  background: var(--hs-accent-soft);
}

body.page .entry-content details > :not(summary) {
  padding: 0 20px 16px;
}

/* ==========================================================================
   13. RESPONSIVE — Tablet
   ========================================================================== */

@media (max-width: 1024px) {
  body.page .entry-content .wp-block-gallery.columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   14. RESPONSIVE — Mobile
   ========================================================================== */

@media (max-width: 767px) {
  body.page .entry-content {
    width: min(100% - 24px, 1140px);
    padding: 24px 0;
  }

  body.page .entry-content h1 { font-size: 30px; }
  body.page .entry-content h2 { font-size: 26px; margin-top: 36px; padding-top: 30px; }
  body.page .entry-content h3 { font-size: 20px; }

  body.page .entry-content .wp-block-columns { flex-direction: column; }
  body.page .entry-content .wp-block-column { flex-basis: 100% !important; }

  body.page .entry-content .wp-block-gallery.columns-2,
  body.page .entry-content .wp-block-gallery.columns-3,
  body.page .entry-content .wp-block-gallery.columns-4 {
    grid-template-columns: 1fr;
  }

  body.page .entry-content table { font-size: 13px; }
  body.page .entry-content table th,
  body.page .entry-content table td { padding: 8px 10px; }

  body.page .entry-content > .wp-block-group.has-background { padding: 28px 20px; }
}

/* ==========================================================================
   15. PRINT
   ========================================================================== */

@media print {
  body.page .entry-content img { box-shadow: none; border-radius: 0; }
  body.page .entry-content .wp-block-button,
  body.page .entry-content .wp-block-embed { display: none !important; }
}
