/*
Theme Name: Project 2 Theme
Theme URI: https://dgl233.dsingh47.imgd.ca/project-2/
Author: Davinder Singh
Author URI: https://dgl233.dsingh47.imgd.ca
Description: This custom WordPress theme was developed for the DGL233 Project 2 assignment. The theme is designed to showcase a personal portfolio and projects in a clean and responsive layout. It includes a custom post type for Projects, a dynamic project archive page, and individual project pages that display detailed information about each project. The theme also features a styled Contact page with a working contact form, a custom 404 error page, and reusable template parts such as the header, footer, and call-to-action section. The layout is built using HTML, CSS, and WordPress template hierarchy to ensure proper structure, responsiveness, and maintainability.
Version: 1.0
Text Domain: project2-theme
*/

/*  RESET  */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after { box-sizing: border-box; }

/* 2. Remove default margin */
*:not(dialog) { margin: 0; }

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html { interpolate-size: allow-keywords; }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select { font: inherit; }

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* 9. Improve line wrapping */
p { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

/* 10. Create a root stacking context */
#root, #__next { isolation: isolate; }

/*  THEME COLORS (matches reference) */

:root{
  --bg-main: #f2f2f2;
  --bg-card: #ffffff;
  --text-main: #222222;
  --text-muted: #555555;
  --border: #e2e2e2;
  --black: #000000;
}

/*  GLOBAL */

html { scroll-behavior: smooth; }

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

a{
  color: inherit;
  text-decoration: none;
}

a:hover{ opacity: 0.85; }

.home{
  width: 100%;
}

/* Utility container */
.container{
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 20px;
}

/*  SECTIONS  */

.section{
  max-width: 1100px;
  margin-inline: auto;
  padding: 40px 20px;
  border-bottom: 1px solid var(--border);
}

.section h1{
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 6px;
}

.section h2{
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 18px;
}

.section h3{
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section p{
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 17px;
}

/* =========================
   HEADER / NAVIGATION
========================= */

.site-header {
  background: #f2f2f2;
  border-bottom: 1px solid #ddd;
  position: relative;
}

.site-header .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.header-top {
  display: flex;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
}

.site-logo img {
  max-height: 50px;
  width: auto;
}

.site-branding {
  display: inline-block;
  font-size: 32px;
  font-weight: 700;
  text-decoration: none;
  color: #000;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #000;
  padding: 0;
}

.site-header nav {
  margin-top: 0;
}

.site-header .menu {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.site-header .menu li {
  margin: 0;
}

.site-header .menu a {
  text-decoration: none;
  font-size: 16px;
  color: #6b6a6a;
  transition: 0.3s ease;
  font-weight: 500;
}

.site-header .menu a:hover {
  color: #382020;
}

.current-menu-item a {
  color: #000;
  font-weight: 600;
}

/* =========================
   MOBILE NAVIGATION
========================= */

@media (max-width: 768px) {
  .site-header .container {
    display: block;
  }

  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .menu-toggle {
    display: block;
  }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    padding: 16px 20px;
    background: #f2f2f2;
    border-top: 1px solid #ddd;
    z-index: 999;
  }

  .site-header nav.active {
    display: block;
  }

  .site-header .menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-header .menu li,
  .site-header .menu a {
    width: 100%;
  }
}
/* FORCE MOBILE HAMBURGER FIX */
@media (max-width: 768px) {
  .menu-toggle {
    display: block !important;
    font-size: 28px !important;
    background: transparent !important;
    border: 0 !important;
    color: #000 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .site-header .container {
    display: block !important;
  }

  .header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .site-header nav {
    display: none !important;
  }

  .site-header nav.active {
    display: block !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f2f2f2;
    padding: 16px 20px;
    border-top: 1px solid #ddd;
    z-index: 999;
  }

  .site-header .menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
}
/*  HERO */

.section-hero h1{
  font-size: 40px;
  font-weight: 700;
  
}

.section-hero p{
  color: #555;
  margin-bottom: 20px;
  padding: 10px;
}

/* Primary button style */
.btn,
.section-hero a,
.cta__btn{
  display: inline-block;
  background: var(--black);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px; 
  font-size: 13px;
  font-weight: 600;
}

/* INTRO  */

.section-intro{
  padding-top: 40px;
}

/* About */

.section-about h2{
  margin-bottom: 24px;
}

.about-wrap{
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
}

.about-media img{
  width: 100%;
  border-radius: 8px;
}

/* Mobile */
@media (max-width: 900px){
  .about-wrap{
    grid-template-columns: 1fr;
  }
}

/*  SKILLS  */

.section-skills{
  background: transparent;
}

.section-skills .skills-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.skill-card{
  text-align: center;
  padding: 18px 12px;
}

.skill-card img{
  width: 70px;
  margin: 0 auto 10px;
}

.skill-card p{
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}
/* PROJECTS SECTION */

.section-projects{
  padding: 60px 0;
}

.section-projects h2{
  margin-bottom: 30px;
}

/* grid layout */

.projects-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
/* PROJECTS SECTION */

.section-projects {
  padding: 60px 0;
}

.section-projects h2 {
  margin-bottom: 30px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.project-card {
  background: #f3f3f3;
  padding: 20px;
}

.project-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background: #ddd;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-content {
  margin-top: 16px;
}

.project-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

/* responsive */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* EXPERIENCE  */

.section-experience .job{
  margin-bottom: 22px;
}

.section-experience .job p{
  margin-bottom: 6px;
}

/* EDUCATION  */

.section-education .edu{
  margin-bottom: 18px;
}

/*  CTA  */

.section-cta{
  text-align: left;
}

.section-cta .cta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
}

.cta__title{
  font-size: 22px;
  margin: 0;
}

.cta__text{
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 60ch;
}

/*  CONTACT  */

.section-contact form{
  max-width: 720px;
  margin: 0 auto;
}

.section-contact label{
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.section-contact input,
.section-contact textarea{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  outline: none;
}

.section-contact input:focus,
.section-contact textarea:focus{
  border-color: #bdbdbd;
}

.section-contact p{
  margin-bottom: 14px;
}

.section-contact button{
  width: 100%;
  background: var(--black);
  color: #fff;
  padding: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.section-contact button:hover{
  opacity: 0.85;
}

/* Footer */

.site-footer{
  border-top: 1px solid #ddd;
  padding: 25px 20px;
  background: #f2f2f2;
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy{
  font-size: 13px;
  color: #555;
}

.footer-menu{
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.footer-menu a{
  text-decoration: none;
  color: #555;
  font-size: 14px;
}

.footer-social{
  display: flex;
  gap: 14px;
}

.footer-social a{
  margin-left:15px;
  font-size:20px;
  color:#000;
}

.footer-social a:hover{
  opacity:0.7;
}

/*  RESPONSIVE  */

@media (max-width: 900px){
  .section-about{
    grid-template-columns: 1fr;
  }

  .section-skills .skills-grid{
    grid-template-columns: repeat(2, 1fr);
  }

  .section h1{ font-size: 34px; }
  .section h2{ font-size: 26px; }

  .section-cta .cta{
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px){
  .site-nav ul{ gap: 14px; }
  .section{ padding: 60px 16px; }
  .section-skills .skills-grid{
    grid-template-columns: 1fr;
  }
}

/* PROJECT SINGLE PAGE */

.project-section{
padding:40px 0;
}

.project-title{
margin-bottom:40px;
}

.project-layout{
display:flex;
gap:40px;
align-items:flex-start;
}

.project-left{
flex:1;
}

.project-right{
flex:1;
}

.project-right img{
width:90%;
height:auto;
}

.project-description{
margin-bottom:25px;
line-height:1.6;
margin-top: 15px;
}

.project-technologies{
margin-top:20px;
}

.project-link{
margin-top:20px;
}

.project-link a{
display:inline-block;
padding:10px 20px;
background:var(--black);
color:#fff;
text-decoration:none;
border-radius:50px;
}

.project-link a:hover{
opacity:0.9;
}

/* Mobile */

@media (max-width:768px){

.project-layout{
flex-direction:column;
}

}
.project-technologies{
margin-top:40px;
max-width:700px;
}

.project-technologies p{
line-height:1.8;
}

.project-link{
margin-top:25px;
}

/* =========================
   PROJECTS ARCHIVE PAGE
========================= */

.projects-archive-section {
  padding: 56px 0;
}

.projects-archive-title {
  margin-bottom: 32px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #dfdede;
  border: 1px solid #e5e5e5;
  padding: 16px;
}

.project-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eaeaea;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 16px;
}

.project-card-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.3;
}

.project-card-title a {
  color: inherit;
  text-decoration: none;
}

.project-card-title a:hover {
  opacity: 0.85;
}

.project-card-excerpt {
  flex: 1;
  margin-bottom: 20px;
  line-height: 1.7;
}

.project-card-excerpt p {
  margin: 0;
}

.project-card-actions {
  margin-top: auto;
}

.project-card-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
}

.project-card-button:hover {
  opacity: 0.9;
}

@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================
   CONTACT PAGE
========================= */

.contact-page {
  padding: 48px 0;
}

.contact-page .container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contact-page-title {
  margin-bottom: 24px;
}

.contact-page-content {
  margin-top: 12px;
}

.contact-page-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

/* Contact Form 7 */
.wpcf7 {
  margin-top: 24px;
}

.wpcf7 p {
  margin-bottom: 18px;
}

.wpcf7 label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.wpcf7 textarea {
  min-height: 180px;
  resize: vertical;
}

.wpcf7 input[type="submit"] {
  display: inline-block;
  padding: 12px 24px;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
  opacity: 0.9;
}

.wpcf7-spinner {
  margin-left: 10px;
}

.wpcf7 form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 4px;
}
/* =========================
   404 PAGE
========================= */

.error-404-page {
  padding-top: 40px;
}

.error-404-section {
  padding: 80px 0;
  text-align: center;
}

.error-404-section .container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.error-404-section h1 {
  font-size: 4rem;
  margin-bottom: 16px;
}

.error-404-section h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.error-404-section p {
  margin-bottom: 24px;
  line-height: 1.7;
}

.error-404-button {
  display: inline-block;
  padding: 12px 24px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
}

.error-404-button:hover {
  opacity: 0.9;
}
/* BONUS: PROJECT NAVIGATION */

.project-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 50px;
  gap: 20px;
}

.project-navigation a {
  display: inline-block;
  padding: 10px 18px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
}

.project-navigation a:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .project-navigation {
    flex-direction: column;
    align-items: flex-start;
  }
}