/**
 * Top India Tips - Main & Layout Styles
 * Single Source of Truth for Global Resets, Typography, Focus, and Buttons
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600;700;800&display=swap');

/* CSS Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 140px;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-cream);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fallback for legacy browsers without overflow-x: clip */
@supports not (overflow-x: clip) {
  html, body {
    overflow-x: hidden;
  }
}

/* Universal Typography & Heading Safety */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: break-word;
}

p, li, blockquote {
  overflow-wrap: break-word;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gold);
  color: var(--color-navy-deep);
  padding: var(--space-3) var(--space-6);
  font-weight: 700;
  border-radius: var(--radius-md);
  z-index: 99999;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

.skip-link:focus {
  top: var(--space-4);
}

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

/* Global Focus States (WCAG 2.2 AA) */
:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

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

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Full-Width Expansive Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.5rem);
  padding-right: clamp(1rem, 2.5vw, 2.5rem);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.5rem);
  padding-right: clamp(1rem, 2.5vw, 2.5rem);
}

/* Typography Helpers */
.font-serif {
  font-family: var(--font-serif);
}

.text-gold {
  color: var(--color-gold) !important;
}

.text-navy {
  color: var(--color-navy-deep) !important;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-white {
  color: var(--color-white);
}

/* Section Header Shared */
.section-header {
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .section-header.with-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-muted);
  position: relative;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-navy-deep);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 680px;
}

/* ==========================================================================
   REUSABLE COMPONENT: BUTTONS (STANDARDIZED ALL STATES)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-normal);
  white-space: nowrap;
  min-height: var(--touch-target-min); /* 44px touch target */
  user-select: none;
}

/* Disabled State across all buttons */
.btn:disabled,
.btn[disabled],
.btn.disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* 1. Primary Gold Button */
.btn-gold {
  background: var(--color-gold-gradient);
  color: var(--color-navy-deep);
  box-shadow: 0 4px 14px rgba(245, 185, 66, 0.3);
}

.btn-gold:hover {
  background: #f7c358;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 185, 66, 0.45);
}

.btn-gold:active {
  transform: translateY(0);
  background: var(--color-gold-active);
  box-shadow: 0 2px 8px rgba(245, 185, 66, 0.3);
}

.btn-gold:focus-visible {
  outline: 3px solid var(--color-white);
  outline-offset: 2px;
}

/* 2. Dark Pill Button */
.btn-dark-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  backdrop-filter: blur(8px);
}

.btn-dark-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-dark-pill:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.06);
}

.btn-dark-pill:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* 3. Navy Solid Button */
.btn-navy {
  background: var(--color-navy-deep);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-navy:hover {
  background: var(--color-navy-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-navy:active {
  transform: translateY(0);
  background: var(--color-navy-darkest);
}

.btn-navy:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* 4. Navy Outline Button */
.btn-outline-navy {
  background: transparent;
  border: 1.5px solid var(--color-navy-deep);
  color: var(--color-navy-deep);
}

.btn-outline-navy:hover {
  background: var(--color-navy-deep);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-navy:active {
  transform: translateY(0);
  background: var(--color-navy-darkest);
}

.btn-outline-navy:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-gold {
  background: var(--color-gold);
  color: var(--color-navy-deep);
}

.badge-navy {
  background: var(--color-navy-light);
  color: var(--color-white);
}

.badge-soft-gold {
  background: var(--color-gold-light);
  color: #925C03;
  border: 1px solid rgba(245, 185, 66, 0.4);
}

/* Spacers & Layout */
.section-padding {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .section-padding {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}
