/* ============================================
   Frontend Blog & Portfolio Styles
   Modern, Clean, Professional Design
   ============================================ */

/* CSS Variables */
:root {
    --blog-max-width: 1200px;
    --blog-spacing: 2rem;
    --blog-radius: 16px;
    --blog-radius-sm: 8px;
    --blog-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
    --blog-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
    --blog-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);
    --blog-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --blog-primary: #E60012;
    --blog-primary-dark: #c4000f;
    --blog-text: #1a1a2e;
    --blog-text-muted: #6b7280;
    --blog-bg: #f8fafc;
    --blog-card-bg: #ffffff;
    --blog-border: #e5e7eb;
}

/* ============================================
   Blog Page Layout
   ============================================ */

.blog-page,
.portfolio-page,
.blog-post-page {
    padding-top: 0;
    background: var(--blog-bg);
    min-height: 100vh;
}

.project-detail-page,
.products-page {
    padding-top: 0;
    background: var(--blog-bg);
    min-height: 100vh;
}

/* Blog Hero */
.blog-hero,
.portfolio-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: calc(80px + 4.5rem) 0 4rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.blog-hero::before,
.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm-30 30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.blog-hero .container,
.portfolio-hero .container {
    position: relative;
    z-index: 1;
}

.blog-hero h1,
.portfolio-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #fff;
}

.blog-hero p,
.portfolio-hero p {
    font-size: 1.125rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

/* Blog Search */
.blog-search-form {
    max-width: 560px;
    margin: 0 auto;
}

.blog-search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 60px;
    padding: 8px 8px 8px 24px;
    box-shadow: var(--blog-shadow-lg);
    transition: var(--blog-transition);
}

.blog-search-wrapper:focus-within {
    box-shadow: var(--blog-shadow-lg), 0 0 0 4px rgba(230, 0, 18, 0.15);
}

.blog-search-wrapper svg {
    color: var(--blog-text-muted);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.blog-search-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 1rem;
    background: transparent;
    color: var(--blog-text);
}

.blog-search-wrapper input::placeholder {
    color: var(--blog-text-muted);
}

.blog-search-wrapper button {
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--blog-transition);
}

.blog-search-wrapper button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.4);
}

/* Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 3.5rem 0 4rem;
}

.blog-main {
    min-width: 0;
}

/* Active Filters */
.blog-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
}

.blog-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--blog-bg);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--blog-text);
    font-weight: 500;
}

.blog-filter-tag a {
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 0, 18, 0.1);
    border-radius: 50%;
    transition: var(--blog-transition);
}

.blog-filter-tag a:hover {
    background: var(--blog-primary);
    color: white;
}

/* Blog Posts Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    transition: var(--blog-transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--blog-shadow-hover);
}

.blog-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

.blog-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

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

.blog-card-meta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.875rem;
}

.blog-card-date,
.blog-card-reading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--blog-text-muted);
}

.blog-card-date svg,
.blog-card-reading svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.blog-card-title a {
    color: var(--blog-text);
    text-decoration: none;
    transition: var(--blog-transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-title a:hover {
    color: var(--blog-primary);
}

.blog-card-excerpt {
    font-size: 0.925rem;
    color: var(--blog-text-muted);
    line-height: 1.65;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid var(--blog-border);
    margin-top: auto;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.blog-author-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--blog-primary) 0%, #ff6b6b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.blog-card-author span {
    font-size: 0.875rem;
    color: var(--blog-text);
    font-weight: 600;
}

.blog-read-more {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--blog-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--blog-transition);
}

.blog-read-more svg {
    transition: transform 0.2s ease;
}

.blog-read-more:hover {
    color: var(--blog-primary-dark);
}

.blog-read-more:hover svg {
    transform: translateX(4px);
}

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--blog-border);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    background: white;
    border: 2px solid var(--blog-border);
    border-radius: 50px;
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--blog-transition);
}

.pagination-btn:hover {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.15);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--blog-text-muted);
    font-weight: 500;
}

/* Blog Empty State */
.blog-empty,
.portfolio-empty {
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
}

.blog-empty svg,
.portfolio-empty svg {
    color: var(--blog-border);
    margin-bottom: 1.5rem;
}

