/* =====================================================
   TechUnitConv — Shared Stylesheet
   Royal Blue theme · Rajdhani + Source Sans 3
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ── Variables ── */
:root {
  --royal:       #1a3a6e;
  --royal-dark:  #0d2247;
  --royal-mid:   #2251a3;
  --royal-light: #3a6fd8;
  --royal-pale:  #d8e4f7;
  --royal-xpale: #eef3fb;
  --gold:        #f0b429;
  --gold-light:  #fde68a;
  --white:       #ffffff;
  --off-white:   #f0f4fb;
  --text:        #1a2540;
  --text-muted:  #5a6a8a;
  --border:      #c5d5ee;
  --success:     #16a34a;
  --shadow:      0 4px 24px rgba(26,58,110,.12);
  --shadow-lg:   0 8px 40px rgba(26,58,110,.18);
  --radius:      14px;
  --radius-sm:   8px;
  --transition:  all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--royal-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utility ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 820px; margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ── Navbar ── */
.navbar {
  background: var(--royal-dark);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.navbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.navbar__logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.navbar__logo-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--royal-light), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.navbar__logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.45rem; font-weight: 700; color: #fff;
  letter-spacing: -.01em;
}
.navbar__logo-text em { color: var(--gold); font-style: normal; }

.navbar__links {
  display: flex; align-items: center; gap: .15rem;
  list-style: none;
}
.navbar__links a {
  color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 500;
  padding: .38rem .85rem; border-radius: 6px; transition: var(--transition);
  text-decoration: none;
}
.navbar__links a:hover,
.navbar__links a.active { background: rgba(255,255,255,.13); color: #fff; }

.navbar__hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.navbar__hamburger span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: var(--transition); }
.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar__mobile {
  display: none; flex-direction: column;
  background: #0a1c3e; padding: .75rem 1.25rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.navbar__mobile.open { display: flex; }
.navbar__mobile a {
  color: rgba(255,255,255,.85); font-size: .92rem;
  padding: .55rem 0; border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}
.navbar__mobile a:last-child { border-bottom: none; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
  font-size: .82rem; color: var(--text-muted);
  padding: .9rem 0;
}
.breadcrumb a { color: var(--royal-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: var(--border); }

/* ── Ad Slots ── */
.ad-slot {
  background: #fff; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  text-align: center;
}
.ad-slot--leaderboard { width: 100%; min-height: 90px; margin: 1rem 0; }
.ad-slot--rectangle  { width: 100%; min-height: 250px; margin: 1.25rem 0; }
.ad-slot--inline     { width: 100%; min-height: 100px; margin: 1.5rem 0; }
.ad-slot--sticky-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  min-height: 60px; background: #fff;
  border-top: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.ad-label {
  display: block; font-size: .7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; padding: .25rem 0;
}

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.75rem;
}
.card + .card { margin-top: 1.5rem; }
.card__title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.35rem; font-weight: 700; color: var(--royal);
  margin-bottom: 1rem;
}
.card__title::after {
  content: ''; display: block; width: 36px; height: 3px;
  background: var(--gold); border-radius: 2px; margin-top: .3rem;
}

/* ── Section title ── */
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.7rem; font-weight: 700; color: var(--royal);
  margin-bottom: 1.25rem; text-align: center;
}
.section-title::after {
  content: ''; display: block; width: 52px; height: 3px;
  background: var(--gold); border-radius: 2px;
  margin: .4rem auto 0;
}

/* ── Converter Widget ── */
.converter {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 1.75rem;
}
.converter__title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem; color: var(--royal); text-align: center;
  margin-bottom: 1.25rem;
}
.converter__row {
  display: grid; grid-template-columns: 1fr 44px 1fr; gap: .75rem; align-items: end;
  margin-bottom: .75rem;
}
.converter__group { display: flex; flex-direction: column; gap: .35rem; }
.converter__label {
  font-size: .78rem; font-weight: 700; color: var(--royal);
  text-transform: uppercase; letter-spacing: .06em;
}
.converter__select, .converter__input {
  width: 100%; border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .65rem .9rem; font-size: .95rem; color: var(--text);
  font-family: 'Source Sans 3', sans-serif; transition: border-color .2s;
  background: var(--royal-xpale);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a3a6e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
  padding-right: 2.2rem;
}
.converter__input { background-image: none; padding-right: .9rem; }
.converter__select:focus, .converter__input:focus {
  outline: none; border-color: var(--royal-light);
  background-color: #fff;
}
.converter__swap {
  background: var(--royal); color: #fff; border: none;
  border-radius: 50%; width: 44px; height: 44px; cursor: pointer;
  font-size: 1.15rem; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); align-self: end; flex-shrink: 0;
}
.converter__swap:hover { background: var(--royal-light); transform: rotate(180deg); }
.converter__result {
  background: var(--royal-pale); border: 2px solid var(--royal-light);
  border-radius: var(--radius-sm); padding: 1rem 1.5rem; text-align: center;
  margin-top: .5rem; display: none;
}
.converter__result.show { display: block; }
.converter__result--error { border-color: #e57373; background: #fff5f5; }
.converter__result-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.1rem; font-weight: 700; color: var(--royal); line-height: 1.1;
}
.converter__result-label { font-size: .88rem; color: var(--text-muted); margin-top: .2rem; }
.converter__btn {
  width: 100%; margin-top: .9rem;
  background: linear-gradient(135deg, var(--royal-mid), var(--royal-light));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: .85rem; font-size: 1rem; font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer; letter-spacing: .02em; transition: var(--transition);
}
.converter__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(34,81,163,.35); }

