/**
 * TEMPLATE T1: Jademond CMS
 * Core Stylesheet
 * 
 * Contains: Variables, Reset, Base, Buttons, Header, Navigation, Footer
 * Always loaded on every page.
 */

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    --font-primary: var(--font-sans);
    
    /* Layout */
    --max-width: 1280px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
}

.centered { text-align: center; margin-left: auto; margin-right: auto; }

section {
    padding: 6rem 1.5rem;
}

/* Spacing utilities */
.mt-4 { margin-top: 4rem; }
.mb-4 { margin-bottom: 4rem; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 1rem 2rem; font-size: 0.9375rem; font-weight: 600;
    border-radius: 4px; transition: box-shadow 0.2s ease;
    white-space: nowrap; border: none; cursor: pointer;
}

.btn--primary {
    background: linear-gradient(135deg, var(--jade) 0%, var(--jade-dark) 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0,135,108,0.3);
}

.btn--primary:hover { 
    box-shadow: 0 8px 30px rgba(0,135,108,0.4); 
}

.btn--light { 
    background: transparent; 
    color: white; 
    border: 2px solid rgba(255,255,255,0.3); 
}

.btn--light:hover { 
    background: white; 
    color: var(--ink); 
    border-color: white; 
}

.btn--secondary { 
    background: var(--pearl); 
    color: var(--ink); 
}

.btn--secondary:hover { 
    background: var(--jade-light); 
}

/* ============================================
   TYPOGRAPHY BASE
   ============================================ */

hgroup { max-width: 600px; }

hgroup small {
    display: block; 
    font-size: 0.8125rem; 
    font-weight: 600;
    letter-spacing: 0.1em; 
    text-transform: uppercase; 
    color: var(--jade); 
    margin-bottom: 0.75rem;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem); 
    font-weight: 700;
    letter-spacing: -0.02em; 
    line-height: 1.15; 
    margin-bottom: 0.75rem;
}

hgroup p { 
    font-size: 1.0625rem; 
    color: var(--charcoal); 
    line-height: 1.7; 
}

/* ============================================
   SITE HEADER
   ============================================ */

.site-header {
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    z-index: 100;
    padding: 1rem max(1.5rem, calc(50vw - var(--max-width) / 2 + 1.5rem));
    background: rgba(253,252,250,0.98);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.t1-logo {
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
    font-size: 1.375rem; 
    font-weight: 700; 
    letter-spacing: -0.02em;
    color: var(--ink);
    flex-shrink: 0;
}

.t1-logo img { 
    height: 40px; 
    width: auto; 
}

/* ============================================
   NAVIGATION
   ============================================ */

.t1-nav { 
    display: flex; 
    align-items: center; 
}

.t1-nav > ul { 
    display: flex; 
    align-items: center; 
    gap: 0.25rem; 
    margin: 0; 
    padding: 0; 
}

.t1-nav li { 
    list-style: none;
    position: relative;
}

.t1-nav > ul > li > a { 
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem; 
    font-weight: 500; 
    color: var(--charcoal); 
    transition: color 0.2s;
    border-radius: 6px;
}

.t1-nav > ul > li > a:hover { 
    color: var(--jade);
    background: var(--jade-light);
}

/* Exclude buttons from nav link hover styles */
.t1-nav > ul > li > a.btn:hover {
    background: var(--jade-bright);
    color: #ffffff;
}

.t1-nav > ul > li > a.btn--primary:hover {
    background: linear-gradient(135deg, var(--jade-bright) 0%, var(--jade) 100%);
    color: #ffffff;
}

.t1-nav .dropdown-icon {
    transition: transform 0.2s;
}

/* Dropdown Menu */
.t1-nav__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    padding: 0.5rem 0;
    margin: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 200;
}

.t1-nav__dropdown li {
    list-style: none;
}

.t1-nav__dropdown a {
    display: block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--charcoal);
    transition: background 0.15s, color 0.15s;
}

.t1-nav__dropdown a:hover {
    background: var(--jade-light);
    color: var(--jade-dark);
}

/* Show dropdown on hover and focus-within */
.t1-nav li.has-dropdown:hover > .t1-nav__dropdown,
.t1-nav li.has-dropdown:focus-within > .t1-nav__dropdown {
    opacity: 1;
    visibility: visible;
}