.blog-empty h3,
.portfolio-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--blog-text);
}

.blog-empty p,
.portfolio-empty p {
    color: var(--blog-text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Sidebar */
.blog-sidebar,
.post-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.sidebar-widget {
    background: white;
    border-radius: var(--blog-radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--blog-shadow);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 3px solid var(--blog-primary);
    color: var(--blog-text);
}

/* Sidebar Categories */
.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li {
    border-bottom: 1px solid var(--blog-border);
}

.sidebar-categories li:last-child {
    border-bottom: none;
}

.sidebar-categories a {
    display: flex;
    align-items: center;
    padding: 0.875rem 0;
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--blog-transition);
}

.sidebar-categories a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--blog-border);
    border-radius: 50%;
    margin-right: 0.75rem;
    transition: var(--blog-transition);
}

.sidebar-categories a:hover,
.sidebar-categories a.active {
    color: var(--blog-primary);
    padding-left: 0.5rem;
}

.sidebar-categories a:hover::before,
.sidebar-categories a.active::before {
    background: var(--blog-primary);
    transform: scale(1.3);
}

/* Sidebar Recent Posts */
.sidebar-recent {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-recent li {
    margin-bottom: 1.25rem;
}

.sidebar-recent li:last-child {
    margin-bottom: 0;
}

.sidebar-recent a {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    transition: var(--blog-transition);
}

.sidebar-recent a:hover {
    opacity: 0.9;
}

.sidebar-recent img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--blog-radius-sm);
    flex-shrink: 0;
}

.sidebar-recent .recent-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blog-text);
    line-height: 1.4;
    margin-bottom: 0.375rem;
    transition: var(--blog-transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-recent a:hover .recent-title {
    color: var(--blog-primary);
}

.sidebar-recent .recent-date {
    font-size: 0.75rem;
    color: var(--blog-text-muted);
}

/* Sidebar Tags */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sidebar-tags .tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--blog-bg);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--blog-transition);
    border: 1px solid transparent;
}

.sidebar-tags .tag:hover,
.sidebar-tags .tag.active {
    background: var(--blog-primary);
    color: white;
    border-color: var(--blog-primary);
}

/* ============================================
   Blog Post Detail
   ============================================ */

.post-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: calc(80px + 4.5rem) 0 4rem;
    color: white;
    position: relative;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm-30 30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.post-header .container {
    position: relative;
    z-index: 1;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.post-category {
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
    transition: var(--blog-transition);
}

.post-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.4);
}

.post-reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    max-width: 850px;
    letter-spacing: -0.02em;
    color: #fff;
}

.post-excerpt {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 750px;
    line-height: 1.65;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.author-name {
    display: block;
    font-weight: 700;
    font-size: 1rem;
}

.post-date {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Featured Image */
.post-featured-image {
    margin-top: -2.5rem;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 2;
}

.post-featured-image img {
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow-lg);
}

/* Post Layout */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3.5rem;
    margin-bottom: 3.5rem;
}

/* Post Content - Article Typography */
.post-content {
    font-size: 1.125rem;
    line-height: 1.85;
    color: #374151;
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 2.5rem 0 1.25rem;
    color: var(--blog-text);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--blog-text);
    letter-spacing: -0.01em;
}

.post-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 1.75rem 0 0.875rem;
    color: var(--blog-text);
}

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

.post-content a {
    color: var(--blog-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--blog-transition);
}

.post-content a:hover {
    color: var(--blog-primary-dark);
}

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

.post-content li {
    margin-bottom: 0.625rem;
}

.post-content li::marker {
    color: var(--blog-primary);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-sm);
    margin: 2rem 0;
    box-shadow: var(--blog-shadow);
}

.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.75rem;
    border-radius: var(--blog-radius);
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-content code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.post-content :not(pre) > code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--blog-primary-dark);
}

.post-content blockquote {
    border-left: 4px solid var(--blog-primary);
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    background: linear-gradient(to right, rgba(230, 0, 18, 0.05), transparent);
    border-radius: 0 var(--blog-radius-sm) var(--blog-radius-sm) 0;
    font-style: italic;
    color: #4b5563;
}

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

