/* ========================================================================
                                CSS VARIABLES (THEME)
   ======================================================================== */
:root {
    /* Link colors */
    --color-link: #1a95e0;
    --color-accent: #F97316;

    /* Navbar */
    --color-navbar-bg: #060811;
    --color-navbar-text: #b5b2b2;

    /* Dark theme */
    --color-dark-bg: #11141b;
    --color-dark-text: #b9b8b8;
    --color-dark-lighter-text: #c6c9ce;
    --color-dark-section-border: #ddd;
    --color-dark-shallow-border: rgba(255, 255, 255, 0.1);

    /* Light theme */
    --color-light-bg: #ffffff;
    --color-light-text: #1c1c1e;
    --color-light-bright-link-title: #2a75ab;
    --color-light-shallow-border: rgba(3, 3, 3, 0.1);

    /* Common colors */
    --color-secondary-text: #6b6b6b;
    --color-shadow: rgba(30,40,60,0.07);
    --color-shadow-hover: rgba(30,40,60,0.13);
    --color-gallery-overlay: rgba(60,40,20,0.7);
    
    /* Fonts */
    --font-main: 'Spectral', 'Crimson Pro', sans-serif;
    --font-serif: 'PT Serif', 'Crimson Pro', serif;
    --font-logo: "Major Mono Display", monospace, 'Permanent Marker', cursive;
    --font-bio-title: "Caveat", 'Reenie Beanie', 'cursive', 'Crimson Pro', serif;
    --font-mono: ui-monospace, SFMono-Regular, monospace, "SF Mono", Menlo, Consolas;
    --font-footer: 'Spectral', sans-serif;

    --blog-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --blog-font-serif: "Charter", "Iowan Old Style", "Georgia", "Times New Roman", serif;

    /* Border radius */
    --radius-card: 12px;
    --radius-btn: 10px;
    --radius-img: 8px;

    /* Shadows */
    --shadow-card: 0 5px 12px var(--color-shadow);
    --shadow-card-hover: 0 18px 18px var(--color-shadow-hover);
}

/* ========================================================================
                    CSS RESET, BASE STYLES & UNIVERSAL ELEMENTS
   ======================================================================== */

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

/* Base Typography & Body */
body {
    font-family: var(--blog-font-serif);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    background-color: var(--color-dark-bg);
    color: var(--color-dark-text);
    font-size: clamp(0.97rem, 1.15vw, 1rem);
    /* font-weight: 400; */
    min-height: 100vh;
    padding-top: 56px; /* Prevent content from hiding under fixed nav */

    
}

h1, h2, h3, h4, h5, h6{
    font-family: inherit;
    color: var(--color-dark-lighter-text);
}

.title, .title h1 {
    color: var(--color-dark-lighter-text);
}

 
/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-navbar-text);
  background: none;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  width: 30px;
  height: 30px;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}
.theme-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  display: none;
}
/* Moon by default (dark mode = no .light-theme on body) */
.theme-toggle #icon-sun  { display: none; }
.theme-toggle #icon-moon { display: block; fill: currentColor; }
 
/* Light mode: hide moon, show sun */
body.light-theme .theme-toggle #icon-moon { display: none; }
body.light-theme .theme-toggle #icon-sun  { display: block; }
body.light-theme .theme-toggle #icon-sun circle { fill: currentColor; stroke: none; }
 
/* ---------- Base navbar ---------- */
.navbar {
  width: 100%;
  background: var(--color-navbar-bg);
  color: var(--color-navbar-text);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  box-shadow:
    0 4px 24px 0 rgba(35, 86, 145, 0.18),
    0 2px 8px 0 rgba(0, 0, 0, 0.12);
}
 
/* ---------- Container ---------- */
.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
 
