/* mm-fixes.css: clean-up layer on top of the original theme CSS.
   Rule: nothing in here may change the desktop (>=979px) rendering except
   invisible things (focus rings for keyboard users, hit areas, max-width guards
   that never trigger at desktop sizes). Every fix is numbered and listed in RESULT.md. */

/* F1. Keyboard focus visible (theme removes outlines). Only for keyboard focus. */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
[role="button"]:focus-visible, .x-anchor:focus-visible {
  outline: 2px solid #545f30 !important;
  outline-offset: 2px;
}

/* F2. Embeds never wider than their column (only triggers when they would overflow). */
iframe, embed, video { max-width: 100%; }

/* F3. Post / project header breadcrumb ("< PROJECTS / 2025"): bigger invisible tap area. */
header.x-section .x-div > a.x-anchor-button { position: relative; }
header.x-section .x-div > a.x-anchor-button::after {
  content: ""; position: absolute; top: -12px; bottom: -12px; left: -8px; right: -8px;
}

/* ---------- tablet + phone (mobile header is shown below 979px) ---------- */
@media screen and (max-width: 978px) {
  /* F4. 125px empty white band between the mobile header and the first section.
     The band exists on desktop to make room for the hanging round logo, which
     the mobile header does not have. */
  .mdp-0.x-section, .m3o-0.x-section, .m58-0.x-section, .m9k-0.x-section, .m15-0.x-section {
    margin-top: 0 !important;
  }

  /* F9. Home flower map on touch screens: the flower labels are full-width
     invisible boxes pulled into place with negative margins, so on tablet the
     ABOUT box sat on top of the lupine and PODCAST could not be tapped, and on
     phones tapping EVENTS opened Art. Only the flowers and the label words take
     taps now, labels above flowers. Nothing moves. */
  .e25-e8 > .x-cell, .e25-e8 .x-text { pointer-events: none; }
  .e25-e8 a { pointer-events: auto; }
  .e25-e8 .x-text a { position: relative; z-index: 3; }

  /* F5. Contact page at tablet width: the 2/3 + 1/3 columns cut off
     "Contact Information" and the email address. Stack them like on phones. */
  .m2-8 > .x-row-inner > * { flex-basis: 100% !important; }
}

/* ---------- phones ---------- */
@media screen and (max-width: 766px) {
  /* F6. YouTube embeds keep 16:9 when scaled down to the column width. */
  iframe[src*="youtube.com/embed"], iframe[src*="youtube-nocookie.com/embed"] {
    width: 100% !important; height: auto !important; aspect-ratio: 16 / 9;
  }

  /* F7. Breadcrumb in post/project headers wrapped word by word and the two
     lines overlapped ("MINI / SERIES" on top of the date). Keep each part on
     one line and let the date drop below when there is no room. */
  header.x-section .x-div:has(> a.x-anchor-button) { flex-wrap: wrap; row-gap: 6px; }
  header.x-section .x-div:has(> a.x-anchor-button) .x-anchor-text-primary,
  header.x-section .x-div:has(> a.x-anchor-button) > .x-text { white-space: nowrap; }
}

@media screen and (max-width: 479px) {
  /* F8. Stacked polaroids in the page heroes spanned the full screen including
     the 20px gutters and, once rotated, were cut off on both sides (photo edges
     and captions clipped). Keep them inside the gutters. Same stack, same tilt. */
  .e493-e2 > .x-cell[data-x-effect], .e132-e2 > .x-cell[data-x-effect],
  .e344-e2 > .x-cell[data-x-effect], .e188-e2 > .x-cell[data-x-effect],
  .e41-e2 > .x-cell[data-x-effect], .e434-e2 > .x-cell[data-x-effect] {
    grid-column: 2 / 3 !important;
  }
  /* captions on those polaroids: a touch smaller so they stay on one line on the narrower card */
  .e493-e2 > .x-cell[data-x-effect] > .x-text, .e132-e2 > .x-cell[data-x-effect] > .x-text,
  .e344-e2 > .x-cell[data-x-effect] > .x-text, .e188-e2 > .x-cell[data-x-effect] > .x-text,
  .e41-e2 > .x-cell[data-x-effect] > .x-text, .e434-e2 > .x-cell[data-x-effect] > .x-text {
    font-size: 0.9em !important;
  }
}

/* F11. Contact form validation tips + status line (CF7 styles them, keep it plain). */
.wpcf7-not-valid-tip { color: #dc3232; font-size: 1em; font-weight: normal; display: block; }
.wpcf7 form .wpcf7-response-output { margin: 2em 0.5em 1em; padding: 0.2em 1em; border: 2px solid #ffb900; }

/* F10. Project search (Projects / Music / Poetry / Minis): WordPress search
   does not exist on a static site, so the box filters the cards on the page.
   Hidden cards use this class. */
.mm-hide { display: none !important; }
.mm-noresults { text-align: center; padding: 1em; font-family: "400-tan-aegean", Quattrocento, serif; }
