/*
Theme Name: Dissertation Statistics Help Pro
Theme URI: https://dissertationstatisticshelp.com
Author: Dominic Tanu
Author URI: https://dissertationstatisticshelp.com
Description: Enterprise-grade premium WordPress theme for professional academic statistical consulting. Features SaaS-level UI, Elementor integration, Tailwind CSS utilities, custom post types for services, case studies, and statistical methods.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dsh-theme
Tags: academic, consulting, statistics, elementor, woocommerce, custom-colors, custom-logo, featured-images, full-width-template, post-formats, theme-options
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
*/

/* ================================================
   DESIGN SYSTEM — CSS Custom Properties
   ================================================ */

:root {
    /* ── Primary Palette (Deep Academic Blue) ── */
    --dsh-primary-50: #eef2ff;
    --dsh-primary-100: #e0e7ff;
    --dsh-primary-200: #c7d2fe;
    --dsh-primary-300: #a5b4fc;
    --dsh-primary-400: #818cf8;
    --dsh-primary-500: #1e3a8a;
    --dsh-primary-600: #1e40af;
    --dsh-primary-700: #1e3a8a;
    --dsh-primary-800: #1e2d6d;
    --dsh-primary-900: #0f172a;

    /* ── Accent Colors ── */
    --dsh-emerald-500: #10b981;
    --dsh-emerald-600: #059669;
    --dsh-gold-400: #fbbf24;
    --dsh-gold-500: #f59e0b;

    /* ── Neutral Palette ── */
    --dsh-gray-50: #f8fafc;
    --dsh-gray-100: #f1f5f9;
    --dsh-gray-200: #e2e8f0;
    --dsh-gray-300: #cbd5e1;
    --dsh-gray-400: #94a3b8;
    --dsh-gray-500: #64748b;
    --dsh-gray-600: #475569;
    --dsh-gray-700: #334155;
    --dsh-gray-800: #1e293b;
    --dsh-gray-900: #0f172a;

    /* ── Background Strategy ── */
    --dsh-bg-main: #f8fafc;
    --dsh-bg-card: #ffffff;
    --dsh-bg-footer: #0f172a;
    --dsh-bg-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);

    /* ── Typography ── */
    --dsh-font-heading: 'Playfair Display', Georgia, serif;
    --dsh-font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --dsh-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* ── Font Sizes (Fluid) ── */
    --dsh-text-xs: 0.75rem;
    --dsh-text-sm: 0.875rem;
    --dsh-text-base: 1rem;
    --dsh-text-lg: 1.125rem;
    --dsh-text-xl: 1.25rem;
    --dsh-text-2xl: 1.5rem;
    --dsh-text-3xl: 1.875rem;
    --dsh-text-4xl: 2.25rem;
    --dsh-text-5xl: 3rem;
    --dsh-text-6xl: 3.75rem;

    /* ── Spacing ── */
    --dsh-space-xs: 0.25rem;
    --dsh-space-sm: 0.5rem;
    --dsh-space-md: 1rem;
    --dsh-space-lg: 1.5rem;
    --dsh-space-xl: 2rem;
    --dsh-space-2xl: 3rem;
    --dsh-space-3xl: 4rem;
    --dsh-space-4xl: 6rem;

    /* ── Border Radius ── */
    --dsh-radius-sm: 0.375rem;
    --dsh-radius-md: 0.5rem;
    --dsh-radius-lg: 0.75rem;
    --dsh-radius-xl: 1rem;
    --dsh-radius-2xl: 1.5rem;
    --dsh-radius-full: 9999px;

    /* ── Shadows ── */
    --dsh-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --dsh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --dsh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --dsh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --dsh-shadow-glow: 0 0 20px rgba(30, 58, 138, 0.15);

    /* ── Transitions ── */
    --dsh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --dsh-transition-fast: all 0.15s ease;
    --dsh-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================
   BASE RESET & GLOBAL STYLES
   ================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--dsh-font-body);
    font-size: var(--dsh-text-base);
    line-height: 1.7;
    color: var(--dsh-gray-700);
    background-color: var(--dsh-bg-main);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--dsh-font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dsh-gray-900);
    margin-top: 0;
}

h1 {
    font-size: var(--dsh-text-5xl);
}

h2 {
    font-size: var(--dsh-text-4xl);
}

h3 {
    font-size: var(--dsh-text-3xl);
}

h4 {
    font-size: var(--dsh-text-2xl);
}

