/* ================================================================
   Ungeeksi Blog — Main Stylesheet
   Paleta: #484450 · #466067 · #459a96 · #34baab · #c4c8c5
   ================================================================ */

:root {
    --deep-purple: #484450;
    --teal-storm:  #466067;
    --mermaid:     #459a96;
    --aqua-breeze: #34baab;
    --soft-smoke:  #c4c8c5;
    --bg:          #f4f6f9;
    --text:        #1e1e2a;
}

/* --- Reset & Base ------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

/* --- Navbar ------------------------------------------------------- */
.navbar-modern {
    background: rgba(70, 96, 103, 0.93);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(196,200,197,0.2);
    padding: 14px 0;
}

.navbar-modern .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #c4c8c5, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-modern .navbar-brand i {
    background: #34baab;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-modern .navbar-toggler { border-color: rgba(255,255,255,0.3); }
.navbar-modern .navbar-toggler-icon { filter: brightness(2); }

.search-form-modern {
    background: rgba(255,255,255,0.12);
    border-radius: 60px;
    padding: 4px 4px 4px 20px;
    border: 1px solid rgba(196,200,197,0.4);
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.search-form-modern:focus-within {
    border-color: #34baab;
    box-shadow: 0 0 0 4px rgba(52,186,171,0.2);
    background: rgba(255,255,255,0.18);
}

.search-form-modern input {
    background: transparent;
    border: none;
    color: white;
    font-weight: 400;
    box-shadow: none !important;
    padding: 0.4rem 0.5rem;
}

.search-form-modern input::placeholder { color: rgba(255,255,255,0.6); }
.search-form-modern input:focus { background: transparent; color: white; }

.search-form-modern button {
    background: #34baab;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 40px;
    color: white;
    font-size: 1rem;
    transition: 0.2s;
    flex-shrink: 0;
}

.search-form-modern button:hover { background: #459a96; transform: scale(1.05); }

.nav-link-custom {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    margin-left: 0.6rem;
    border-radius: 40px;
    padding: 0.45rem 1.1rem !important;
    transition: 0.2s;
}

.nav-link-custom:hover,
.nav-link-custom.active { background: #34baab; color: white !important; }

/* --- Main (no padding — pages control their own) --------------- */
.blog-main { position: relative; z-index: 1; }

/* --- Hero: Homepage -------------------------------------------- */
.hero-magazine {
    background: linear-gradient(145deg, #484450 0%, #466067 40%, #459a96 80%, #34baab 100%);
    padding: 5.5rem 0 6rem;
    margin-top: 76px;
    border-bottom-left-radius: 3rem;
    border-bottom-right-radius: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-magazine::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 20%, rgba(52,186,171,0.28) 0%, transparent 50%);
    pointer-events: none;
}

.hero-title {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-title span { color: #c4c8c5; text-decoration: underline wavy #34baab; }

.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(4px);
    padding: 0.85rem 1.6rem;
    border-radius: 80px;
    border: 1px solid rgba(196,200,197,0.25);
    font-weight: 500;
    font-size: 0.95rem;
}

.stat-item i { color: #34baab; margin-right: 6px; }

/* --- Hero: Secondary pages (category, search…) --------------- */
.page-hero {
    background: linear-gradient(145deg, #484450 0%, #466067 60%, #459a96 100%);
    padding: 6.5rem 0 3.5rem;
    margin-top: 76px;
    border-bottom-left-radius: 3rem;
    border-bottom-right-radius: 3rem;
    color: white;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-hero h1 i {
    color: #34baab;
    background: rgba(72,68,80,0.5);
    border-radius: 80px;
    padding: 0.45rem 0.6rem;
}

.breadcrumb-custom {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1.6rem;
    border-radius: 60px;
    display: inline-block;
    color: #c4c8c5;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-custom a { color: white; text-decoration: none; }
.breadcrumb-custom a:hover { color: #34baab; }

/* --- Section header ------------------------------------------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3rem 0 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-weight: 700;
    color: #484450;
    border-left: 6px solid #34baab;
    padding-left: 1.1rem;
    font-size: 1.6rem;
}

.pill-tag {
    background: #c4c8c5;
    color: #1e1e2a;
    padding: 0.45rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.88rem;
}

.pill-tag i { color: #466067; }

/* --- Article Cards (homepage / category) ----------------------- */
.grid-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: white;
    border-radius: 2.5rem 1rem 2.5rem 1rem;
    overflow: hidden;
    box-shadow: 0 18px 38px -12px rgba(70,96,103,0.18);
    transition: all 0.3s ease;
    border: 1px solid rgba(196,200,197,0.4);
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 28px 48px -12px #459a96;
    border-color: #34baab;
}

.feature-card .card-media {
    height: 220px;
    position: relative;
    background: #466067;
    overflow: hidden;
}

.feature-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-card:hover .card-media img { transform: scale(1.07); }

.card-media-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #466067, #459a96);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-media-placeholder i { font-size: 3.5rem; color: rgba(255,255,255,0.35); }

.card-category-badge {
    position: absolute;
    bottom: 14px;
    left: 18px;
    background: #34baab;
    padding: 5px 14px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 0.78rem;
    border: 1px solid rgba(255,255,255,0.25);
    text-decoration: none;
    z-index: 2;
}

.card-category-badge i { color: #484450; }

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

.card-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #484450;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    transition: color 0.2s;
}

.feature-card:hover .card-title { color: #34baab; }

.card-excerpt {
    color: #466067;
    font-size: 0.93rem;
    line-height: 1.6;
    opacity: 0.85;
    margin-bottom: 1.4rem;
    flex: 1;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(196,200,197,0.5);
    margin-top: auto;
}

.views-badge {
    background: #c4c8c5;
    color: #1e1e2a;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
}

.read-link {
    color: #459a96;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    font-size: 0.9rem;
}

.read-link:hover { color: #34baab; border-bottom-color: #34baab; }

/* --- Categories Grid ------------------------------------------ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.8rem;
    margin: 3rem 0 5rem;
}

.category-block {
    background: white;
    border-radius: 2.5rem 1rem 2.5rem 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 14px 28px -10px rgba(70,96,103,0.14);
    transition: all 0.25s ease;
    border: 1px solid var(--soft-smoke);
    text-align: center;
    text-decoration: none;
    display: block;
}

.category-block:hover {
    transform: translateY(-8px);
    border-color: #34baab;
    box-shadow: 0 24px 38px -12px #459a96;
}

.category-icon {
    background: rgba(52,186,171,0.1);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.4rem;
    font-size: 2.2rem;
    color: #34baab;
    border: 2px dashed #c4c8c5;
    transition: 0.2s;
}

.category-block:hover .category-icon {
    background: #34baab;
    color: white;
    border-color: #34baab;
}

.category-block .cat-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #484450;
    margin-bottom: 0.3rem;
}

.category-count {
    background: #c4c8c5;
    color: #1e1e2a;
    padding: 0.28rem 1rem;
    border-radius: 40px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0.7rem 0 1rem;
}

.category-description {
    color: #466067;
    font-size: 0.92rem;
    opacity: 0.82;
    margin-bottom: 1.2rem;
}

/* --- Category Chips (home showcase) --------------------------- */
.category-showcase {
    background: rgba(255,255,255,0.9);
    border-radius: 3rem;
    padding: 2.5rem 2rem;
    margin: 3rem 0;
    box-shadow: 0 14px 28px -10px rgba(0,0,0,0.06);
}

.cat-chip {
    background: #484450;
    color: white !important;
    padding: 0.75rem 1.7rem;
    border-radius: 100px;
    font-weight: 600;
    margin: 0.35rem;
    display: inline-block;
    transition: 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}

.cat-chip i { color: #34baab; }

.cat-chip:hover {
    background: #34baab;
    color: #484450 !important;
}

/* --- Newsletter ------------------------------------------------ */
.newsletter-modern {
    background: linear-gradient(120deg, #484450, #466067);
    border-radius: 3rem;
    padding: 3rem;
    color: white;
    margin: 2rem 0;
}

.newsletter-modern .form-control {
    background: rgba(255,255,255,0.12);
    border: 1px solid #c4c8c5;
    border-radius: 60px;
    padding: 0.9rem 1.5rem;
    color: white;
}

.newsletter-modern .form-control::placeholder { color: rgba(255,255,255,0.55); }
.newsletter-modern .form-control:focus {
    background: rgba(255,255,255,0.18);
    border-color: #34baab;
    color: white;
    box-shadow: 0 0 0 3px rgba(52,186,171,0.25);
}

.btn-subscribe {
    background: #34baab;
    border: none;
    border-radius: 60px;
    padding: 0.9rem 2.2rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    transition: 0.2s;
}

.btn-subscribe:hover { background: #459a96; color: white; }

/* --- Footer ---------------------------------------------------- */
.footer-modern {
    background: white;
    border-top: 3px solid #34baab;
    color: #484450;
    padding: 2rem 0;
    margin-top: 1rem;
}

/* --- Article Page --------------------------------------------- */
.article-wrapper {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px -12px rgba(70,96,103,0.2);
    margin-bottom: 2rem;
}

.article-hero { position: relative; height: 420px; overflow: hidden; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.article-hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #466067, #459a96);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-hero-placeholder i { font-size: 6rem; color: rgba(255,255,255,0.3); }

.article-body { padding: 2.5rem 3rem; }

.article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #34baab;
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.1rem;
    text-decoration: none;
}

.article-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.3;
    color: #484450;
    margin-bottom: 1.25rem;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: #466067;
    font-size: 0.9rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(196,200,197,0.5);
    margin-bottom: 2rem;
}

.article-meta i { color: #34baab; }

.article-content { font-size: 1.05rem; line-height: 1.85; color: #334155; }

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: #484450;
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    font-weight: 700;
}

.article-content h2 { border-left: 4px solid #34baab; padding-left: 1rem; }

.article-content p { margin-bottom: 1.2rem; }

.article-content pre {
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.article-content img { max-width: 100%; border-radius: 12px; margin: 1rem 0; }
.article-content a { color: #459a96; }

.article-content blockquote {
    border-left: 4px solid #34baab;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(52,186,171,0.06);
    border-radius: 0 12px 12px 0;
    color: #466067;
    font-style: italic;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(70,96,103,0.1);
    color: #466067;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 50px;
    border: 1px solid rgba(70,96,103,0.2);
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.btn-back:hover {
    background: #34baab;
    color: white;
    border-color: #34baab;
    transform: translateX(-4px);
}

/* --- Auth Pages ----------------------------------------------- */
.auth-wrapper {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 2rem;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px -12px rgba(70,96,103,0.2);
}

.auth-title { font-size: 1.75rem; font-weight: 800; color: #484450; margin-bottom: 0.4rem; }
.auth-subtitle { color: #466067; font-size: 0.95rem; margin-bottom: 2rem; }

.auth-card .form-control {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card .form-control:focus {
    border-color: #34baab;
    box-shadow: 0 0 0 3px rgba(52,186,171,0.15);
}

.auth-card .form-label { font-weight: 600; font-size: 0.88rem; color: #484450; margin-bottom: 0.4rem; }

.btn-auth {
    background: linear-gradient(135deg, #466067, #34baab);
    border: none;
    border-radius: 12px;
    padding: 0.85rem;
    font-weight: 700;
    color: white;
    width: 100%;
    transition: all 0.2s;
}

.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(52,186,171,0.35); color: white; }

.auth-link { color: #459a96; font-weight: 600; text-decoration: none; }
.auth-link:hover { color: #34baab; text-decoration: underline; }

/* --- Search page ------------------------------------------------ */
.search-header { margin-bottom: 2rem; padding-top: 1.5rem; }
.search-header h1 { font-size: 2.25rem; font-weight: 800; color: #484450; }
.search-header h1 em { font-style: normal; color: #34baab; }
.search-count { color: #466067; font-size: 0.95rem; margin-top: 0.5rem; }

.search-no-results {
    background: white;
    border: 1px solid #c4c8c5;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    color: #466067;
}

.search-no-results h4 { color: #484450; margin-bottom: 0.75rem; font-weight: 700; }

/* --- Highlight.js line numbers (light theme) -------------------- */
.hljs-ln-numbers {
    user-select: none;
    text-align: right;
    color: #aaa;
    border-right: 1px solid #e2e8f0;
    padding-right: 12px !important;
    padding-left: 6px !important;
    min-width: 40px;
    font-size: 0.85em;
}

.hljs-ln-code { padding-left: 14px !important; }

/* --- Pagination ------------------------------------------------- */
.pagination .page-link {
    background: white;
    border-color: #c4c8c5;
    color: #466067;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: #34baab;
    border-color: #34baab;
    color: white;
}

.pagination .page-item.active .page-link {
    background: #34baab;
    border-color: #34baab;
    color: white;
}

.pagination .page-item.disabled .page-link {
    background: #f4f6f9;
    color: #c4c8c5;
}

/* --- Responsive ------------------------------------------------- */
@media (max-width: 1100px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-masonry { grid-template-columns: repeat(2, 1fr); }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 2.6rem; }
    .search-form-modern { width: 100% !important; margin: 0.5rem 0; }
}

@media (max-width: 768px) {
    .hero-magazine { padding: 5rem 0 4rem; }
    .article-body { padding: 1.5rem; }
    .article-title { font-size: 1.6rem; }
    .article-hero { height: 260px; }
    .auth-card { padding: 1.75rem; }
}

@media (max-width: 576px) {
    .grid-masonry { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
    .hero-stats { flex-direction: column; gap: 0.75rem; }
    .newsletter-modern { padding: 2rem 1.5rem; }
}
