/* =============================================
   IvSpin777 - Styles
   Mobile-first, single font family
   ============================================= */

:root {
  --primary: #312e81;
  --primary-light: #4338ca;
  --secondary: #6366f1;
  --accent: #d97706;
  --accent-hover: #b45309;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-mid: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --max-w: 1080px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary); color: #fff; padding: 0.5rem 1rem;
  border-radius: var(--radius); z-index: 1000;
}
.skip-link:focus { top: 0.5rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 1.5rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.25rem; font-weight: 700; color: var(--primary);
  text-decoration: none; letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; color: var(--primary-light); }

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s;
}

.main-nav { display: none; }
.main-nav.open {
  display: flex; flex-direction: column;
  position: absolute; top: 60px; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.main-nav a {
  display: block; padding: 0.75rem 1.5rem;
  color: var(--text); font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.main-nav a:hover { background: var(--bg); text-decoration: none; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .main-nav, .main-nav.open {
    display: flex; position: static;
    flex-direction: row; gap: 0.25rem;
    background: none; border: none; box-shadow: none;
  }
  .main-nav a {
    padding: 0.5rem 0.75rem; border: none; border-radius: var(--radius);
    font-size: 0.875rem;
  }
}

/* ---- Layout ---- */
main { min-height: 60vh; }
.section {
  padding: 3rem 1.5rem;
}
.section-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.narrow { max-width: 680px; margin: 0 auto; }
.medium { max-width: 780px; margin: 0 auto; }
.wide { max-width: 880px; margin: 0 auto; }

.section-alt { background: var(--surface); }
.section-dark {
  background: var(--primary); color: #e2e8f0;
}
.section-dark a { color: #a5b4fc; }

/* ---- Hero ---- */
.hero {
  padding: 3.5rem 1.5rem 3rem;
  background: var(--surface);
}
.hero-inner {
  max-width: 780px; margin: 0 auto;
}
.hero h1 {
  font-size: 2rem; font-weight: 800; line-height: 1.2;
  color: var(--primary); margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text-mid);
  line-height: 1.65; margin-bottom: 1.5rem;
  max-width: 600px;
}
.hero-meta {
  font-size: 0.8rem; color: var(--text-light);
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.hero-meta a { color: var(--text-light); text-decoration: underline; }

@media (min-width: 768px) {
  .hero { padding: 4.5rem 1.5rem 3.5rem; }
  .hero h1 { font-size: 2.5rem; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 0.7rem 1.5rem;
  border-radius: var(--radius); font-weight: 600;
  font-size: 0.95rem; cursor: pointer; border: none;
  transition: background 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent; color: var(--secondary);
  border: 1.5px solid var(--secondary);
}
.btn-outline:hover { background: var(--secondary); color: #fff; }

/* ---- Typography ---- */
h2 {
  font-size: 1.5rem; font-weight: 700; color: var(--primary);
  margin-bottom: 1rem; line-height: 1.3;
}
h3 {
  font-size: 1.15rem; font-weight: 600; color: var(--text);
  margin-bottom: 0.5rem; line-height: 1.4;
}
p { margin-bottom: 1rem; }
.section p:last-child { margin-bottom: 0; }

/* ---- Pull Quote ---- */
.pull-quote {
  background: #eef2ff; border-left: 4px solid var(--secondary);
  padding: 1.5rem 2rem; margin: 2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem; color: var(--primary);
  font-style: italic;
}
.pull-quote cite {
  display: block; margin-top: 0.75rem;
  font-size: 0.85rem; font-style: normal;
  color: var(--text-light);
}

/* ---- Numbered Steps (Services) ---- */
.step-list { list-style: none; padding: 0; }
.step-item {
  display: flex; gap: 1.5rem; padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 48px; height: 48px;
  background: var(--primary); color: #fff;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 1.1rem;
}
.step-content h3 { margin-bottom: 0.5rem; }
.step-content p { color: var(--text-mid); margin-bottom: 0.5rem; }
.step-scope {
  font-size: 0.85rem; color: var(--text-light);
  background: var(--bg); padding: 0.5rem 0.75rem;
  border-radius: var(--radius); margin-top: 0.75rem;
  display: inline-block;
}

/* ---- Article Cards (asymmetric) ---- */
.article-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
}
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: box-shadow 0.15s;
}
.article-card:hover { box-shadow: var(--shadow); }
.article-card-featured {
  padding: 2rem;
  border-left: 4px solid var(--accent);
}
.article-card h3 {
  font-size: 1.1rem; margin-bottom: 0.5rem;
}
.article-card-featured h3 {
  font-size: 1.3rem;
}
.article-card .meta {
  font-size: 0.8rem; color: var(--text-light);
  margin-bottom: 0.75rem;
}
.article-card .excerpt {
  font-size: 0.9rem; color: var(--text-mid); line-height: 1.6;
}
.article-card .read-more {
  display: inline-block; margin-top: 0.75rem;
  font-size: 0.85rem; font-weight: 600;
}

@media (min-width: 768px) {
  .article-grid {
    grid-template-columns: 1.5fr 1fr;
  }
  .article-card-featured {
    grid-row: span 2;
  }
}

/* ---- FAQ ---- */
.faq-list { list-style: none; padding: 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600; font-size: 1rem;
  color: var(--text); margin-bottom: 0.5rem;
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: '+'; font-size: 1.25rem; color: var(--text-light);
  transition: transform 0.2s;
}
.faq-item.open .faq-q::after {
  content: '-';
}
.faq-a {
  font-size: 0.95rem; color: var(--text-mid);
  line-height: 1.65; display: none;
  padding-top: 0.25rem;
}
.faq-item.open .faq-a { display: block; }

/* ---- About Page ---- */
.about-hero {
  padding: 3rem 1.5rem; background: var(--surface);
}
.about-hero h1 {
  font-size: 2rem; font-weight: 800;
  color: var(--primary); margin-bottom: 0.5rem;
}
.about-hero .subtitle {
  font-size: 1rem; color: var(--text-light);
}
.author-card {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--bg); padding: 1.5rem;
  border-radius: var(--radius-lg); margin: 2rem 0;
}
.author-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  flex-shrink: 0; background: var(--border);
}
.author-info h3 { margin-bottom: 0.25rem; }
.author-info p {
  font-size: 0.9rem; color: var(--text-mid);
  margin-bottom: 0.25rem;
}

/* ---- Contact ---- */
.contact-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; }
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 0.35rem; color: var(--text);
}
.form-group input,
.form-group textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.95rem;
  color: var(--text); background: var(--surface);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.contact-details { font-size: 0.9rem; }