h5 {
    font-size: var(--dsh-text-xl);
}

h6 {
    font-size: var(--dsh-text-lg);
}

a {
    color: var(--dsh-primary-600);
    text-decoration: none;
    transition: var(--dsh-transition-fast);
}

a:hover {
    color: var(--dsh-primary-500);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Container ── */
.dsh-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dsh-container-narrow {
    max-width: 960px;
}

.dsh-container-wide {
    max-width: 1440px;
}

/* ── Section Spacing ── */
.dsh-section {
    padding: var(--dsh-space-4xl) 0;
}

.dsh-section-sm {
    padding: var(--dsh-space-2xl) 0;
}

/* ── Section Headers ── */
.dsh-section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--dsh-space-3xl);
}

.dsh-section-header .dsh-overline {
    display: inline-block;
    font-family: var(--dsh-font-mono);
    font-size: var(--dsh-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dsh-primary-600);
    background: var(--dsh-primary-50);
    padding: 0.375rem 1rem;
    border-radius: var(--dsh-radius-full);
    margin-bottom: var(--dsh-space-md);
}

.dsh-section-header h2 {
    margin-bottom: var(--dsh-space-md);
}

.dsh-section-header p {
    font-size: var(--dsh-text-lg);
    color: var(--dsh-gray-500);
}

/* ── Cards ── */
.dsh-card {
    background: var(--dsh-bg-card);
    border-radius: var(--dsh-radius-xl);
    padding: var(--dsh-space-xl);
    box-shadow: var(--dsh-shadow-md);
    border: 1px solid var(--dsh-gray-200);
    transition: var(--dsh-transition);
}

.dsh-card:hover {
    box-shadow: var(--dsh-shadow-xl);
    transform: translateY(-4px);
    border-color: var(--dsh-primary-200);
}

.dsh-card-flat {
    box-shadow: none;
    border: 1px solid var(--dsh-gray-200);
}

/* ── Buttons ── */
.dsh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--dsh-font-body);
    font-size: var(--dsh-text-sm);
    font-weight: 600;
    border-radius: var(--dsh-radius-lg);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--dsh-transition);
    text-decoration: none;
    line-height: 1;
}

.dsh-btn-primary {
    background: var(--dsh-primary-600);
    color: #ffffff;
    border-color: var(--dsh-primary-600);
}

.dsh-btn-primary:hover {
    background: var(--dsh-primary-500);
    border-color: var(--dsh-primary-500);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.3);
}

.dsh-btn-secondary {
    background: transparent;
    color: var(--dsh-primary-600);
    border-color: var(--dsh-primary-600);
}

.dsh-btn-secondary:hover {
    background: var(--dsh-primary-600);
    color: #ffffff;
    transform: translateY(-2px);
}

.dsh-btn-gold {
    background: linear-gradient(135deg, var(--dsh-gold-400), var(--dsh-gold-500));
    color: var(--dsh-gray-900);
    border-color: var(--dsh-gold-500);
    font-weight: 700;
}

.dsh-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
    color: var(--dsh-gray-900);
}

.dsh-btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: var(--dsh-text-base);
    border-radius: var(--dsh-radius-xl);
}

.dsh-btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--dsh-text-xs);
}