.post-content hr {
    border: none;
    height: 1px;
    background: var(--blog-border);
    margin: 3rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 0.875rem 1rem;
    border: 1px solid var(--blog-border);
    text-align: left;
}

.post-content th {
    background: var(--blog-bg);
    font-weight: 600;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--blog-border);
}

.post-tags span {
    font-weight: 600;
    color: var(--blog-text-muted);
    margin-right: 0.5rem;
}

.post-tags .tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--blog-bg);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--blog-transition);
}

.post-tags .tag:hover {
    background: var(--blog-primary);
    color: white;
}

/* Share Buttons */
.post-share {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
}

.post-share span {
    font-weight: 600;
    color: var(--blog-text-muted);
}

.share-buttons {
    display: flex;
    gap: 0.625rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--blog-transition);
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-twitter { background: #1da1f2; color: white; }
.share-facebook { background: #4267b2; color: white; }
.share-linkedin { background: #0077b5; color: white; }
.share-copy {
    background: var(--blog-bg);
    color: var(--blog-text);
    border: 1px solid var(--blog-border);
}
.share-copy.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* Table of Contents */
.toc-widget nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-widget nav li {
    margin-bottom: 0.5rem;
}

.toc-widget nav a {
    display: block;
    padding: 0.625rem 0;
    color: var(--blog-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--blog-transition);
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.toc-widget nav a:hover {
    color: var(--blog-primary);
    border-color: var(--blog-primary);
}

.toc-widget nav .toc-sub {
    padding-left: 1.5rem;
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--blog-border);
}

.comments-section h2 {
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    font-weight: 800;
}

.comment-count {
    font-weight: 500;
    color: var(--blog-text-muted);
}

/* Comment Form */
.comment-form-wrapper {
    background: white;
    padding: 2.5rem;
    border-radius: var(--blog-radius);
    margin-bottom: 2.5rem;
    box-shadow: var(--blog-shadow);
}

.comment-form-wrapper h3 {
    font-size: 1.25rem;
    margin-bottom: 1.75rem;
    font-weight: 700;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.comment-form .form-group {
    margin-bottom: 1.25rem;
}

.comment-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--blog-text);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--blog-border);
    border-radius: var(--blog-radius-sm);
    font-size: 1rem;
    transition: var(--blog-transition);
    background: white;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--blog-primary);
    box-shadow: 0 0 0 4px rgba(230, 0, 18, 0.1);
}

.comment-form .form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--blog-text-muted);
    margin-top: 0.5rem;
}

.comment-form button {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--blog-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--blog-transition);
}

.comment-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.4);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem;
    background: white;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
}

.comment-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--blog-primary) 0%, #ff6b6b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.comment-author {
    font-weight: 700;
    color: var(--blog-text);
    font-size: 1rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--blog-text-muted);
}

.comment-content {
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
}

.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--blog-text-muted);
    background: white;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--blog-border);
}

.related-posts h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

/* Back to Blog */
.back-to-blog {
    background: white;
    padding: 2.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--blog-border);
}

.back-to-blog a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--blog-transition);
}

.back-to-blog a svg {
    transition: transform 0.2s ease;
}

.back-to-blog a:hover {
    color: var(--blog-primary-dark);
}

.back-to-blog a:hover svg {
    transform: translateX(-4px);
}

/* ============================================
   Portfolio Page
   ============================================ */

/* Portfolio Filters */
.portfolio-filters {
    display: flex;
    justify-content: center;
    padding: 3rem 0 2.5rem;
}

.portfolio-filter-track {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.3rem;
    border-radius: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blog-text-muted);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--blog-text);
}

.filter-btn.active {
    background: white;
    color: var(--blog-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    padding-bottom: 5rem;
}

/* Portfolio Card */
.portfolio-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-card.is-hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.portfolio-card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    position: relative;
    width: auto;
    height: auto;
    overflow: visible;
}

.portfolio-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--blog-radius);
    overflow: hidden;
    background: var(--blog-card-bg);
    box-shadow: var(--blog-shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.portfolio-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f5f5f7;
}

.portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card-link:hover .portfolio-card-image img {
    transform: scale(1.04);
}

.portfolio-card-body {
    padding: 1.75rem 1.75rem 2rem;
}

