/* ============================================
   Sah Studio - Main Stylesheet
   Theme: Dabba-inspired lightweight
   ============================================ */

:root {
    --primary: #3b42a2;
    --primary-dark: #2e3480;
    --accent: #1e205a;
    --text: #333;
    --text-light: #666;
    --bg: #ffffff;
    --bg-light: #f7f8fc;
    --bg-card: #ffffff;
    --border: #e2e4f0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(30, 32, 90, 0.08);
    --shadow-hover: 0 4px 16px rgba(30, 32, 90, 0.14);
    --transition: 0.25s ease;
    --max-width: 1200px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---- Container ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--bg);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.site-logo img {
    height: 45px;
    width: auto;
}

/* Navigation */
.main-nav ul {
    display: flex;
    gap: 8px;
}
.main-nav a {
    display: block;
    padding: 8px 16px;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
    background: var(--primary);
    color: #fff;
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}
.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
    transition: all var(--transition);
    position: relative;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.menu-toggle.active .hamburger { background: transparent; }
.menu-toggle.active .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle.active .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ============================================
   Main Content
   ============================================ */
.site-main {
    min-height: 60vh;
    padding: 30px 0 60px;
}

/* ---- Content with sidebar ---- */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* ============================================
   Hero
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    padding: 60px 40px;
    border-radius: var(--radius);
    margin-bottom: 40px;
    text-align: center;
}
.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    font-weight: 700;
}
.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Grid Cards (Featured)
   ============================================ */
.grid-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 20px;
}
.grid-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    color: var(--text);
}
.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}
.grid-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}
.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.grid-card:hover .grid-card-image img {
    transform: scale(1.05);
}
.grid-card-body {
    padding: 16px;
}
.grid-card-cat {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 6px;
}
.grid-card-body h3 {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--accent);
}

/* ============================================
   Post Cards (Category / Related)
   ============================================ */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 20px;
}
.post-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    color: var(--text);
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}
.post-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.post-card:hover .post-card-image img {
    transform: scale(1.05);
}
.post-card-body {
    padding: 14px;
}
.post-card-body h3 {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--accent);
    margin-bottom: 6px;
}
.post-card-body p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ============================================
   Section Headers
   ============================================ */
.section-title {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 700;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}
.see-all {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
}
.see-all:hover { color: var(--accent); }
.section-desc {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.category-section {
    margin-bottom: 50px;
}
.featured-grid {
    margin-bottom: 50px;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
    padding: 10px 0;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--accent); }

/* ============================================
   Article Single
   ============================================ */
.article-single {
    max-width: 100%;
}
.article-header {
    margin-bottom: 24px;
}
.article-category a {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 12px;
}
.article-category a:hover {
    background: var(--accent);
    color: #fff;
}
.article-header h1 {
    font-size: 2rem;
    line-height: 1.3;
    color: var(--accent);
}
.article-featured-image {
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
}
.article-featured-image img {
    width: 100%;
    height: auto;
}

/* Article Content */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.article-content h2 {
    font-size: 1.5rem;
    color: var(--accent);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.article-content h3 {
    font-size: 1.25rem;
    color: var(--accent);
    margin: 24px 0 12px;
}
.article-content p {
    margin-bottom: 16px;
}
.article-content img {
    border-radius: var(--radius);
    margin: 20px 0;
}
.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
    margin-bottom: 8px;
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}
.article-content a {
    color: var(--primary);
    text-decoration: underline;
}
.article-content a:hover {
    color: var(--accent);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.article-content th,
.article-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.article-content th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--accent);
}

/* Related */
.related-articles {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

/* ============================================
   Category Page
   ============================================ */
.category-header {
    margin-bottom: 30px;
}
.category-header h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 8px;
}
.category-description {
    color: var(--text-light);
    font-size: 1.05rem;
}
.no-articles {
    color: var(--text-light);
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: sticky;
    top: 90px;
}
.widget {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.widget-title {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
.widget-categories ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.widget-categories ul li:last-child { border-bottom: none; }
.widget-categories .count {
    font-size: 0.8rem;
    color: var(--text-light);
}
.widget-recent ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.widget-recent ul li:last-child { border-bottom: none; }
.widget-recent a {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}
.widget-recent a:hover { color: var(--primary); }

/* ============================================
   404 / Error Page
   ============================================ */
.error-page {
    text-align: center;
    padding: 60px 0;
}
.error-page h1 {
    font-size: 6rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}
.error-page h2 {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 16px;
}
.error-page > p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.1rem;
}
.error-actions { margin-bottom: 50px; }
.error-suggestions { text-align: left; }
.error-suggestions h3 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
}

/* ============================================
   Legal Page
   ============================================ */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}
.legal-page h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 30px;
}
.legal-page section {
    margin-bottom: 30px;
}
.legal-page h2 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 12px;
}
.legal-page p {
    margin-bottom: 10px;
    color: var(--text);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================
   Back to Top
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    z-index: 999;
}
.back-to-top:hover {
    background: var(--accent);
    color: #fff;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--accent);
    color: #fff;
    padding: 30px 0;
    margin-top: 60px;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-inner p {
    font-size: 0.9rem;
    opacity: 0.8;
}
.footer-nav a {
    color: #fff;
    opacity: 0.8;
    font-size: 0.9rem;
    transition: opacity var(--transition);
}
.footer-nav a:hover {
    opacity: 1;
    color: #fff;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .grid-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .content-with-sidebar {
        grid-template-columns: 1fr 260px;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    /* Header */
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 2px solid var(--primary);
        box-shadow: var(--shadow);
        padding: 16px 20px;
    }
    .main-nav.open { display: block; }
    .main-nav ul {
        flex-direction: column;
        gap: 4px;
    }
    .main-nav a {
        padding: 10px 16px;
    }

    /* Layout */
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
    }

    /* Grids */
    .grid-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Hero */
    .hero {
        padding: 40px 24px;
    }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }

    /* Article */
    .article-header h1 { font-size: 1.5rem; }
    .category-header h1 { font-size: 1.5rem; }

    /* Footer */
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .grid-tiles {
        grid-template-columns: 1fr;
    }
    .post-grid {
        grid-template-columns: 1fr;
    }
    .header-inner { height: 60px; }
    .site-logo img { height: 36px; }
    .hero { padding: 30px 16px; }
    .hero h1 { font-size: 1.3rem; }
    .error-page h1 { font-size: 4rem; }
}
