/* Systemwide UX baseline for controls and readable text.
 * This file intentionally contains cross-template rules only.
 */

:root {
  --mgt-hit-target: 44px;
}

.mgt-wordmark a {
  display: inline-flex;
  min-height: var(--mgt-hit-target);
  align-items: center;
}

.mgt-site-header .wp-block-navigation-item__content,
.mgt-site-footer .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.preview-nav a {
  font-size: 14px;
}

.mgt-main-nav .wp-block-navigation-item__content,
.mgt-site-footer .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.preview-nav a {
  display: inline-flex;
  min-height: var(--mgt-hit-target);
  align-items: center;
  padding-block: 10px;
}

.mgt-main-nav .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.preview-nav a {
  padding-inline: 0;
}

/* Keep the 44px hit area without overriding WordPress responsive visibility.
 * WordPress owns display for the open/close controls so desktop keeps the
 * hamburger hidden while mobile still exposes the menu trigger. */
.mgt-main-nav .wp-block-navigation__responsive-container-open,
.mgt-main-nav .wp-block-navigation__responsive-container-close {
  min-width: var(--mgt-hit-target);
  min-height: var(--mgt-hit-target);
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.mgt-header-search .wp-block-search__input {
  font-size: 16px;
}

.mgt-header-search .wp-block-search__button,
.mgt-site-header .wp-block-search__button.has-icon {
  min-width: var(--mgt-hit-target);
  min-height: var(--mgt-hit-target);
  padding-inline: 14px;
  font-size: 14px;
}

.mgt-site-logo .custom-logo-link {
  display: grid;
  min-width: var(--mgt-hit-target);
  min-height: var(--mgt-hit-target);
  place-items: center;
}

.mgt-main--home .mgt-quick-links a,
.mgt-main--home .mgt-duration-links a,
.mgt-chip {
  display: inline-flex;
  min-height: var(--mgt-hit-target);
  align-items: center;
  padding-block: 10px;
  font-size: 14px;
}

.mgt-skip-link {
  display: inline-flex;
  min-height: var(--mgt-hit-target);
  align-items: center;
  font-size: 14px;
}

.mgt-kicker,
.mgt-card-label,
.mgt-card-foot,
.mgt-main--home .mgt-story-card .wp-block-post-date,
.mgt-main--home .mgt-stamp-copy p {
  font-size: 14px;
}

/* Gutenberg stored these three labels with inline 0.84rem. The narrow
 * !important is intentional: it only normalizes metadata inside comparison
 * rows and does not override editorial prose. */
.mgt-main--home .mgt-comparison-row > p {
  font-size: 14px !important;
}

.mgt-card-body > p:not(.mgt-card-label):not(.mgt-card-foot),
.mgt-story-card .wp-block-post-excerpt p {
  font-size: 16px;
  line-height: 1.55;
}

.mgt-footer-lead,
.mgt-footer-nav .wp-block-navigation-item__content,
.mgt-footer-bottom p {
  font-size: 14px;
}

/* The editorial landing intro has inline Gutenberg font sizes. These two
 * selectors are deliberately restricted to the first intro group. */
.mgt-page-shell .mgt-editorial-content > .wp-block-group:first-child > p.has-text-color {
  font-size: 14px !important;
}

.mgt-page-shell .mgt-editorial-content > .wp-block-group:first-child > p:not(.has-text-color) {
  font-size: 16px !important;
}

/* Mobile navigation opens as a full-screen WordPress overlay. Keep the
 * menu content clear of the sticky header while leaving the close control
 * in its native, keyboard-accessible position. */
@media (max-width: 781px) {
  .mgt-main-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top: calc(4.25rem + 1rem);
  }
}

/* Verification dates stored directly after an article title are metadata,
 * not body emphasis. Restrict the override to that exact document position. */
.mgt-editorial-content > h1:first-child + p > strong:only-child {
  color: var(--mgt-muted, #5f6d66);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .mgt-trip-search .wp-block-search__input,
  .preview-search input {
    font-size: 16px;
  }
}

body.mg-practical-article {
  --mgt-practical-reading: var(--mgt-reading, 760px);
}

:is(body.mg-practical-article, main) .mg-practical-content > :where(p, ul, ol),
:is(body.mg-practical-article, main) .mg-practical-hero-copy > :where(p, ul, ol) {
  max-width: var(--mgt-reading, 760px);
}

:where(
  .mg-reading-shell,
  .mg-editorial-byline,
  .mg-day,
  .mg-route-step-card,
  .mg-timeline article,
  .mg-article-prose,
  .entry-content
) > :where(p, ul, ol) {
  max-width: var(--mgt-reading, 760px);
}
