/* ==========================================================================
   Vazi App Global Styles - Core global styling
   Author: Shorea Solutions
   Version: 1.0
   ========================================================================== */

/* ==========================================================================
   Font Imports - Playfair Display for headings, Lato for body text
   NOTE: Fonts are now loaded via a <link rel="stylesheet"> in HTML head
   to avoid @import() render‑blocking and extra round‑trips.
   ========================================================================== */

/* ==========================================================================
   Global Box-Sizing Reset - Apply border-box to all elements
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
  padding: 0;
  width: 100%;

}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}


/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box;
  /* 1 */
  height: 0;
  /* 1 */
  overflow: visible;
  /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */
}

ul,
li {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none;
  /* 1 */
  text-decoration: underline;
  /* 2 */
  text-decoration: underline dotted;
  /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  /* 1 */
  font-size: 100%;
  /* 1 */
  line-height: 1.15;
  /* 1 */
  margin: 0;
  /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input {
  /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select {
  /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box;
  /* 1 */
  color: inherit;
  /* 2 */
  display: table;
  /* 1 */
  max-width: 100%;
  /* 1 */
  padding: 0;
  /* 3 */
  white-space: normal;
  /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  /* 1 */
  padding: 0;
  /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield;
  /* 1 */
  appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}


/* ==========================================================================
   CSS Variables (Custom Properties) - Central color and typography management
   ========================================================================== */
:root {
  /* Typography */
  --font-body: 'Lato', sans-serif;
  --font-heading: 'Playfair Display', serif;

  /* Typography Scale */
  --text-xs: 0.75rem;      /* 12px - Labels, metadata only */
  --text-sm: 0.875rem;     /* 14px - Minimum readable text */
  --text-base: 1rem;       /* 16px - Body text */
  --text-lg: 1.125rem;     /* 18px - Large body text */
  --text-xl: 1.25rem;      /* 20px - Small headings */
  --text-2xl: 1.5rem;      /* 24px - Medium headings */
  --text-3xl: 1.875rem;    /* 30px - Large headings */
  --text-4xl: 2.25rem;     /* 36px - Extra large headings */

  /* Font Weight Scale */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Letter Spacing */
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.01em;

  /* Line Height Scale */
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;

  /* Core palette */
  --color-background: #ffffff;
  --color-foreground: #111827;
  /* AAA primary text */
  --color-secondary: #1f2937;
  /* dark neutral for secondary surfaces */
  --color-border: #e5e7eb;
  --color-border-light: #d1d5db;
  --color-border-strong: #cccccc;
  --color-light-bg: #f5f5f5;
  --background-white: #ffffff;
  --background-gray: #f3f4f6;

  /* Brand & semantic tokens */
  --color-brand: #000000;
  /* neutralized to black */
  --color-brand-hover: #1a1a1b;
  /* darker hover */
  --color-brand-contrast: #ffffff;
  /* text on brand */
  --color-success: #22c55e;
  /* subtle green */
  --color-muted: #666666;
  /* subdued text */
  --color-bg-soft: #f9f9f9;
  /* light neutral bg */

  /* Text color tokens (AAA-focused) */
  --color-text-secondary: #4b5563;
  /* AAA secondary text (~7:1 on white) */

  /* Shadow tokens */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Spacing Scale */
  --padding-xs: 0.25rem;
  --padding-sm: 0.5rem;
  --padding-md: 0.75rem;
  --padding-lg: 1rem;
  --padding-xl: 1.5rem;
  --padding-2xl: 2rem;

  /* Border Radius Scale */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-pill: 999px;
  --border-radius-composer: 38px;
  --button-radius: 8px;
}

/* ==========================================================================
   Reset & Base styles - Foundational styles and resets
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  /* Use more intuitive box-sizing model */
}

html {
  font-size: 100%;
  /* Sets base font size for rem units */
  height: 100%;
}

/* ==========================================================================
   Button Styles - Global button styles for consistent design using BEM
   ========================================================================== */

/* Ensure all buttons have pointer cursor */
button,
[type="button"],
[type="submit"],
[role="button"],
.btn,
.pill-btn,
.vote,
.comment-action-btn,
.composer-action-btn,
.feed-carousel-btn {
  cursor: pointer;
}

.btn {
  border: none;
  border-radius: 5px;
  background-color: var(--color-brand);
  color: var(--color-brand-contrast);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Button variants */
.btn--primary {
  background: var(--color-brand);
  color: var(--color-brand-contrast);
}

.btn--primary:hover {
  background: var(--color-brand-hover);
}

.btn--primary:active {
  transform: scale(0.98);
}

.btn--primary:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-brand-contrast);
}

.btn--secondary:hover {
  background: #2a2a2a;
}

.btn--secondary:active {
  transform: scale(0.98);
}

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

