/*
Theme Name: Larun Child
Theme URI: https://laruneng.com
Template: bloghash
Author: Larun Engineering
Author URI: https://laruneng.com
Description: Child theme for Bloghash, implementing the Larun Platform design system.
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: larun-child
*/

/* =================================================================*********
 *  Larun Design Tokens & Overrides
 *  (Inherits from Bloghash, overrides specific elements)
 * =================================================================********* */

/* Layout & Container (Essential for centering) */
.site-main,
#main,
#primary {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
}

/* Force Centering specifically on Home */
body.home #page,
body.home .site-content,
body.home .site-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body.home .container {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    max-width: 1200px;
    /* robust default */
}

.container {
    width: 100%;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1536px;
        /* Increased from 1400px */
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
}

/* =========================================
   Functional Safety Course Styles
   ========================================= */

/* Key concepts and important notes */
.key-concept {
    background-color: #f0f7ff;
    border-left: 4px solid #2196F3;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
}

/* Formula boxes */
.formula-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
}

.formula {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: #475569;
    padding: 1rem;
    background: #ffffff;
    border-radius: 0.25rem;
}

/* Data tables */
.data-table,
.terminology-table,
.comparison-table,
.structure-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.data-table th,
.terminology-table th,
.comparison-table th,
.structure-table th {
    background-color: #1e293b;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td,
.terminology-table td,
.comparison-table td,
.structure-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.data-table tr:nth-child(even),
.terminology-table tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Learning objectives */
.learning-objective {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 1.5rem;
    margin: 2.5rem 0;
    border-radius: 0.5rem;
}

/* Example boxes */
.example-box {
    background-color: #fff7ed;
    border-left: 4px solid #f97316;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
}

/* Historical/warning notes */
.historical-note,
.key-statistic {
    background-color: #fdf2f8;
    border-left: 4px solid #db2777;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
}

/* Concept Diagram Placeholder Style */
.concept-diagram {
    background: #f1f5f9;
    padding: 2rem;
    text-align: center;
    border-radius: 0.5rem;
    border: 2px dashed #cbd5e1;
    margin: 2rem 0;
    font-weight: 500;
    color: #475569;
}


:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --border: 214.3 31.8% 91.4%;
    --radius: 0.5rem;
}

/* Typography Overrides */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: hsl(var(--foreground));
}

/* Header Tweaks */
.site-header {
    background-color: hsl(var(--background)) !important;
    border-bottom: 1px solid hsl(var(--border));
}

/* Interactive Card Styles (Larun Specific) */
.card {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: hsl(var(--primary));
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

.card:hover .card-icon {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* Background Utilities */
.bg-slate-50\/50 {
    background-color: hsl(210 40% 96.1% / 0.5);
}

/* Button Overrides */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    opacity: 0.9;
    color: hsl(var(--primary-foreground));
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--background));
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid hsl(var(--border));
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
 *  UTILITIES (Adding missing Tailwind-like classes used in templates)
 * ========================================================================== */

/* Grid System */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-12 {
    gap: 3rem;
}

@media (min-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:col-span-1 {
        grid-column: span 1 / span 1;
    }

    .md\:col-span-3 {
        grid-column: span 3 / span 3;
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:mt-0 {
        margin-top: 0;
    }

    .md\:mb-0 {
        margin-bottom: 0;
    }
}

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Spacing */
.pt-16 {
    padding-top: 4rem;
}

.pb-8 {
    padding-bottom: 2rem;
}

.mt-auto {
    margin-top: auto;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

/* Sizing & Alignment (Missing classes causing left-alignment) */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.w-full {
    width: 100%;
}

.max-w-sm {
    max-width: 24rem;
}

.max-w-\[58rem\] {
    max-width: 58rem;
}

.max-w-\[64rem\] {
    max-width: 64rem;
}

.max-w-\[72rem\] {
    max-width: 72rem;
}

.max-w-\[85\%\] {
    max-width: 85%;
}

/* Colors & Backgrounds */
.bg-secondary {
    background-color: hsl(var(--secondary));
}

.text-secondary-foreground {
    color: hsl(var(--secondary-foreground));
}

.text-foreground {
    color: hsl(var(--foreground));
}

.text-muted-foreground {
    color: hsl(var(--muted-foreground));
}

.bg-primary {
    background-color: hsl(var(--primary));
}

.text-primary-foreground {
    color: hsl(var(--primary-foreground));
}

.hover\:text-primary:hover {
    color: hsl(var(--primary));
}

.hover\:text-foreground:hover {
    color: hsl(var(--foreground));
}

.border-t {
    border-top-width: 1px;
}

.border-border {
    border-color: hsl(var(--border));
}

/* Typography */
.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.leading-relaxed {
    line-height: 1.625;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.hover\:no-underline:hover {
    text-decoration: none;
}

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

/* Visibility & Transitions */
.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-300 {
    transition-duration: 300ms;
}

.fixed {
    position: fixed;
}

.bottom-8 {
    bottom: 2rem;
}

.right-8 {
    right: 2rem;
}

.z-50 {
    z-index: 50;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.rounded-full {
    border-radius: 9999px;
}

.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

.transform {
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.translate-y-4 {
    --tw-translate-y: 1rem;
    transform: translateY(1rem);
}

.translate-y-0 {
    --tw-translate-y: 0px;
    transform: translateY(0px);
}

.hover\:-translate-y-1:hover {
    --tw-translate-y: -0.25rem;
    transform: translateY(-0.25rem);
}

/* Modern Feature Card Extensions */
.hover\:shadow-2xl:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.border-t-4 {
    border-top-width: 4px;
}

.border-t-primary\/0 {
    border-top-color: hsl(var(--primary) / 0);
}

.hover\:border-t-primary:hover {
    border-top-color: hsl(var(--primary));
}

.rounded-2xl {
    border-radius: 1rem;
}

.bg-primary\/5 {
    background-color: hsl(var(--primary) / 0.05);
}

.group:hover .group-hover\:bg-primary {
    background-color: hsl(var(--primary));
}

.group:hover .group-hover\:text-white {
    color: #ffffff;
}

.group:hover .group-hover\:translate-x-1 {
    transform: translateX(0.25rem);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.inline-flex {
    display: inline-flex;
}

/* =================================================================*********
 *  App Embed Template Styles (Fixed Sizing)
 * =================================================================********* */
/* =================================================================*********
 *  App Embed Template Styles (Fixed Sizing)
 * =================================================================********* */
.app-embed-wrapper {
    /* Go full width/height */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.app-container {
    width: 100%;
    /* Calculate height: 100vh minus approximate header height (usually ~80-100px) */
    height: calc(100vh - 80px);
    min-height: 800px;
    /* Strong fallback */
    overflow: hidden;
    position: relative;
    background-color: hsl(var(--background));
}

.app-frame {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

/* =================================================================*********
 *  PREMIUM UI UPGRADES (Visual Polish)
 * =================================================================********* */

/* 1. Subtle Hero Gradient Background */
.bg-hero-gradient {
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

/* 2. Text Gradient for Headlines */
.text-gradient {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(217, 91%, 60%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
    /* Ensure block for gradient to work on breaks */
}

/* 3. Glassmorphism Card Effect */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    /* Primary color hint */
}

/* 4. Enhanced Buttons */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.btn-glow:hover::after {
    opacity: 1;
    transform: scale(1);
}