/* ================================
   MAIN.CSS - General Site-Wide Styles
   Applies to all pages in the portfolio
   ================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* for maximum compatibility */
    overflow-y: scroll;
    /* modern browsers only */
    /* scrollbar-gutter: stable;     */
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/* -------------------------------
   Link Styles
--------------------------------- */
a {
    color: #005fa3;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
    color: #0077cc;
    text-decoration: underline;
}


/* -------------------------------
   Headings
--------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #222;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* -------------------------------
   Paragraphs & Text
--------------------------------- */
p {
    margin-bottom: 1rem;
    color: #444;
}

/* -------------------------------
   Paragraphs & Text
--------------------------------- */
pre, code {
    font-weight: 900;
}

/* -------------------------------
   Container / Layout Helpers
--------------------------------- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 0 15px; */
    padding: 0 20px;
}

/* -------------------------------
   Utility Classes
--------------------------------- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* -------------------------------
   Buttons
--------------------------------- */
button, .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;           /* normalize line height */
    border: none;
    border-radius: 5px;
    background-color: #0077cc;
    color: #fff;
    font-weight: 700; /* keep it bold always */
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover, .btn:hover {
    background-color: #005fa3;
    color: white;
    transform: scale(1.05); /* make it appear stronger */
    text-decoration: none;

}

button:focus, .btn:focus {
    outline: none; /* optional: customize focus */
}

.btn-control {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: 0.5rem;
}

/* -----------------------------------
   BACK BUTTON (blog, lab, project single)
   ----------------------------------- */
.back-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #eee;
    color: #333;
    font-weight: 700; /* keep it bold always */
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 0.8;
    border: 2px solid #0077cc;
}

.back-btn:hover {
    background-color: #0077cc;
    color: #eee;
    transform: scale(1.05); /* make it appear stronger */
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.pagination-info {
    font-weight: bold;
}


/* -------------------------------
   Forms
--------------------------------- */
input, textarea, select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0077cc;
    box-shadow: 0 0 5px rgba(0, 119, 204, 0.3);
}

label {
    margin: 0;
    line-height: 1;
}

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

/* -------------------------------
   Lists
--------------------------------- */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* Nested lists (inside a ul or ol) */
ul ul,
ul ol,
ol ul,
ol ol {
    margin-bottom: 0;
}


/* -------------------------------
   Table Styling
--------------------------------- */
table {
    width: 100%;             /* Full width table */
    border-collapse: collapse; /* Merge borders */
    font-family: Arial, sans-serif;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ccc;   /* Add border to cells */
    padding: 8px 12px;        /* Space inside cells */
    text-align: left;          /* Align text to left */
}

th {
    background-color: #f2f2f2; /* Header background */
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #fafafa; /* Zebra striping */
}

tr:hover {
    background-color: #e6f7ff; /* Hover effect */
}

td > p {
    margin-bottom: 0.2rem;
}

/* -------------------------------
   Misc / Global Elements
--------------------------------- */
hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

.hidden {
    display: none !important;
}

/* ================================
   NAVBAR STYLES
   ================================ */

#main-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
}

/* Brand / Logo */
.nav-brand a {
    /* font-size: 1.4rem; */
    font-size: 1.8rem;
    font-weight: 700;
    color: #222;
}

/* =========================================
   Primary Navbar Menu Layout
   ========================================= */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}


/* =========================================
   Primary Navbar Links (base style)
   ========================================= */
.nav-menu li a {
    position: relative;          /* anchor for underline pseudo-element */
    display: inline-block;       /* ensures predictable underline width */
    font-size: 1.05rem;          /* slightly emphasized over body text */
    font-weight: 600;
    line-height: 1.2;
    /* vertical click target */
    padding: 0.5rem 0;
    /* padding: 0.1rem 0; */
    color: #222;
    text-decoration: none;
}


/* =========================================
   Hover state (color + underline animation)
   ========================================= */
.nav-menu li a:hover {
    color: #0077cc;
}


/* =========================================
   Underline (hover + active)
   ========================================= */
.nav-menu li a::after {
    content: "";
    position: absolute;
    left: 0;
    /* bottom: -2px;            */
    /* bottom: -0.5px; */
    bottom: 0.5rem;
    width: 0;
    height: 2px;
    background-color: #0077cc;
    transition: width 0.2s ease;
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 100%;
}


/* =========================================
   Active link state (current page)
   ========================================= */
.nav-menu li a.active {
    color: #0077cc;
    font-weight: 700;
}


