/* =============================================
   CSS Reset and Base Styles
   ============================================= */

/* Apply box-sizing globally */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins */
body,
h1,
h2,
h3,
p,
ul {
    margin: 0;
}

/* =============================================
   Custom Properties (CSS Variables)
   ============================================= */
:root {
    /* Colors */
    --color-bg: #25231f;
    --color-text: #c2b59e;
    --color-accent: #a6c777;
    --color-link: #6696cc;
    --color-link-visited: #9782c9;
    --color-link-hover: #e4ab75;
    --color-border-top: #ea713f;
    
    /* Layout */
    --max-width: 650px;
    --spacing-small: 0.5rem;
    --spacing-medium: 1rem;
    --spacing-large: 2rem;
    
    /* Typography */
    --font-size-base: 18px;
    --line-height-base: 1.5;
    --line-height-heading: 1.2;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
        "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* =============================================
   Document Setup
   ============================================= */
html {
    background-color: var(--color-bg);
    /* Smooth scrolling for anchor links */
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    
    /* Container styling */
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-medium);
    
    /* Border effect */
    border-width: 3px;
    border-style: solid;
    border-image: linear-gradient(
        to bottom,
        var(--color-border-top),
        var(--color-bg)
    ) 1 100%;
}

/* =============================================
   Typography
   ============================================= */
h1 {
    font-size: 2rem;
    text-align: center;
    line-height: var(--line-height-heading);
    margin-top: var(--spacing-large);
    margin-bottom: var(--spacing-medium);
}

h2 {
    font-size: 1.5rem;
    line-height: var(--line-height-heading);
    margin-top: var(--spacing-large);
    margin-bottom: var(--spacing-medium);
}

h3 {
    font-size: 1.25rem;
    line-height: var(--line-height-heading);
    color: var(--color-accent);
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-small);
}

p {
    margin-bottom: var(--spacing-medium);
}

em {
    color: var(--color-accent);
}

.tagline {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-medium);
}

.core-competencies {
    text-align: center;
    margin-bottom: var(--spacing-large);
}

.core-competencies p {
    padding-top: var(--spacing-medium);
}

.core-competencies h3 {
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-medium);
    margin-top: var(--spacing-medium);
}

.competencies-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-small);
    max-width: 600px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}

@media (max-width: 480px) {
    .competencies-grid {
        gap: 0.3rem;
    }
    
    .competency {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

.competency {
    background-color: rgba(166, 199, 119, 0.1);
    color: var(--color-accent);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(166, 199, 119, 0.3);
    transition: all 0.2s ease-in-out;
}

/* .competency:hover {
    background-color: rgba(166, 199, 119, 0.2);
    border-color: var(--color-accent);
} */

/* =============================================
   Links
   ============================================= */
a {
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

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

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

a:hover,
a:focus {
    color: var(--color-link-hover);
    text-decoration: underline dotted;
    /* Improve focus visibility */
    outline: 2px solid var(--color-link-hover);
    outline-offset: 2px;
}

/* =============================================
   Layout Components
   ============================================= */
header {
    position: relative;
}

#banner {
    margin-left: calc(-1 * var(--spacing-medium));
    margin-right: calc(-1 * var(--spacing-medium));
    margin-top: -3px;
    height: 100px;
    background: url("./img/background.svg") no-repeat center center;
    background-size: cover;
}

/* Site Logo */
.logo-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.site-logo {
    display: block;
    width: 100px !important;
    max-width: 325px !important; /* Half of the 650px max-width */
    height: auto !important;
    /* Debug styles - remove these after confirming it works */
    /* border: 2px solid red; Temporary: to see the actual size */
}

/* Contact Info List */
.contact-info {
    list-style: none;
    padding: 0;
    margin-bottom: var(--spacing-large);
}

.contact-info li {
    margin-bottom: var(--spacing-small);
}

/* Work Preferences List */
.work-preferences {
    list-style: none;
    padding: 0;
    margin-bottom: var(--spacing-large);
}

.work-preferences li {
    margin-bottom: var(--spacing-small);
}

/* =============================================
   Gallery/Photos Section
   ============================================= */
.gallery {
    margin-top: var(--spacing-large);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-small);
    margin-top: var(--spacing-medium);
}

.photo-grid a {
    display: block;
    position: relative;
    height: 0;
    padding-bottom: 100%; /* for 1:1 aspect ratio */
    overflow: hidden;
    border-radius: 4px;
}

.photo-grid img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease-in-out;
}

.photo-grid img:hover {
    transform: scale(1.05);
}

/* =============================================
   Footer
   ============================================= */
hr {
    border: none;
    height: 1px;
    background-color: var(--color-accent);
    margin: var(--spacing-large) 0;
}

footer {
    padding-bottom: var(--spacing-large);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* =============================================
   Utility Classes
   ============================================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================
   Media Queries for Responsive Design
   ============================================= */
@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .photo-grid img:hover {
        transform: none;
    }
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 999;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
}

html:not(.js-enabled) .lightbox:target {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-open {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.2s ease-in-out;
  z-index: 1;
  padding: 0.5rem;
  border-radius: 5px;
}

.lightbox-close:hover {
  opacity: 1;
  text-decoration: none;
}

.lightbox-close::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white; /* This will be inverted */
  mix-blend-mode: difference;
  border-radius: 5px;
  z-index: -1;
}


.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.2s ease-in-out;
  z-index: 1;
  padding: 1rem 0 1rem 0;
  border-radius: 5px;
}

.lightbox-nav:hover {
  opacity: 1;
  text-decoration: none;
}

.lightbox-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white; /* This will be inverted */
  mix-blend-mode: difference;
  border-radius: 5px;
  z-index: -1;
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}