/*
 * Tapua Theme — assets/css/content.css
 *
 * Gutenberg block styles for posts and pages.
 * ALL rules here are scoped to .entry-content so they cannot affect the
 * homepage (front-page.php), navigation, footer, or any other custom section.
 *
 * Brand tokens are inherited from main.css :root variables.
 * Load order: tapua-main → tapua-content → wp-block-library (WP default).
 * Our rules run AFTER wp-block-library, so we cleanly layer brand tokens on top.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   BASE TYPOGRAPHY
───────────────────────────────────────────────────────────────────────────── */

.entry-content {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-mid);
}

/* ─────────────────────────────────────────────────────────────────────────────
   PARAGRAPHS
───────────────────────────────────────────────────────────────────────────── */

.entry-content p {
  margin-bottom: 1.25em;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-mid);
  line-height: 1.85;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LINKS
───────────────────────────────────────────────────────────────────────────── */

.entry-content a {
  color: var(--teal-mid);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.entry-content a:hover {
  color: var(--orange);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADINGS  (h1–h6 and the Gutenberg heading block)
───────────────────────────────────────────────────────────────────────────── */

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.entry-content .wp-block-heading {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

/* First heading has no extra top margin */
.entry-content > *:first-child { margin-top: 0; }

.entry-content h1 { font-size: clamp(24px, 2.5vw, 32px); }
.entry-content h2 { font-size: clamp(20px, 2vw, 26px); }
.entry-content h3 { font-size: clamp(17px, 1.5vw, 22px); }
.entry-content h4 { font-size: clamp(15px, 1.2vw, 18px); }
.entry-content h5 { font-size: 15px; }
.entry-content h6 { font-size: 14px; font-weight: 600; }

/* Italic inside headings uses brand teal */
.entry-content h1 em,
.entry-content h2 em,
.entry-content h3 em,
.entry-content h4 em,
.entry-content h5 em,
.entry-content h6 em {
  font-style: italic;
  color: var(--teal-mid);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LISTS
───────────────────────────────────────────────────────────────────────────── */

.entry-content ul,
.entry-content ol {
  padding-left: 1.6em;
  margin-bottom: 1.25em;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-mid);
  line-height: 1.8;
}

/* Restore bullets/numbers that the global reset strips */
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

/* Nested lists */
.entry-content ul ul   { list-style: circle; }
.entry-content ul ul ul { list-style: square; }

.entry-content li { margin-bottom: 0.35em; }

/* Gutenberg list block */
.entry-content .wp-block-list {
  padding-left: 1.6em;
  margin-bottom: 1.25em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BLOCKQUOTE  /  WP Quote block
───────────────────────────────────────────────────────────────────────────── */

.entry-content blockquote,
.entry-content .wp-block-quote {
  border-left: 4px solid var(--teal-mid);
  padding: 0.6em 0 0.6em 1.4em;
  margin: 1.8em 0;
  color: var(--ink-mid);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15em;
  line-height: 1.65;
  background: transparent;
}

.entry-content blockquote cite,
.entry-content .wp-block-quote cite,
.entry-content .wp-block-quote .wp-block-quote__citation {
  display: block;
  margin-top: 0.6em;
  font-size: 0.8em;
  font-style: normal;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}

/* Large quote variant */
.entry-content .wp-block-quote.is-style-large,
.entry-content .wp-block-quote.is-style-plain {
  border-left: none;
  padding-left: 0;
  text-align: center;
  font-size: 1.35em;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.2em 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PULLQUOTE
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-pullquote {
  border-top: 4px solid var(--teal-mid);
  border-bottom: 4px solid var(--teal-mid);
  padding: 1.5em 1em;
  margin: 2em 0;
  text-align: center;
}

.entry-content .wp-block-pullquote blockquote {
  border-left: none;
  padding-left: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4em;
  color: var(--teal-deep);
  background: transparent;
}

.entry-content .wp-block-pullquote cite {
  font-size: 0.75em;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   VERSE
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-verse,
.entry-content pre.wp-block-verse {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1em;
  line-height: 1.9;
  color: var(--ink-mid);
  white-space: pre-wrap;
  padding: 1em 1.4em;
  background: var(--teal-pale);
  border-left: 4px solid var(--teal-mid);
  border-radius: 0 4px 4px 0;
  margin: 1.5em 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SEPARATOR  /  Horizontal Rule
───────────────────────────────────────────────────────────────────────────── */

.entry-content hr,
.entry-content .wp-block-separator {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 2.5em 0;
}

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

.entry-content .wp-block-separator.is-style-dots::before {
  content: '· · ·';
  display: block;
  text-align: center;
  font-size: 1.2em;
  letter-spacing: 0.5em;
  color: var(--ink-light);
  border-top: none;
}

.entry-content .wp-block-separator.is-style-dots {
  border-top: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   IMAGES
───────────────────────────────────────────────────────────────────────────── */

.entry-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.entry-content figure.wp-block-image {
  margin: 1.8em 0;
}

.entry-content figcaption,
.entry-content .wp-element-caption {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-light);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   GALLERY BLOCK
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-gallery {
  margin: 1.8em 0;
}

.entry-content .wp-block-gallery figure img {
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-button__link {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 3px;
  background: var(--orange);
  color: #fff !important;
  padding: 14px 30px;
  text-decoration: none;
  transition: background 0.25s, transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.entry-content .wp-block-button__link:hover {
  background: var(--teal-deep);
  transform: translateY(-2px);
  color: #fff !important;
}

/* Outline variant */
.entry-content .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--teal-mid);
  color: var(--teal-mid) !important;
}

.entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--teal-mid);
  color: #fff !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TABLE
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-table {
  margin: 1.8em 0;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink);
}

.entry-content .wp-block-table td,
.entry-content .wp-block-table th {
  border: 1px solid var(--border);
  padding: 10px 16px;
  text-align: left;
  line-height: 1.5;
}

.entry-content .wp-block-table th {
  background: var(--teal-pale);
  font-weight: 700;
  color: var(--teal-deep);
  font-family: 'Nunito', sans-serif;
}

.entry-content .wp-block-table tbody tr:nth-child(even) td {
  background: rgba(234, 243, 243, 0.35);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CODE  /  PREFORMATTED
───────────────────────────────────────────────────────────────────────────── */

.entry-content code,
.entry-content .wp-block-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  background: var(--teal-pale);
  color: var(--teal-deep);
  padding: 2px 7px;
  border-radius: 3px;
}

.entry-content pre,
.entry-content pre.wp-block-code {
  background: var(--teal-pale);
  color: var(--teal-deep);
  padding: 18px 22px;
  overflow-x: auto;
  border-left: 4px solid var(--teal-mid);
  border-radius: 0 4px 4px 0;
  margin: 1.5em 0;
  font-size: 13px;
  line-height: 1.75;
}

.entry-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* ─────────────────────────────────────────────────────────────────────────────
   COLUMNS BLOCK
───────────────────────────────────────────────────────────────────────────── */

/* Allow the block library's column layout to work — we only add spacing */
.entry-content .wp-block-columns {
  margin-bottom: 1.8em;
  gap: 2em;
}

.entry-content .wp-block-column {
  /* flex-basis managed by block library; we just add comfortable spacing */
}

/* ─────────────────────────────────────────────────────────────────────────────
   COVER BLOCK
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-cover {
  border-radius: 6px;
  overflow: hidden;
  margin: 1.8em 0;
}

.entry-content .wp-block-cover__inner-container {
  font-family: 'Playfair Display', serif;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MEDIA & TEXT BLOCK
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-media-text {
  margin: 1.8em 0;
  border-radius: 6px;
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────
   GROUP  /  SPACER  /  DETAILS
───────────────────────────────────────────────────────────────────────────── */

.entry-content .wp-block-group {
  margin-bottom: 1.5em;
}

.entry-content details {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75em 1.1em;
  margin-bottom: 1em;
}

.entry-content summary {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--teal-deep);
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ALIGNMENT HELPERS  (WordPress standard classes)
───────────────────────────────────────────────────────────────────────────── */

.entry-content .alignleft  { float: left;  margin: 0.5em 1.5em 0.5em 0; }
.entry-content .alignright { float: right; margin: 0.5em 0 0.5em 1.5em; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content .alignwide:not(.wp-block-woocommerce-checkout):not(.wp-block-woocommerce-cart) { margin-left: -4vw; margin-right: -4vw; }
.entry-content .alignfull  { margin-left: calc(-7vw - 1px); margin-right: calc(-7vw - 1px); max-width: calc(100% + 14vw + 2px); }

/* Cart & Checkout blocks: full-width within parent, no bleed */
.entry-content .wp-block-woocommerce-checkout.alignwide,
.entry-content .wp-block-woocommerce-cart.alignwide {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 680px) {
  .entry-content .wp-block-columns {
    flex-direction: column;
    gap: 1em;
  }

  .entry-content .alignleft,
  .entry-content .alignright {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }

  .entry-content .alignwide,
  .entry-content .alignfull {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .entry-content .wp-block-woocommerce-checkout.alignwide {
    margin-left: 0;
    margin-right: 0;
  }
}
