/*
==============================================================
 LostInA4x4 – Gutenberg Block Overrides (Front-End Only)
 Lightweight, fully commented, and inherits all theme typography
==============================================================
*/

/* Base Gutenberg block container alignment */
.wp-block {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Paragraphs inherit theme typography */
.wp-block-paragraph {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
  margin-bottom: 1.5em;
}

/* Headings inherit theme heading styles */
.wp-block-heading h1,
.wp-block-heading h2,
.wp-block-heading h3,
.wp-block-heading h4,
.wp-block-heading h5,
.wp-block-heading h6 {
  font-family: inherit;
  color: inherit;
  line-height: 1.2;
  margin: 1.5em 0 0.75em;
}

/* Images and galleries */
.wp-block-image img,
.wp-block-gallery img {
  height: auto;
  max-width: 100%;
  border-radius: 0.25rem;
}

/* Buttons */
.wp-block-button .wp-block-button__link {
  display: inline-block;
  padding: 0.8em 1.6em;
  border-radius: 2rem;
  text-decoration: none;
  background-color: var(--wp--preset--color--primary, #333);
  color: #fff;
  transition: all 0.2s ease;
  font-weight: 500;
}

.wp-block-button .wp-block-button__link:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* Lists */
.wp-block-list,
.wp-block-list ul,
.wp-block-list ol {
  margin-left: 1.25em;
  line-height: inherit;
  color: inherit;
}

/* Quotes */
.wp-block-quote {
  border-left: 4px solid var(--wp--preset--color--primary, #ccc);
  padding-left: 1.25em;
  font-style: italic;
  color: inherit;
  margin: 1.5em 0;
}

/* Pullquotes */
.wp-block-pullquote {
  border-top: 2px solid var(--wp--preset--color--primary, #ccc);
  border-bottom: 2px solid var(--wp--preset--color--primary, #ccc);
  margin: 2em 0;
  padding: 1.5em 0;
  font-style: italic;
  color: inherit;
}

/* Separator lines */
.wp-block-separator {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin: 2em 0;
}

/* Columns */
.wp-block-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 2em 0;
}

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

/* Spacer block */
.wp-block-spacer {
  display: block;
  width: 100%;
  height: var(--wp--custom--spacer-height, 2rem);
}

/* Alignwide / alignfull blocks */
.alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Table block */
.wp-block-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.wp-block-table th,
.wp-block-table td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75em 1em;
  text-align: left;
}

/* Code block */
.wp-block-code code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.25em 0.5em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.95em;
}

/* Preformatted text */
.wp-block-preformatted {
  background: rgba(0, 0, 0, 0.04);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
}

/* Gallery spacing fix */
.wp-block-gallery {
  gap: 1rem;
}

/* Group block */
.wp-block-group {
  margin-bottom: 2rem;
}

/* Media & text block */
.wp-block-media-text {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 2rem;
  align-items: center;
  margin: 2em 0;
}

.wp-block-media-text.has-media-on-the-right {
  grid-template-columns: 50% 50%;
  direction: rtl;
  text-align: left;
}

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

/* Buttons container */
.wp-block-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Embed block (YouTube, etc.) */
.wp-block-embed {
  margin: 2em 0;
  overflow: hidden;
  border-radius: 0.5rem;
}

.wp-block-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Cover block */
.wp-block-cover {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
}

.wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
}

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

/* Fine-tune Gutenberg defaults */
.wp-block-group > *:last-child {
  margin-bottom: 0;
}

.wp-block-group > *:first-child {
  margin-top: 0;
}

/* End of Gutenberg Overrides */