.portfolio-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blog-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.625rem;
}

.portfolio-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
    color: var(--blog-text);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.portfolio-description {
    font-size: 0.95rem;
    color: var(--blog-text-muted);
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tech-pill {
    padding: 0.3rem 0.75rem;
    background: var(--blog-bg);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--blog-text-muted);
    font-weight: 500;
    border: 1px solid var(--blog-border);
    transition: var(--blog-transition);
}

.tech-pill.tech-more {
    background: transparent;
    border-color: var(--blog-border);
    color: var(--blog-text-muted);
}

/* Shared card classes (used by Products page) */
.portfolio-card-content {
    padding: 1.75rem 1.75rem 2rem;
}

.tech-tag {
    padding: 0.3rem 0.75rem;
    background: var(--blog-bg);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--blog-text-muted);
    font-weight: 500;
    border: 1px solid var(--blog-border);
}

.tech-more {
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: 1px solid var(--blog-border);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--blog-text-muted);
}

/* Portfolio CTA */
.portfolio-cta,
.project-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 5rem 0;
    text-align: center;
    color: white;
    margin-top: 4rem;
}

.portfolio-cta h2,
.project-cta h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    color: #fff;
}

.portfolio-cta p,
.project-cta p {
    opacity: 0.85;
    margin-bottom: 2rem;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   Project Detail Page — Apple-style
   ============================================ */

.project-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: calc(80px + 4.5rem) 0 6.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.project-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm-30 30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.project-header .container {
    position: relative;
    z-index: 1;
}

.project-header .back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin: 0 auto 2.5rem;
    transition: var(--blog-transition);
    font-weight: 600;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1.125rem;
    border-radius: 50px;
}

.project-header .back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.project-header .back-link:hover svg {
    transform: translateX(-3px);
}

.project-header .back-link svg {
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
}

.project-category-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.25rem;
}

.project-header h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.04em;
    color: #fff;
    line-height: 1.05;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.project-tagline {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 600px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 auto;
    font-weight: 400;
}

/* Hero Image */
.project-hero-image {
    padding: 2.5rem 0;
    background: var(--blog-bg);
}

.project-hero-image-wrapper {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.project-hero-image img {
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    display: block;
}

/* Details Strip — horizontal info bar below hero */
.project-details-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    background: var(--blog-card-bg);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-top: 2.5rem;
    margin-bottom: 3.5rem;
    overflow: hidden;
}

.project-detail-item {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.5rem;
    border-right: 1px solid var(--blog-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-detail-item:last-child {
    border-right: none;
}

.project-detail-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blog-text-muted);
    margin-bottom: 0.375rem;
}

.project-detail-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blog-text);
    line-height: 1.35;
}

.project-detail-tech {
    flex: 2;
}

.project-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.project-detail-tag {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--blog-text-muted);
    font-weight: 500;
}

.project-detail-action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.project-visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--blog-transition);
    white-space: nowrap;
}

.project-visit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(230, 0, 18, 0.35);
}

/* Content Area — single column, reading width */
.project-content-area {
    max-width: 800px;
    margin: 0 auto 4rem;
}

.project-overview {
    margin-bottom: 3.5rem;
}

.project-overview h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: var(--blog-text);
    letter-spacing: -0.02em;
}

.project-prose {
    font-size: 1.1rem;
    line-height: 1.85;
    color: #374151;
}

.project-prose p {
    margin-bottom: 1.5rem;
}

.project-prose h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 2.5rem 0 1rem;
    color: var(--blog-text);
}

.project-prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--blog-text);
}

.project-prose ul,
.project-prose ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-prose li {
    margin-bottom: 0.5rem;
}

.project-prose li::marker {
    color: var(--blog-primary);
}

.project-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-sm);
    margin: 2rem 0;
}