/* ── Formula box ── */
.formula {
  background: var(--royal-dark); color: #fff;
  border-radius: var(--radius-sm); padding: 1rem 1.5rem;
  font-family: 'Courier New', monospace; font-size: 1rem;
  text-align: center; letter-spacing: .04em; margin: 1rem 0;
}

/* ── Highlight box ── */
.highlight { border-left: 4px solid var(--royal-light); background: var(--royal-pale); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 1rem 1.25rem; margin: 1rem 0; }
.highlight--gold { border-left-color: var(--gold); background: #fffbeb; }
.highlight--green { border-left-color: var(--success); background: #f0fdf4; }

/* ── Illustration grid ── */
.illus-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .85rem; margin-top: 1rem;
}
.illus-item {
  background: var(--royal-xpale); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .9rem .7rem; text-align: center;
  transition: var(--transition);
}
.illus-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.illus-item__icon { font-size: 1.9rem; margin-bottom: .3rem; }
.illus-item__name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .88rem; color: var(--royal); }
.illus-item__val  { font-size: .76rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Unit Table ── */
.unit-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.unit-table th {
  background: var(--royal); color: #fff;
  padding: .65rem 1rem; text-align: left;
  font-family: 'Rajdhani', sans-serif; font-size: .95rem; font-weight: 600;
}
.unit-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.unit-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.unit-table td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.unit-table tr:last-child td { border-bottom: none; }
.unit-table tr:nth-child(even) td { background: var(--royal-xpale); }
.unit-table tbody tr:hover td { background: var(--royal-pale); }

/* ── Category grid ── */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.cat-card {
  background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem 1rem; text-align: center;
  text-decoration: none; color: var(--text);
  transition: var(--transition); display: block;
}
.cat-card:hover {
  border-color: var(--royal-light); transform: translateY(-4px);
  box-shadow: var(--shadow); text-decoration: none;
}
.cat-card__icon { font-size: 2.4rem; margin-bottom: .5rem; }
.cat-card__name { font-family: 'Rajdhani', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--royal); }
.cat-card__count { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Hero variants ── */
.hero-page {
  background: linear-gradient(135deg, var(--royal-dark) 0%, var(--royal-mid) 65%, var(--royal-light) 100%);
  color: #fff; padding: 3rem 1.25rem 2.5rem; text-align: center;
  position: relative; overflow: hidden;
}
.hero-page::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-page__inner { position: relative; max-width: 700px; margin: 0 auto; }
.hero-page__icon { font-size: 3.5rem; margin-bottom: .5rem; display: block; }
.hero-page__title {
  font-family: 'Rajdhani', sans-serif; font-size: clamp(1.8rem,5vw,2.8rem);
  font-weight: 700; line-height: 1.15; margin-bottom: .6rem;
}
.hero-page__title span { color: var(--gold); }
.hero-page__desc { font-size: 1.05rem; opacity: .9; max-width: 580px; margin: 0 auto; }
.hero-page__badge {
  display: inline-block; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25); border-radius: 20px;
  padding: .28rem 1rem; font-size: .82rem; margin-top: .75rem;
}

/* ── Tags ── */
.tag {
  display: inline-block; background: var(--royal-pale); color: var(--royal);
  border-radius: 4px; padding: .12rem .5rem; font-size: .78rem; font-weight: 600;
}

/* ── SVG diagram wrapper ── */
.diagram { background: var(--royal-xpale); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem; text-align: center; margin: 1rem 0; }
.diagram svg { max-width: 100%; }
.diagram__caption { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }

/* ── Calc card ── */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: .32rem; }
.field label { font-size: .8rem; font-weight: 700; color: var(--royal); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .85rem; font-size: .93rem; font-family: 'Source Sans 3', sans-serif;
  transition: border-color .2s; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--royal-light); }