/* =========================================
   Disabled link state
   ========================================= */
.nav-menu li a.disabled {
    color: #999;
    pointer-events: none;
}

/* =========================================
   Language Switch Container
   ========================================= */
.lang-switch {
    /* Match font size and weight to primary navbar links */
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;

    /* Layout links horizontally with small gap */
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* =========================================
   All language links and active text
   ========================================= */
.lang-switch a,
.lang-switch strong {
    /* Needed for pseudo-element positioning */
    position: relative;

    /* Space below text for underline */
    padding-bottom: 1px;

    /* Smooth color transition for hover */
    transition: color 0.2s ease;

    /* Remove default underline from links */
    text-decoration: none;
}

/* Hover effect for inactive link */
.nav-menu .lang-switch a:hover {
    /* dark, but hard to see change */
    /* color: #023458; */
    /* subtle */
    /* color: #3392dd; */
    /* Clear but restrained */
    /* color: #4da0e6; */
    /* Brighter hover emphasis */
    /* color: #66adee; */
    /* WCAG-friendly on white backgrounds */
    /* color: #1a85d6; */

    /* keep the same */
    color: #0077cc;
}

/* =========================================
   Active language indicator
   ========================================= */
.lang-switch strong {
    color: #0077cc;
    font-weight: 900;
}

/* Add underline using pseudo-element for active language */
.lang-switch strong::after {
    /* No text content, just a visual underline */
    content: "";

    /* Absolute positioning relative to strong */
    position: absolute;
    left: 0;
    bottom: 0;              /* sits snug under text baseline */

    /* Full width underline */
    width: 100%;

    /* Thickness and color */
    height: 2px;
    background-color: #0077cc;
}

/* Mobile Toggle Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
}

/* styling content when printing (or when generating a PDF from a page) */

/* =========================================================
   PRINT STYLES (Puppeteer PDF)
   ========================================================= */
@media print {

  /* Prevent extra top spacing in printed/PDF output caused by
   scroll-margin-top used for in-page anchor navigation */
  h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
    scroll-margin-top: 0;
  }

  a {
    text-decoration: underline;
    color: #0077cc;
  }

  /* ---------------------------------
     Prevent page breaks inside blocks
     --------------------------------- */
  .keep-together {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ---------------------------------
     Tables
     --------------------------------- */
  table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;   /* cleaner PDF rendering */
  }

  /* ---------------------------------
     All table cells (TEXT TABLES)
     --------------------------------- */
  td {
    padding: 8px 12px;            /* ensures both left & right cells match */
    line-height: normal;
    vertical-align: top;
  }

  /* ---------------------------------
     Image table cells (OVERRIDES td)
     --------------------------------- */
  td.img-cell {
    padding: 8px 12px;
  }

  td.img-cell .img-wrapper {
    height: 200px;                /* 🔧 tune per document */
    display: flex;
    justify-content: center;
    align-items: center;
  }

  td.img-cell img {
    width: 100%;
    height: 100%;
    /* fills wrapper without distortion */
    object-fit: contain;
    /* fills container */
    /* object-fit: cover; */
  }

  /* ---------------------------------
     Non-table images
     --------------------------------- */
  img {
    max-width: 100%;
    height: auto;
  }

  /* ---------------------------------
     Code blocks
     --------------------------------- */
  pre {
    margin: 0;
    padding: 12px;
    background: #f4f4f4;
  }

  code {
    font-family: monospace;
  }
}

/* ================================
   Mobile Styles
   ================================ */

@media (max-width: 768px) {

    /* Show toggle button */
    .nav-toggle {
        display: flex;
    }

    /* Menu starts hidden */
    .nav-menu {
        position: absolute;
        top: 60px;
        right: 0;
        background: #111;
        width: 200px;
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-15px);
        transition: all 0.3s ease;
        border-left: 1px solid #333;
        border-bottom: 1px solid #333;
    }

    /* When JS adds .nav-menu-visible */
    .nav-menu.nav-menu-visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}


/* ============================
   TOGGLE ICON ANIMATION
============================ */

/* X animation */
.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   Sticky Navbar + Anchor Link Fix
   ======================================== */

/* let JS dynamically set the padding/margin */
html {
    scroll-padding-top: 0;
}

/* -----------------------------
   Anchor targets (headings, sections)
   JS will dynamically set scroll-margin-top
   ----------------------------- */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id],
section[id], article[id], div[id] {
    scroll-margin-top: 0;
}

/* Site footer */
#site-footer > div {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}