/* ---------- Logo ---------- */
.navbar-logo {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  color: var(--color-navbar-text);
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* About Me: hide logo and keep right controls on the right */
.about-page .navbar-logo {
  display: none;
}
 
/* ---------- Nav links (desktop row) ---------- */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
 
.navbar-links a {
  color: var(--color-navbar-text);
  text-decoration: none;
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.navbar-links a:hover {
  color: var(--color-link);
}
.navbar-links a.active {
  color: var(--color-link);
  border-bottom: 2px solid var(--color-link);
}
 
/* Thin vertical rule before CV/Resume */
.nav-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
 
/* CV / Resume inline pair */
.nav-inline-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.nav-inline-group a {
  padding: 2px 0;
}
.nav-slash {
  color: var(--color-navbar-text);
  opacity: 0.45;
  font-size: 0.9rem;
  user-select: none;
}
 
/* ---------- Right controls (theme + hamburger) ---------- */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 1.5rem;
}
 
/* ---------- Hamburger button ---------- */
.navbar-toggle {
  display: none;     
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  width: 32px;
  height: 32px;
}
.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-navbar-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
  transform-origin: center;
}
 
/* Hamburger → X animation when open */
.navbar-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.navbar-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.navbar-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
 
/* =====================================================================
   RESPONSIVE — mobile breakpoint
   ===================================================================== */
@media (max-width: 1024px) {
  .navbar-logo {
    font-size: 1.3rem;
  }
}

@media (max-width: 920px) {
  .about-page .navbar-container {
    justify-content: flex-end;
  }

  .about-page .navbar-right {
    margin-left: 0;
  }
 
  .navbar-container {
    padding: 0 calc(clamp(10px, 4vw, 20px) + clamp(7px, 3vw, 35px));
  }
 
  /* Show hamburger */
  .navbar-toggle {
    display: flex;
  }
 
  /* Links panel: full-width slide-down from behind the navbar */
  .navbar-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--color-navbar-bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
 
    /* Slide animation via max-height */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.22s ease;
 
    /* Match navbar shadow on bottom edge */
    box-shadow:
      0 8px 24px rgba(35, 86, 145, 0.15),
      0 4px 8px rgba(0, 0, 0, 0.1);
  }
 
  .navbar-links.open {
    max-height: 480px;  /* tall enough for all links */
    opacity: 1;
  }
 
  /* Each link: full-width row with a subtle separator */
  .navbar-links a {
    display: block;
    padding: 0.8rem 1.4rem;
    font-size: 0.97rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-left: none;
  }
  .navbar-links a:last-of-type {
    border-bottom: none;
  }
  /* Keep active underline out of mobile — use left accent instead */
  .navbar-links a.active {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid var(--color-link);
    padding-left: calc(1.4rem - 3px);
    color: var(--color-link);
  }
 
  /* Hide the desktop divider on mobile */
  .nav-divider { display: none; }
 
  /* CV/Resume row */
  .nav-inline-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  .nav-inline-group a {
    padding: 0;
    border-bottom: none !important;
    border-left: none !important;
    display: inline;
  }
}
 
@media (max-width: 400px) {
  .navbar-logo { font-size: 1.1rem; }
}


/* ========================================================================
                            MAIN LAYOUT & CONTAINERS
   ======================================================================== */

.main {
    padding: clamp(10px, 4vw, 20px);
    flex: 1;
    min-height: 100vh;
}

.content-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 10px clamp(7px, 3vw, 35px) clamp(10px, 5vw, 50px);
    border-radius: 8px;
    box-sizing: border-box;
    padding-bottom: 20px;
    line-height: 1.55;
}

/* ========================================================================
                            COMMON COMPONENTS
   ======================================================================== */

a {
    text-decoration: none;
    color: var(--color-link);
    transition: color 0.3s;
    font-weight: 500;
}

a:hover {
    /* background-color: var(--color-link); */
    color: var(--color-accent);
    font-weight: 600;
}

.message {
    margin: 1.5rem auto 0 auto;
    padding: 0.35rem 1rem;

    color: #00ff9f;
    border: 1.5px solid #00ff9f;

    background: rgba(0, 255, 159, 0.03);

    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 600;
    /* text-transform: uppercase; */

    border-radius: 4px;
    box-shadow:
        0 0 6px rgba(0, 255, 159, 0.35);

    transition: all 0.2s ease;
}


