/* =========================================================
   MyAVLock — Editorial Technology & Security Publication
   ========================================================= */

:root {
  --ink: #0B1F3A;
  --ink-soft: #16305A;
  --signal: #0FA6A6;
  --signal-deep: #0B7E7E;
  --paper: #FBFAF7;
  --paper-raised: #FFFFFF;
  --line: #E4E2DA;
  --ash: #5B6472;
  --text: #1B2430;
  --amber: #A9660E;
  --violet: #55589E;
  --danger: #B23A3A;

  --font-display: -apple-system, "Segoe UI Semibold", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --maxw: 1180px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(11,31,58,0.06);
  --shadow-md: 0 8px 24px rgba(11,31,58,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--signal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 1.6rem + 1.8vw, 3.05rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.05rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1.15em; }
.lede { font-size: 1.2rem; color: var(--ash); line-height: 1.55; }

ul, ol { padding-left: 1.35em; }
li { margin-bottom: 0.5em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 18px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* =============== Header =============== */
.site-header {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name b { color: var(--signal-deep); }

.main-nav { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav a {
  color: var(--ink-soft); font-weight: 600; font-size: 0.96rem;
  padding: 10px 12px; border-radius: 8px; display: block;
}
.main-nav a:hover { background: #EFF6F5; text-decoration: none; color: var(--signal-deep); }
.main-nav a[aria-current="page"] { color: var(--signal-deep); background: #EFF6F5; }

.nav-toggle {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.mobile-nav {
  display: none; flex-direction: column; border-top: 1px solid var(--line);
  background: var(--paper-raised);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 14px 24px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-weight: 600;
}

@media (min-width: 900px) {
  .main-nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* =============== Buttons / small UI =============== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.95rem;
  padding: 12px 20px; border-radius: 8px;
  border: 2px solid var(--ink);
  color: var(--ink); background: transparent;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn-solid { background: var(--signal-deep); border-color: var(--signal-deep); color: #fff; }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); }

.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 5px 10px; border-radius: 999px;
  background: #EFF6F5; color: var(--signal-deep);
}
.tag-security { background: #E9F6F6; color: var(--signal-deep); }
.tag-payments { background: #EAF0FA; color: var(--ink-soft); }
.tag-privacy { background: #EFEFF7; color: var(--violet); }
.tag-safety { background: #FBF1E4; color: var(--amber); }
.tag-software { background: #F1F1EE; color: #5B5B52; }

/* =============== Hero =============== */
.hero {
  background: linear-gradient(180deg, #0B1F3A 0%, #0E2A4F 100%);
  color: #fff;
  padding: 64px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; position: relative; z-index: 2; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; } }
.hero-eyebrow {
  display: inline-block; color: #7FE3E3; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.78rem; margin-bottom: 14px;
}
.hero h1 { color: #fff; margin-bottom: 0.4em; }
.hero p.lede { color: #C7D3E6; }
.hero-graphic { width: 100%; max-width: 420px; margin: 0 auto; }

/* =============== Sections =============== */
.section { padding: 56px 0; }
.section-alt { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { color: var(--signal-deep); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; display: block; margin-bottom: 6px; }
.section-link { font-weight: 700; font-size: 0.93rem; white-space: nowrap; }

/* =============== Cards / Grids =============== */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-media { aspect-ratio: 16/10; background: #EFF3F6; }
.card-media svg { width: 100%; height: 100%; }
.card-body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 1.08rem; margin: 0; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--signal-deep); text-decoration: none; }
.card-excerpt { color: var(--ash); font-size: 0.93rem; margin: 0; flex: 1; }
.card-meta { font-size: 0.78rem; color: var(--ash); display: flex; gap: 10px; align-items: center; }

.featured-card {
  display: grid; grid-template-columns: 1fr; gap: 28px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
@media (min-width: 800px) { .featured-card { grid-template-columns: 1fr 1fr; } }
.featured-media { background: linear-gradient(135deg,#0B1F3A,#123A5E); display:flex; align-items:center; justify-content:center; padding: 24px; }
.featured-media svg { width: 100%; max-width: 320px; }
.featured-body { padding: 32px 32px 32px 0; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 799px) { .featured-body { padding: 0 24px 28px; } }

/* Topic browse */
.topic-tile {
  display: block; padding: 22px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper-raised); color: var(--ink);
}
.topic-tile:hover { border-color: var(--signal); text-decoration: none; box-shadow: var(--shadow-sm); }
.topic-tile h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.topic-tile p { margin: 0; color: var(--ash); font-size: 0.88rem; }
.topic-icon { width: 34px; height: 34px; color: var(--signal-deep); }

/* Newsletter */
.newsletter {
  background: var(--ink); color: #fff; border-radius: 16px; padding: 40px;
  display: grid; gap: 24px;
}
@media (min-width: 800px) { .newsletter { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.newsletter h2 { color: #fff; }
.newsletter p { color: #C7D3E6; margin-bottom: 0; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter-form input[type="email"] {
  flex: 1 1 220px; padding: 13px 14px; border-radius: 8px; border: none; font-size: 0.95rem;
}
.newsletter-note { font-size: 0.78rem; color: #9FB0C9; margin-top: 10px; }

/* =============== Footer =============== */
.site-footer { background: var(--ink); color: #C7D3E6; padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: #fff; margin-bottom: 10px; }
.footer-tagline { color: #93A4BE; font-size: 0.9rem; max-width: 320px; }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #C7D3E6; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #223A5E; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; color: #7F91AC; font-size: 0.82rem; }
.footer-disclosure {
  background: #0E2A4F; border: 1px solid #1E3F66; border-radius: 10px; padding: 18px 20px;
  font-size: 0.83rem; color: #A9BAD3; margin-bottom: 32px; line-height: 1.55;
}

/* =============== Breadcrumbs =============== */
.breadcrumb { font-size: 0.85rem; color: var(--ash); margin: 20px 0; }
.breadcrumb a { color: var(--ash); }
.breadcrumb a:hover { color: var(--signal-deep); }
.breadcrumb .sep { margin: 0 6px; color: #C6C9CE; }

/* =============== Article layout =============== */
.article-header { padding: 18px 0 32px; border-bottom: 1px solid var(--line); }
.article-header .tag { margin-bottom: 14px; }
.article-header h1 { margin-bottom: 14px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--ash); font-size: 0.88rem;
  padding-top: 14px; border-top: 1px solid var(--line); margin-top: 18px;
}
.article-meta .byline { font-weight: 700; color: var(--ink-soft); }
.article-hero { margin: 32px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.article-hero svg { width: 100%; display: block; }

.article-layout { display: grid; grid-template-columns: 1fr; gap: 40px; padding: 40px 0 64px; }
@media (min-width: 960px) { .article-layout { grid-template-columns: 220px minmax(0,1fr); } }
.article-layout.no-toc { grid-template-columns: 1fr; }

.toc { position: sticky; top: 90px; align-self: start; }
.toc h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ash); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 0 7px 14px; font-size: 0.86rem; color: var(--ash); border-left: 2px solid transparent; margin-left: -2px;
}
.toc a:hover { color: var(--signal-deep); text-decoration: none; border-left-color: var(--signal); }

.article-body h2 { margin-top: 1.6em; padding-top: 0.2em; scroll-margin-top: 90px; }
.article-body h3 { margin-top: 1.3em; scroll-margin-top: 90px; }
.article-body p, .article-body li { color: var(--text); }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.92rem; }
.article-body caption { text-align: left; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article-body th { background: #F2F5F4; color: var(--ink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.article-body tbody tr:nth-child(even) { background: #FCFCFA; }
.article-body blockquote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--signal); background: #F5FAFA;
  border-radius: 0 8px 8px 0; color: var(--ink-soft);
}
.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--ink); background: var(--paper-raised);
  border-radius: 0 10px 10px 0; padding: 18px 20px; margin: 1.6em 0;
}
.callout h4 { margin: 0 0 8px; font-size: 0.95rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-disclosure { border-left-color: var(--signal-deep); background: #F2FAFA; }
.callout-warn { border-left-color: var(--danger); background: #FBF3F3; }

.ad-slot {
  border: 1px dashed #C7CCD3; border-radius: 10px; padding: 18px; text-align: center;
  color: #8A93A0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 2em 0;
  background: #F5F5F3;
}

.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item h3 { font-size: 1rem; margin-bottom: 8px; }
.faq-item p { color: var(--ash); margin: 0; }

.reading-progress { position: sticky; top: 0; height: 3px; background: var(--line); z-index: 99; }
.reading-progress-bar { height: 100%; width: 0; background: var(--signal); }

.related-grid { margin-top: 20px; }

.author-box {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--paper-raised); margin: 2.4em 0;
}
.author-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--ink);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
}
.author-box h4 { margin: 0 0 4px; }
.author-box p { margin: 0; color: var(--ash); font-size: 0.9rem; }

/* =============== Page header (non-article) =============== */
.page-header { padding: 44px 0 36px; border-bottom: 1px solid var(--line); background: var(--paper-raised); }
.page-header h1 { margin-bottom: 10px; }
.page-header p { color: var(--ash); max-width: 68ch; margin: 0; }

/* Prose (legal pages) */
.prose { max-width: 78ch; padding: 40px 0 64px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.2em; }
.prose ul { margin-bottom: 1.2em; }

/* Contact / forms */
.form-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; color: var(--ink-soft); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #CBD1D8; border-radius: 8px; font: inherit; background: #fff;
}
.form-row textarea { resize: vertical; min-height: 120px; }
.contact-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.1fr; } }
.contact-card { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-card h3 { margin-bottom: 4px; font-size: 1rem; }
.contact-card p { margin: 0; color: var(--ash); font-size: 0.92rem; }

/* 404 */
.error-page { text-align: center; padding: 100px 0; }
.error-page .code { font-family: var(--font-display); font-size: 5rem; font-weight: 800; color: var(--signal); line-height: 1; }

/* Sitemap */
.sitemap-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .sitemap-grid { grid-template-columns: repeat(3, 1fr); } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
