/*
Theme Name: Mermaidmess
Theme URI: https://mermaidmess.com
Author: Ariel Anderson
Author URI: https://mermaidmess.com
Description: A quiet, gallery-minimal block theme for the artist Ariel Anderson (mermaidmess.com) — imaginative impressionist forest animals in oil. Warm cream surfaces on an oceanic mist background, with a deep-teal footer. Built for full-site editing; all colors, fonts and spacing are editable under Appearance → Editor → Styles.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mermaidmess
Tags: full-site-editing, block-patterns, art, portfolio, one-column, custom-colors, custom-menu, editor-style, threaded-comments
*/

/* -------------------------------------------------------------------------
   Most styling lives in theme.json (the WordPress way for block themes).
   This file only carries the required theme header above plus a few touches
   that theme.json can't express cleanly.
   ------------------------------------------------------------------------- */

/* The brand wordmark: "mermaid" light + "mess" bold. */
.mm-wordmark {
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mm-wordmark strong { font-weight: 700; }

/* Tracked uppercase "signage" label used for eyebrows + tags. */
.mm-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}

/* CV timeline: fixed 80px bold year column beside the stacked venues.
   Backed by CSS (not block child-layout) so the width is deterministic. */
.mm-cv-year { flex: 0 0 80px; }

/* Artwork frame — gallery-squared with a soft floating shadow. */
.mm-artwork img,
.mm-artwork .wp-block-cover {
  border-radius: 2px;
  box-shadow: 0 24px 60px -18px rgba(24, 36, 34, 0.28);
}

/* Hero painting: cap the height so it fits the viewport, keep aspect ratio.
   In CSS (not an inline style on the <img>) so the image block validates. */
.mm-hero-art img { max-height: 68vh; width: auto; }

/* -------------------------------------------------------------------------
   Hero rotating gallery (About / home). The slides are a native Gallery block
   the artist edits; assets/js/hero-carousel.js cross-fades through them. All
   slides are stacked in one CSS grid cell so the cream frame sizes to the
   artwork and each slide can fade over the next.
   ------------------------------------------------------------------------- */
.mm-hero-carousel { position: relative; }

.mm-hero-gallery.wp-block-gallery {
  display: grid;
  grid-template-areas: "stack";
  place-items: center;
  gap: 0;
  margin: 0;
}
.mm-hero-gallery.wp-block-gallery > .wp-block-image {
  grid-area: stack;
  margin: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
/* Before JS initializes, show the first slide so the frame is never blank. */
.mm-hero-carousel:not(.is-ready) .mm-hero-gallery > .wp-block-image:first-child { opacity: 1; }
/* Once JS is ready, only the active slide is visible. */
.mm-hero-carousel.is-ready .mm-hero-gallery > .wp-block-image.is-active { opacity: 1; }
.mm-hero-gallery.wp-block-gallery > .wp-block-image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 68vh;
  margin: 0 auto;
  display: block;
}

/* Prev / next arrows. */
.mm-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wp--preset--color--paper-300);
  border-radius: 999px;
  background: var(--wp--preset--color--paper-50);
  color: var(--wp--preset--color--ink-900);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(24, 36, 34, 0.12);
  transition: background 0.15s ease, color 0.15s ease;
}
.mm-carousel-arrow:hover,
.mm-carousel-arrow:focus-visible {
  background: var(--wp--preset--color--teal-700);
  color: #fff;
}
.mm-carousel-prev { left: 0.75rem; display: none !important; }
.mm-carousel-next { right: 0.75rem; display: none !important; }

/* Dot indicators. */
.mm-carousel-dots {
  display: none !important;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.mm-carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--teal-700);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.mm-carousel-dot[aria-selected="true"] {
  background: var(--wp--preset--color--teal-700);
  transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
  .mm-hero-gallery.wp-block-gallery > .wp-block-image { transition: none; }
}

/* Status tag pill. */
.mm-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45em 0.7em;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   In-page "Jump to" nav (Available Work & Services page). A small row of pill
   links that anchor to the #available-work and #services sections so the
   Services band is easy to reach without scrolling the whole grid.
   ------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
#available-work, #services { scroll-margin-top: 1.5rem; }

.mm-section-nav { align-items: center; }
.mm-section-nav .mm-section-nav__label { margin: 0; }
.mm-section-nav .mm-section-nav__link { margin: 0; }
.mm-section-nav .mm-section-nav__link a {
  display: inline-block;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.55em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--sea-300);
  color: var(--wp--preset--color--teal-700);
  background: var(--wp--preset--color--paper-50);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mm-section-nav .mm-section-nav__link a:hover,
.mm-section-nav .mm-section-nav__link a:focus-visible {
  background: var(--wp--preset--color--teal-700);
  border-color: var(--wp--preset--color--teal-700);
  color: #fff;
}

