/* ==========================================================================
   Trustline Resources - Main CSS (v2)
   Design System: "Cress" Reference (Purple/Lavender/Charcoal)
   ========================================================================== */

/* 1. CSS Variables & Tokens */
:root {
    /* Colors */
    --purple: #520E7D;
    --purple-dark: #3D0A5E;
    --purple-light: #7A3DA0;
    --lavender: #F4EFF8;
    --lavender-200: #E9DEF2;
    --charcoal: #303030;
    --charcoal-700: #4A4A4A;
    --gray-500: #6B6B6B;
    --line: #E6E1EC;
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    
    /* Typography clamp scale */
    --text-xs: clamp(0.75rem, 0.71rem + 0.18vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.83rem + 0.23vw, 1.05rem);
    --text-base: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.08rem + 0.22vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.36rem + 0.72vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.6rem + 1.36vw, 2.625rem);
    --text-4xl: clamp(2.25rem, 1.84rem + 2.05vw, 3.375rem);
    --text-5xl: clamp(2.75rem, 2.1rem + 3.27vw, 4.5rem);
    
    /* Spacing */
    --section-padding: clamp(3rem, 8vw, 7rem);
}

/* 2. Base Resets & Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--charcoal-700);
    background-color: var(--off-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-montserrat {
    font-family: 'Montserrat', sans-serif;
    color: var(--charcoal);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); font-weight: 800; }
h2 { font-size: var(--text-4xl); font-weight: 700; }
h3 { font-size: var(--text-2xl); font-weight: 700; }

a {
    color: inherit;
    text-decoration: none;
}

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

.section-padding {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}

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

/* Background Utility Classes */
.bg-white { background-color: var(--white); }
.bg-off-white { background-color: var(--off-white); }
.bg-lavender { background-color: var(--lavender); }
.bg-lavender-200 { background-color: var(--lavender-200); }
.bg-purple { background-color: var(--purple); }
.bg-charcoal { background-color: var(--charcoal); }

/* Text Utility Classes */
.text-purple { color: var(--purple); }
.text-white { color: var(--white); }
.text-charcoal { color: var(--charcoal); }
.text-charcoal-700 { color: var(--charcoal-700); }

/* 3. Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    padding: 0 1.5rem;
    text-decoration: none;
}

.btn-solid {
    background-color: var(--purple);
    color: var(--white);
    border-radius: 8px;
    border: none;
}

.btn-solid:hover {
    background-color: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(82, 14, 125, 0.3);
}

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

.btn-pill {
    background-color: transparent;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    border-radius: 9999px; /* Fully rounded */
}

.btn-pill:hover {
    background-color: var(--purple);
    color: var(--white);
}

@media (max-width: 639px) {
    .btn {
        width: 100%;
    }
}

/* 4. Cards */
/* Sector/Photo Card */
.photo-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(82, 14, 125, 0.1);
}

.photo-card-img-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.photo-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Treated image look: slight desaturation and purple overlay applied via pseudoelement */
}

.photo-card-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(82, 14, 125, 0.3); /* Purple overlay at 30% */
    pointer-events: none;
}

.photo-card-content {
    padding: 2rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.photo-card-title {
    color: var(--purple);
    margin-bottom: 1rem;
    font-size: var(--text-xl);
}

.photo-card-desc {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Service Card */
.service-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    border: 1.5px solid var(--line);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.service-card.outlined {
    border-color: var(--purple);
}

.service-card-icon {
    width: 48px;
    height: 48px;
    color: var(--purple);
    margin-bottom: 1.5rem;
}

.service-card-title {
    color: var(--purple);
    font-size: var(--text-lg);
    margin-bottom: 1rem;
}

/* TRUST Letter Card */
.letter-card {
    background: transparent;
    border: 1.5px solid var(--purple);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.letter-card:hover {
    background: var(--purple);
}

.letter-card:hover .letter-initial,
.letter-card:hover .letter-label {
    color: var(--white);
}

.letter-initial {
    font-family: 'Montserrat', sans-serif;
    font-size: var(--text-5xl);
    font-weight: 800;
    color: var(--purple);
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.letter-label {
    font-weight: 600;
    color: var(--charcoal);
    font-size: var(--text-base);
    transition: color 0.3s ease;
}

/* 5. Section Patterns & Motifs */

/* Watermark Headings */
.watermark-container {
    position: relative;
    padding-top: 2rem;
}

.watermark-text {
    position: absolute;
    top: -20px;
    left: -10px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 800;
    color: var(--line);
    opacity: 0.4;
    z-index: 0;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.05em;
}

.watermark-content {
    position: relative;
    z-index: 1;
}

/* Section Label */
.section-label {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--purple);
    margin-bottom: 1rem;
}

/* Hexagon Decor */
.bg-hexagon-pattern {
    position: relative;
    overflow: hidden;
}

.bg-hexagon-pattern::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -5%;
    width: 300px;
    height: 300px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115.47'%3E%3Cpath d='M50 0L100 28.87v57.73L50 115.47 0 86.6V28.87z' fill='none' stroke='%237A3DA0' stroke-width='2' stroke-opacity='0.15'/%3E%3C/svg%3E");
    background-size: 100px;
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
}

/* Slanted Bands (Clip-Path) */
.slanted-band {
    position: relative;
    padding-top: calc(var(--section-padding) + 3vw);
    padding-bottom: calc(var(--section-padding) + 3vw);
    background-color: var(--purple);
    color: var(--white);
    clip-path: polygon(0 4vw, 100% 0, 100% calc(100% - 4vw), 0 100%);
    margin-top: -4vw;
    z-index: 10;
}

.slanted-band h2 {
    color: var(--white);
}

.slanted-band.slanted-bottom-only {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
    margin-top: 0;
}

/* Stat Cards Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin-top: -3rem; /* overlap previous section */
    position: relative;
    z-index: 20;
}

@media (min-width: 640px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .stats-row { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.stat-card.stat-purple {
    background: var(--purple);
    color: var(--white);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1.5rem auto;
    color: var(--purple);
}

.stat-card.stat-purple .stat-card-icon {
    color: var(--white);
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card:not(.stat-purple) .stat-number {
    color: var(--purple);
}

.stat-label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.stat-card:not(.stat-purple) .stat-label {
    color: var(--charcoal);
}

/* 6. Layout Utilities (Tailwind-like) */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:w-1\/2 { width: 50%; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.w-full { width: 100%; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

.pt-32 { padding-top: 8rem; }
.pb-32 { padding-bottom: 8rem; }

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

.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

.hidden { display: none; }
@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
}
