/* AMT Guns – static archive styles */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #646a72;
  --line: #e2ddd2;
  --accent: #9a6a1c;        /* brass */
  --accent-strong: #7c5313;
  --accent-soft: #f3e8d3;
  --head: #1b1f23;          /* gunmetal header, both themes */
  --head-2: #262b31;
  --head-text: #e9e6df;
  --head-muted: #9aa1a9;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Oswald", "Bahnschrift", "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --surface: #1a1d21; --text: #e6e3dc; --muted: #9aa1a9; --line: #2c3137;
    --accent: #d6a24a; --accent-strong: #e8b965; --accent-soft: #2e2618; --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1a1d21; --text: #e6e3dc; --muted: #9aa1a9; --line: #2c3137;
  --accent: #d6a24a; --accent-strong: #e8b965; --accent-soft: #2e2618; --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header { background: var(--head); color: var(--head-text); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.bar { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-text); text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { font: 700 15px/1 var(--font-head); letter-spacing: .08em; background: linear-gradient(135deg,#d9a84e,#8c5f17); color: #1b1f23; padding: 8px 8px; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font: 600 19px/1.1 var(--font-head); letter-spacing: .03em; text-transform: uppercase; }
.brand-text small { color: var(--head-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search { margin-left: auto; }
.header-search input { width: 240px; background: var(--head-2); border: 1px solid #3a4048; color: var(--head-text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; }
.header-search input::placeholder { color: var(--head-muted); }
.header-search input:focus { outline: 2px solid #d6a24a; outline-offset: 1px; }
.menu-toggle { display: none; }

/* ---------- navigation (desktop: dropdowns) ---------- */
.site-nav { background: var(--head-2); border-top: 1px solid #30363d; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--head-text); text-decoration: none; display: block; }
.site-nav .menu-l0 { max-width: 1120px; margin: 0 auto; padding: 0 8px; display: flex; flex-wrap: wrap; }
.site-nav .menu-l0 > li { position: relative; }
.site-nav .menu-l0 > li > a { padding: 11px 12px; font: 500 14px/1.2 var(--font); letter-spacing: .02em; }
.site-nav .menu-l0 > li > a:hover, .site-nav .menu-l0 > li:focus-within > a { color: #f0c46f; }
.site-nav .has-kids > a::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.site-nav li ul { display: none; position: absolute; min-width: 240px; background: var(--head); border: 1px solid #353b42; border-radius: 8px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 60; }
.site-nav .menu-l0 > li > ul { top: 100%; left: 0; }
.site-nav li li { position: relative; }
.site-nav li li > a { padding: 7px 10px; border-radius: 5px; font-size: 14px; }
.site-nav li li > a:hover { background: var(--head-2); color: #f0c46f; }
.site-nav li li.has-kids > a::after { transform: translateY(-1px) rotate(-45deg); float: right; margin-top: 8px; }
.site-nav li li > ul { top: -7px; left: 100%; }
.site-nav li:hover > ul, .site-nav li:focus-within > ul { display: block; }
.site-nav .menu-l0 > li:nth-last-child(-n+2) > ul { left: auto; right: 0; }
.site-nav .menu-l0 > li:nth-last-child(-n+2) li > ul { left: auto; right: 100%; }
.sub-toggle { display: none; }

/* ---------- mobile nav ---------- */
@media (max-width: 860px) {
  .header-search { display: none; }
  .menu-toggle { display: block; margin-left: auto; width: 42px; height: 38px; border: 1px solid #3a4048; background: var(--head-2); border-radius: 8px; cursor: pointer; position: relative; }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { position: absolute; left: 11px; width: 18px; height: 2px; background: var(--head-text); content: ""; }
  .menu-toggle span { top: 18px; } .menu-toggle span::before { top: -6px; left: 0; } .menu-toggle span::after { top: 6px; left: 0; }
  .site-nav { display: none; max-height: calc(100vh - 60px); overflow-y: auto; }
  .site-nav.open { display: block; }
  .site-nav .menu-l0 { display: block; padding: 6px 8px 12px; }
  .site-nav li { position: relative; }
  .site-nav li ul, .site-nav li:hover > ul, .site-nav li:focus-within > ul { display: none; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; min-width: 0; }
  .site-nav li.open > ul { display: block; }
  .site-nav a, .site-nav .menu-l0 > li > a, .site-nav li li > a { padding: 10px 46px 10px 8px; font-size: 15px; border-bottom: 1px solid #2f353c; border-radius: 0; }
  .site-nav .has-kids > a::after { display: none; }
  .sub-toggle { display: block; position: absolute; right: 0; top: 2px; width: 40px; height: 38px; background: none; border: 0; color: var(--head-text); cursor: pointer; }
  .sub-toggle::before { content: ""; display: block; margin: 0 auto; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
  li.open > .sub-toggle::before { transform: rotate(-135deg); }
}

/* ---------- page body ---------- */
main.wrap { padding-top: 22px; padding-bottom: 48px; min-height: 60vh; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px clamp(16px, 4vw, 40px) 36px; box-shadow: var(--shadow); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.page-title { font: 600 clamp(26px, 4vw, 36px)/1.15 var(--font-head); letter-spacing: .01em; margin: 0 0 18px; }
.post-date { margin: -10px 0 18px; color: var(--muted); font-size: 14px; }
.section-h { font: 600 15px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.content { overflow-wrap: anywhere; }
.content > :first-child { margin-top: 0; }
.content h2, .content h3 { font-family: var(--font-head); font-weight: 600; }
.content ul { padding-left: 1.3em; }
.content li { margin: 3px 0; }
.content table { border-collapse: collapse; width: 100%; margin: 16px 0; display: block; overflow-x: auto; }
.content td, .content th { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.content tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.content img { border-radius: 6px; }
.content .alignleft { float: left; margin: 4px 20px 12px 0; }
.content .alignright { float: right; margin: 4px 0 12px 20px; }
.content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) { .content .alignleft, .content .alignright { float: none; margin: 12px auto; display: block; } }
.content .wp-caption { max-width: 100% !important; margin: 16px auto; }
.content .wp-caption-text, .content figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.content figure { margin: 0; }

/* WordPress galleries -> responsive grid */
.content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.content .gallery-item { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.content .gallery-icon img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: 0; transition: transform .25s; }
.content .gallery-icon a { display: block; overflow: hidden; }
.content .gallery-icon a:hover img { transform: scale(1.04); }
.content .gallery-item figcaption { padding: 6px 8px 8px; margin: 0; }
.content .gallery br { display: none; }

/* child-page link lists from WordPress plugins */
.content ul.wp-block-oik-sb-children, .content .ccchildpages_list { columns: 2 260px; }

/* PDF links */
.content a.pdf { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 8px; text-decoration: none; font-weight: 500; line-height: 1.35; }
.content a.pdf::before { content: "PDF"; font: 700 10px/1 var(--font); letter-spacing: .05em; color: #fff; background: #b3412e; border-radius: 4px; padding: 5px 5px; flex: none; }
.content a.pdf:hover { border-color: var(--accent); }
.content a.pdf.missing { opacity: .55; text-decoration: line-through; }

/* video embeds */
.video { position: relative; aspect-ratio: 16/9; max-width: 720px; margin: 18px 0; border-radius: 8px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.button { display: inline-block; background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.button:hover { background: var(--accent-strong); color: #fff; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); color: var(--text); }
.card img, .card-ph { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--bg); border-radius: 0; }
.card-ph { background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 12px; color: var(--muted); }

/* ---------- home ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(214,162,74,.28), transparent 60%), linear-gradient(160deg, #22272d, #15181b); color: #ece8df; border-radius: 14px; padding: clamp(28px, 6vw, 56px) clamp(18px, 5vw, 48px); margin-bottom: 8px; }
.hero h1 { font: 600 clamp(30px, 5.5vw, 50px)/1.05 var(--font-head); margin: 6px 0 12px; letter-spacing: .01em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: #d6a24a; margin: 0; }
.lede { max-width: 640px; color: #c6c2b9; font-size: 17px; margin: 0 0 22px; }
.hero-search { display: flex; gap: 8px; max-width: 560px; }
.hero-search input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 10px; border: 1px solid #444b53; background: rgba(255,255,255,.07); color: inherit; font: inherit; }
.entry .hero-search input { background: var(--bg); border-color: var(--line); }
.hero-search button { padding: 0 20px; border: 0; border-radius: 10px; background: #d6a24a; color: #1b1f23; font: 600 15px var(--font); cursor: pointer; }
.hero-search button:hover { background: #e8b965; }
.home-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; align-items: start; }
.home-cols .entry img.alignleft { float: none; margin: 16px 0 0; }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 16px; }
.side .section-h { margin-top: 18px; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.post-list li:last-child { border: 0; }
.post-list span { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .home-cols { grid-template-columns: 1fr; } }

/* ---------- search ---------- */
.search-page input { width: 100%; font: inherit; font-size: 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.search-page input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.results { list-style: none; padding: 0; margin: 8px 0 0; }
.results li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.results a.r-title { font-weight: 600; font-size: 17px; text-decoration: none; }
.results a.r-title:hover { text-decoration: underline; }
.r-sec { font-size: 12px; color: var(--muted); margin: 2px 0; }
.r-snip { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.results mark { background: var(--accent-soft); color: var(--text); padding: 0 1px; border-radius: 2px; }
.badge { display: inline-block; font: 700 10px/1 var(--font); color: #fff; background: #b3412e; border-radius: 4px; padding: 4px 5px; margin-right: 6px; vertical-align: 2px; }

/* ---------- footer ---------- */
.site-footer { background: var(--head); color: var(--head-muted); padding: 26px 0 18px; font-size: 14px; }
.site-footer a { color: var(--head-text); }
.footer-cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-cols .right { text-align: right; }
.footer-note { margin-top: 14px; padding-top: 14px; border-top: 1px solid #2f353c; font-size: 12px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,11,12,.93); display: flex; align-items: center; justify-content: center; padding: 48px 56px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { color: #ddd; margin-top: 10px; font-size: 14px; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.2); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox { padding: 56px 8px; } .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; } }
.content a.missing { color: var(--muted); text-decoration: line-through; cursor: not-allowed; }

/* ---------- embedded PDF viewer ---------- */
.pdf-viewer { margin: 24px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.pdf-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface); }
.pdf-viewer.embedded .pdf-bar { border-bottom: 1px solid var(--line); }
.pdf-name { flex: 1 1 200px; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-name::before { content: "PDF"; font: 700 10px/1 var(--font); letter-spacing: .05em; color: #fff; background: #b3412e; border-radius: 4px; padding: 4px 5px; margin-right: 8px; vertical-align: 1px; }
.content a.pdf-btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.content a.pdf-btn:hover { border-color: var(--accent); color: var(--accent); }
.content a.pdf-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.content a.pdf-btn.primary:hover { background: var(--accent-strong); color: #fff; }
.pdf-viewer iframe { display: block; width: 100%; height: max(600px, 85vh); border: 0; background: #525659; }

/* inline download button beside PDF links */
.content a.pdf-dl { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; vertical-align: middle; line-height: 1.35; }
.content a.pdf-dl::before { content: ""; width: 10px; height: 10px; background: currentColor; -webkit-mask: linear-gradient(#000 0 0) 4px 0/2px 6px no-repeat, conic-gradient(from 135deg at 50% 70%, #000 90deg, #0000 0) 0 0/10px 8px no-repeat, linear-gradient(#000 0 0) 0 9px/10px 1.5px no-repeat; mask: linear-gradient(#000 0 0) 4px 0/2px 6px no-repeat, conic-gradient(from 135deg at 50% 70%, #000 90deg, #0000 0) 0 0/10px 8px no-repeat, linear-gradient(#000 0 0) 0 9px/10px 1.5px no-repeat; }
.content a.pdf-dl:hover { border-color: var(--accent); color: var(--accent); }

/* document library: list of PDFs + shared viewer */
.pdf-library .pdf-viewer { margin: 0; }
.pdf-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.pdf-list li { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.pdf-list li:last-child { border-bottom: 0; }
.pdf-list li.current { background: var(--accent-soft); border-left-color: var(--accent); }
.pdf-list .pdf-pick { display: block; font-weight: 600; text-decoration: none; color: var(--text); line-height: 1.35; }
.pdf-list .pdf-pick::before { content: "PDF"; font: 700 9px/1 var(--font); letter-spacing: .05em; color: #fff; background: #b3412e; border-radius: 3px; padding: 3px 4px; margin-right: 7px; vertical-align: 2px; }
.pdf-list .pdf-pick:hover { color: var(--accent); }
.pdf-meta { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.pdf-meta a { color: var(--accent); }
.pdf-lib-grid { display: grid; gap: 14px; }
.pdf-library:not(.embedded) .pdf-viewer { display: none; }
@media (min-width: 900px) {
  .pdf-library.embedded .pdf-lib-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .pdf-library.embedded .pdf-list { position: sticky; top: 120px; max-height: max(600px, 85vh); }
}
@media (min-width: 700px) and (max-width: 899px) { .pdf-library.embedded .pdf-list { max-height: 260px; } }
