/**
 * HBN Media — Main Stylesheet
 *
 * Load order: tokens.css → main.css
 *
 * Organisation:
 *  1. CSS Reset & Base
 *  2. Typography
 *  3. Layout utilities
 *  4. Scrollbar utilities
 *  5. Accessibility
 *  6. WordPress Core Overrides
 *  7. Admin Bar compensation
 */

/* =========================================================
   1. CSS RESET & BASE
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--hbn-text-primary);
  background-color: var(--hbn-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Anchor defaults */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Image defaults */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Form element reset */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* List reset */
ul, ol {
  list-style: none;
}

/* =========================================================
   2. TYPOGRAPHY
   ========================================================= */

/* Hindi / Devanagari — applies to all content by default */
h1, h2, h3, h4, h5, h6,
.hbn-heading,
.post-title,
.entry-title {
  font-family: var(--font-hindi);
  line-height: var(--leading-snug);
  color: var(--hbn-text-primary);
  font-weight: 700;
}

/* English UI labels — override for interface text */
.hbn-label,
.hbn-ui,
nav,
.nav-label {
  font-family: var(--font-ui);
}

/* Hindi content class */
.hindi-title,
.hbn-hindi {
  font-family: var(--font-hindi);
  line-height: var(--leading-snug);
}

/* Article body text — relaxed for Hindi readability */
.entry-content,
.article-body,
.hbn-article-content {
  font-family: var(--font-hindi);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--hbn-text-secondary);
}

.entry-content p,
.article-body p {
  margin-bottom: var(--space-4);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

/* Blockquote */
.entry-content blockquote {
  border-left: 3px solid var(--hbn-red);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--hbn-text-secondary);
  font-style: italic;
}

/* Text clamps */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* =========================================================
   3. LAYOUT UTILITIES
   ========================================================= */

/* Main site wrapper */
#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#content {
  flex: 1;
}

/* Container */
.hbn-container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

@media (max-width: 767px) {
  .hbn-container {
    padding-left: var(--container-px-sm);
    padding-right: var(--container-px-sm);
  }
}

/* Grid systems */
.hbn-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}

.hbn-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

@media (max-width: 767px) {
  .hbn-grid-12,
  .hbn-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hbn-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   4. SCROLLBAR UTILITIES
   ========================================================= */

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* =========================================================
   5. ACCESSIBILITY
   ========================================================= */

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-modal);
  background: var(--hbn-red);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Screen reader text */
.screen-reader-text,
.sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--hbn-red);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   6. WORDPRESS CORE OVERRIDES
   ========================================================= */

/* Alignment classes */
.alignleft {
  float: left;
  margin-right: var(--space-4);
  margin-bottom: var(--space-2);
}
.alignright {
  float: right;
  margin-left: var(--space-4);
  margin-bottom: var(--space-2);
}
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* WordPress captions */
.wp-caption {
  max-width: 100%;
}
.wp-caption-text {
  font-size: var(--text-sm);
  color: var(--hbn-text-muted);
  margin-top: var(--space-2);
  text-align: center;
}

/* WP images */
.wp-post-image {
  max-width: 100%;
  height: auto;
}

/* Gallery */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* WordPress default pagination */
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--hbn-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--hbn-text-muted);
  transition: all var(--transition-fast);
}
.page-numbers:hover,
.page-numbers.current {
  background: var(--hbn-red);
  border-color: var(--hbn-red);
  color: white;
}

/* =========================================================
   7. ADMIN BAR COMPENSATION
   ========================================================= */

/* WordPress admin bar pushes content down */
.admin-bar .hbn-sticky-nav {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .hbn-sticky-nav {
    top: 46px;
  }
}

/* =========================================================
   8. PRINT STYLES
   ========================================================= */
@media print {
  .hbn-utility-bar,
  .hbn-brand-header,
  .hbn-primary-nav,
  .hbn-breaking-ticker,
  .hbn-footer,
  .hbn-ad-slot,
  .hbn-mobile-nav-overlay {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }
}