.btn--outline {
  background: transparent;
  color: var(--color-brand);
  border: 2px solid var(--color-brand);
}

.btn--outline:hover {
  background: var(--color-brand);
  color: var(--color-brand-contrast);
}

.btn--outline:active {
  transform: scale(0.98);
  background: var(--color-brand-hover);
}

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

/* Disabled button state */
.btn--disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 160px;
  width: auto;
  text-align: center;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

/* Hide */
.hide {
  display: none !important;
}

/* Optional: For "skip to content" links that become visible on focus */
.visually-hidden-focusable:not(:focus):not(:active) {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.visually-hidden-focusable:focus,
.visually-hidden-focusable:active {
  clip: auto;
  height: auto;
  width: auto;
  position: static;
  margin: 0;
  overflow: visible;
  padding: 0;
}

/* Main body class - Uses CSS grid for sticky footer layout */
.body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-relaxed);
  font-weight: var(--font-weight-normal);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-foreground);
  min-height: 100vh;
  background-color: var(--color-background);
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* Header, main content, footer */
  grid-template-columns: 100%;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 1rem;
}


.container__narrow {
  width: 100%;
  max-width: 750px;
}

@media screen and (min-width: 992px) {
  .body {
    font-size: 1.125rem;
  }
}

/* Responsive button styles */
@media screen and (max-width: 768px) {
  .btn {
    width: 100%;
  }
}

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

/* ==========================================================================
   Typography & Content
   ========================================================================== */

/* Text Wrapping - Prevent overflow and improve readability */
.body,
p,
.comment-body,
.post-preview-caption,
.pages__content {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  letter-spacing: var(--letter-spacing-wide);
}


h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  margin: 0;
}

h1,
.h1 {
  font-size: 2.22rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

@media screen and (min-width: 768px) {

  h1,
  .h1 {
    font-size: 2.5rem;
  }
}

h2,
.h2 {
  font-size: 1.8rem;
  line-height: 1.3;
  letter-spacing: 0.015em;
}

@media screen and (min-width: 768px) {

  h2,
  .h2 {
    font-size: 2.2rem;
  }
}

h3,
.h3 {
  font-size: 1.6rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

@media screen and (min-width: 768px) {

  h3,
  .h3 {
    font-size: 1.7rem;
  }
}


h4,
.h4 {
  font-size: 1.4rem;
  line-height: 1.4;
}

@media screen and (min-width: 768px) {

  h4,
  .h4 {
    font-size: 1.5rem;
  }
}

h5,
.h5 {
  font-size: 1.1rem;
  /* Slightly larger than body to distinguish */
  line-height: 1.45;
}

@media screen and (min-width: 768px) {

  h5,
  .h5 {
    font-size: 1.2rem;
  }
}

h6,
.h6 {
  font-size: 1rem;
  font-weight: 600;
  /* Use weight to distinguish from body text */
  line-height: 1.5;
}

small {
  font-size: 0.875rem;
}

a {
  list-style: none;
  text-decoration: none;
  color: var(--color-foreground);
}

/* Utilities */
.is-hidden {
  opacity: 0;
  height: 0;
  margin-top: 0;
  overflow: hidden;
}

.u-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Block pointer events and dim when disabled */
.is-disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ==========================================================================
   Focus States - Enhanced keyboard navigation visibility
   ========================================================================== */
*:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reusable hint component */
.hint {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  color: var(--color-secondary);
  border-radius: 8px;
  padding: .75rem 1rem;
}

.hint__text {
  margin: 0;
  font-size: .95rem;
}

.hint__actions {
  display: flex;
  gap: .5rem;
}

/* Shared animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes bblFadInOut {

  0%,
  80%,
  100% {
    box-shadow: 0 2.5em 0 -1.3em;
  }

  40% {
    box-shadow: 0 2.5em 0 0;
  }
}

/* ==========================================================================
   Reusable Loader Component - Three-dot bouncing animation
   ========================================================================== */
.loader {
  color: var(--color-brand, #3b82f6);
  font-size: 7px;
  position: relative;
  text-indent: -9999em;
  transform: translateZ(0);
  animation-delay: -0.16s;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  animation-fill-mode: both;
  animation: bblFadInOut 1.8s infinite ease-in-out;
}

.loader:before,
.loader:after {
  content: '';
  position: absolute;
  top: 0;
  border-radius: 50%;
  width: 2.5em;
  height: 2.5em;
  animation-fill-mode: both;
  animation: bblFadInOut 1.8s infinite ease-in-out;
}

.loader:before {
  left: -3.5em;
  animation-delay: -0.32s;
}

.loader:after {
  left: 3.5em;
}

/* Loader size variants */
.loader--small {
  font-size: 5px;
}

.loader--large {
  font-size: 10px;
}

/* Loader color variants */
.loader--white {
  color: #fff;
}