/* ===================================================
   mobiletarifcheck.com — Main Stylesheet
   HP-inspired documentation design system
   Font: Inter (Google Fonts CDN)
   =================================================== */

/* ---------- 1. CSS Variables ---------- */
:root {
  --color-canvas:     #ffffff;
  --color-accent:     #1a56db;
  --color-accent-dark:#1340b0;
  --color-surface:    #f8fafc;
  --color-band:       #f1f5f9;
  --color-ink:        #1e293b;
  --color-body:       #475569;
  --color-hairline:   #e2e8f0;
  --color-success:    #059669;
  --color-warning:    #d97706;
  --color-info-bg:    #eff6ff;
  --color-info-border:#bfdbfe;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  --sidebar-width: 260px;
  --max-width:     1200px;
  --header-height: 64px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: 0.2s ease;
}

/* ---------- 2. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-body);
  background: var(--color-canvas);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-accent-dark); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-ink);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: .75rem; }
h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: .5rem; color: var(--color-body); }

p { margin-bottom: 1rem; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .35rem; }

code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--color-band);
  padding: .15em .4em;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}

pre {
  background: var(--color-band);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code { background: none; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--color-hairline);
  margin: 2rem 0;
}

/* ---------- 3. Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-logo:hover { color: var(--color-accent); text-decoration: none; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg { width: 18px; height: 18px; fill: #fff; }

.header-tagline {
  font-size: .8rem;
  color: var(--color-body);
  opacity: .7;
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-sm);
  padding: .45rem .6rem;
  cursor: pointer;
  color: var(--color-ink);
  font-size: 1.2rem;
  line-height: 1;
}

.hamburger:hover { background: var(--color-band); }

/* ---------- 4. Page Layout ---------- */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - var(--header-height) - 120px);
}

/* ---------- 5. Sidebar Navigation ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--color-hairline);
  background: var(--color-canvas);
  padding: 1.5rem 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-hairline); border-radius: 2px; }

.nav-section { margin-bottom: 1.5rem; }

.nav-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-body);
  opacity: .6;
  padding: .4rem 1.25rem;
  margin-bottom: .25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1.25rem;
  font-size: .875rem;
  color: var(--color-body);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1.4;
}

.nav-link:hover {
  background: var(--color-band);
  color: var(--color-accent);
  text-decoration: none;
  border-left-color: var(--color-hairline);
}

.nav-link.active {
  background: var(--color-info-bg);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 500;
}

.nav-link .nav-icon {
  width: 16px;
  height: 16px;
  opacity: .6;
  flex-shrink: 0;
}

/* ---------- 6. Main Content ---------- */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 2.5rem 3rem;
}

/* ---------- 7. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .8rem;
  color: var(--color-body);
  opacity: .75;
  margin-bottom: 1.75rem;
}

.breadcrumb a { color: inherit; }
.breadcrumb a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumb-sep { opacity: .5; }

/* ---------- 8. Table of Contents ---------- */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  max-width: 480px;
}

.toc-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-body);
  opacity: .7;
  margin-bottom: .75rem;
}

.toc ol {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
}

.toc li { margin-bottom: .3rem; }

.toc a {
  font-size: .875rem;
  color: var(--color-accent);
}

.toc a:hover { text-decoration: underline; }

/* ---------- 9. Callout / Info Box ---------- */
.callout {
  border-left: 3px solid var(--color-accent);
  background: var(--color-info-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .9rem;
}

.callout-title {
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: .4rem;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.callout.warning {
  border-left-color: var(--color-warning);
  background: #fffbeb;
}
.callout.warning .callout-title { color: var(--color-warning); }

.callout.success {
  border-left-color: var(--color-success);
  background: #f0fdf4;
}
.callout.success .callout-title { color: var(--color-success); }

/* ---------- 10. Tables ---------- */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-hairline);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead {
  background: var(--color-band);
}

thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-hairline);
}

tbody tr { border-bottom: 1px solid var(--color-hairline); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--color-surface); }
tbody tr:hover { background: var(--color-band); }

td {
  padding: .7rem 1rem;
  vertical-align: top;
  color: var(--color-body);
}

td strong { color: var(--color-ink); }

/* ---------- 11. FAQ — Details/Summary ---------- */
.faq-list { margin: 1.5rem 0; }

