/* ChainLinkHosting front site — brand-matched to the WHMCS theme
   (primary #0CBED5, headings #161C2D, Inter Tight). */

:root {
  --brand:        #0CBED5;
  --brand-hover:  #09AABF;
  --brand-soft:   #CFECF4;
  --accent:       #834CE4;
  --bg:           #FCFDFE;
  --bg-2:         #F5FAFF;
  --surface:      #FFFFFF;
  --ink:          #161C2D;
  --ink-soft:     #5B6278;
  --ink-faint:    #8B93A9;
  --border:       #E7E9ED;
  --ok:           #50CD89;
  --danger:       #D92632;
  --shadow:       0 6px 24px rgba(22, 28, 45, .07);
  --radius:       14px;
}
html[data-theme="dark"] {
  --bg:        #0E1019;
  --bg-2:      #131624;
  --surface:   #181C2C;
  --ink:       #F2F4F8;
  --ink-soft:  #B5B5C3;
  --ink-faint: #8B93A9;
  --border:    #262B3E;
  --brand-soft:#123A44;
  --shadow:    0 6px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: inline-flex; align-items: center; }
.brand img {
  height: 42px; width: auto; max-width: 190px; object-fit: contain; display: block;
  transition: transform .18s ease, filter .18s ease;
}
/* The logo art is black: keep it in light mode, render it white in dark mode. */
html[data-theme="dark"] .brand img,
html[data-theme="dark"] #page-loader img { filter: brightness(0) invert(1); }
/* Reactive hover pop. */
.brand:hover img { transform: scale(1.1) translateY(-1px); filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--brand) 45%, transparent)); }
html[data-theme="dark"] .brand:hover img {
  filter: brightness(0) invert(1) drop-shadow(0 4px 10px color-mix(in srgb, var(--brand) 55%, transparent));
}
.footer-about .brand img { height: 34px; }
.main-nav { display: flex; gap: 20px; margin-left: 8px; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--brand); }
.main-nav a.active { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 10px;
  font-weight: 600; font-size: .93rem; border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 13px 26px; font-size: 1rem; border-radius: 12px; }
.btn-block { display: block; width: 100%; }
.btn-disabled { background: var(--border); color: var(--ink-faint); cursor: not-allowed; display: block; }