.t1-nav li.has-dropdown:hover .dropdown-icon,
.t1-nav li.has-dropdown:focus-within .dropdown-icon {
    transform: rotate(180deg);
}

/* Mobile Toggle */
.t1-nav-toggle { display: none; }

.t1-nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 110;
    position: relative;
}

.t1-nav-toggle-label span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.t1-nav-toggle:checked ~ .t1-nav-toggle-label span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.t1-nav-toggle:checked ~ .t1-nav-toggle-label span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.t1-nav-toggle:checked ~ .t1-nav-toggle-label span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 900px) {
    .t1-nav-toggle-label { display: flex; }
    
    .t1-nav > ul {
        position: fixed;
        top: 0;
        right: 0;
        width: min(320px, 85vw);
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5rem 0 2rem;
        background: var(--cream);
        box-shadow: -10px 0 40px rgba(0,0,0,0.15);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 105;
    }
    
    .t1-nav > ul > li {
        border-bottom: 1px solid var(--pearl);
    }
    
    .t1-nav > ul > li:last-child {
        border-bottom: none;
        padding: 1.5rem;
    }
    
    .t1-nav > ul > li > a {
        display: flex;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        font-size: 1.0625rem;
        color: var(--ink);
        font-weight: 600;
        border-radius: 0;
    }
    
    .t1-nav > ul > li > a:hover {
        background: var(--pearl);
    }
    
    .t1-nav > ul .btn {
        width: 100%;
        justify-content: center;
    }
    
    .t1-nav-toggle:checked ~ ul {
        transform: translateX(0);
    }
    
    /* Mobile Dropdown - always visible, indented */
    .t1-nav__dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--pearl);
        border-radius: 0;
        padding: 0;
    }
    
    .t1-nav__dropdown a {
        padding: 0.75rem 1.5rem 0.75rem 2.5rem;
        font-size: 0.9375rem;
        color: var(--charcoal);
    }
    
    .t1-nav__dropdown a:hover {
        background: rgba(0,0,0,0.05);
    }
    
    .t1-nav .dropdown-icon {
        display: none;
    }
}

/* ============================================
   FOOTER
   ============================================ */

.t1-footer {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    padding: 4rem max(1.5rem, calc(50vw - var(--max-width) / 2 + 1.5rem)) 2rem;
    background: var(--ink);
    color: white;
}

@media (max-width: 900px) {
    .t1-footer { 
        grid-template-columns: 1fr 1fr; 
    }
    .t1-footer__brand { 
        grid-column: 1 / -1; 
    }
}

@media (max-width: 480px) {
    .t1-footer { 
        grid-template-columns: 1fr; 
    }
}

/* Brand Column */
.t1-footer__brand { 
    max-width: 300px; 
}

.t1-footer__brand .t1-logo {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: white;
}

.t1-footer__brand .t1-logo img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.t1-footer__brand > p {
    color: rgba(255,255,255,0.6);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0 0 1rem;
}

/* Social Links */
.t1-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
}

.t1-footer__social a {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.t1-footer__social a:hover { 
    color: var(--jade-bright); 
}

.t1-footer__social a:not(:last-child)::after {
    content: "·";
    margin: 0 0.5rem;
    color: rgba(255,255,255,0.3);
}

/* Nav Columns */
.t1-footer > nav {
    display: flex;
    flex-direction: column;
}

.t1-footer > nav h3 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin: 0 0 1.25rem;
}

.t1-footer > nav a {
    color: rgba(255,255,255,0.75);
    font-size: 0.9375rem;
    padding: 0.375rem 0;
    transition: color 0.2s;
}

.t1-footer > nav a:hover { 
    color: var(--jade-bright); 
}

/* Footer Bottom */
.t1-footer__bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0 0;
    padding: 2rem 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.875rem;
    color: rgba(255,255,255,0.4);
}

.t1-footer__bottom nav {
    display: flex;
    gap: 1.5rem;
}

.t1-footer__bottom a {
    color: rgba(255,255,255,0.4);
    transition: color 0.2s;
}

.t1-footer__bottom a:hover { 
    color: white; 
}

@media (max-width: 480px) {
    .t1-footer__bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .t1-footer__bottom nav {
        justify-content: center;
    }
}