@media (max-width: 768px) {
    .message {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ========================================================================
                                BIO SECTION
   ======================================================================== */

.about-container {
    margin-bottom: 30px;
}

.about-container p {
    margin: 0 0 15px;
    text-align: justify;
}

/* Name + short introduction */

.bio-header {
    margin-bottom: 20px;
}

.bio-header first-name {
    /* margin: 0; */
    font-size: 2rem;
    line-height: 1.25;
    /* font-weight: 500; */
    /* letter-spacing: -0.02em; */
    font-family: var(--font-bio-title)
}

.bio-tagline {
    max-width: 720px;
    letter-spacing: -0.01em;
}

.bio-name {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.bio-role {
    line-height: 1.5;
    color: var(--color-secondary-text);
}

.bio-image-container {
    display: block;
}

/* Image */

.bio-image {
    /* height: 185px; */
    float: left;
    width: 185px;
    margin: 0 30px 0 0;
}

.bio-image img {
    display: block;
    margin-top: 3px;
    height: 185px;
    width: 185px;

    object-fit: cover;
    cursor: pointer;

    will-change: transform;
    transform: translateZ(0);

    border: 0.5px solid var(--color-dark-text);
    border-radius: 1px;

    transition:
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-title {
    margin-top: 7px;
    font-family: var(--font-bio-title);
    font-size: 1.15em;
    font-weight: 600;
    margin-right: 30px;
}

/* ---------- Classic divider icon row under profile image ---------- */
.bio-image .bio-social {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0 0 0;
    width: 185px;
}

.bio-image .bio-social li {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    height: 35px;
}

.bio-image .bio-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bio-image .bio-social a i {
    font-size: 18px;
}

.bio-image .bio-social a:hover {
    color: var(--color-accent);
}

.bio-image .bio-social a i:hover {
    font-weight: 900;
    font-size: 23px;
}

@media (max-width: 580px) {
    .bio-image .bio-social {
        margin-bottom: -15px;
        width: 100%;
    }

    .bio-image .bio-social li {
        height: 50px;
    }

    .bio-image .bio-social a i {
        font-size: 25px;
    }
}

/* Bio text */

.bio-text {
    min-width: 0;
    margin: 0;
}

.bio-text p {
    margin: 0 0 15px;
    /* text-align: justify; */
}

/* Clear the float after the section */
.bio-image-container::after {
    content: "";
    display: block;
    clear: both;
}

/* Mobile */

@media (max-width: 580px) {

    .bio-image-container {
        display: block;
    }

    .bio-image {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }

    .bio-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .bio-text {
        width: 100%;
    }
}

/* ========================================================================
                                MODAL (IMAGE POPUP)
   ======================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}
.modal-content {
    margin: auto;
    display: block;
    width: 45%;
    max-width: 90%;
}
#close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
#close-modal:hover { color: #ccc; }
@media (max-width: 768px) {
    .modal-content { width: 70%; max-width: 80%; }
    #close-modal { top: 20px; right: 15px; font-size: 35px; }
}
@media (max-width: 480px) {
    .modal-content { width: 90%; max-width: 95%; }
    #close-modal { top: 15px; right: 10px; font-size: 30px; }
}

/* ========================================================================
                            RECENT NEWS & UPDATES
   ======================================================================== */

/* Container styling */
.recent-news-container {
    margin: auto;
}

/* Scrollable news box */
.news-box {
    max-height: 300px;          /* height of the box */
    overflow-y: auto;           /* scroll if content exceeds */
    border-top: 1px solid;
    border-radius: 5px;
    padding: 1rem 0.5rem 1rem 0.5rem;
    scroll-behavior: smooth;
    margin-top: 5px;
}

/* News list — now a flex column so `order` works */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}


/* Each news item — added a leading gutter column reserved for the pin icon */
.news-list li {
    display: grid;
    grid-template-columns: 22px 95px 1fr;
    column-gap: 2px;
    margin-bottom: 0.5rem;
    align-items: start;
    order: 0;
}

/* Reserve the gutter cell on every item so columns stay aligned,
   whether or not that item is pinned */
.news-list li:not(.news-pinned)::before {
    content: "";
}

/* ---------- Pinned items ---------- */
.news-pinned {
    position: relative;
    background-color: color-mix(in srgb, var(--color-link) 12%, transparent);
    border-radius: 4px;
    padding: 4px 6px 4px 0px;
}

.news-list li.news-pinned {
    order: -1;
}

.news-pinned::before {
    content: "📌";
    /* font-size: 0.75em; */
    line-height: 1.6;
    grid-column: 1;
    padding-left: 5px;
}

.news-date {
    position: relative;
    display: inline-block;
    overflow: visible;
    color: var(--color-link);
}

.news-event {
    margin-left: 0px;
}

@media (max-width: 768px) {
    .news-date {
        padding-left: 0px;
    }
    /* .news-list li {
        grid-template-columns: 25px 90px 1fr;
    } */
}
/* ========================================================================
                            EXPERIENCE & PROJECTS
   ======================================================================== */

.experience-container { padding-bottom: 20px; }
.work-container, .thesis-container, .project-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-dark-section-border);
}
.work-image, .thesis-image {
    flex: 1;
    max-width: 120px;
    max-height: 150px;
    margin-right: 30px;
    align-self: center;
}
.project-image {
    width: 120px;
    max-height: 150px;

    margin-right: 30px;
    object-fit: contain;

    cursor: zoom-in;
    transition: transform .2s ease;

    border: 1px solid #11141b;
    border-radius: 3px;
    padding: 4px;
    background: #fff;
}

.project-image:hover {
    transform: scale(1.08);
}

.thesis-image { padding-top: 5px; max-height: 150px; }
.work-content, .thesis-content, .project-content { flex: 3; }
.work-content p, .thesis-content p, .project-content p {
    margin: 6px 0;
    text-align: justify;
}
.experience-sections-header {
    padding-bottom: 5px;
    font-family: monospace, 'Crimson Pro', serif;
    font-size: large;
}
@media (max-width: 480px) {
    .work-container, .thesis-container, .project-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .work-image, .thesis-image, .project-image {
        margin-right: 0;
        margin-bottom: 10px;
        max-width: 100px;
        max-height: 120px;
    }
    .work-content, .thesis-content, .project-content { flex: none; }
    .work-content p, .thesis-content p, .project-content p { text-align: justify; }
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;

    margin-bottom: 0.5rem;
}

.project-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.project-filter {
    display: inline-flex;
    align-items: center;

    padding: 0.15rem 0.65rem;

    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;

    /* border: 1px solid #d0d7de; */
    border-radius: 3px;

    color: #1f9d8f;
    background-color: rgba(42, 157, 143, 0.12);

    margin-left: 0.1rem;
}

@media (max-width: 768px) {
    .project-filter {
        font-size: 0.7rem;
        padding: 0.1rem 0.5rem;
        line-height: 1;
    }
}


/* ========================================================================
                        BLOGS: ARTICLE LIST & TILES
   ======================================================================== */

.description {
    margin-bottom: 20px;
    text-align: justify;
}
.article-sections-header {
    font-size: large;
    font-family: monospace, 'Crimson Pro', serif;
    margin-top: 40px;
    margin-bottom: 40px;
}
.articles-list {
    display: flex;
    flex-direction: column;
}
.article-item {
    display: flex;
    align-items: center;
    padding: 10px 0px 5px 0px;
    /* background: linear-gradient(270deg, #edf2f7 30%, #deeefc 100%); */
    margin-bottom: 0.7em;
    transition: transform 0.16s, box-shadow 0.16s, border 0.16s;
}
.article-item:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-card-hover);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 0.5px solid #cee1ee;
    border-color: #2d87c3;
    padding: 20px 20px 20px 20px;
}

