/* ==========================================================================
   Buildero Theme — shared foundation
   Brand tokens, a light base and the layout for non-Elementor templates.

   Element-level rules use :where() (zero specificity) so Elementor widget,
   section and Site Settings styles always take precedence over them.
   ========================================================================== */

:root {
  /* Brand palette (from html/css/header.css) */
  --pie-gold: #D99A00;
  --pie-gold-dark: #A96C08;
  --pie-gold-text: #9E6407;          /* gold tuned for AA contrast on white */
  --pie-brown: #603800;
  --pie-charcoal: #171717;
  --pie-white: #FFFFFF;
  --pie-cream: #F7F4EE;
  --pie-grey: #D6D2CB;

  /* Typography */
  --pie-font-display: "Playfair Display", "DM Serif Display", Georgia, "Times New Roman", serif;
  --pie-font-body: "Manrope", "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Layout */
  --pie-content-max: 1376px;
  --pie-gutter: clamp(16px, 4vw, 40px);

  /* Motion */
  --pie-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pie-dur-fast: 0.2s;
  --pie-dur: 0.35s;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:where(html) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(body) {
  margin: 0;
  background: var(--pie-white);
  color: var(--pie-charcoal);
  font-family: var(--pie-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* clip (not hidden) so position: sticky keeps working inside Elementor */
  overflow-x: clip;
}

:where(img, svg, video) {
  max-width: 100%;
  height: auto;
}

:where(a) {
  color: var(--pie-gold-text);
}

:where(h1, h2, h3, h4, h5, h6) {
  color: var(--pie-charcoal);
  font-family: var(--pie-font-display);
  font-weight: 600;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
  word-wrap: normal !important;
}

.buildero-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100002;
  padding: 12px 18px;
  border-radius: 0 0 6px 6px;
  background: var(--pie-brown);
  color: var(--pie-white);
  font-family: var(--pie-font-body);
  font-weight: 600;
  text-decoration: none;
}

.buildero-skip-link:focus {
  top: 0;
  outline: 2px solid var(--pie-gold);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Main content
   Elementor pages get no wrapper styles at all (full available width).
   The container below is only used by the theme's own templates.
   -------------------------------------------------------------------------- */
.buildero-main:focus {
  outline: none;
}

.buildero-container {
  width: 100%;
  max-width: calc(var(--pie-content-max) + 2 * var(--pie-gutter));
  margin-inline: auto;
  padding: clamp(40px, 6vw, 88px) var(--pie-gutter);
}

.buildero-container--narrow {
  max-width: calc(860px + 2 * var(--pie-gutter));
}

.buildero-page-header {
  margin-bottom: clamp(24px, 4vw, 48px);
}

.buildero-page-title {
  margin: 0;
  font-size: clamp(32px, 4.2vw, 56px);
}

.buildero-archive-description {
  margin-top: 12px;
  color: #5C5750;
}

.buildero-entry + .buildero-entry {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--pie-grey);
}

.buildero-entry-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.6vw, 34px);
}

.buildero-entry-title a {
  color: inherit;
  text-decoration: none;
}

.buildero-entry-title a:hover {
  color: var(--pie-gold-text);
}

.buildero-entry-meta {
  margin: 0 0 20px;
  color: #6B655D;
  font-size: 14px;
}

.buildero-entry-thumbnail {
  margin: 0 0 24px;
}

.buildero-entry-thumbnail img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.buildero-entry-content > :first-child {
  margin-top: 0;
}

.buildero-entry-content::after {
  content: "";
  display: table;
  clear: both;
}

.buildero-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #9C6612 0%, #84540B 55%, #744708 100%);
  color: var(--pie-white);
  font-weight: 600;
  text-decoration: none;
}

.buildero-button:hover {
  filter: brightness(1.1);
}

.buildero-pagination {
  margin-top: 48px;
}

.buildero-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.buildero-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--pie-grey);
  border-radius: 6px;
  color: var(--pie-charcoal);
  text-decoration: none;
}

.buildero-pagination .page-numbers.current,
.buildero-pagination a.page-numbers:hover {
  border-color: var(--pie-gold);
  color: var(--pie-gold-text);
}

/* WordPress core content classes (classic editor + blocks) */
.alignleft {
  float: left;
  margin: 0 24px 16px 0;
}

.alignright {
  float: right;
  margin: 0 0 16px 24px;
}

.aligncenter {
  display: block;
  margin-inline: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text,
.wp-element-caption {
  color: #6B655D;
  font-size: 14px;
}

.sticky,
.bypostauthor,
.gallery-caption {
  /* Required by the WordPress theme review; no extra styling. */
}

/* Comments */
.buildero-comments {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--pie-grey);
}

.buildero-comments .comment-list {
  padding-left: 0;
  list-style: none;
}

.buildero-comments .children {
  list-style: none;
}

.buildero-comments textarea,
.buildero-comments input:not([type="submit"]):not([type="checkbox"]) {
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  border: 1px solid var(--pie-grey);
  border-radius: 6px;
  font: inherit;
}

@media (max-width: 767.98px) {
  .alignleft,
  .alignright {
    float: none;
    margin: 0 0 16px;
  }
}

/* WebP <picture> wrapper for bundled images (buildero_webp_picture()):
   no box of its own, so the <img> lays out exactly as without it. */
picture.buildero-picture {
  display: contents;
}
