/* === GLOBAL STYLES === */
:root {
  --bg-light: #f9f9f8;
  --text-light: #1a1a1a;
  --accent: #8fa68e;

  --bg-dark: #1b1b1b;
  --text-dark: #eaeaea;

  --border-color: #ccc;

  --transition: 0.3s ease;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: background-color var(--transition), color var(--transition);
}

body.dark {
  background-color: var(--bg-dark);
  color: var(--text-dark);

  /* Dark mode form + UI support */
  --bg-color: #2a2a2a;
  --text-color: #eaeaea;
  --border-color: #555;

  --accent-color: var(--accent);
  --accent-hover: #7e957d;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

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

/* === LAYOUT HELPERS === */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* === HEADER === */
.site-header {
  padding: 1.2rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
}

.header-inner {
  width: 90%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.nav a {
  margin-left: 1.5rem;
  font-weight: 400;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  transition: width var(--transition);
}

.nav a:hover::after {
  width: 100%;
}

/* === THEME TOGGLE === */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

.sun { display: inline; }
.moon { display: none; }

body.dark .sun { display: none; }
body.dark .moon { display: inline; }

/* === HERO === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 1rem 3rem;
}

.hero-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero-text {
  max-width: 600px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #444;
  margin: 0 auto;
}

body.dark .hero-text {
  color: #ccc;
}

.hero-cta {
  margin-top: 2.2rem; /* spacing below the text */
}

.hero .container {
  display: flex;
  flex-direction: column; /* stack children vertically */
  align-items: center;    /* center children horizontally */
  text-align: center;     /* center text inside elements */
}

html {
  scroll-behavior: smooth;
}

/* === RESPONSIVE HERO === */
@media (max-width: 800px) {
  .hero-title { font-size: 2.4rem; }
  .hero-text { font-size: 1.05rem; padding: 0 1rem; }
}

@media (max-width: 500px) {
  .hero-title { font-size: 2rem; }
  .hero-text { font-size: 1rem; }
  .hero { padding: 3rem 1rem 2rem; }
}

/* === PROJECTS PREVIEW === */
.projects-preview { padding: 4rem 0; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  display: block;
  background-color: transparent;
  transition: transform var(--transition), opacity var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  opacity: 0.95;
}

.project-info {
  margin-top: 0.6rem;
}

.project-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.project-info p {
  font-size: 0.95rem;
  opacity: 0.8;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

/* === BUTTONS === */
.button {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  transition: background-color var(--transition), transform var(--transition);
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.button:hover {
  background-color: #7e957d;
  transform: translateY(-2px);
}

/* === FOOTER === */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 3rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.social-links a {
  margin: 0 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.social-links a:hover {
  opacity: 1;
  color: var(--accent);
}

body.dark .site-header,
body.dark .site-footer { border-color: rgba(255, 255, 255, 0.1); }

/* === CONTACT FORM === */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 750px;
  width: 100%;
  margin: 2rem auto 0;
}

.contact-form label { font-weight: 500; margin-bottom: 0.25rem; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--bg-color, #fff);
  color: var(--text-color, #111);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-color, #555);
}

/* === CONTACT FORM BUTTON FIX === */
.contact-form .button {
  align-self: flex-start;
  padding: 0.8rem 1.5rem; /* same as .button global */
  font-size: 1rem;        /* ensure same size as hero buttons */
  border-radius: 50px;    /* same as global button */
  background-color: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.contact-form .button:hover {
  background-color: #7e957d; /* same hover as global button */
  transform: translateY(-2px);
}


.contact-note {
  max-width: 750px;
  margin: 2rem auto 0;
}

/* === STORE PAGE === */
.store-container p { margin-bottom: 3rem; }

/* === PROJECT DETAIL PAGE === */
.project-hero {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  border-radius: 10px;
  overflow: hidden;
}

.project-page-container {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.project-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.project-subtitle {
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 2rem;
}

.project-section { margin: 2.5rem 0; }

.project-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.project-section p {
  line-height: 1.7;
  font-size: 1.05rem;
  opacity: 0.9;
}

/* === PROJECT GALLERY === */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

/* Tablet */
@media (max-width: 900px) { .project-gallery { grid-template-columns: repeat(2, 1fr); } }

/* Mobile */
@media (max-width: 600px) { .project-gallery { grid-template-columns: 1fr; } }

/* === BACK BUTTON === */
.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.back-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* === ABOUT PAGE === */

.about-intro > .section-title { /* Fix title spacing so paragraph aligns with image */
  margin-top: 0;          /* remove default top margin */
  margin-bottom: 1.5rem;  /* adjust spacing below title */
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* aligns items to top */
  gap: 1rem; /* the space inbetween the text and image */
  max-width: 850px; /* match the width of focus areas */
  margin: 0 auto;   /* center it */
}

.about-text {
  flex: 1;
}

.about-text p {
  line-height: 1.7;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.about-image {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.about-image img {
  width: 100%;
  max-width: 300px; /* smaller image on desktop */
  border-radius: 12px;
  object-fit: cover;
}

.about-intro {
  padding-bottom: 6rem;
}

/* Mobile layout */
@media (max-width: 800px) {
  .about-container {
    flex-direction: column;
    text-align: center;
  }
  .about-text { order: 1; }
  .about-image { order: 2; }
  .about-image img { max-width: 350px; } /* larger on mobile if needed */
  .about-intro { padding-bottom: 4rem; }
}

/* Button alignment */
.focus-areas .more-link {
  display: flex;
  justify-content: center; /* centers the button horizontally */
  margin-top: 2rem;
}

/* === DARK MODE PROJECT TWEAKS === */
body.dark .project-section p { opacity: 0.85; }
body.dark .project-subtitle { opacity: 0.65; }
body.dark .back-link { opacity: 0.6; }

/* === MOBILE TWEAKS === */
@media (max-width: 600px) {
  .nav a { margin-left: 0.8rem; }
  .hero-title { font-size: 2.2rem; }
  .project-gallery { grid-template-columns: 1fr; }
}

/* === BLOG LIST PAGE === */
.section-intro {
  max-width: 750px;
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.8;
}

@media (max-width: 950px) {
  .section-intro {
    max-width: 90%; /* keeps padding on smaller screens */
  }
}

body.dark .section-intro { opacity: 0.7; }

.blog-meta {
  display: block;
  font-size: 1rem;
  opacity: 0.7;
  margin-bottom: 0.4rem;
}

body.dark .blog-meta { opacity: 0.6; }

.blog-post-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--post-meta-color, #888);
}

body.dark { --post-meta-color: #aaa; }

/* === ARTICLE PAGE === */
.blog-article-container {
  max-width: 800px;
  margin: 3rem auto;
  padding-top: 2rem;
}

.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.article-meta {
  display: block;
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 2rem;
}

.article-hero-image {
  margin: 2rem 0;
  border-radius: 10px;
}

.article-content p,
.article-content li {
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.article-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-image-float {
  max-width: 400px;
  float: right;
  margin: 0 0 1.5rem 2rem;
}

.article-section::after {
  content: "";
  display: table;
  clear: both;
}

body.dark .article-content p { opacity: 0.85; }

@media (max-width: 768px) {
  .article-title { font-size: 2rem; }
  .article-image-float {
    max-width: 100%;
    float: none;
    margin: 1.5rem 0;
  }
}

/* === PAGE TITLE ALIGNMENT FIX === */
.about-intro,
.blog-list,
.projects-preview,
.store,
.contact-container {
  padding-top: 4rem;
}

.section-title { margin-top: 0; }

@media (max-width: 600px) {
  .about-intro,
  .blog-list,
  .projects-preview,
  .store,
  .contact-container { padding-top: 3rem; }
}

/* === FIX SPACING BETWEEN PROJECT CATEGORIES === */
.projects-page .section-title {
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.projects-page h1.section-title { margin-top: 0; }

/* === MOBILE NAVIGATION === */
.menu-toggle {
  display: none; /* hidden on desktop */
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-light); /* add this for light mode */
  transition: color var(--transition); /* optional for smooth color change */
}

/* dark mode override */
body.dark .menu-toggle {
  color: var(--text-dark);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .menu-toggle {
    display: block; /* show hamburger on mobile */
  }

  .nav {
    position: absolute;
    top: 70px; /* adjust depending on header height */
    right: 0;
    background-color: var(--bg-light);
    flex-direction: column;
    width: 200px;
    padding: 1rem;
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  body.dark .nav {
    background-color: var(--bg-dark);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .nav a {
    margin: 0.8rem 0;
  }

  .nav.show {
    transform: translateX(0); /* slide in when active */
  }
}