@media (max-width: 768px) {
    .articles-header {
        margin-bottom: 30px;
    }
    .article-item {
        margin-bottom: 0.3em;
    }
}

@media (max-width: 480px) {
    .articles-header {
        margin-top: 25px;
        margin-bottom: 25px;
    }
}

/* --------------- Container for the filters ---------------- */

.article-tag-icon {
    display: inline-flex;
    align-items: center;
    font-size: 1.25rem;
    padding-right: 10px;
}

/* Mirror the icon */
.article-tag-icon i.mirrored {
    transform: scaleX(-1); /* flips horizontally */
}
.article-filter-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.2rem;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Filter buttons */
.filter-button {
    cursor: pointer;
    padding: 0.3em 0.7em;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.6rem;
    border-radius: 4px;
    border: 1.5px solid;
    background: transparent;
    transition: background-color 0.25s, color 0.25s;
    user-select: none;
    color: inherit;
    letter-spacing: 0.13em;
}

.filter-button.active {
    background-color: currentColor;
}

/* Individual filter button colors */
.filter-research_journal {
    color: #d8674b;
    border-color: #d8674b;
}

.filter-dev_journal {
    color: #1f9d8f;
    border-color: #1f9d8f;
}

.filter-academic_journal {
    color: #c375d7;
    border-color: #c375d7;
}

