/* === FONT === */
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* === DESIGN TOKENS (mirrored from iproxy.online) === */
:root {
  --brand-blue: #244EB3;
  --brand-blue-deep: #2C55B5;
  --text: rgba(0, 0, 0, 0.8);
  --surface: #fff;
  --surface-soft: #F2F3F7;     /* prod --b-100 */
  --surface-table: #F7F8FA;
  --surface-chip: #EBF5FF;
  --text-muted: #6583C9;
  --steel-700: #37546D;        /* prod --s-700 */
  --grad-footer: linear-gradient(250.86deg, #88B8E0 2.04%, #6388DA 97.97%);
  --radius-card: 12px;
  --radius-pill: 30px;
  --container-max: 1208px;
  --container-gap: 16px;
  --container-pad: 32px;
}
@media (max-width: 1024px) {
  :root {
    --container-gap: 12px;
    --container-pad: 20px;
  }
}

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', 'Montserrat Fallback', Arial, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: #244EB3; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* === SHARED PAGE CONTAINER ===
   One source of truth for the outer width of every full-page block.
   Override the relevant tokens (or add an inner element) — never re-declare
   width/max-width/margin/padding-inline on these selectors elsewhere. */
.site-header,
.blog-hero-inner,
.article-hero-inner,
.index-layout,
.article-layout {
  max-width: var(--container-max);
  width: calc(100% - var(--container-gap) * 2);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* === HEADER === */
.site-header {
  background: #fff;
  padding-top: 12px;
  padding-bottom: 12px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  margin-top: 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  position: relative;
  z-index: 100;
}
.body--article .site-header,
.body--blog-index .site-header {
  margin-bottom: 0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-menu {
  position: relative;
}
.nav-toggle {
  list-style: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle::marker { content: ""; }
.nav-toggle:hover { background: var(--surface-soft); }
.nav-toggle img { width: 22px; height: 22px; display: block; }
.nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  padding: 4px 0;
}
.nav-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #1a1f36;
}
.nav-dropdown a:hover { background: var(--surface-soft); text-decoration: none; }
.nav-dropdown .nav-divider {
  height: 1px;
  background: #e8eaed;
  margin: 4px 0;
}
.nav-dropdown a.nav-lang { font-size: 13px; padding: 8px 16px; color: #444; }
.nav-dropdown a.nav-lang.active { font-weight: 700; color: #244EB3; }
.site-logo {
  display: inline-flex;
  align-items: center;
}
.site-logo img { width: 144px; height: 22px; display: block; }
.site-logo:hover { text-decoration: none; }
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* === PAGE-TYPE BACKGROUNDS === */
.body--article { background: var(--brand-blue-deep); }
.body--blog-index { background: var(--surface-chip); }

/* === ARTICLE HERO (dark blue band, white text) === */
.article-hero {
  padding: 8px 0 28px;
}
.article-hero-inner { /* widths come from the shared container rule */ }
.article-hero .breadcrumbs {
  padding: 0;
  color: rgba(255, 255, 255, .65);
}
.article-hero .breadcrumbs a { color: #fff; }
.article-hero .breadcrumbs .sep { color: rgba(255, 255, 255, .55); }
.article-hero .article-title { color: #fff; }
.article-hero .article-cat-badge {
  background: #fff;
  color: var(--brand-blue);
}
.article-hero .article-cat-badge:hover { color: var(--brand-blue); }
.article-hero .author-row { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.article-hero .author-name { color: #fff; }
.article-hero .author-date { color: rgba(255, 255, 255, .75); }

/* Article content card sits below the hero on the colored body */
.body--article .article-layout {
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding-top: 32px;
}

/* === BLOG INDEX HERO (light blue, dark text) === */
.blog-hero-inner { /* widths come from the shared container rule */ }
.blog-hero { padding: 8px 0 24px; }
.blog-hero .breadcrumbs { padding: 0 0 8px; }
.blog-hero .blog-header { padding: 4px 0 16px; }
.blog-hero .category-tabs { padding: 0; }

.body--blog-index .blog-cards-band {
  background: #fff;
  padding-top: 32px;
}

/* === LANGUAGE SELECTOR === */
.lang-selector {
  position: relative;
}
.lang-current {
  background: #f0f2f5;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #244EB3;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.lang-current::-webkit-details-marker { display: none; }
.lang-current::marker { content: ""; }
.lang-current:hover { background: #e4e6ea; }
.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.lang-selector[open] .lang-dropdown { display: block; }
.lang-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #1a1f36;
}
.lang-dropdown a:hover { background: #f0f2f5; text-decoration: none; }
.lang-dropdown a.active { font-weight: 700; color: #244EB3; }

/* === BREADCRUMBS === */
.breadcrumbs {
  padding: 16px 40px 0;
  font-size: 13px;
  color: #888;
}
.breadcrumbs a { color: #244EB3; }
.breadcrumbs .sep {
  margin: 0 8px;
  color: #ccc;
  display: inline-block;
}

/* === BLOG INDEX === */
.blog-header {
  padding: 20px 40px 0;
}
.blog-header h1 {
  font-size: 45px;
  line-height: 55px;
  font-weight: 500;
  margin-bottom: 16px;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  max-width: 700px;
}
.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  flex: 1;
  color: #555;
}
.search-bar .search-icon {
  color: #888;
  font-size: 18px;
}

/* === CATEGORY TABS === */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 0 40px 24px;
  flex-wrap: wrap;
}
.cat-tab {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: #E2EDF9;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  transition: all .15s;
}
.cat-tab:hover { background: #d4e1f0; text-decoration: none; }
.cat-tab.active {
  background: var(--brand-blue);
  color: #fff;
}

/* === INDEX LAYOUT (cards + sidebar) === */
.index-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-areas: "cards sidebar";
  gap: 32px;
  padding-bottom: 20px;
}
.index-layout .cards-grid { grid-area: cards; }
.index-layout .sidebar { grid-area: sidebar; }

/* === ARTICLE CARDS === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.card {
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); transform: translateY(-2px); }
.card a { color: inherit; text-decoration: none; display: block; }
.card a:hover { text-decoration: none; }
.card-cover {
  aspect-ratio: 16 / 9;
  background: #e2edf9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 16px; }
.cat-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--brand-blue);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}
.card-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}
.card-stars {
  color: #67CDAA;
  font-size: 14px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.card-body .excerpt {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 12px;
  color: #999;
  display: flex;
  gap: 12px;
}

/* === SIDEBAR === */
.sidebar { position: sticky; top: 80px; }
.sidebar-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.sidebar-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #244EB3;
}
.sidebar-section ul { list-style: none; }
.sidebar-section li { margin-bottom: 10px; }
.sidebar-section li a {
  font-size: 14px;
  color: #244EB3;
  line-height: 1.4;
}
.toc-list li {
  font-size: 13px;
  margin-bottom: 8px;
  padding-left: 14px;
  position: relative;
}
.toc-list li::before {
  content: '•';
  color: #244EB3;
  position: absolute;
  left: 0;
}
.toc-list li.toc-h3 { padding-left: 28px; }
.toc-list li.toc-h3::before { left: 14px; }

/* === PAGINATION === */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 40px 40px;
}
.pagination a, .pagination span {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  background: var(--surface-chip);
  color: var(--text-muted);
}
.pagination .active {
  background: var(--brand-blue);
  color: #fff;
}
.pagination a { color: var(--text-muted); }
.pagination a:hover { background: #d8e6f5; text-decoration: none; }

/* === ARTICLE PAGE — TWO-COL LAYOUT === */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding-bottom: 40px;
}
.article-layout > * { min-width: 0; }

/* === ARTICLE HEADER === */
.article-title {
  font-size: 45px;
  font-weight: 500;
  line-height: 55px;
  margin: 16px 0 16px;
}
.article-cat-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--brand-blue);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.article-cat-badge:hover { text-decoration: none; color: #fff; }
.article-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.article-rating .stars { color: #67CDAA; letter-spacing: 1px; }
.article-rating .avg { font-weight: 600; }
.article-rating .votes { color: #888; }

/* === AUTHOR ROW === */
.author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.author-photo {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}
.author-name { font-weight: 600; font-size: 14px; }
.author-date {
  font-size: 13px;
  color: #888;
  display: flex;
  gap: 16px;
}
.share-links {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #888;
}
.share-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e8eef8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #244EB3;
}

/* === ARTICLE BODY (rendered markdown) === */
.article-body { font-size: 16px; line-height: 1.5; }
.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  margin: 36px 0 12px;
}
.article-body h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  margin: 28px 0 8px;
}
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border: 1px solid var(--brand-blue-deep);
  border-radius: 10px;
  padding: 24px 28px;
  background: #fff;
  margin: 24px 0;
  color: var(--text);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
/* Tables become their own horizontal-scroll container, so wide tables never
   push the article (or the page) wider than the viewport. `display: block`
   makes overflow-x effective on the table; `width: max-content` keeps small
   tables at their natural width instead of stretching them edge-to-edge. */
.article-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  font-size: 14px;
  background: var(--surface-table);
  border: 1px solid #e6e8ec;
  border-radius: 10px;
}
.article-body th, .article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid #e6e8ec;
  text-align: left;
}
.article-body tr:last-child td { border-bottom: 0; }
.article-body th { background: #eef0f4; font-weight: 600; }
.article-body code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.article-body pre {
  background: #1a1f36;
  color: #e8eaed;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.article-body img {
  border-radius: 8px;
  margin: 16px 0;
}
.article-body a { color: #244EB3; }
.article-body a:hover { text-decoration: underline; }

/* === CTA BLOCK === */
.cta-block {
  background: #f8f9fa;
  border-left: 3px solid #244EB3;
  border-radius: 4px;
  padding: 18px 22px;
  color: #333;
  margin: 28px 0;
}
.cta-block h3 { font-size: 16px; margin-bottom: 4px; font-weight: 600; }
.cta-block p { font-size: 14px; color: #555; margin: 0; }
.cta-btn {
  color: #244EB3;
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.cta-btn:hover { color: #1a3a8a; }
.cta-block a:not(.cta-btn) { color: #244EB3; text-decoration: underline; }
.cta-block a:not(.cta-btn):hover { color: #1a3a8a; }

/* === RATING BOTTOM === */
.rating-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
  padding: 16px 0;
  border-top: 1px solid #eee;
}
.rating-bottom .stars { color: #67CDAA; font-size: 20px; letter-spacing: 1px; }
.rating-bottom .avg { font-size: 18px; font-weight: 700; }
.rating-bottom .votes { color: #888; font-size: 14px; }

/* === FAQ === */
.faq-section { margin: 36px 0; }
.faq-section > h2 {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}
.faq-item {
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-q {
  font-weight: 600;
  font-size: 15px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.faq-q .chevron {
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #888;
  transition: transform .2s;
}
.faq-item.open .faq-q .chevron { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}
.faq-item.open .faq-a { display: block; }

/* === RELATED ARTICLES === */
.related-section { margin: 36px 0; }
.related-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.related-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: box-shadow .2s;
}
.related-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.related-card a { color: inherit; text-decoration: none; display: block; }
.related-card a:hover { text-decoration: none; }
.related-card .cover {
  aspect-ratio: 16 / 9;
  background: #e2edf9;
  overflow: hidden;
}
.related-card .cover img { width: 100%; height: 100%; object-fit: contain; }
.related-card .body { padding: 12px; }
.related-card .body h4 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 6px;
}

/* === RESPONSIVE: SMALL SCREENS ===
   Outer widths and side padding flow from --container-* tokens at the top of
   the file; this block only handles layout-shape changes. */
@media (max-width: 1024px) {
  .index-layout, .article-layout { grid-template-columns: 1fr; }
  .index-layout { grid-template-areas: "cards" "sidebar"; }
  .sidebar { position: static; }
  .site-header { padding-top: 10px; padding-bottom: 10px; min-height: 72px; margin-top: 12px; margin-bottom: 20px; }
  .pagination { padding-left: var(--container-pad); padding-right: var(--container-pad); }
}
@media (max-width: 768px) {
  .cards-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 32px; line-height: 40px; }
  .blog-header h1 { font-size: 32px; line-height: 40px; }
  .author-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .share-links { align-self: flex-start; }
  .cta-block { }
}

/* === FOOTER (cloned from iproxy.online) === */
.site-footer {
  background: var(--grad-footer);
  color: #fff;
  padding: 70px 0 40px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}
.footer-logo { display: inline-block; margin-bottom: 24px; }
.footer-logo img { display: block; height: 30px; width: auto; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-socials img { width: 25px; height: 25px; }
.footer-col-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  color: #fff;
  font-size: 14px;
  opacity: .92;
  text-decoration: none;
}
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-col-reviews {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.footer-col-reviews a { display: inline-block; }
.footer-col-reviews img { display: block; }
.footer-company {
  max-width: 1240px;
  margin: 40px auto 0;
  padding: 24px 40px 0;
  border-top: 1px solid rgba(255, 255, 255, .25);
  font-size: 14px;
  color: #fff;
  line-height: 1.4;
}
@media (max-width: 1024px) {
  .footer-inner {
    padding: 0 20px;
    gap: 28px;
    grid-template-columns: 1fr 1fr;
  }
  .footer-company { padding: 24px 20px 0; }
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
}
