/* ============================================
   Planet Inter Logistics - Custom Theme CSS
   Theme: Red Corporate
   ============================================ */

:root {
    --pil-dark: #1A0A0A;
    --pil-dark-light: #2B1215;
    --pil-dark-mid: #3D1A1E;
    --pil-red: #DC2626;
    --pil-red-dark: #B91C1C;
    --pil-red-light: #F87171;
    --pil-red-glow: rgba(220, 38, 38, 0.12);
    --pil-orange: #FF6B35;
    --pil-orange-light: #FF9F6C;
    --pil-green: #00D68F;
    --pil-gray-100: #FAF5F5;
    --pil-gray-200: #EDE2E2;
    --pil-gray-300: #C9B0B0;
    --pil-gray-600: #6B5A5A;
    --pil-gray-800: #2A2020;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Navbar sticky */
.pil-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

/* Nav link hover */
.pil-nav-link {
    position: relative;
    transition: all 0.3s ease;
}
.pil-nav-link:hover {
    color: var(--pil-red) !important;
    background: var(--pil-red-glow);
}
.pil-nav-link.active {
    color: var(--pil-red) !important;
    background: var(--pil-red-glow);
    font-weight: 600;
}

/* Buttons */
.btn-pil-primary {
    background: linear-gradient(135deg, var(--pil-red) 0%, var(--pil-red-dark) 100%);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-pil-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.45);
}

.btn-pil-secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-pil-secondary:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* Hero section */
.pil-hero {
    background: linear-gradient(135deg, var(--pil-dark) 0%, var(--pil-dark-light) 40%, var(--pil-dark-mid) 100%);
    position: relative;
    overflow: hidden;
}
.pil-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(220,38,38,0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: pil-float 8s ease-in-out infinite;
}
.pil-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: pil-float 10s ease-in-out infinite reverse;
}

.pil-hero .grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes pil-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}
@keyframes pil-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes pil-fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.pil-animate-up {
    animation: pil-fadeInUp 0.8s ease both;
}
.pil-animate-up-1 { animation-delay: 0.1s; }
.pil-animate-up-2 { animation-delay: 0.2s; }
.pil-animate-up-3 { animation-delay: 0.3s; }
.pil-animate-up-4 { animation-delay: 0.4s; }

/* Service cards */
.pil-service-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}
.pil-service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pil-red), var(--pil-red-light));
    transform: scaleX(0);
    transition: all 0.35s ease;
    transform-origin: left;
}
.pil-service-card:hover {
    background: white !important;
    border-color: var(--pil-gray-200);
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.12);
    transform: translateY(-6px);
}
.pil-service-card:hover::before {
    transform: scaleX(1);
}
.pil-service-card:hover .service-arrow {
    opacity: 1;
    transform: translateX(0);
}
.service-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.35s ease;
}

/* Stat cards */
.pil-stat-card {
    transition: all 0.35s ease;
}
.pil-stat-card:hover {
    border-color: var(--pil-red) !important;
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.12);
    transform: translateY(-4px);
}

/* Partner logos */
.pil-partner {
    transition: all 0.35s ease;
}
.pil-partner:hover {
    color: var(--pil-dark) !important;
    background: var(--pil-red-glow) !important;
}

/* Tracking card */
.pil-tracking-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* CTA section */
.pil-cta-box {
    background: linear-gradient(135deg, var(--pil-red) 0%, var(--pil-red-dark) 100%);
    position: relative;
    overflow: hidden;
}
.pil-cta-box::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* Footer */
.pil-footer a {
    transition: color 0.3s ease;
}
.pil-footer a:hover {
    color: var(--pil-red-light) !important;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
    transition: .3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.blog-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.blog-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-body h3 {
    margin: 10px 0;
    font-size: 20px;
}

.blog-body p {
    flex: 1;
}

.blog-body a {
    text-decoration: none;
    color: #222;
}

.read-more {
    color: #0d6efd;
    font-weight: 600;
}

/* ============================================
   Post Content Typography
   ============================================ */
.post-content {
    color: var(--pil-gray-800);
    font-size: 1.0625rem;
    line-height: 1.85;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--pil-dark);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--pil-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--pil-gray-800);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--pil-red);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.post-content a:hover {
    color: var(--pil-red-dark);
    border-bottom-color: var(--pil-red-dark);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* CKEditor image alignment support (structure: p > img) */
.post-content img[style*="float"],
.post-content img.left,
.post-content img.right {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 50%;
    height: auto;
}

.post-content img[style*="float: left"],
.post-content img[style*="float:left"],
.post-content img.left {
    float: left;
    margin: 0.25rem 1.5rem 1rem 0;
}

.post-content img[style*="float: right"],
.post-content img[style*="float:right"],
.post-content img.right {
    float: right;
    margin: 0.25rem 0 1rem 1.5rem;
}

/* CKEditor wraps img in <p> — collapse the <p> so float works across paragraphs */
.post-content p:has(> img[style*="float"]),
.post-content p:has(> img.left),
.post-content p:has(> img.right) {
    display: contents;
}

/* CKEditor text alignment support */
.post-content [style*="text-align: center"],
.post-content [style*="text-align:center"] {
    text-align: center;
}

.post-content [style*="text-align: right"],
.post-content [style*="text-align:right"] {
    text-align: right;
}

.post-content [style*="text-align: justify"],
.post-content [style*="text-align:justify"] {
    text-align: justify;
}

.post-content [style*="text-align: left"],
.post-content [style*="text-align:left"] {
    text-align: left;
}

/* Center-aligned images */
.post-content [style*="text-align: center"] img,
.post-content [style*="text-align:center"] img {
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

/* Clear float after content sections */
.post-content::after {
    content: '';
    display: table;
    clear: both;
}

/* Figure/caption support */
.post-content figure {
    display: table;
    margin: 1.5rem auto;
}

.post-content figure figcaption {
    text-align: center;
    font-style: italic;
    color: var(--pil-gray-600);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.post-content blockquote {
    border-left: 4px solid var(--pil-red);
    background: var(--pil-gray-100);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--pil-gray-600);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}

.post-content pre {
    background: var(--pil-dark);
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.post-content code {
    background: var(--pil-gray-100);
    color: var(--pil-red);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-content th {
    background: var(--pil-dark);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

.post-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pil-gray-200);
    font-size: 0.9375rem;
}

.post-content tr:hover td {
    background: var(--pil-gray-100);
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--pil-gray-200);
    margin: 2rem 0;
}

/* Post cover image (legacy) */
.post-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Responsive */
@media (max-width: 1024px) {
    .pil-hero-visual { display: none !important; }
}
@media (max-width: 768px) {
    .pil-nav-links { display: none !important; }
}