/* Container for date and tags */
.date-filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3em;
}

/* Article filter tags */
.article-filter {
    display: inline-flex;
    align-items: center;

    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;

    padding: 0.15rem 0.65rem;

    /* border: 1px solid #d0d7de; */
    border-radius: 3px;

    background: #f6f8fa;
    color: #57606a;

    /* white-space: nowrap; */
    user-select: none;

    margin-left: 0.25rem;
}


/* Tag background colors matching buttons but lighter */
.article-filter.filter-research_journal {
    color: #d8674b;
    background-color: rgba(231, 111, 81, 0.12);
}

.article-filter.filter-dev_journal {
    color: #1f9d8f;
    background-color: rgba(42, 157, 143, 0.12);
}

.article-filter.filter-academic_journal {
    color: #c375d7;
    background-color: rgba(202, 161, 205, 0.18);
}

.article-metadata {
    display: flex;
    align-items: center; /* vertical alignment */
}

.article-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.article-content h3 {
    font-size: clamp(0.97em, 1.15vw, 1rem);
    /* line-height: 1.2; */
    /* color: var(--color-notice-border-left); */
    color: var(--color-link);
    font-family: var(--font-serif);
    /* font-weight: 450; */
    margin: 0 0 0.18em 0;
    /* letter-spacing: 0.01em; */
}
.article-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.16s;
    margin-top: 0;
}
.article-content h3 a:hover { color: var(--color-accent); }
.article-metadata-date {
    font-size: 0.85em;
    margin-top: 0.3em;
    margin-bottom: 0.1em;
    margin-right: 0.5em;
    padding-left: 1px;
    /* font-style: italic; */
}
@media (max-width: 768px) {
    .article-tag-icon {
        padding-right: 5px;
    }
    .article-content h3 { 
        margin-top: 0 !important; 
    }
    .filter-button {
        font-size: 0.5rem;
        letter-spacing: 0.08em;
    }
    .article-filter {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    .article-metadata {
        padding-bottom: 0.3em;
    }
}
@media (max-width: 480px) {
    .article-tag-icon {
        padding-right: 3px;
    }
    .filter-button {
        font-size: 0.5rem;
        letter-spacing: 0.04em;
    }
    .article-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0;
    }
    .article-content {
        padding-top: 0;
        margin-top: 0;
        align-items: flex-start;
        width: 100%;
        /* font-size: 1rem; */
    }
    .article-metadata {
        padding-bottom: 0.3em;
    }
    .article-filter {
        font-size: 0.6rem;
        line-height: 1;
        
    }
}

/* ========================================================================
                                PAGINATION
   ======================================================================== */

.pagination {
    display: flex;
    font-size: 1em;
    justify-content: center;
    margin-top: 100px;
}
.pagination a {
    color: var(--color-link);
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid var(--color-dark-section-border);
    margin: 0 5px;
    transition: background-color 0.3s, color 0.3s;
}

/* ========================================================================
                            GALLERY SECTION
   ======================================================================== */