.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
html[data-theme="dark"] .icon-sun { display: inline; }
html[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.nav-burger { display: none; }

/* ---------- hero ---------- */
.hero {
  padding: 84px 0 60px; text-align: center;
  background:
    radial-gradient(700px 320px at 15% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent),
    radial-gradient(700px 320px at 85% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.hero-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--brand); margin: 0 0 12px; }
.hero-sub { max-width: 640px; margin: 14px auto 26px; color: var(--ink-soft); font-size: 1.06rem; }
.accent { color: var(--brand); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-badges { list-style: none; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 30px 0 0; }
.hero-badges li {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: .85rem; color: var(--ink-soft); font-weight: 500;
}
/* hero with the portal's stock illustration on the right */
.hero-with-art { text-align: left; }
.hero-with-art .hero-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: center; }
.hero-with-art .hero-sub { margin-left: 0; }
.hero-with-art .hero-cta, .hero-with-art .hero-badges { justify-content: flex-start; }
.hero-art img { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
/* Framed look when a custom showcase image is configured. */
.hero-art-framed img {
  max-height: 340px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--surface);
}
@media (max-width: 900px) {
  .hero-with-art .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* ---------- optional images (settings/images.php) ----------
   Boxes only exist when an image is configured; a failed image hides
   its whole box again (site.js). Text always keeps priority: banners
   sit BELOW the page title, fill the width, and crop cleanly. */
.page-banner { margin: 26px auto 0; }
.page-banner img {
  display: block; width: 100%; max-height: 300px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--surface);
}
.card-thumb {
  display: block; height: 96px; margin: -4px 0 12px; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plan-img {
  height: 110px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); overflow: hidden;
}
.plan-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* ---------- promo strip ---------- */
.promo-strip {
  background: linear-gradient(90deg, var(--brand), #23D4EB);
  color: #063138; padding: 12px 0; text-align: center; font-size: .98rem;
}
.promo-strip strong { margin-right: 10px; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.link-more { font-weight: 600; font-size: .93rem; }

/* ---------- group cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 36px; }
.group-card {
  position: relative; display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  color: var(--ink); box-shadow: var(--shadow); transition: all .15s ease;
}
.group-card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.group-card h3 { margin-bottom: 8px; padding-right: 22px; }
.price-from { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.price-from b { color: var(--brand); font-size: 1.05rem; }
.plan-count { margin: 2px 0 0; color: var(--ink-faint); font-size: .85rem; }
.card-arrow { position: absolute; right: 18px; top: 18px; color: var(--brand); font-weight: 700; }

/* ---------- plan cards ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 18px; }
.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.plan-card.is-out { opacity: .65; }
.plan-desc { color: var(--ink-soft); font-size: .9rem; margin: 0 0 10px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin: 8px 0 16px; }
.plan-price .cur { font-size: 1.1rem; color: var(--ink-soft); }
.plan-price .amt { font-size: 2rem; font-weight: 800; color: var(--ink); }
.plan-price .cycle { color: var(--ink-faint); font-size: .9rem; }
.plan-features { list-style: none; padding: 0; margin: 18px 0 0; font-size: .9rem; }
.plan-features li { padding: 6px 0 6px 24px; position: relative; border-bottom: 1px dashed var(--border); color: var(--ink-soft); }
.plan-features li:last-child { border-bottom: 0; }
.plan-features li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.plan-features li.f-excluded { color: var(--ink-faint); }
.plan-features li.f-excluded::before { content: "✕"; color: var(--danger); }
.plan-features li.f-excluded s { text-decoration: none; }
.plan-features li.f-muted::before { content: "★"; color: var(--brand); }
.plan-features b { color: var(--ink); }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.feature p { color: var(--ink-soft); font-size: .93rem; margin: 0; }

/* ---------- news ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.news-card, .news-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.news-item { margin-bottom: 18px; }
.news-card time, .news-item time { color: var(--ink-faint); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.news-card h3 a, .news-item h2 a { color: var(--ink); }
.news-card h3 a:hover, .news-item h2 a:hover { color: var(--brand); }
.news-body { color: var(--ink-soft); font-size: .93rem; }
.news-body a { word-break: break-all; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- page head / breadcrumbs ---------- */
.page-head { padding: 46px 0 30px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.page-head p { color: var(--ink-soft); max-width: 720px; }
.crumbs { font-size: .85rem; color: var(--ink-faint); margin-bottom: 10px; }
.crumbs a { color: var(--ink-faint); }
.crumbs a:hover { color: var(--brand); }

/* ---------- legal ---------- */
.legal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.legal-tabs a {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--ink-soft); font-size: .88rem; font-weight: 600; background: var(--surface);
}
.legal-tabs a.active, .legal-tabs a:hover { border-color: var(--brand); color: var(--brand); }
.legal-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 38px; line-height: 1.7; }
.legal-body div { margin: 5px 0; color: var(--ink-soft); }
.legal-body p { color: var(--ink-soft); }
.legal-body h2 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.legal-body h3 { margin: 28px 0 10px; color: var(--brand); font-size: 1.05rem; }
.legal-body strong, .legal-body b { color: var(--ink); }
.legal-body a { word-break: break-word; }
.legal-source { color: var(--ink-faint); font-size: .85rem; margin-top: 16px; }

/* ---------- page loader ----------
   Styled via the inline critical CSS in layout.php <head> (it must work
   even when this stylesheet is stale or still loading). ---------- */

/* ---------- cookie consent ---------- */
.consent-banner {
  position: fixed; left: 18px; bottom: 18px; z-index: 150;
  max-width: 380px; width: calc(100vw - 36px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.consent-banner h6 { margin: 0 0 8px; font-size: 1rem; font-weight: 700; color: var(--ink); }
.consent-banner p { margin: 0 0 10px; font-size: .88rem; color: var(--ink-soft); }
.consent-banner .consent-note { font-size: .8rem; color: var(--ink-faint); }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ---------- group switcher (grouped by category) ---------- */
.group-switcher { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.cat-row {
  display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px dashed var(--border);
}
.cat-row:last-child { border-bottom: 0; }
.cat-label {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); padding-top: 8px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
  padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 700px) {
  .cat-row { grid-template-columns: 1fr; gap: 6px; }
  .cat-label { padding-top: 0; }
}

.empty-note { color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 28px; padding: 46px 20px 26px; }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--ink-soft); padding: 3px 0; font-size: .92rem; }
.footer-col a:hover { color: var(--brand); }
.footer-about p { color: var(--ink-soft); font-size: .9rem; margin: 12px 0 0; }
.footer-contact { margin: 6px 0 0 !important; }
.social-row { display: flex; gap: 8px; margin-top: 14px; }
/* Specificity beats `.footer-col a` so the icons stay flex-centred. */
.footer-col a.social-btn, a.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid var(--border); color: var(--ink-soft); background: var(--surface);
  line-height: 0;
}
.social-btn svg { display: block; }
.footer-col a.social-btn:hover, a.social-btn:hover { border-color: var(--brand); color: var(--brand); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: 18px 20px; font-size: .84rem; color: var(--ink-faint);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .main-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 14px 20px; gap: 12px;
  }
  .main-nav.open { display: flex; }
  .nav-burger { display: inline-block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 56px 0 44px; }
}
@media (max-width: 520px) {
  .header-actions .btn-ghost { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}
