/* ===============================
   Base Settings & Global Styles
   =============================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Merriweather:wght@300;400;700&display=swap');

:root {
  /* Color Scheme */
  --fg-color: #444;
  --fg2-color: #666;
  --heading-color: #5a4a42;
  --link-color: #8c695f;
  --link-hover: #ba3d28;
  --bg-color: #fff;
  --button-color: #eee;
  --button-hover: #ccc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body { 
  text-align: center; 
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-color);
  color: var(--fg-color);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-family: 'Merriweather', serif;
  font-weight: 400;
  padding-bottom: 0.5rem;
}

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; }

p {
  color: var(--fg2-color);
  line-height: 1.6;
  font-weight: 400;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* ===============================
   Header & Navigation (Old Style Integration)
   =============================== */

header {
  padding: 1.5rem;
  margin-bottom: 4rem;
  position: relative;
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  background: url(/images/mBlack.svg) no-repeat center center;
  width: 3rem;
  height: 3rem;
  transition: opacity 0.3s ease;
  margin: 0 3rem;
}

nav ul.linksB {
  display: flex;
  list-style: none;
}

nav ul.linksB li {
  display: inline-block;
  padding: 0.3rem;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 600;
}

nav ul.linksB li a {
  color: var(--fg-color);
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.bars {
  display: none;
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  z-index: 25;
  cursor: pointer;
}

.fa-bars {
  font-size: 2rem;
  color: var(--fg-color);
  opacity: 0.8;
  transition: all 0.3s ease;
}

/* Mobile Menu (Old Style) */
#mobile-links {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 15;
  text-align: right;
}

#mobile-links.visible {
  display: block;
}

.mobile-links-container {
  margin-top: 7rem;
  margin-right: 2rem;
}

.mobile {
  font-size: 2rem;
  line-height: 2;
  list-style: none;
}

.mobile a {
  color: var(--fg-color);
  transition: all 0.3s ease;
}

/* ===============================
   Main Content
   =============================== */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.headText {
  margin: 0 auto 3rem;
  max-width: 800px;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg2-color);
}

/* ===============================
   Blog/Portfolio Cards
   =============================== */

.blog-container {
  display: grid;
  gap: 1.25rem;
  padding: 0 0.5rem;
}

.blog-card {
  display: flex;
  background: var(--bg-color);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-image {
  flex: 0 0 35%;
  overflow: hidden;
}

.blog-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-thumbnail {
  transform: scale(1.05);
}

.blog-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  background-color: var(--bg-color);
  min-height: 0;
}

.blog-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--heading-color);
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--fg2-color);
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-excerpt {
  margin-bottom: 1.5rem;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--fg2-color);
}

.read-more {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--link-color);
  font-weight: 500;
  margin-top: auto !important;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  visibility: visible !important;
  opacity: 1 !important; 
  position: relative;
}

.read-more i {
  transition: transform 0.3s ease;
}

.read-more:hover i {
  transform: translateX(4px);
}

/* ===============================
   Footer (Keep New Style)
   =============================== */

footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.copyright {
  font-size: 0.85rem;
  color: var(--fg2-color);
}

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

@media (max-width: 850px) {
  header {
    padding: 1rem 0;
    margin-bottom: 2rem;
  }

  .logo {
    margin: 0 1rem;
  }

  nav ul.linksB {
    display: none;
  }

  .bars {
    display: flex;
  }

  .blog-card {
    flex-direction: column;
  }

  .blog-image {
    height: 220px;
  }
}

@media (max-width: 640px) {
  header {
    padding: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .logo {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0.5rem;
  }

  .mobile-links-container {
    margin-top: 5rem;
    margin-right: 1rem;
  }

  .mobile {
    font-size: 1.5rem;
    line-height: 1.8;
  }

  .blog-image {
    height: 180px;
  }
}

/* ===============================
   Dark Mode
   =============================== */

@media (prefers-color-scheme: dark) {
  :root {
    --fg-color: #f5f5f5;
    --fg2-color: #aaa;
    --heading-color: #e0e0e0;
    --link-color: #dc3232;
    --link-hover: #ff4545;
    --bg-color: #121212;
    --button-color: #2a2a2a;
    --button-hover: #3a3a3a;
  }

  .logo {
    background-image: url(/images/mWhite.svg);
  }

  #mobile-links {
    background-color: rgba(18, 18, 18, 0.98);
  }

  .fa-bars {
    color: var(--fg-color);
  }

  .blog-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
}
