/* =========================================================================
   Num2Word - user.css (WebView-first)
   Purpose: compact header/logo, responsive tiles, safe-area and accessibility
   ========================================================================= */

/* ---------- Base / Root ---------- */
/* Responsive base font-size (clamped for small->large screens) */
:root {
  font-family: "Segoe UI", Roboto, "Noto Sans", system-ui, -apple-system, sans-serif;
  /* base font scales between 15px and 18px depending on viewport */
  font-size: clamp(15px, 1.6vw, 18px);
  --primary-text: #212121;
  --secondary-text: #666666;
  --bg: #f2f5f9;
  --card-bg: #ffffff;
  --card-radius: 14px;
  --card-shadow: 0 6px 18px rgba(13, 38, 76, 0.06);
  --gap: 16px;
  --tile-min-height: 56px; /* comfortable touch target */
  --safe-nav: 84px;        /* space reserved at bottom for gesture nav */
}

/* Prevent browser auto-zoom of text */
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }

/* Body */
body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--primary-text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: inherit;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

/* =========================================================================
   Header & Logo (WebView-first)
   - compact height, center aligned, respects safe-area (notch)
   ========================================================================= */

.header.container-header {
  padding-top: env(safe-area-inset-top, 8px); /* notch safe zone */
  padding-bottom: 8px;
  background: linear-gradient(180deg,#071a3b 0%,#13264b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  box-shadow: none;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  width: 100%;
}

/* inner wrapper constrains width on large screens */
.header .header-inner {
  width: 100%;
  max-width: 980px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* brand logo — responsive and retina-friendly (use srcset in HTML) */
.header .brand-logo,
.navbar-brand {
  margin: 0 auto;
  display: block;
  float: none !important;
  text-align: center;
}

.header .brand-logo img,
.navbar-brand img {
  display: block;
  width: auto !important;
  height: 44px !important;       /* compact for WebView; adjust 40-48 if needed */
  max-height: 56px !important;
  max-width: 90% !important;
  object-fit: contain !important;
  image-rendering: -webkit-optimize-contrast;
}

/* accessibility focus style for logo link */
.header .brand-logo:focus {
  outline: 2px solid rgba(255,255,255,0.08);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Hide large hero/banner elements on narrower screens (mobile/WebView) */
@media (max-width: 900px) {
  .header-banner, .top-banner, .hero-banner, .header .hero, .brand-hero {
    display: none !important;
  }
}

/* Desktop sizes for logo */
@media (min-width: 769px) {
  .header .brand-logo img { height: 46px; max-height: 64px; }
}

/* =========================================================================
   Tile Grid / Cards (main content)
   ========================================================================= */

.section-heading {
  font-size: 0.875rem; /* ~14px */
  font-weight: 600;
  color: var(--secondary-text);
  margin: 20px 6px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* tile grid is column-first (mobile) */
.tile-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin: 8px 0;
}

/* card/tile styles */
.tile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  min-height: var(--tile-min-height);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--primary-text);
  transition: transform .12s ease, box-shadow .12s ease;
  overflow: hidden;
}

/* active/pressed feedback */
.tile-card:active {
  transform: scale(.995);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* badge on left */
.tile-badge {
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* badge colors */
.badge-blue  { background-color: #2196F3; }
.badge-green { background-color: #4CAF50; }
.badge-orange{ background-color: #FF9800; }
.badge-teal  { background-color: #009688; }
.badge-red   { background-color: #e53935; }
.badge-purple{ background-color: #7E57C2; }

/* text in tile */
.tile-text {
  font-size: 1rem; /* ~16px */
  font-weight: 500;
  word-break: break-word;
}

/* lead text slightly larger for emphasis */
.tile-text.lead {
  font-size: 1.125rem; /* ~18px */
  font-weight: 600;
}

/* last tile spacing to avoid bottom nav overlap (extra safe padding) */
.tile-grid > .tile-card:last-child {
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
}

/* show two columns on wider screens */
@media (min-width: 900px) {
  .tile-grid { flex-direction: row; flex-wrap: wrap; }
  .tile-card { width: calc(50% - var(--gap)); }
}

/* language-specific tweaks: Devanagari/Hindi readability */
.lang-hi {
  font-family: "Noto Sans Devanagari", "Hind", "Segoe UI", Roboto, sans-serif;
}
.lang-hi .tile-text {
  font-size: calc(1rem + 1px);
  line-height: 1.45;
}

/* =========================================================================
   Utility / Overrides (higher specificity)
   These help override older template rules that may use !important
   ========================================================================= */

/* Ensure container main has bottom padding so content isn't hidden by nav */
.container-component, main, .site-grid {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--safe-nav));
}

/* Center small nav/menu if present in header */
body.site header .container-header .mod-menu {
  text-align: center;
  margin-top: 8px;
  display: block;
}

/* Small screens: ensure the navbar-brand stays centered */
@media (max-width: 768px) {
  .navbar-brand, .header .navbar-brand, .header .brand-logo {
    margin: 0 auto !important;
    display: block !important;
    float: none !important;
    text-align: center !important;
  }
  .navbar-brand img, .header .brand-logo img {
    margin: 0 auto;
    display: block;
    width: auto !important;
    height: 44px !important;
    max-height: 56px !important;
    max-width: 90% !important;
    object-fit: contain !important;
  }
}

/* If something still overrides us with !important, this final rule aims to assert */
.header.container-header .brand-logo img,
.navbar-brand img {
  -webkit-font-smoothing: antialiased;
  image-rendering: -webkit-optimize-contrast;
}

/* =========================================================================
   Accessibility helpers
   ========================================================================= */

/* focusable elements visible outline */
a:focus, button:focus, .tile-card:focus {
  outline: 3px solid rgba(2, 119, 189, 0.12);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ensure links are easily tappable */
a, button {
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

/* =========================================================================
   Image helpers
   - suggest using srcset in markup; ensure images scale within container
   ========================================================================= */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================================================
   Performance / Debug helpers (optional)
   ========================================================================= */

/* Hide heavy decorative elements when WebView (mobile-first) */
@media (max-width: 900px) {
  .decorative-large, .parallax-banner, .video-hero {
    display: none !important;
  }
}

/* =========================================================================
   END OF user.css
   ========================================================================= */


.container-header .grid-child {
     padding: .0em; 
}