/* -------------------------------------------------------------------------
   "See examples" lightbox (Services pattern). Markup is a <dialog> the
   pattern prints; behavior is in assets/js/examples-modal.js. Styles live
   here (not inline in the pattern) so they survive plugins that strip inline
   markup and so they're editable in one place.
   ------------------------------------------------------------------------- */
.mm-examples-trigger {
  flex: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--wp--preset--color--teal-700, #1F4E4A);
  background: transparent;
  border: 1px solid var(--wp--preset--color--teal-700, #1F4E4A);
  border-radius: 999px;
  padding: 0.5em 1.05em;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Services cards: make each an equal-height column (the grid already stretches
   them to the tallest in the row) so the action row can pin to the bottom. The
   foot lays Enquire and "See examples" across from each other. */
.mm-service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.mm-service-foot { margin-top: auto; }
.mm-service-foot p { margin: 0; }
.mm-examples-trigger:hover,
.mm-examples-trigger:focus-visible {
  background: var(--wp--preset--color--teal-700, #1F4E4A);
  color: #fff;
}
.mm-examples-dialog {
  width: min(1100px, 92vw);
  max-width: 1100px;
  border: 0;
  border-radius: 14px;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--wp--preset--color--paper-50, #FBF8F2);
  color: inherit;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}
.mm-examples-dialog::backdrop { background: rgba(23, 62, 58, .55); backdrop-filter: blur(6px); }
.mm-examples-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--wp--preset--color--ink-700, #33433F);
}
.mm-examples-eyebrow {
  margin: 0 0 .35rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--wp--preset--color--ink-500, #5C6B66);
}
.mm-examples-title { margin: 0; font-size: 1.9rem; font-weight: 600; font-style: italic; }
.mm-examples-close {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--paper-300, #E5DBC9);
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.mm-examples-close:hover { background: rgba(0, 0, 0, .05); }
.mm-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.mm-ex-card { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.mm-ex-mat {
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: linear-gradient(135deg, #C7D8D3, #8FB2A8);
  box-shadow: 0 10px 30px rgba(23, 62, 58, .12);
}
.mm-ex-card h3 { margin: 0; font-size: 1.1rem; font-weight: 600; font-style: italic; }
.mm-ex-card .mm-ex-meta { margin: 0; font-size: .875rem; color: var(--wp--preset--color--ink-500, #5C6B66); }
.mm-ex-card .mm-ex-tag {
  align-self: flex-start;
  margin: .15rem 0 0;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--wp--preset--color--teal-900, #173E3A);
  border: 1px solid var(--wp--preset--color--teal-900, #173E3A);
  border-radius: 999px;
  padding: .25em .7em;
}

/* Wordmark subtext under "mermaidmess" in the header. */
.mm-wordmark-sub {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--wp--preset--color--ink-500);
}

/* Active nav item: bold + teal underline (added via current-menu-item /
   aria-current by the render_block filter in functions.php). Scoped to real
   nav items so it never touches the drawer's site-title. */
.wp-block-navigation .wp-block-navigation-item.current-menu-item > a,
.wp-block-navigation .wp-block-navigation-item > a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--wp--preset--color--teal-700);
}

/* -------------------------------------------------------------------------
   Mobile slide-out drawer (Navigation block overlay). The site title and
   Instagram live inside the nav so they appear in the drawer; the title is
   marked .mm-drawer-only so it shows ONLY when the drawer is open (the
   standalone wordmark already sits in the header bar on desktop).
   ------------------------------------------------------------------------- */
.mm-drawer-only { display: none !important; }

/* Bound the overlay to the *visible* viewport. 100dvh (not 100vh) excludes the
   mobile browser's URL bar, whose gap previously let the drawer grow taller than
   the screen — pushing Instagram off the bottom and forcing a scrollbar. */
.wp-block-navigation__responsive-container.is-menu-open {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
/* Make the wrapper chain a full-height flex column so the nav list can fill the
   drawer and pin Instagram to the bottom via margin-top:auto — no fixed height. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
/* Pin the X to the top-right at the same offset the title row uses, so the two
   sit on one line across from each other. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
  top: var(--wp--preset--spacing--40);
  right: var(--wp--preset--spacing--40);
}

.has-modal-open .admin-bar .is-menu-open:where(:not(.disable-default-overlay)) .wp-block-navigation__responsive-dialog {
	margin-top: 0 !important;
}

/* Lay the open drawer out as a full-height, LEFT-aligned column. The nav's
   justify-content:right (correct for the desktop bar) is forced back to the
   left inside the overlay. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  padding-top: 1.9rem !important;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  display: flex !important;
  flex: 1;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
  gap: 0;
  /* Fill the drawer height so the last item (Instagram) pins to the bottom.
     Height comes from the flex chain above, not a fixed 100vh, so it can never
     overflow the visible viewport. */
  flex: 1 1 auto;
  min-height: 0;
}
/* Every drawer item is a <li class="wp-block-navigation-item">. Force its
   content to the LEFT (the desktop bar's right-justify sets align-items:flex-end
   on each item) and give it a hairline divider. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
  align-self: stretch !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
  /* border-bottom: 1px solid var(--wp--preset--color--sea-300); */
  padding-top: var(--wp--preset--spacing--20);
  padding-bottom: var(--wp--preset--spacing--20);
  padding-left: 2rem;
}

/* Title row (first item): a header bar at the very top-left, on the same line as
   the X close button. No divider — it reads as a header, not a nav link. The
   right padding keeps the wordmark clear of the X; min-height matches the close
   button so the two line up vertically. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:first-child {
  border-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 3.5rem;
  min-height: 44px;
  align-items: start !important;
  margin-bottom: var(--wp--preset--spacing--20);
}

/* Drawer title (first item): light wordmark, left-aligned, not underlined. */
.wp-block-navigation__responsive-container.is-menu-open .mm-drawer-only {
  display: block !important;
  font-size: 1.6rem;
  font-weight: 300;
  text-align: left;
  margin: 0;
}
.wp-block-navigation__responsive-container.is-menu-open .mm-drawer-only a { text-decoration: none; }

/* Instagram is the last item: push it to the bottom, drop its divider. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:last-child {
  padding-left: 0 !important;
  margin-top: auto;
  border-bottom: 0;
  align-items: center !important;
  padding-bottom: 3rem;
}

/* Instagram with its "@mermaidmess" label. The label is kept screen-reader-only
   by is-style-logos-only (so the desktop header shows just the icon); reveal it
   in the footer and inside the open mobile drawer to match the design. */
.mm-site-footer .wp-block-social-links.is-style-logos-only .wp-block-social-link-label,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-social-links.is-style-logos-only .wp-block-social-link-label {
  position: static !important;
  clip: auto !important;
  clip-path: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 0 0.55em !important;
  padding: 0;
  overflow: visible !important;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}
.mm-site-footer .wp-block-social-link,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-social-link {
  display: inline-flex;
  align-items: center;
}

/* -------------------------------------------------------------------------
   Fluent Forms — style the contact form to match the gallery aesthetic.
   Scoped to .ff-el-group etc. so it only touches Fluent Forms output.
   ------------------------------------------------------------------------- */
.fluentform .ff-el-group { margin-bottom: 1.25rem; }
.fluentform .ff-el-input--label label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wp--preset--color--ink-900);
  margin-bottom: 0.4rem;
}
.fluentform input[type="text"],
.fluentform input[type="email"],
.fluentform input[type="tel"],
.fluentform select,
.fluentform textarea {
  width: 100%;
  background: var(--wp--preset--color--shell, #FAF6EE);
  border: 1px solid var(--wp--preset--color--paper-300);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 1.0625rem;
  color: var(--wp--preset--color--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fluentform input:focus,
.fluentform select:focus,
.fluentform textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--teal-700);
  box-shadow: 0 0 0 3px rgba(31, 78, 74, 0.15);
}
.fluentform textarea { min-height: 140px; resize: vertical; }
.fluentform .ff-btn-submit {
  /* !important: Fluent Forms applies its own (blue) button background with high
     specificity/inline styles; force the theme's teal pill over it. */
  background: var(--wp--preset--color--teal-700) !important;
  background-color: var(--wp--preset--color--teal-700) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 0.85rem 1.9rem;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.fluentform .ff-btn-submit:hover,
.fluentform .ff-btn-submit:focus {
  background: var(--wp--preset--color--teal-900) !important;
  background-color: var(--wp--preset--color--teal-900) !important;
}
.fluentform .ff-el-is-error input,
.fluentform .ff-el-is-error textarea,
.fluentform .ff-el-is-error select { border-color: var(--wp--preset--color--error); }
.fluentform .error-text,
.fluentform .text-danger { color: var(--wp--preset--color--error); font-size: 0.875rem; }
/* --- Services cards: equal-height columns, action row pinned to bottom --- */
.mm-service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.mm-service-foot { margin-top: auto; }
.mm-service-foot p { margin: 0; }

/* "See examples" as a pill button (overrides the older text-link rule). */
.mm-examples-trigger {
  flex: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--wp--preset--color--teal-700, #1F4E4A);
  background: transparent;
  border: 1px solid var(--wp--preset--color--teal-700, #1F4E4A);
  border-radius: 999px;
  padding: 0.5em 1.05em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.mm-examples-trigger:hover,
.mm-examples-trigger:focus-visible {
  background: var(--wp--preset--color--teal-700, #1F4E4A);
  color: #fff;
  text-decoration: none;
}

/* Real Featured image in the popup grid (matches the placeholder mat frame). */
.mm-ex-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(23, 62, 58, .12);
}
