/* MGN on vi.ki's look: app.css (copied from vi.ki) is the shell, the header, the column and the
   type; this file adds MGN's logo and menu, the post lists, and the WordPress block markup the
   imported posts carry. Dark only, like vi.ki. */

/* --- header ---------------------------------------------------------------------------------- */
header.site .mgn-brand { align-items: center; }
header.site .mgn-logo { display: block; height: 30px; width: auto; max-width: 12rem; }
/* Sign in for every visitor (layout.html); edit.css, loaded only once signed in, styles the rest. */
.mgn-me { display: flex; align-items: center; gap: .5rem; margin-left: .4rem; font-size: .88rem; }
.mgn-signin { color: var(--ink); white-space: nowrap; }
.mgn-nav { display: flex; gap: .9rem; align-items: center; font-size: .95rem; }
.mgn-nav > a { color: var(--ink); white-space: nowrap; }
.mgn-nav > a:hover { color: var(--link); text-decoration: none; }
.mgn-menu { position: relative; }
.mgn-menu > summary { list-style: none; cursor: pointer; color: var(--ink); white-space: nowrap; }
.mgn-menu > summary::-webkit-details-marker { display: none; }
.mgn-menu > summary::after { content: ""; display: inline-block; margin-left: .35rem; border: .28rem solid transparent; border-top-color: currentColor; transform: translateY(.14rem); }
.mgn-menu > summary:hover, .mgn-menu[open] > summary { color: var(--link); }
.mgn-menu-list {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 40; min-width: 14rem;
  display: flex; flex-direction: column; padding: .35rem; border: 1px solid var(--line); border-radius: 10px;
  background: #1a1d23; box-shadow: var(--shadow);
}
.mgn-menu-list a { padding: .4rem .6rem; border-radius: 6px; color: var(--ink); white-space: nowrap; }
.mgn-menu-list a:hover { background: var(--tint); color: var(--link); text-decoration: none; }
@media (max-width: 760px) {
  header.site { grid-template-columns: auto minmax(0, 1fr); }
  .mgn-nav { grid-column: 1 / -1; flex-wrap: wrap; gap: .4rem .9rem; font-size: .9rem; }
  .mgn-menu-list { left: 0; right: auto; }
}

/* The staging note: only on the hidden staging address, never on mgn.gg. */
.staging-bar { padding: .35rem 1rem; background: #3a2a00; color: #ffd98a; font-size: .8rem; }
.staging-bar a { color: #ffd98a; margin-right: .5rem; }
.staging-bar a[aria-current] { font-weight: 600; text-decoration: underline; }

/* --- lists ------------------------------------------------------------------------------------- */
.mgn-list .page-header { margin: 1rem 0 1.5rem; }
.mgn-list .page-title { margin: 0; font-size: 1.6rem; }
.taxonomy-description { color: var(--muted); }
.mgn-entry { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.mgn-entry:first-of-type { padding-top: .6rem; }
.mgn-entry-image img { display: block; width: 100%; height: auto; border-radius: 10px; margin-bottom: .9rem; background: var(--tint); }
.mgn-entry .entry-title { margin: 0 0 .3rem; font-size: 1.35rem; line-height: 1.3; }
.mgn-entry .entry-title a { color: var(--ink); }
.mgn-entry .entry-title a:hover { color: var(--link); }
.entry-meta { color: var(--muted); font-size: .88rem; }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--link); }
.entry-summary { margin-top: .6rem; }
.entry-summary p { margin: 0; }
.mgn-entry-foot { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: .7rem; }
.read-more { white-space: nowrap; }
/* The home page is a grid of cards once the window holds two (George, Nov 15, 2026: "Arrange all
   mgn.gg and tips.h.ki homepages in a grid view if there is enough available width"); narrower,
   it is the list above, one post a row. The heading and the pager span the grid. */
@media (min-width: 40rem) {
  /* A grid page uses the whole window, not the article column (George: "use the full browser
     width not max 3 columns"), with at most 4 columns however wide the window (George, Nov 15,
     2026, then Nov 16: "cap the grids to 4 columns instead of 5"). */
  main:has(.mgn-grid) { max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
  .mgn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(18rem, calc((100% - 3 * 1.4rem) / 4)), 1fr)); gap: 1.4rem; align-items: start; }
  .mgn-grid > :not(.mgn-entry) { grid-column: 1 / -1; }
  /* No border or rule around each card (George, Nov 15, 2026: "looks cleaner without so many lines"). */
  .mgn-grid .mgn-entry, .mgn-grid .mgn-entry:first-of-type { padding: 0 0 .6rem; border: 0; }
  .mgn-grid .mgn-entry-image img { border-radius: 12px; aspect-ratio: 16 / 9; object-fit: cover; }
  .mgn-grid .mgn-entry .entry-title { font-size: 1.15rem; }
  .mgn-grid .entry-summary { font-size: .95rem; }
}
.mgn-pager { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; margin: 2rem 0 1rem; }
.page-numbers { display: inline-block; min-width: 2.2rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 8px; text-align: center; color: var(--ink); }
a.page-numbers:hover { border-color: var(--link); color: var(--link); text-decoration: none; }
.page-numbers.current { background: var(--link); border-color: var(--link); color: var(--on-link); }
.page-numbers.dots { border-color: transparent; }

