/*
Theme Name: Reverse Engineered
Theme URI: https://reverse-engineered.com
Description: The look of the BattleTech download page (owenmorgan.com/battletech): dark panels, amber accents, Saira Condensed display type. The front page is the download page; posts and pages use the same panels.
Version: 1.1.8
Requires at least: 6.4
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: reverse-engineered
*/

@font-face { font-family: "Saira Condensed"; font-weight: 700; font-display: swap;
             src: url("assets/font/saira-condensed-bold.ttf") format("truetype"); }
:root {
  --bg: #0b0c0f; --panel: #15171c; --panel2: #1b1e24; --line: #2b2f38; --text: #dde1e8;
  --muted: #8d95a3; --accent: #e8a531; --accent2: #f5c25e; --link: #8cc1ff; --code: #0f1115;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
section[id] { scroll-margin-top: 12px; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.display { font-family: "Saira Condensed", "Arial Narrow", system-ui, sans-serif; font-weight: 700;
           text-transform: uppercase; letter-spacing: .06em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link:focus { position: fixed; left: 8px; top: 8px; z-index: 100; width: auto; height: auto; clip: auto;
                   background: var(--accent); color: #15110a; padding: 8px 14px; border-radius: 6px; }

/* site bar */
.sitebar { background: #07080a; border-bottom: 1px solid var(--line); }
.sitebar .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand span { font-size: 21px; line-height: 1; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { display: block; padding: 6px 11px; border-radius: 6px; text-decoration: none; color: var(--text);
         font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-weight: 700; text-transform: uppercase;
         letter-spacing: .06em; font-size: 16px; }
.nav a:hover, .nav .current-menu-item > a { color: var(--accent2); background: #15171c; }

/* hero */
header.hero { background: #000 url("assets/img/stars.jpg") center / cover no-repeat; border-bottom: 1px solid var(--line); }
header.hero .wrap { display: flex; align-items: center; gap: 28px; padding-top: 44px; padding-bottom: 40px; }
header.hero img.emblem { width: 132px; height: 132px; flex: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
header.hero h1 { margin: 0; line-height: 1; }
header.hero h1 img { display: block; width: min(560px, 100%); height: auto; margin-left: -4px; }
header.hero h1 span.sr { position: absolute; left: -9999px; }
header.hero h1.text { font-size: 44px; color: #fff; }
header.hero p { margin: 12px 0 0; max-width: 552px; text-wrap: pretty; color: #c9ced8; font-size: 16px; }
header.hero.slim .wrap { padding-top: 30px; padding-bottom: 26px; }
header.hero.slim h1.text { font-size: 38px; }

/* download */
section { padding: 8px 0 8px; }
h2 { font-size: 26px; margin: 40px 0 14px; color: #fff; }
h2 small { font-family: system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 15px;
           font-weight: 400; color: var(--muted); margin-left: 10px; }
.main-dl { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
           border-radius: 12px; padding: 22px 22px 18px; }
.main-dl p.what { margin: 0 0 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; flex-direction: column; justify-content: center; min-width: 200px;
       padding: 12px 20px; border-radius: 9px; text-decoration: none; color: var(--text);
       background: #23272f; border: 1px solid #343a45; }
.btn:hover { border-color: var(--accent); }
.btn b { font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-size: 22px; letter-spacing: .05em;
         text-transform: uppercase; line-height: 1.1; }
.btn span { font-size: 13px; color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent2); color: #15110a; }
.btn.primary span { color: #3d2c0b; }
.btn.primary:hover { background: var(--accent2); }
.under { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.under a { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 15px; }
.step h3 { margin: 0 0 6px; font-size: 18px; color: var(--accent2); }
.step p { margin: 0 0 6px; }
.step p:last-child { margin-bottom: 0; }
code { background: var(--code); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
       font: 13.5px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-word; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }

/* games */
.games { display: grid; gap: 14px; }
.game { display: grid; grid-template-columns: 104px 1fr; gap: 18px; align-items: start;
        background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.game img { width: 104px; height: 104px; }
.game h3 { margin: 0; font-size: 24px; color: #fff; }
.game .ver { font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.game p { margin: 0 0 10px; font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.links a { text-decoration: none; padding: 5px 11px; border-radius: 6px; border: 1px solid #343a45; background: #1f232a; color: var(--text); }
.links a:hover { border-color: var(--accent); }
.links a.src { color: var(--link); }
.soon { display: inline-block; font-size: 13px; padding: 2px 9px; border-radius: 5px; background: #2a2f38; color: var(--accent2);
        letter-spacing: .08em; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.note { border-left: 3px solid var(--accent); padding: 12px 16px; background: var(--panel); border-radius: 4px; font-size: 15px; }
.note p { margin: 0 0 8px; } .note p:last-child { margin: 0; }
footer.site { margin: 48px auto 0; padding: 22px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
footer.site a { color: var(--muted); }

/* posts and pages */
.entries { display: grid; gap: 14px; margin: 32px 0 0; }
.entry-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.entry-card h2 { margin: 0 0 4px; font-size: 24px; }
.entry-card h2 a { color: #fff; text-decoration: none; }
.entry-card h2 a:hover { color: var(--accent2); }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.entry-card p { margin: 0 0 8px; font-size: 15px; }
.more { font-size: 14px; }
article.single { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
                 border-radius: 12px; padding: 24px 26px; margin: 32px 0 0; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 32px 0 12px; font-size: 24px; color: #fff; font-family: "Saira Condensed", "Arial Narrow", sans-serif;
            text-transform: uppercase; letter-spacing: .06em; }
.prose h3 { margin: 26px 0 8px; font-size: 19px; color: var(--accent2); font-family: "Saira Condensed", "Arial Narrow", sans-serif;
            text-transform: uppercase; letter-spacing: .05em; }
.prose blockquote { margin: 16px 0; border-left: 3px solid var(--accent); padding: 8px 16px; background: var(--panel); border-radius: 4px; }
.prose figure { margin: 18px 0; }
.prose figcaption, .wp-element-caption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.alignwide { margin-left: -26px; margin-right: -26px; }
.alignfull { margin-left: -26px; margin-right: -26px; max-width: none; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-block-button__link, .button { display: inline-block; padding: 9px 18px; border-radius: 8px; background: var(--accent);
  color: #15110a; text-decoration: none; font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: 18px; }
.wp-block-button__link:hover, .button:hover { background: var(--accent2); }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 0; }
.pagination .page-numbers { padding: 5px 11px; border-radius: 6px; border: 1px solid #343a45; background: #1f232a; color: var(--text); text-decoration: none; font-size: 14px; }
.pagination .current { border-color: var(--accent); color: var(--accent2); }
.search-form { display: flex; gap: 8px; margin: 14px 0; }
input[type=search], input[type=text], input[type=email], input[type=password], textarea {
  background: var(--code); color: var(--text); border: 1px solid #343a45; border-radius: 7px; padding: 8px 10px; font: inherit; }
button, input[type=submit] { background: #23272f; color: var(--text); border: 1px solid #343a45; border-radius: 7px; padding: 8px 14px; font: inherit; cursor: pointer; }
button:hover, input[type=submit]:hover { border-color: var(--accent); }

@media (max-width: 640px) {
  header.hero .wrap { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
  header.hero img.emblem { width: 92px; height: 92px; }
  header.hero h1.text { font-size: 34px; }
  .btn { min-width: 0; flex: 1 1 100%; }
  .game { grid-template-columns: 64px 1fr; gap: 12px; padding: 14px; }
  .game img { width: 64px; height: 64px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .sitebar .wrap { padding-top: 8px; padding-bottom: 8px; }
  .nav a { padding: 5px 8px; font-size: 15px; }
  article.single { padding: 18px 16px; }
  .alignwide, .alignfull { margin-left: -16px; margin-right: -16px; }
}

/* game pages */
header.game-hero { position: relative; background: #000 url("assets/img/stars.jpg") center / cover no-repeat; }
header.game-hero[style] { background-image: linear-gradient(90deg, rgba(11,12,15,.94) 0%, rgba(11,12,15,.78) 45%, rgba(11,12,15,.35) 100%), var(--shot); }
header.game-hero { background-position: center 45%; }
header.game-hero .wrap { padding-top: 96px; padding-bottom: 88px; }
header.game-hero img.emblem { width: 120px; height: 120px; }
header.game-hero img.emblem.dim { filter: grayscale(1) drop-shadow(0 6px 18px rgba(0,0,0,.6)); opacity: .5; }
header.game-hero h1.text { font-size: 46px; }
header.game-hero p.tagline { margin: 8px 0 0; color: #c9ced8; }
header.game-hero p.ver { margin: 4px 0 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.game-dl { margin-top: 28px; }
.btn.minor { min-width: 0; }
.game-body { margin-top: 18px; }
.game-links { margin: 18px 0 0; }
.prose .wp-block-gallery { --wp--style--unstable-gallery-gap: 10px; gap: 10px; margin: 22px 0 6px; }
.prose .wp-block-gallery.has-nested-images figure.wp-block-image:not(#x) { margin: 0; }
@media (min-width: 600px) {
  .prose .wp-block-gallery.has-nested-images.columns-2 figure.wp-block-image:not(#x) { width: calc(50% - 5px); flex-grow: 0; }
  .prose .wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#x) { width: calc(33.333% - 6.67px); flex-grow: 0; }
}
.prose .wp-block-gallery figure.wp-block-image img { border-radius: 8px; border: 1px solid var(--line); transition: border-color .15s; }
.prose .wp-block-gallery figure.wp-block-image a:hover img { border-color: var(--accent); }
.prose .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { background: linear-gradient(0deg, rgba(0,0,0,.75), rgba(0,0,0,0)); border-radius: 0 0 8px 8px; font-size: 13px; }

/* front-page card thumbnails */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.thumbs a { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 7px; border: 1px solid #343a45; background: #0f1115; }
.thumbs a:hover { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game .more { display: inline-block; font-size: 14px; margin-top: 2px; }
.game h3 a { color: inherit; text-decoration: none; }
.game h3 a:hover { color: var(--accent2); }

/* screenshot viewer */
.lb { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
      background: rgba(5,6,8,.94); padding: 48px 64px; }
.lb.open { display: flex; }
html.lb-lock { overflow: hidden; }
.lb figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lb img { max-width: 100%; max-height: calc(100vh - 130px); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #000; }
.lb figcaption { margin-top: 10px; color: var(--text); font-size: 14px; display: flex; gap: 14px; }
.lb .lb-n { color: var(--muted); }
.lb button { position: absolute; background: rgba(21,23,28,.85); border: 1px solid #343a45; color: #fff; border-radius: 8px;
             font-size: 30px; line-height: 1; width: 46px; height: 46px; padding: 0; cursor: pointer; }
.lb button:hover { border-color: var(--accent); }
.lb .lb-x { top: 14px; right: 14px; font-size: 28px; }
.lb .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb.single .lb-prev, .lb.single .lb-next { display: none; }
@media (max-width: 640px) {
  .lb { padding: 56px 8px; }
  .lb .lb-prev, .lb .lb-next { top: auto; bottom: 10px; transform: none; }
  header.game-hero .wrap { padding-top: 48px; padding-bottom: 44px; }
  header.game-hero h1.text { font-size: 34px; }
  .thumbs { gap: 6px; }
}

/* the own-game note under "The games" */
.own-game { margin: -4px 0 16px; font-size: 15px; color: #c9ced8; max-width: 860px; }
.own-game strong { color: var(--accent2); }

/* table blocks look like the theme's tables */
.prose .wp-block-table { margin: 14px 0 0; overflow-x: auto; }
.prose .wp-block-table table { border-collapse: collapse; }
.prose .wp-block-table th, .prose .wp-block-table td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 8px; }
.prose .wp-block-table thead { border-bottom: 0; }

/* Game pages: credit line and the Discoveries topics */
.credit { margin: 18px 0 0; padding: 12px 16px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 15px; color: #c9ced8; }
.prose .discoveries { margin-top: 36px; }
.prose .discoveries > p { color: #c9ced8; }
.prose .wp-block-details { margin: 10px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0; }
.prose .wp-block-details summary { cursor: pointer; padding: 12px 16px; font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: 18px; color: #fff; list-style: none; display: flex; align-items: center; gap: 10px; }
.prose .wp-block-details summary::-webkit-details-marker { display: none; }
.prose .wp-block-details summary::before { content: "\25B8"; color: var(--accent); transition: transform .15s; }
.prose .wp-block-details[open] summary::before { transform: rotate(90deg); }
.prose .wp-block-details summary:hover { color: var(--accent2); }
.prose .wp-block-details summary .n { margin-left: auto; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.prose .wp-block-details > ul { margin: 0; padding: 4px 18px 14px 34px; border-top: 1px solid var(--line); }
.prose .wp-block-details li { margin: 10px 0; }
.prose .wp-block-details li ul { margin: 6px 0; padding-left: 20px; }
.prose .wp-block-details li li { margin: 4px 0; }
.prose .wp-block-details strong { color: var(--accent2); }
.prose .ref { color: var(--muted); font-size: 13.5px; }
.prose .disc-more { margin-top: 14px; font-size: 15px; }
@media (max-width: 600px) { .prose .wp-block-details > ul { padding: 2px 12px 12px 26px; } }

/* "Verify a download" (1.1.7) */
.verify { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.verify summary { cursor: pointer; display: inline-block; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.verify summary::-webkit-details-marker { display: none; }
.verify summary:hover { color: var(--accent2); }
.verify[open] { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 4px; text-align: left; }
.verify[open] summary { color: var(--text, inherit); text-decoration: none; font-weight: 700; margin-bottom: 4px; }
.verify p { margin: 8px 0; }
.verify a { color: var(--muted); }
.verify code.key { word-break: break-all; }
.verify pre { margin: 6px 0 10px; padding: 10px 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 6px; white-space: pre; }
