/*
Theme Name:   Security Events
Theme URI:    https://security-events.com/blog/
Author:       Security Events
Description:  Minimal dark theme for the Security Events blog — same look as the live app (public/index.php, public/event.php). Kept in the security-events repo (secev-wordpress-theme/) and deployed by GitHub Actions; edit it there, not in wp-admin.
Version:      1.5.0
Requires at least: 6.4
Requires PHP: 8.0
License:      GPL-2.0-or-later
Text Domain:  secev
*/

/* Tokens copied from public/event.php — keep them in sync with the app. */
:root {
  --bg: #0e1013;
  --surface: #15171b;
  --surface-raised: #1a1c21;
  --border: #24262c;
  --border-soft: #1c1e23;
  --text: #e8e8e6;
  --text-muted: #8b8d94;
  --text-faint: #5c5e64;
  --accent: #3fa9a0;
  --accent-dim: #2a6f69;
  --accent-wash: rgba(63, 169, 160, 0.1);
  --red-bg: #ef4444;
  --amber-bg: #f59e0b;
  --yellow-bg: #c9c46a;
  --green-bg: #22c55e;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

img { max-width: 100%; height: auto; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; z-index: 100;
  top: 0.5rem; left: 0.5rem; padding: 0.5rem 0.9rem;
  background: var(--accent); color: var(--bg); border-radius: 6px;
}

.page { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* ---- Header (same block as the app's home page) ---- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
  padding-bottom: 1.25rem; border-bottom: 0.5px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { height: 2.6rem; width: auto; }
.brand-name { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
.brand-tag { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.site-nav a {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted); background: var(--surface-raised);
  border: 0.5px solid var(--border); border-radius: 20px; padding: 0.35rem 0.75rem; white-space: nowrap;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.site-nav .live-link { display: inline-flex; align-items: center; gap: 0.45rem; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 169, 160, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(63, 169, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 169, 160, 0); }
}

/* ---- Archive heading ---- */
.archive-head { margin-bottom: 1.5rem; }
.archive-head h1 { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.3rem; letter-spacing: -0.01em; }
.archive-head .archive-description { color: var(--text-muted); font-size: 0.92rem; }
.archive-head .archive-description p { margin: 0; }

/* ---- Post list: cards like the app's event cards ---- */
.post-list { display: grid; gap: 0.9rem; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-dim);
  border-radius: 10px; padding: 1.2rem 1.4rem;
}
.post-card:hover { border-left-color: var(--accent); }
.post-card .thumb { display: block; margin: -1.2rem -1.4rem 1rem; }
.post-card .thumb img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 9px 9px 0 0; }
.post-card h2 { font-size: 1.12rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.45rem; text-wrap: balance; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); }
.post-card .excerpt { color: var(--text-muted); font-size: 0.92rem; }
.post-card .excerpt p { margin: 0; }

/* ---- Chips + meta (event.php) ---- */
.eyebrow-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 500; padding: 3px 9px; border-radius: 100px;
  background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border);
}
a.chip:hover { color: var(--accent); border-color: var(--accent-dim); text-decoration: none; }
.meta { font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint); }
.meta a { color: var(--text-muted); }

/* ---- Single post / page ---- */
.crumb { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1.5rem; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }

.entry {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-dim);
  border-radius: 10px; padding: 1.9rem 1.9rem 1.6rem;
}
.entry-title { font-size: 1.75rem; font-weight: 600; line-height: 1.25; margin: 0 0 0.8rem; text-wrap: balance; letter-spacing: -0.015em; }
.entry .meta {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.3rem;
  padding: 0.8rem 0; margin-bottom: 1.4rem;
  border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
}
.affiliate-notice {
  margin: -0.6rem 0 1.4rem; padding: 0.6rem 0.85rem;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.8rem; color: var(--text-muted);
}
.affiliate-notice a { color: var(--accent); }
.entry-thumb { margin: 0 0 1.5rem; }
.entry-thumb img { display: block; border-radius: 8px; border: 1px solid var(--border); }

/* Long-form content: the block editor's output */
.entry-content { font-size: 1.02rem; overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: 1.15rem; }
.entry-content h2, .entry-content h3, .entry-content h4 { line-height: 1.3; letter-spacing: -0.01em; margin-top: 2rem; margin-bottom: 0.7rem; }
.entry-content h2 { font-size: 1.3rem; font-weight: 600; }
.entry-content h3 { font-size: 1.1rem; font-weight: 600; }
.entry-content h4 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content li { margin-bottom: 0.35rem; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 2px; }
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content hr, .wp-block-separator { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.entry-content blockquote, .wp-block-quote {
  margin-left: 0; margin-right: 0; padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--text-muted);
}
.wp-block-quote cite, .wp-block-pullquote cite { font-size: 0.82rem; color: var(--text-faint); font-style: normal; }
.wp-block-pullquote { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.5rem 0; text-align: center; }
.entry-content code, .entry-content kbd {
  font-family: var(--mono); font-size: 0.88em; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 4px; padding: 0.1em 0.35em;
}
.entry-content pre, .wp-block-code {
  font-family: var(--mono); font-size: 0.85rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto;
}
.entry-content pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.entry-content table, .wp-block-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--surface-raised); font-weight: 600; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-element-caption { font-size: 0.78rem; color: var(--text-faint); text-align: center; margin-top: 0.5rem; }
.entry-content img { border-radius: 6px; }
.alignleft { float: left; margin: 0.3rem 1.2rem 0.8rem 0; }
.alignright { float: right; margin: 0.3rem 0 0.8rem 1.2rem; }
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry-content::after { content: ''; display: table; clear: both; }