/* --- one post -------------------------------------------------------------------------------- */
.mgn-article { max-width: 46rem; margin: 0 auto; }
.mgn-article .featured-image { margin: 1rem 0 1.2rem; }
.mgn-article .featured-image img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--tint); }
.mgn-article .entry-title { font-size: 2rem; line-height: 1.2; margin: .6rem 0 .4rem; }
.mgn-article .entry-header { margin-bottom: 1.2rem; }
/* The one "More on" line after a post's body (server/crosslinks.go). */
.mgn-more-on { margin: 1.5rem 0 0; color: var(--muted, inherit); }
.mgn-article-foot { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.mgn-article-foot p { margin: .3rem 0; }
.mgn-label { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; margin-right: .35rem; }
.post-navigation { display: grid; gap: .6rem; margin-top: 1rem; }
@media (min-width: 700px) { .post-navigation { grid-template-columns: 1fr 1fr; } .post-navigation .nav-next { text-align: right; } }

/* WordPress's block markup inside the imported bodies. */
.entry-content img { max-width: 100%; height: auto; }
.entry-content figure { margin: 1.2rem 0; }
.entry-content figcaption, .wp-element-caption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: .4rem; }
.entry-content .aligncenter, .entry-content .has-text-align-center { text-align: center; }
.entry-content .aligncenter img, .entry-content img.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.entry-content .alignleft { float: left; margin: .3rem 1rem .6rem 0; }
.entry-content .alignright { float: right; margin: .3rem 0 .6rem 1rem; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content .has-text-align-justify { text-align: left; }
.entry-content::after { content: ""; display: table; clear: both; }
.wp-block-image img { border-radius: 8px; }
.wp-block-embed { margin: 1.2rem 0; }
.wp-block-embed__wrapper { position: relative; }
.wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.wp-embed-aspect-4-3 .wp-block-embed__wrapper::before { padding-top: 75%; }
.wp-embed-aspect-1-1 .wp-block-embed__wrapper::before { padding-top: 100%; }
.wp-has-aspect-ratio .wp-block-embed__wrapper > iframe, .wp-has-aspect-ratio .wp-block-embed__wrapper > div.iframe-heartbeat {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; background: var(--tint);
}
.entry-content iframe { max-width: 100%; }
/* The old Heartbeat player's mode buttons (normal, fixed, mini) sat under each video in 651 posts.
   Their scripts never run here, and on tips.h.ki their icons still load from WordPress at full size
   and stretched the video box to over 1,500 px (Nov 15, 2026), so they are hidden. */
.heartbeat-moments-player-toolbar { display: none !important; }
.wp-block-gallery, .blocks-gallery-grid { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.wp-block-gallery figure, .blocks-gallery-item { flex: 1 1 12rem; margin: 0; }
.wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.wp-block-column { flex: 1 1 14rem; min-width: 0; }
/* WordPress post embeds turned into cards (server/cards.go): thumbnail on top, then title, author
   and a short excerpt; in a "Related" row of columns they sit side by side. */
.wp-block-embed.is-type-wp-embed { margin: 0 0 1rem; }
.mgn-card { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--tint); }
.mgn-card:hover { border-color: var(--muted); }
.mgn-card:hover .mgn-card-title { color: var(--link, #8ab4f8); }
.mgn-card-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.mgn-card-text { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .8rem .9rem; }
.mgn-card-title { font-size: 1rem; line-height: 1.3; font-weight: 500; }
.mgn-card-meta { color: var(--muted); font-size: .8rem; }
.mgn-card-excerpt { color: var(--muted); font-size: .85rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wp-block-table { overflow-x: auto; }
.wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.wp-block-quote, .wp-block-pullquote { margin: 1.2rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.wp-block-button__link, .wp-block-file__button { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--link); border-radius: 6px; color: var(--link); }
.has-small-font-size { font-size: .85rem; }
.has-large-font-size { font-size: 1.3rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Text colors picked for the old white theme would vanish on black: the reader's ink wins. */
.entry-content [class*="has-"][class*="-color"]:not(.has-background) { color: inherit; }
.entry-content .has-background { color: #111; border-radius: 6px; padding: .6rem .8rem; }
.entry-content [style*="color"] { color: inherit !important; }
.entry-content mark { background: #5a4a00; color: inherit; }

/* --- comments -------------------------------------------------------------------------------- */
.comments-area { max-width: 46rem; margin: 2.4rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.comments-title { font-size: 1.25rem; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { margin-left: 1.6rem; }
.comment-body { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; gap: .7rem; align-items: center; }
.comment-meta .avatar { border-radius: 50%; flex: none; }
.comment-author-info cite { font-style: normal; font-weight: 600; }
.comment-metadata { font-size: .82rem; }
.comment-metadata a { color: var(--muted); }
.comment-content { margin: .5rem 0 0 calc(50px + .7rem); }
.comment-content p { margin: 0 0 .5rem; }

/* --- the 404 and the 410 ------------------------------------------------------------------------ */
.lost h1 { margin-top: 1.4rem; }
.lost-why { color: var(--muted); }
.lost-search { margin: 1.2rem 0; display: flex; flex-direction: column; gap: .4rem; }
.lost-row { display: flex; gap: .5rem; }
.lost-row input { flex: 1; min-width: 0; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); color: var(--ink); font: inherit; }
.mgn-links { padding-left: 1.2rem; }
.mgn-links li { margin: .35rem 0; }
.lost-ways { margin-top: 2rem; color: var(--muted); }
.mgn-social { margin-bottom: .4rem; }

/* --- the embed card ----------------------------------------------------------------------------- */
.mgn-embed { padding: 1rem; }
.mgn-embed-card { max-width: 36rem; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.mgn-embed-card img { width: 100%; height: auto; border-radius: 8px; }
.mgn-embed-title { font-size: 1.2rem; font-weight: 600; margin: .6rem 0 .3rem; }
.mgn-embed-site { color: var(--muted); font-size: .85rem; margin: .6rem 0 0; }

/* The right-hand column beside a post ("Up next"), as YouTube lists what to watch next beside a
   video; under the article on narrow screens. */
.mgn-related { max-width: 46rem; margin: 2.4rem auto 0; }
.mgn-related-title { font-size: 1.05rem; font-weight: 500; margin: 0 0 .8rem; }
.mgn-related ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.mgn-related a { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: .7rem; align-items: start; color: inherit; text-decoration: none; border-radius: 10px; }
.mgn-related a:hover .mgn-related-name { color: var(--link, #8ab4f8); }
.mgn-related img { display: block; width: 168px; height: 94px; object-fit: cover; border-radius: 8px; background: var(--tint); }
.mgn-related-text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.mgn-related-name { font-size: .92rem; line-height: 1.3; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mgn-related-meta { color: var(--muted); font-size: .8rem; }
@media (min-width: 1180px) {
  .mgn-single.has-related { display: grid; grid-template-columns: minmax(0, 46rem) 24rem; gap: 2.5rem; justify-content: center; align-items: start; }
  .mgn-single.has-related .mgn-article, .mgn-single.has-related .comments-area { margin-left: 0; margin-right: 0; }
  .mgn-single.has-related .mgn-related { margin: 1rem 0 0; }
}

/* --- video moments (server/moments.go) ------------------------------------------------------
   Under a video: its moments, a time chip and one line each (vi.ki's .moment-list look); a click
   seeks the player above (mgn.js). Bold is 500 on George's sites. */
.mgn-moments { margin: -.4rem 0 1.6rem; padding: .6rem .7rem .4rem; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--tint) 60%, transparent); }
.mgn-moments-h { margin: 0 0 .2rem .6rem; font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mgn-moments .moment-list { margin: 0; }
.mgn-moments .moment-list li { margin: 0; }
.mgn-moments .moment-ts { font-weight: 500; }
/* The old Heartbeat plugin's moments in the bodies (server/embeds.go withSeeks): a time that
   seeks the post's player, styled as the link it acts as. */
.entry-content [data-mgn-seek] { color: var(--link) !important; cursor: pointer; }
.entry-content [data-mgn-seek]:hover { opacity: .8; }
/* No underline appears on hover anywhere (George, Nov 15, 2026: "Don't add the underline on hover
   over links it looks bad"); app.css, copied from vi.ki, underlines a:hover, so it is undone here.
   Keyboard focus stays visible with an outline. */
a:hover, a:focus-visible, a:hover *, a:focus-visible *, [data-mgn-seek]:hover, [data-mgn-seek]:focus-visible { text-decoration: none !important; }
a:focus-visible, [data-mgn-seek]:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
.mgn-moments .moment-desc { display: block; font-size: .95rem; color: var(--ink); }
.mgn-moments .moment-list li:hover { background: var(--tint); }
.moment-list.clock-4 { --clock-ch: 4; }
.moment-list.clock-5 { --clock-ch: 5; }
.moment-list.clock-7 { --clock-ch: 7; }
.mgn-moments-after .mgn-moments { margin-top: 1.2rem; }