.project-prose a {
    color: var(--blog-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Project Gallery */
.project-gallery {
    margin-top: 3rem;
}

.project-gallery h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: var(--blog-text);
    letter-spacing: -0.02em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    transition: var(--blog-transition);
}

.gallery-item:hover {
    box-shadow: var(--blog-shadow-hover);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Related Projects */
.related-projects {
    margin-top: 4rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--blog-border);
}

.related-projects h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.related-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--blog-radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: var(--blog-transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 0, 18, 0.4);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 2rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: var(--blog-radius-sm);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.flash-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.flash-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        display: none;
    }

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        order: -1;
        position: static;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-details-strip {
        flex-wrap: wrap;
    }

    .project-detail-item {
        flex: 1 1 45%;
        min-width: 45%;
    }

    .project-detail-item:nth-child(even) {
        border-right: none;
    }

    .project-detail-tech {
        flex: 1 1 100%;
        border-right: none;
        border-top: 1px solid var(--blog-border);
    }

    .project-detail-action {
        flex: 1 1 100%;
        border-right: none;
        border-top: 1px solid var(--blog-border);
    }

    .related-posts-grid,
    .related-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero,
    .portfolio-hero {
        padding: calc(80px + 3rem) 0 3rem;
    }

    .post-header {
        padding: calc(80px + 3rem) 0 3rem;
    }

    .blog-hero h1,
    .portfolio-hero h1,
    .post-header h1,
    .project-header h1 {
        font-size: 1.75rem;
    }

    .project-header {
        padding: calc(80px + 3rem) 0 5.5rem;
    }

    .project-header .back-link {
        margin-bottom: 1.5rem;
        font-size: 0.8rem;
    }

    .project-category-badge {
        font-size: 0.6rem;
        letter-spacing: 0.12em;
        margin-bottom: 0.875rem;
    }

    .project-header h1 {
        font-size: 1.75rem;
        letter-spacing: -0.03em;
        margin-bottom: 1rem;
        line-height: 1.1;
        padding: 0 0.5rem;
    }

    .project-tagline {
        font-size: 0.95rem;
        line-height: 1.5;
        padding: 0 0.5rem;
    }

    .project-hero-image {
        padding: 1.5rem 0;
    }

    .project-hero-image-wrapper {
        border-radius: 12px;
    }

    .project-details-strip {
        flex-direction: column;
        margin-top: 1.25rem;
        margin-bottom: 2rem;
        border-radius: 12px;
    }

    .project-detail-item {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--blog-border);
        border-top: none !important;
        padding: 1rem 1.25rem;
    }

    .project-detail-item:last-child {
        border-bottom: none;
    }

    .project-detail-label {
        font-size: 0.6rem;
        margin-bottom: 0.25rem;
    }

    .project-detail-value {
        font-size: 0.85rem;
    }

    .project-detail-tag {
        font-size: 0.65rem;
        padding: 0.175rem 0.5rem;
    }

    .project-visit-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .project-content-area {
        margin-bottom: 2rem;
    }

    .project-overview h2,
    .project-gallery h2 {
        font-size: 1.25rem;
    }

    .project-prose {
        font-size: 1rem;
        line-height: 1.75;
    }

    .project-overview {
        margin-bottom: 2.5rem;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        gap: 1.5rem;
    }

    .portfolio-card-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .portfolio-title {
        font-size: 1.15rem;
    }

    .portfolio-filter-track {
        gap: 0.125rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .comment-form .form-row {
        grid-template-columns: 1fr;
    }

    .related-posts-grid,
    .related-projects-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .post-featured-image {
        margin-top: -1.5rem;
        margin-bottom: 2.5rem;
    }

    .post-featured-image img {
        border-radius: 0;
    }

    .portfolio-filters {
        padding: 2rem 0 1.5rem;
    }

    .post-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pagination-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .blog-search-wrapper {
        flex-direction: column;
        padding: 1rem;
        border-radius: var(--blog-radius);
    }

    .blog-search-wrapper input {
        width: 100%;
        padding: 12px 0;
    }

    .blog-search-wrapper button {
        width: 100%;
        margin-top: 0.75rem;
    }

    .blog-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .blog-pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .project-header {
        padding: calc(80px + 2rem) 0 5rem;
    }

    .project-header h1 {
        font-size: 1.5rem;
        padding: 0;
    }

    .project-tagline {
        font-size: 0.875rem;
        padding: 0;
    }

    .project-hero-image {
        padding: 1rem 0;
    }

    .project-hero-image-wrapper {
        border-radius: 10px;
    }

    .project-details-strip {
        border-radius: 10px;
    }
}