/* ── Badges ── */
.dsh-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: var(--dsh-text-xs);
    font-weight: 600;
    border-radius: var(--dsh-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dsh-badge-primary {
    background: var(--dsh-primary-50);
    color: var(--dsh-primary-600);
}

.dsh-badge-emerald {
    background: #ecfdf5;
    color: var(--dsh-emerald-600);
}

.dsh-badge-gold {
    background: #fffbeb;
    color: #b45309;
}

/* ── Grid Utilities ── */
.dsh-grid {
    display: grid;
    gap: var(--dsh-space-xl);
}

.dsh-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.dsh-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dsh-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .dsh-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dsh-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .dsh-grid-4,
    .dsh-grid-3,
    .dsh-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Flex Utilities ── */
.dsh-flex {
    display: flex;
}

.dsh-flex-col {
    flex-direction: column;
}

.dsh-flex-center {
    align-items: center;
    justify-content: center;
}

.dsh-flex-between {
    align-items: center;
    justify-content: space-between;
}

.dsh-flex-wrap {
    flex-wrap: wrap;
}

.dsh-gap-sm {
    gap: var(--dsh-space-sm);
}

.dsh-gap-md {
    gap: var(--dsh-space-md);
}

.dsh-gap-lg {
    gap: var(--dsh-space-lg);
}

.dsh-gap-xl {
    gap: var(--dsh-space-xl);
}

/* ── Text Utilities ── */
.dsh-text-center {
    text-align: center;
}

.dsh-text-left {
    text-align: left;
}

.dsh-text-right {
    text-align: right;
}

.dsh-text-primary {
    color: var(--dsh-primary-600);
}

.dsh-text-muted {
    color: var(--dsh-gray-500);
}

.dsh-text-white {
    color: #ffffff;
}

.dsh-font-heading {
    font-family: var(--dsh-font-heading);
}

.dsh-font-mono {
    font-family: var(--dsh-font-mono);
}

/* ── Visibility ── */
.dsh-hidden {
    display: none;
}

.dsh-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ── Responsive Visibility ── */
@media (max-width: 768px) {
    .dsh-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .dsh-hide-desktop {
        display: none !important;
    }
}

/* ── Divider ── */
.dsh-divider {
    height: 1px;
    background: var(--dsh-gray-200);
    border: none;
    margin: var(--dsh-space-2xl) 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dsh-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--dsh-gray-400);
    border-radius: var(--dsh-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dsh-gray-500);
}

/* ── Selection ── */
::selection {
    background: var(--dsh-primary-200);
    color: var(--dsh-primary-900);
}

/* ── WP Core Overrides ── */
.wp-block-group {
    margin-bottom: 0;
}

.entry-content>*+* {
    margin-top: var(--dsh-space-lg);
}

/* ================================================
   SINGLE POST & ARCHIVE ENHANCEMENTS
   ================================================ */

/* --- Page Hero --- */
.dsh-page-hero {
    padding-top: 5rem;
    padding-bottom: 5rem;
    color: #fff;
}

.dsh-page-hero .dsh-section-header h1 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* --- Breadcrumbs --- */
.dsh-breadcrumbs {
    display: inline-block;
    background-color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--dsh-radius-lg);
    box-shadow: var(--dsh-shadow-sm);
    border: 1px solid var(--dsh-gray-200);
    font-size: var(--dsh-text-sm);
    color: var(--dsh-gray-500);
    margin-bottom: var(--dsh-space-lg);
}

.dsh-breadcrumbs ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dsh-breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsh-breadcrumbs a {
    color: var(--dsh-gray-600);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--dsh-transition-fast);
}

.dsh-breadcrumbs a:hover {
    color: var(--dsh-primary-600);
}

.dsh-breadcrumbs .dsh-breadcrumb-separator {
    color: var(--dsh-gray-400);
}

.dsh-breadcrumbs li span[itemprop="name"] {
    color: var(--dsh-gray-800);
    font-weight: 500;
}

.dsh-breadcrumbs a i {
    font-size: 1.1rem;
}

/* --- Single Post Layout --- */
.dsh-sticky-sidebar {
    position: sticky;
    top: 120px;
    /* Adjust based on sticky header height */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dsh-single-article .entry-content h2,
.dsh-single-article .entry-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 120px;
    /* Offset for sticky header */
}

/* --- Widgets --- */
.dsh-widget {
    background: var(--dsh-bg-card);
    border: 1px solid var(--dsh-gray-200);
    border-radius: var(--dsh-radius-xl);
    padding: var(--dsh-space-xl);
    box-shadow: var(--dsh-shadow-sm);
}

.dsh-widget-title {
    font-family: var(--dsh-font-heading);
    font-size: var(--dsh-text-lg);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dsh-gray-200);
}

/* --- TOC Widget --- */
.dsh-toc ul {
    padding-left: 0.5rem;
}

.dsh-toc-item a {
    color: var(--dsh-gray-600);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--dsh-transition-fast);
    padding: 0.25rem 0.5rem;
    border-left: 2px solid var(--dsh-gray-200);
}

.dsh-toc-item a:hover {
    color: var(--dsh-primary-600);
    background-color: var(--dsh-primary-50);
    border-left-color: var(--dsh-primary-600);
    transform: translateX(4px);
}

.dsh-toc-item--h3 {
    padding-left: 1rem;
}

/* --- Author Bio Widget V2 --- */
.dsh-author-bio-v2__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: var(--dsh-emerald-500);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.dsh-social-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--dsh-gray-100);
    color: var(--dsh-gray-600);
    transition: var(--dsh-transition);
}