.contact-details dt {
  font-weight: 600; color: var(--text);
  margin-top: 1rem;
}
.contact-details dt:first-child { margin-top: 0; }
.contact-details dd {
  color: var(--text-mid); margin-left: 0;
  line-height: 1.6;
}

/* ---- Article Pages ---- */
.article-header {
  padding: 3rem 1.5rem 2rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.article-header-inner {
  max-width: 780px; margin: 0 auto;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: 0.8rem; color: var(--text-light);
  margin-bottom: 1rem;
}
.article-meta span { white-space: nowrap; }
.article-header h1 {
  font-size: 1.75rem; font-weight: 800;
  color: var(--primary); line-height: 1.3;
  margin-bottom: 1rem;
}
.article-summary {
  font-size: 1.05rem; color: var(--text-mid);
  line-height: 1.65; padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.article-body {
  padding: 2.5rem 1.5rem;
}
.article-body-inner {
  max-width: 780px; margin: 0 auto;
}
.article-body h2 {
  margin-top: 2.5rem; margin-bottom: 1rem;
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
  margin-top: 2rem; margin-bottom: 0.75rem;
}
.article-body p { line-height: 1.75; }
.article-body ul, .article-body ol {
  margin-bottom: 1rem; line-height: 1.7;
}
.article-body li { margin-bottom: 0.35rem; }
.article-body blockquote {
  border-left: 3px solid var(--secondary);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  background: #f8faff; border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-mid);
}

.article-table {
  width: 100%; border-collapse: collapse;
  margin: 1.5rem 0; font-size: 0.9rem;
}
.article-table th, .article-table td {
  padding: 0.65rem 0.85rem; text-align: left;
  border: 1px solid var(--border);
}
.article-table th {
  background: var(--bg); font-weight: 600;
  color: var(--text);
}
.article-table td { color: var(--text-mid); }

.article-footer {
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
}
.article-footer-inner {
  max-width: 780px; margin: 0 auto;
}
.refs-section { margin-bottom: 2rem; }
.refs-section h3 {
  font-size: 0.95rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.refs-section ol {
  font-size: 0.85rem; color: var(--text-mid);
  line-height: 1.8;
}
.related-links {
  background: var(--bg); padding: 1.5rem;
  border-radius: var(--radius-lg);
}
.related-links h3 {
  font-size: 0.95rem; margin-bottom: 0.75rem;
}
.related-links ul {
  list-style: none; padding: 0;
}
.related-links li {
  padding: 0.35rem 0;
}
.related-links a {
  font-size: 0.9rem;
}

/* ---- Legal Pages ---- */
.legal-header {
  padding: 3rem 1.5rem 1.5rem; background: var(--surface);
}
.legal-header h1 {
  font-size: 1.75rem; font-weight: 800;
  color: var(--primary); max-width: 780px; margin: 0 auto;
}
.legal-body {
  padding: 2rem 1.5rem 3rem;
}
.legal-body-inner {
  max-width: 780px; margin: 0 auto;
}
.legal-body h2 {
  margin-top: 2rem; margin-bottom: 0.75rem;
  font-size: 1.2rem;
}
.legal-body p, .legal-body ul {
  font-size: 0.95rem; color: var(--text-mid);
  line-height: 1.7;
}
.legal-body ul { margin-bottom: 1rem; }

/* ---- 404 ---- */
.error-page {
  min-height: 60vh; display: flex;
  align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.5rem;
}
.error-page h1 {
  font-size: 4rem; color: var(--primary);
  font-weight: 800; margin-bottom: 0.5rem;
}
.error-page p {
  font-size: 1.05rem; color: var(--text-mid);
  margin-bottom: 1.5rem; max-width: 400px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--primary); color: #cbd5e1;
  padding: 2.5rem 1.5rem 1.5rem;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-col h4 {
  color: #fff; font-size: 0.9rem;
  margin-bottom: 0.75rem; font-weight: 600;
}
.footer-col p { line-height: 1.6; margin-bottom: 0.5rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a {
  color: #a5b4fc; font-size: 0.85rem;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 0.5rem; font-size: 0.8rem; color: #94a3b8;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem; color: var(--text-light);
  max-width: var(--max-w); margin: 0 auto;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb span { margin: 0 0.35rem; }

/* ---- Placeholder warning ---- */
.placeholder-warn {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #991b1b; padding: 0.5rem 0.75rem;
  border-radius: var(--radius); font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* ---- Image containers ---- */
.img-placeholder {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light); font-size: 0.85rem;
  font-weight: 500; min-height: 200px;
  border: 2px dashed #c7d2fe;
}

/* ---- Print ---- */
@media print {
  .site-header, .site-footer, .nav-toggle { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