.calc-btn {
  background: var(--royal); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: .72rem 2rem;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  font-family: 'Source Sans 3', sans-serif; transition: var(--transition);
}
.calc-btn:hover { background: var(--royal-light); }
.calc-result {
  background: var(--royal-pale); border: 2px solid var(--royal-light);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-top: .85rem; display: none;
}
.calc-result.show { display: block; }

/* ── Back / CTA button ── */
.btn { display: inline-flex; align-items: center; gap: .45rem; border: none; border-radius: var(--radius-sm); padding: .65rem 1.5rem; font-size: .93rem; font-weight: 600; cursor: pointer; font-family: 'Source Sans 3', sans-serif; transition: var(--transition); text-decoration: none; }
.btn--primary { background: var(--royal); color: #fff; }
.btn--primary:hover { background: var(--royal-light); text-decoration: none; color: #fff; }
.btn--outline { background: transparent; border: 2px solid var(--royal); color: var(--royal); }
.btn--outline:hover { background: var(--royal); color: #fff; text-decoration: none; }

/* ── Related units row ── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-top: .75rem; }
.related-card { background: var(--royal-xpale); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem .75rem; text-align: center; text-decoration: none; transition: var(--transition); display: block; }
.related-card:hover { border-color: var(--royal-light); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.related-card__icon { font-size: 1.6rem; }
.related-card__name { font-family: 'Rajdhani', sans-serif; font-size: .9rem; font-weight: 700; color: var(--royal); margin-top: .3rem; }

/* ── Footer ── */
.footer {
  background: var(--royal-dark); color: rgba(255,255,255,.7);
  padding: 2.25rem 1.25rem 5rem; /* 5rem bottom for sticky ad */
  margin-top: auto;
}
.footer__inner { max-width: 1160px; margin: 0 auto; }
.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1rem; }
.footer__links a { color: var(--gold); font-size: .88rem; text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__copy { text-align: center; font-size: .82rem; }

/* ── GDPR Banner ── */
.gdpr {
  position: fixed; bottom: 60px; left: 0; right: 0; z-index: 9999;
  background: #0a1c3e; color: #fff; padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  border-top: 3px solid var(--gold);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.gdpr p { flex: 1; min-width: 200px; font-size: .88rem; }
.gdpr a { color: var(--gold); }
.gdpr__accept { background: var(--gold); color: var(--royal-dark); border: none; border-radius: 6px; padding: .5rem 1.25rem; font-weight: 700; cursor: pointer; font-size: .88rem; white-space: nowrap; }
.gdpr__decline { background: transparent; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: .5rem 1rem; cursor: pointer; font-size: .88rem; white-space: nowrap; }
.gdpr.hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar__links { display: none; }
  .navbar__hamburger { display: flex; }
  .converter__row { grid-template-columns: 1fr; }
  .converter__swap { transform: rotate(90deg); margin: 0 auto; }
  .converter__swap:hover { transform: rotate(270deg); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .illus-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .illus-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-page { padding: 2rem 1rem 1.75rem; }
  .card { padding: 1.25rem; }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Page layout spacing ── */
.page-body { padding: 1.25rem 0 3rem; }
.page-body > * + * { margin-top: 1.5rem; }

/* ── Main homepage hero ── */
.hero-home {
  background: linear-gradient(135deg, var(--royal-dark) 0%, var(--royal-mid) 55%, #2a7dd4 100%);
  padding: 4rem 1.25rem 5rem; text-align: center;
  position: relative; overflow: hidden;
}
.hero-home::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='0' cy='0' r='3'/%3E%3Ccircle cx='80' cy='0' r='3'/%3E%3Ccircle cx='0' cy='80' r='3'/%3E%3Ccircle cx='80' cy='80' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-home__inner { position: relative; max-width: 720px; margin: 0 auto; }
.hero-home__title {
  font-family: 'Rajdhani', sans-serif; font-size: clamp(2.4rem,6vw,3.8rem);
  font-weight: 700; color: #fff; line-height: 1.1; margin-bottom: .75rem;
}
.hero-home__title em { color: var(--gold); font-style: normal; }
.hero-home__subtitle { font-size: 1.12rem; color: rgba(255,255,255,.88); margin-bottom: 1.25rem; }
.hero-home__badges { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.hero-home__badge {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px; padding: .3rem 1rem; font-size: .82rem; color: #fff;
}
/* Converter pulled up over hero */
.hero-home__converter {
  position: relative; margin: -3rem auto 0;
  max-width: 860px; padding: 0 1.25rem;
  z-index: 10;
}