/* Buttons (block editor + comment form): the app's .btn-source */
.wp-block-button__link, .wp-element-button, .button, input[type="submit"], button.submit {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--accent-wash); color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 6px;
  padding: 8px 14px; font: 500 0.88rem/1.4 'Inter', system-ui, sans-serif;
  text-decoration: none !important; transition: background 120ms ease;
}
.wp-block-button__link:hover, .wp-element-button:hover, .button:hover, input[type="submit"]:hover {
  background: rgba(63, 169, 160, 0.18); color: var(--accent);
}

/* A "panel" group for affiliate boxes, key takeaways, kit lists… (Group block → Additional CSS class "panel") */
.panel, .wp-block-group.panel {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.3rem;
}
.panel > :last-child { margin-bottom: 0; }

.tags { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---- Share buttons (end of each post) ---- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--border-soft); }
.share-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-right: 0.3rem; }
.share-btn {
  display: inline-flex; align-items: center; cursor: pointer;
  font: 500 0.8rem/1.3 'Inter', system-ui, sans-serif;
  color: var(--text-muted); background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: 100px; padding: 5px 12px;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-wash); text-decoration: none; }

/* ---- Post navigation + pagination ---- */
.post-navigation, .pagination { margin-top: 1.5rem; }
.post-navigation .nav-links, .pagination .nav-links { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.post-navigation a {
  display: block; flex: 1 1 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 0.95rem; color: var(--text); font-size: 0.9rem;
}
.post-navigation a:hover { border-color: var(--accent-dim); text-decoration: none; }
.post-navigation .nav-label { display: block; font-size: 0.72rem; color: var(--text-faint); margin-bottom: 2px; }
.post-navigation .nav-next { text-align: right; }
.pagination .nav-links { justify-content: center; }
.pagination .page-numbers {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted);
  background: var(--surface-raised); border: 0.5px solid var(--border); border-radius: 20px; padding: 0.35rem 0.75rem;
}
.pagination .page-numbers.current { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.pagination a.page-numbers:hover { color: var(--text); text-decoration: none; }

/* ---- Panels under the post (event.php's .panel) ---- */
.box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem 1.5rem; margin-top: 1rem;
}
.box h2, .box .comment-reply-title {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 0.9rem;
}
.box p:last-child { margin-bottom: 0; }
.live-cta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.92rem; color: var(--text-muted); }

/* ---- Forms ---- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.55rem 0.7rem;
  font: 0.92rem/1.4 'Inter', system-ui, sans-serif;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
label { font-size: 0.8rem; color: var(--text-muted); }
.search-form { display: flex; gap: 0.5rem; }
.search-form label { flex: 1; }

/* ---- Comments ---- */
.comment-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.2rem; border-left: 1px solid var(--border); }
.comment-body { padding: 0.8rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.92rem; }
.comment-meta { font-size: 0.78rem; color: var(--text-faint); }
.comment-meta a { color: var(--text-muted); }
.comment-author .avatar { display: none; }
.comment-author .fn { color: var(--text); font-style: normal; font-weight: 500; }
.comment-form p { margin: 0 0 0.8rem; }
.comment-notes, .logged-in-as { font-size: 0.8rem; color: var(--text-faint); }

/* ---- Widgets (sidebar under posts — future partner banners) ---- */
.widget { margin-bottom: 1rem; font-size: 0.9rem; }
.widget:last-child { margin-bottom: 0; }
.widget ul { margin: 0; padding-left: 1.1rem; }

/* ---- Footer (same text style as the app's footer) ---- */
.site-footer {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 0.5px solid var(--border);
  color: var(--text-faint); font-size: 0.75rem; line-height: 1.6;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer a { color: var(--text-muted); }
.footer-nav ul { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }

.empty { color: var(--text-faint); font-size: 0.92rem; }

@media (max-width: 560px) {
  .page { padding-top: 1.5rem; }
  .entry { padding: 1.3rem 1.15rem 1.2rem; }
  .entry-title { font-size: 1.45rem; }
  .post-card { padding: 1rem 1.1rem; }
  .post-card .thumb { margin: -1rem -1.1rem 0.9rem; }
  .box { padding: 1.1rem; }
  .alignleft, .alignright { float: none; margin: 0 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
  .wp-block-button__link, .button, .share-btn { transition: none; }
}
