/* ═══════════════════════════════════════════
   Pakistan Tribune — style.css
   Design: Teal + Amber Duo
   Site 01/16 | Content DNA: Quick Answer Box
   ═══════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  /* Teal (Primary) */
  --teal-50: #E1F5EE;
  --teal-100: #9FE1CB;
  --teal-200: #5DCAA5;
  --teal-400: #1D9E75;
  --teal-600: #0F6E56;
  --teal-800: #085041;
  --teal-900: #04342C;

  /* Amber (Accent) */
  --amber-50: #FAEEDA;
  --amber-100: #FAC775;
  --amber-200: #EF9F27;
  --amber-400: #BA7517;
  --amber-600: #854F0B;
  --amber-800: #633806;
  --amber-900: #412402;

  /* Neutral */
  --gray-50: #F1EFE8;
  --gray-100: #D3D1C7;
  --gray-200: #B4B2A9;
  --gray-400: #888780;
  --gray-600: #5F5E5A;
  --gray-800: #444441;
  --gray-900: #2C2C2A;

  /* Semantic */
  --bg-body: #F6FAF8;
  --bg-white: #FFFFFF;
  --bg-surface: #F0F5F3;
  --text-primary: #1A1A1A;
  --text-secondary: #5F5E5A;
  --text-muted: #888780;
  --border-light: #D3D1C7;
  --border-nav: #9FE1CB;

  /* Layout */
  --max-width: 1200px;
  --content-width: 820px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --nav-height: 64px;

  /* Typography */
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-600); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-800); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--teal-900);
}

h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.75rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); margin: 2rem 0 0.75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1rem; }

/* ─── Skip Link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--teal-800);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  z-index: 9999;
  font-size: 14px;
}
.skip-link:focus { top: 0.5rem; }

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.site-header {
  background: var(--bg-white);
  border-bottom: 0.5px solid var(--border-nav);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--teal-800);
  text-decoration: none;
}
.site-logo .logo-accent { color: var(--amber-400); }
.site-logo svg {
  width: 28px;
  height: 28px;
  color: var(--teal-600);
}

/* Desktop Nav */
.main-nav { display: flex; gap: 0; list-style: none; }
.main-nav > li { position: relative; }
.main-nav > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.85rem;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}
.main-nav > li > a:hover,
.main-nav > li > a:focus {
  background: var(--teal-50);
  color: var(--teal-800);
}
.main-nav > li > a .nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-white);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0;
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  z-index: 100;
}
.main-nav > li:hover > .nav-dropdown,
.main-nav > li:focus-within > .nav-dropdown { display: block; }
.main-nav > li:hover > a .nav-chevron { transform: rotate(180deg); }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.25rem;
}
.nav-dropdown a {
  display: block;
  padding: 0.35rem 1rem;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.1s;
}
.nav-dropdown a:hover {
  background: var(--teal-50);
  color: var(--teal-800);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Mobile nav */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 0.5px solid var(--border-light);
    flex-direction: column;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }
  .main-nav.is-open { display: flex; }
  .main-nav > li > a { padding: 0.75rem 1.25rem; font-size: 16px; }

  .nav-dropdown {
    position: static;
    display: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    min-width: unset;
    border-radius: 0;
    background: var(--bg-surface);
    margin: 0 0.75rem;
    border-radius: var(--radius-md);
  }
  .nav-dropdown.is-open { display: block; }
  .main-nav > li:hover > .nav-dropdown { display: none; }
  .main-nav > li.is-expanded > .nav-dropdown { display: block; }
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.content-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.page-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border-light);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* ═══════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0 0.5rem;
  font-size: 13px;
  color: var(--text-muted);
  list-style: none;
}
.breadcrumbs a { color: var(--teal-600); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--gray-200); }

/* ═══════════════════════════════════════════
   QUICK ANSWER BOX — Signature Component
   ═══════════════════════════════════════════ */
.quick-answer-box {
  background: var(--teal-50);
  border-top: 3px solid var(--amber-400);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0 2rem;
}

.quick-answer-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--amber-600);
  margin-bottom: 0.5rem;
}

.qab-icon {
  width: 16px;
  height: 16px;
  color: var(--amber-400);
}

.quick-answer-box p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--teal-800);
  margin: 0;
}

.quick-answer-box p strong {
  color: var(--teal-900);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   TABLES — Package/Comparison
   ═══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
}

.pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pkg-table thead th {
  background: var(--teal-800);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.pkg-table tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 0.5px solid var(--gray-50);
  vertical-align: top;
}

.pkg-table tbody tr:last-child td { border-bottom: none; }

.pkg-table tbody tr:hover { background: var(--teal-50); }

