/*
Theme Name: Tamang Theme
Theme URI: https://tamangsociety.ca
Author: Ram Bhandari, Karya Technology Pvt. Ltd.
Author URI: https://karyatech.com
Description: Official theme for Tamang Society of Canada. A custom WordPress theme featuring membership management, events, and gallery functionality.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tamang-theme
Tags: custom-menu, featured-images, responsive-layout, custom-logo, membership
*/

/* =========================================================
   CSS Custom Properties — Option A Color Palette
   ========================================================= */
:root {
  /* Brand Colors */
  --color-primary:       #1E3A5F; /* Himalayan Navy */
  --color-secondary:     #4A7C59; /* Sagarmatha Green (replaces Tamang Crimson in light mode) */
  --color-accent:        #D4A843; /* Dharma Gold */
  --color-success:       #4A7C59; /* Sagarmatha Green */

  /* Neutrals */
  --color-snow:          #FAFBFD;
  --color-mist:          #F0F2F6;
  --color-border:        #E2E6EC;
  --color-charcoal:      #1E2328;

  /* Semantic aliases */
  --color-bg:            #F0F2F6;   /* Cloud Mist — page background */
  --color-surface:       #E4E9F2;   /* Deeper mist — alt section backgrounds */
  --color-card:          #FAFBFD;   /* Snow — raised card / panel backgrounds */
  --color-text:          var(--color-charcoal);
  --color-text-light:    #5A6270;
  --color-link:          var(--color-primary);
  --color-link-hover:    var(--color-secondary);

  /* Typography */
  --font-display:        'Playfair Display', Georgia, serif;
  --font-body:           'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --font-size-xs:        0.75rem;
  --font-size-sm:        0.875rem;
  --font-size-base:      1rem;
  --font-size-md:        1.125rem;
  --font-size-lg:        1.25rem;
  --font-size-xl:        1.5rem;
  --font-size-2xl:       2rem;
  --font-size-3xl:       2.5rem;
  --font-size-4xl:       3rem;

  --line-height-tight:   1.2;
  --line-height-normal:  1.6;
  --line-height-loose:   1.8;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;

  /* Layout */
  --container-max:       1200px;
  --container-wide:      1400px;
  --container-narrow:    800px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(30, 58, 95, 0.08);
  --shadow-md:    0 4px 12px rgba(30, 58, 95, 0.12);
  --shadow-lg:    0 8px 24px rgba(30, 58, 95, 0.16);
  --shadow-xl:    0 16px 48px rgba(30, 58, 95, 0.20);

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Z-index layers */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
}

/* =========================================================
   Dark Mode — Semantic Token Overrides
   Applied when html[data-theme="dark"] is set by JS toggle
   ========================================================= */
html[data-theme="dark"] {
  --color-bg:          #0F1923;
  --color-surface:     #162231;
  --color-card:        #1A2A3A;
  --color-text:        #E8EDF2;
  --color-text-light:  #8D9AAB;
  --color-border:      #243447;
  --color-link:        #6B9FD4;
  --color-link-hover:  #D4A843;
  /* No red in dark mode — brand gold replaces crimson for all text, icons & interactive */
  --color-secondary:   #D4A843;
  --shadow-sm:  0 1px 3px  rgba(0,0,0,0.40);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.50);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.60);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.70);
}

/* =========================================================
   Reset & Base
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: #152e4d; /* match topbar — fills the gap when WP admin bar adds margin-top to html */
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-loose);
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

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

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

/* =========================================================
   Layout Utilities
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}

.btn--primary:hover {
  background-color: #8f1a27;
  border-color: #8f1a27;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.btn--gold {
  background-color: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-accent);
}

.btn--gold:hover {
  background-color: #b8902f;
  border-color: #b8902f;
  color: #fff;
}

/* =========================================================
   Screen reader only
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   WordPress Core Classes
   ========================================================= */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--font-size-sm); color: var(--color-text-light); }
.sticky {}
.gallery-caption {}
.bypostauthor {}
.alignnone { margin: var(--space-sm) var(--space-md) var(--space-md) 0; }
.aligncenter { display: block; margin: var(--space-md) auto; }
.alignright { float: right; margin: var(--space-sm) 0 var(--space-md) var(--space-md); }
.alignleft  { float: left;  margin: var(--space-sm) var(--space-md) var(--space-md) 0; }

/* =========================================================
   Skip Link
   ========================================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: var(--z-modal);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* =========================================================
   Responsive base
   ========================================================= */
@media (max-width: 768px) {
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }
}

/* =========================================================
   Tibetan Script — shared utility
   Applied to all Tibetan text across the site
   ========================================================= */
.bo-script {
  font-family: 'Noto Serif Tibetan', 'Microsoft Himalaya', serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
