/*
 Theme Name:   Selangor Theme
 Theme URI:    https://selangor.com
 Description:  Custom Genesis child theme for Selangor.com — Business & Living Hub. AI-agent built, trilingual (EN/BM/BI).
 Author:       Selangor.com
 Author URI:   https://selangor.com
 Template:     genesis
 Version:      1.0.0
 License:      GPL-2.0-or-later
 Text Domain:  selangor-theme
*/

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Brand Colors */
    --color-primary: #1B4D7A;          /* Deep blue — authority, trust */
    --color-primary-dark: #0F3357;
    --color-primary-light: #2A6FAF;
    --color-secondary: #E8A838;         /* Gold accent — premium, warm */
    --color-secondary-dark: #C88B1E;
    --color-secondary-light: #F4C563;
    --color-accent: #2EAD6D;            /* Green — growth, prosperity */

    /* Neutrals */
    --color-white: #FFFFFF;
    --color-off-white: #F8F9FA;
    --color-light-gray: #E9ECEF;
    --color-mid-gray: #ADB5BD;
    --color-dark-gray: #495057;
    --color-near-black: #212529;
    --color-black: #000000;

    /* Semantic Colors */
    --color-text: #212529;
    --color-text-light: #6C757D;
    --color-text-inverse: #FFFFFF;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8F9FA;
    --color-border: #DEE2E6;
    --color-link: #1B4D7A;
    --color-link-hover: #E8A838;
    --color-success: #2EAD6D;
    --color-error: #DC3545;
    --color-warning: #FFC107;

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes (fluid scale) */
    --text-xs: clamp(0.7rem, 0.66rem + 0.2vw, 0.8rem);
    --text-sm: clamp(0.8rem, 0.76rem + 0.2vw, 0.9rem);
    --text-base: clamp(0.95rem, 0.91rem + 0.2vw, 1.05rem);
    --text-lg: clamp(1.1rem, 1.02rem + 0.4vw, 1.3rem);
    --text-xl: clamp(1.3rem, 1.18rem + 0.6vw, 1.6rem);
    --text-2xl: clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
    --text-3xl: clamp(2rem, 1.7rem + 1.5vw, 2.8rem);
    --text-4xl: clamp(2.4rem, 2rem + 2vw, 3.5rem);

    /* Font Weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Line Heights */
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* Spacing Scale */
    --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-narrow: 800px;
    --container-wide: 1400px;
    --sidebar-width: 300px;
    --gap: clamp(1rem, 0.5rem + 2vw, 2rem);

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

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

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

    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

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

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--color-near-black);
    margin-top: 0;
    margin-bottom: var(--space-md);
}

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

/* Body Text */
p {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

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

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

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

/* Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

li {
    margin-bottom: var(--space-xs);
}

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

/* ==========================================================================
   Layout Grid
   ========================================================================== */

.site-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.site-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}

/* Content + Sidebar layout */
.content-sidebar-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

@media (min-width: 960px) {
    .content-sidebar-wrap {
        grid-template-columns: 1fr var(--sidebar-width);
    }
}

/* Full-width layout */
.full-width-content .content-sidebar-wrap {
    grid-template-columns: 1fr;
}

.full-width-content .content-sidebar-wrap .content {
    max-width: var(--container-narrow);
    margin: 0 auto;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.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;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

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

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