.faq-item {
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-canvas);
  list-style: none;
  transition: background var(--transition);
  font-size: .95rem;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; font-weight: 400; opacity: .5; flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--color-band); }
.faq-item[open] summary { background: var(--color-band); border-bottom: 1px solid var(--color-hairline); }

.faq-body {
  padding: 1rem 1.25rem;
  font-size: .9rem;
  color: var(--color-body);
}

/* ---------- 12. Related Articles ---------- */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-hairline);
}

.related-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-body);
  opacity: .65;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-body);
  font-size: .875rem;
  transition: all var(--transition);
  display: block;
  line-height: 1.4;
}

.related-card:hover {
  border-color: var(--color-accent);
  background: var(--color-info-bg);
  color: var(--color-accent);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.related-card-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .55;
  margin-bottom: .35rem;
  font-weight: 600;
}

.related-card-title { font-weight: 500; color: var(--color-ink); }
.related-card:hover .related-card-title { color: var(--color-accent); }

/* ---------- 13. Homepage Hero ---------- */
.home-hero {
  background: linear-gradient(135deg, #f1f5f9 0%, #e8f0fe 100%);
  border-bottom: 1px solid var(--color-hairline);
  padding: 3.5rem 2.5rem;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-ink);
  max-width: 700px;
  margin-bottom: 1rem;
}

.home-hero p {
  font-size: 1.05rem;
  max-width: 640px;
  color: var(--color-body);
  margin-bottom: 0;
}

/* ---------- 14. Topic Grid (Homepage) ---------- */
.topics-section {
  padding: 2.5rem 2.5rem 3rem;
}

.topics-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-body);
  opacity: .6;
  margin-bottom: 1.5rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-body);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.topic-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.topic-card-icon {
  width: 40px;
  height: 40px;
  background: var(--color-info-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.topic-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: .5rem;
}

.topic-card:hover .topic-card-title { color: var(--color-accent); }

.topic-card-desc {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--color-body);
  flex: 1;
}

.topic-card-arrow {
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* ---------- 15. Footer ---------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-hairline);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 700;
  color: var(--color-ink);
  font-size: .95rem;
  margin-bottom: .4rem;
}

.footer-tagline {
  font-size: .8rem;
  color: var(--color-body);
  opacity: .7;
  max-width: 240px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.footer-links a {
  font-size: .85rem;
  color: var(--color-body);
  text-decoration: none;
}

.footer-links a:hover { color: var(--color-accent); text-decoration: underline; }

.footer-copy {
  width: 100%;
  border-top: 1px solid var(--color-hairline);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  font-size: .78rem;
  color: var(--color-body);
  opacity: .6;
}

/* ---------- 16. Back to Top Button ---------- */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 42px;
  height: 42px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
}

/* ---------- 17. Content Images ---------- */
.content-img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0;
}

.img-caption {
  font-size: .8rem;
  color: var(--color-body);
  opacity: .65;
  text-align: center;
  margin-top: .5rem;
  font-style: italic;
}

/* ---------- 18. Data/Spec Badges ---------- */
.badge {
  display: inline-block;
  padding: .2em .6em;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow{ background: #fef3c7; color: #92400e; }
.badge-gray  { background: #f1f5f9; color: #475569; }

/* ---------- 19. Active Anchor (TOC highlight) ---------- */
.toc a.toc-active {
  color: var(--color-accent-dark);
  font-weight: 600;
}

/* ---------- 20. Section anchor targets ---------- */
h2[id], h3[id] { scroll-margin-top: calc(var(--header-height) + 1.5rem); }

/* ---------- 21. Responsive — Tablet/Mobile ---------- */
@media (max-width: 900px) {
  .page-wrapper { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    width: var(--sidebar-width);
    background: var(--color-canvas);
    border-right: 1px solid var(--color-hairline);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 80;
  }

  .sidebar.open { transform: translateX(0); }

  .hamburger { display: flex; align-items: center; }

  .main-content { padding: 1.5rem 1.25rem 2.5rem; }

  .home-hero { padding: 2.5rem 1.25rem; }
  .topics-section { padding: 1.5rem 1.25rem 2.5rem; }
}

@media (max-width: 560px) {
  .topics-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 1rem; }
}

/* ---------- 22. Print ---------- */
@media print {
  .site-header, .sidebar, #back-to-top { display: none; }
  .page-wrapper { display: block; }
  .main-content { padding: 0; }
}