.pkg-table .pkg-name {
  font-weight: 600;
  color: var(--teal-800);
}

.pkg-table .pkg-price {
  font-weight: 600;
  color: var(--amber-600);
  white-space: nowrap;
}

.pkg-table .pkg-code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--gray-50);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--teal-800);
}

/* Best value highlight */
.pkg-table tr.best-value {
  background: var(--amber-50);
}
.pkg-table tr.best-value td:first-child {
  border-left: 3px solid var(--amber-400);
}

/* ═══════════════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════════════ */
.faq-section { margin: 2.5rem 0 1rem; }
.faq-section h2 { margin-bottom: 1rem; }

.faq-item {
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover { border-color: var(--teal-200); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-question:hover { color: var(--teal-800); }

.faq-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.faq-item.is-open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.faq-item.is-open .faq-answer { display: block; }

/* ═══════════════════════════════════════════
   CALCULATOR COMPONENTS
   ═══════════════════════════════════════════ */
.calc-wrap {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.calc-wrap label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.calc-wrap input[type="number"],
.calc-wrap input[type="text"],
.calc-wrap select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 15px;
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}
.calc-wrap input:focus,
.calc-wrap select:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.12);
}

.calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--teal-600);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.calc-btn:hover { background: var(--teal-800); }
.calc-btn:active { transform: scale(0.98); }

.calc-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--amber-50);
  border-left: 3px solid var(--amber-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.calc-result-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--amber-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.calc-result-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-900);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ═══════════════════════════════════════════
   HOMEPAGE — Hero
   ═══════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-800) 100%);
  color: #fff;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.25rem;
  text-align: center;
}
.hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  max-width: 680px;
  margin: 0 auto 0.75rem;
}
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--teal-100);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Category Grid ─── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}

.cat-card {
  background: var(--bg-white);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s, transform 0.1s;
  border-top: 2px solid var(--teal-400);
}
.cat-card:hover {
  border-color: var(--teal-200);
  transform: translateY(-2px);
  color: var(--teal-800);
}

.cat-card-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.5rem;
  color: var(--teal-600);
}

.cat-card-label {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
}

/* ─── Latest Articles ─── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.article-card {
  background: var(--bg-white);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--teal-200); }

.article-card-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--amber-600);
  margin-bottom: 0.35rem;
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════
   CONTENT TYPOGRAPHY
   ═══════════════════════════════════════════ */
.page-content ul,
.page-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.page-content li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}

.page-content strong { color: var(--teal-900); }

.page-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--gray-50);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Info callout */
.info-box {
  background: var(--teal-50);
  border-left: 3px solid var(--teal-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 15px;
  color: var(--teal-800);
}

/* Warning callout */
.warning-box {
  background: var(--amber-50);
  border-left: 3px solid var(--amber-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 15px;
  color: var(--amber-800);
}

/* Internal link styling */
.page-content a {
  color: var(--teal-600);
  text-decoration: underline;
  text-decoration-color: var(--teal-200);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.page-content a:hover {
  text-decoration-color: var(--teal-600);
  color: var(--teal-800);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  background: var(--teal-900);
  color: var(--teal-100);
  padding: 3rem 1.25rem 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--amber-100);
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a {
  font-size: 14px;
  color: var(--teal-100);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 0.5px solid rgba(255,255,255,0.15);
  font-size: 13px;
  color: var(--teal-200);
  text-align: center;
}

/* ═══════════════════════════════════════════
   404 PAGE
   ═══════════════════════════════════════════ */
.page-404 {
  text-align: center;
  padding: 4rem 1.25rem;
}
.page-404 .code-404 {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  color: var(--teal-100);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.page-404 h1 { color: var(--teal-800); }
.page-404 p { color: var(--text-secondary); max-width: 480px; margin: 0.5rem auto 1.5rem; }
.page-404 .btn-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--teal-600);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.page-404 .btn-home:hover { background: var(--teal-800); color: #fff; }

/* ═══════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════ */
.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;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
  .page-content { padding: 1.25rem; }
  .quick-answer-box { padding: 1rem; }
  .calc-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }

  .pkg-table { font-size: 13px; }
  .pkg-table thead th,
  .pkg-table tbody td { padding: 0.5rem 0.65rem; }
}

@media (max-width: 400px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .cat-card { padding: 0.85rem 0.5rem; }
  .cat-card-icon { width: 24px; height: 24px; }
}

/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */
@media print {
  .site-header, .site-footer, .nav-toggle, .breadcrumbs { display: none; }
  .page-content { border: none; box-shadow: none; padding: 0; }
  body { font-size: 12pt; background: #fff; }
  a { color: inherit; text-decoration: underline; }
  .quick-answer-box { border: 1px solid #ccc; }
}