.gallery-intro {
    max-width: 600px;
    margin: 0rem auto 2rem auto;
    text-align: center;
    color: #3d2c1e;
}
.gallery-filters {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 0.7rem;
}
.filter-btn {
    background: linear-gradient(90deg, #eaf4fb 0%, #b6d5eb 100%);
    color: #1a2a3a;
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border: none; /* Remove border */
}
.filter-btn.active, .filter-btn:hover {
    background: linear-gradient(90deg, #3574a1 0%, #0a4486 100%);
    color: #ebf1f8;
}
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    max-width: 900px;
    margin: 0 auto 2rem auto;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(80, 60, 30, 0.08);
    background: #fff;
}
.gallery-item img {
    width: 100%;
    height: 275px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(.4,2,.3,1);
    cursor: pointer;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(0deg, var(--color-gallery-overlay) 50%, transparent 100%);
    color: var(--color-dark-lighter-text);
    padding: 0.7rem 1rem;
    opacity: 1;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.gallery-caption h3 {
    color: var(--color-light-bg);
}

@media (hover: none) and (pointer: coarse), (max-width: 700px) {
    .gallery-overlay {
        opacity: 1 !important;
        pointer-events: auto;
    }
    .gallery-item:hover .gallery-overlay {
        opacity: 1 !important;
    }
}
@media (min-width: 600px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-btn .filter-flag { display: none; }
    /* .filter-btn-active .filter-flag { display: none; } */
}
@media (min-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .gallery-filters { flex-wrap: wrap; gap: 0.3rem; }
    .filter-btn { font-size: 0.9rem; padding: 0.28rem 0.6rem; min-width: 70px; }
    .filter-btn .filter-label { display: none; }
    .filter-btn .filter-flag { font-size: 1.2em; }
}
@media (max-width: 400px) {
    .filter-btn { font-size: 0.85rem; padding: 0.22rem 0.5rem; min-width: 54px; }
}

/* ========================================================================
                            RESOURCES SECTION
   ======================================================================== */

.resource-subsection {
    margin-top: 1.5rem;
}

.resource-subsection h2 {
    font-size: larger;
    margin-bottom: 0.4rem;
    font-family: var(--font-mono);
}

.resource-subsection ul li {
    padding: 0.2rem 0;
    margin-left: 2rem;
}

.resource-subsection ul li a {
    text-decoration: none;
    color: var(--color-link);
}

.resource-subsection ul li a:hover {
    color: var(--color-accent);
    font-weight: bold;
}

.resource-filter {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;

    position: relative;
    top: -1px;

    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;

    padding: 0.1rem 0.45rem;

    border-radius: 3px;

    background: #ffedd5;
    color: #c2410c;

    user-select: none;

    margin-right: 0.5rem;
}

/* ========================================================================
                                FOOTER CONTAINER
   ======================================================================== */

.site-footer {
  margin-top: 5rem;
}

.site-footer::before {
  content: "";
  display: block;
  width: calc(100% + 2 * clamp(10px, 4vw, 20px));
  margin-left: calc(-1 * clamp(10px, 4vw, 20px));
  border-top: 1px solid var(--color-dark-shallow-border);
}

.site-footer-inner {
  font-family: var(--font-footer);
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem clamp(7px, 3vw, 35px) 1rem;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-sizing: border-box;
}

.site-footer-inner a {
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-link);
  text-decoration: none;
}

.site-footer-inner a:hover {
  text-decoration: underline;
}

/* ========================================================================
                                LIGHT THEME OVERRIDE
   ======================================================================== */

body.light-theme {
    background-color: var(--color-light-bg);
    color: var(--color-light-text);
}

body.light-theme .links a i {
    color: var(--color-navbar-bg);
}

body.light-theme .links a:hover i { 
    color: var(--color-accent); 
}

body.light-theme .theme-toggle {
    color: var(--color-light-bg);
    text-shadow: 0 0 25px #f4a261;
}

body.light-theme .message {
    font-weight: 600;

    color: #008f5a;
    border: 1.5px solid #00c97b;

    background: rgba(0, 201, 123, 0.08);

    box-shadow:
        0 0 4px rgba(0, 201, 123, 0.18);
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .title,
body.light-theme .title h1,
body.light-theme .blog-metadata-modification-time{
    color: var(--color-light-text);
}

body.light-theme .article-content h3 {
    /* color: var(--color-light-bright-link-title); */
    color: var(--color-link);
}

body.light-theme .gallery-caption h3 {
    color: var(--color-light-bg);
}

body.light-theme .site-footer::before {
  border-top: 1px solid var(--color-light-shallow-border);
}