/* ============================================
   RTO Scan – Government Project Website
   Wikipedia-Inspired Design System
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@400;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Colours — Wikipedia palette */
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-bg-sidebar: #f6f6f6;
    --color-border: #a2a9b1;
    --color-border-light: #e0e0e0;
    --color-text: #202122;
    --color-text-muted: #54595d;
    --color-link: #0645ad;
    --color-link-hover: #0b0080;
    --color-link-visited: #0b0080;
    --color-accent: #2a4365;
    --color-accent-light: #e8f0fe;
    --color-highlight: #fef3cd;
    --color-success: #14532d;
    --color-success-bg: #dcfce7;
    --color-stat-bg: #eef2ff;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;

    /* Sizing */
    --sidebar-width: 260px;
    --navbar-height: 56px;
    --max-content: 960px;
    --radius: 4px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, .10);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, .12);

    /* Transitions */
    --transition: .2s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--navbar-height) + 16px);
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

ul,
ol {
    list-style-position: inside;
}

/* ---------- Top Navigation Bar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    padding: 0 24px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
}

.navbar__brand:hover {
    text-decoration: none;
    color: var(--color-accent);
}

.navbar__brand-icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.navbar__links a {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.navbar__links a:hover,
.navbar__links a.active {
    background: var(--color-bg-alt);
    color: var(--color-link);
    text-decoration: none;
}

/* Hamburger */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* ---------- Layout ---------- */
.page-wrapper {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky;
    top: var(--navbar-height);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border-light);
    padding: 24px 16px;
    font-size: 13.5px;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.sidebar__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar__nav {
    list-style: none;
}

.sidebar__nav li {
    margin-bottom: 2px;
}

.sidebar__nav a {
    display: block;
    padding: 6px 10px;
    color: var(--color-text);
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.4;
    transition: background var(--transition), color var(--transition);
}

.sidebar__nav a:hover {
    background: var(--color-border-light);
    text-decoration: none;
    color: var(--color-link);
}

.sidebar__nav a.active {
    background: var(--color-accent-light);
    color: var(--color-link);
    font-weight: 600;
}

.sidebar__nav .indent {
    padding-left: 24px;
    font-size: 13px;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    max-width: var(--max-content);
    padding: 32px 40px 64px;
}

/* ---------- Hero Section ---------- */
.hero {
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border-light);
}

.hero__badge {
    display: inline-block;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: .03em;
}

.hero__title {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
    margin-bottom: 8px;
}

.hero__subtitle {
    font-size: 17px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn--primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.btn--primary:hover {
    background: #1a365d;
    color: #fff;
}

.btn--secondary {
    background: var(--color-bg);
    color: var(--color-accent);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-bg-alt);
}

/* ---------- Article Sections ---------- */
.section {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border-light);
}

.section:last-child {
    border-bottom: none;
}

.section__heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}

.section__subheading {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    margin: 20px 0 10px;
}

.section p {
    margin-bottom: 14px;
    color: var(--color-text);
}

.section ul,
.section ol {
    margin-bottom: 14px;
    padding-left: 4px;
}

.section li {
    margin-bottom: 6px;
    line-height: 1.6;
}

/* ---------- Info Boxes ---------- */
.infobox {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin: 20px 0;
}

.infobox--highlight {
    background: var(--color-highlight);
    border-color: #e0c97a;
}

.infobox--success {
    background: var(--color-success-bg);
    border-color: #86efac;
}

.infobox__title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: var(--color-stat-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
}

.stat-card__number {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card__label {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ---------- Features Grid ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.feature-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
}

.feature-card__icon {
    width: 40px;
    height: 40px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-card__desc {
    font-size: 13.5px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---------- Tech Stack ---------- */
.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 16px 0;
}

.tech-list li {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ---------- Image Gallery ---------- */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.image-gallery__item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-alt);
}

.image-gallery__item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-gallery__caption {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
}

/* ---------- Video Grid ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.video-card {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-alt);
}

.video-card__embed {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-card__embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-card__desc {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.video-card__desc strong {
    display: block;
    color: var(--color-text);
    margin-bottom: 4px;
    font-size: 14px;
}

/* ---------- Project Cards ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.project-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: box-shadow var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
}

.project-card__icon {
    width: 56px;
    height: 56px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
    margin: 0 auto 16px;
}

.project-card__title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-card__status {
    font-size: 13px;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ---------- Contact / Hire Me ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 24px 0;
}

.contact-info__name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.contact-info__role {
    font-size: 15px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.contact-info__item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.contact-info__item-icon {
    width: 36px;
    height: 36px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
}

.contact-info__buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Contact Form */
.contact-form {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.contact-form__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(42, 67, 101, .1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
    padding: 32px 40px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

.footer__content {
    max-width: var(--max-content);
    margin: 0 auto;
}

.footer__social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    list-style: none;
}

.footer__social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    font-size: 16px;
    transition: all var(--transition);
}

.footer__social a:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.footer p {
    margin-bottom: 4px;
}

/* ---------- Overlay for Mobile Sidebar ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 900;
}

.sidebar-overlay.visible {
    display: block;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablets */
@media (max-width: 960px) {
    .main-content {
        padding: 24px 28px 48px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

/* Mobile */
@media (max-width: 768px) {
    .navbar__links {
        display: none;
    }

    .navbar__hamburger {
        display: flex;
    }

    /* Sidebar off-canvas */
    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        z-index: 950;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .page-wrapper {
        flex-direction: column;
    }

    .main-content {
        padding: 20px 16px 48px;
    }

    .hero__title {
        font-size: 24px;
    }

    .hero__subtitle {
        font-size: 15px;
    }

    .features-grid,
    .projects-grid,
    .video-grid,
    .image-gallery {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card__number {
        font-size: 26px;
    }

    .section__heading {
        font-size: 19px;
    }

    .footer {
        padding: 24px 16px;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .hero__actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .contact-info__buttons {
        flex-direction: column;
    }
}

/* Zigzag Floating Images */
.wiki-figure {
    max-width: 320px;
    margin: 10px 0 20px;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.wiki-figure img {
    width: 100%;
    display: block;
}

.wiki-figure figcaption {
    font-size: 12px;
    padding: 8px;
    text-align: center;
    border-top: 1px solid var(--color-border-light);
    color: var(--color-text-muted);
}

.wiki-figure--right {
    float: right;
    margin-left: 20px;
}

.wiki-figure--left {
    float: left;
    margin-right: 20px;
}

@media (max-width: 768px) {
    .wiki-figure--right,
    .wiki-figure--left {
        float: none;
        margin: 20px auto;
    }
}