.dsh-social-icon:hover {
    background-color: var(--dsh-primary-600);
    color: #fff;
    transform: translateY(-2px);
}

/* --- Archive Writer Card --- */
.dsh-writer-card {
    transition: var(--dsh-transition);
}

.dsh-writer-card:hover {
    transform: translateY(-5px);
}

.dsh-writer-card .dsh-btn {
    opacity: 0;
    transform: translateY(10px);
    transition: var(--dsh-transition);
}

.dsh-writer-card:hover .dsh-btn {
    opacity: 1;
    transform: translateY(0);
}

/* --- Horizontal Post Card (Blog Archive) --- */
.dsh-post-card-h__image {
    flex-basis: 300px;
    flex-shrink: 0;
}

.dsh-post-card-h__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Single Post Hero --- */
.dsh-post-hero {
    padding: 6rem 0;
}

.dsh-post-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dsh-post-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dsh-post-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    /* slate-900 with alpha */
    backdrop-filter: blur(8px);
}

.dsh-post-hero .dsh-breadcrumbs a,
.dsh-post-hero .dsh-breadcrumbs span {
    color: var(--dsh-gray-300);
}

.dsh-post-hero .dsh-breadcrumbs a:hover {
    color: #fff;
}

.dsh-post-hero .dsh-breadcrumbs li span[itemprop="name"] {
    color: #fff;
}

/* --- Post Tags --- */
.dsh-post-tags h4 {
    font-size: var(--dsh-text-base);
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.dsh-post-tags a {
    display: inline-block;
    background-color: var(--dsh-gray-100);
    color: var(--dsh-gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: var(--dsh-radius-full);
    text-decoration: none;
    font-size: var(--dsh-text-sm);
    transition: var(--dsh-transition);
}

.dsh-post-tags a:hover {
    background-color: var(--dsh-primary-600);
    color: #fff;
}


/* ================================================
   POST & CONTENT META STYLES
   ================================================ */

/* ── Author Bio & Meta Details ── */
.dsh-author-bio .avatar {
    border: 2px solid var(--dsh-gray-200);
}

.dsh-meta-details {
    color: var(--dsh-gray-500);
}

.dsh-meta-details i {
    color: var(--dsh-primary-400);
    vertical-align: middle;
}

/* ── Table of Contents ── */
.dsh-toc {
    position: relative;
}

.dsh-toc-item {
    position: relative;
    padding-left: 1.25rem;
}

.dsh-toc-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--dsh-gray-200);
    transition: var(--dsh-transition);
}

.dsh-toc-item a:hover::before {
    background-color: var(--dsh-primary-500);
}

.dsh-toc-item--h3 {
    margin-left: 1rem;
}

.dsh-toc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dsh-gray-400);
    transition: var(--dsh-transition);
    position: absolute;
    left: -0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--dsh-bg-main);
    padding: 0.1rem;
}

.dsh-toc-text {
    font-size: var(--dsh-text-sm);
    font-weight: 500;
}

.dsh-toc-item a:hover .dsh-toc-icon {
    color: var(--dsh-primary-600);
    transform: translateY(-50%) rotate(90deg);
}

.dsh-toc-item a:hover .dsh-toc-text {
    color: var(--dsh-primary-600);
}


/* ── Custom Scrollable Content ── */
.dsh-scrollable-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
    /* Add some space for the scrollbar */
}

/* ── Custom Archive Styles ── */

/* Case Studies */
.dsh-card-hover {
    transition: var(--dsh-transition);
}

.dsh-card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--dsh-shadow-xl) !important;
}

.hover-scale {
    transition: transform 0.5s ease;
}

.dsh-card-hover:hover .hover-scale {
    transform: scale(1.05);
}

.hover-text-primary:hover {
    color: var(--dsh-primary-600) !important;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Testimonials Masonry */
.dsh-masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.dsh-masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Writers Grid */
.dsh-writer-avatar .hover-scale {
    transition: transform 0.3s ease;
}

.dsh-writer-card:hover .dsh-writer-avatar .hover-scale {
    transform: scale(1.05);
}

.grayscale {
    filter: grayscale(100%);
}

.hover-color {
    transition: filter 0.3s ease;
}

.dsh-writer-card:hover .grayscale {
    filter: grayscale(0%);
}

.group-hover-opacity-100 {
    opacity: 0;
}

.dsh-writer-card:hover .group-hover-opacity-100 {
    opacity: 1;
}