/* Theme system - Dark mode */
body[a="dark"] {
  background-color: #0D0F1C;
  color: #e3e2d8;
}

body[a="dark"] a {
  color: #EA9AAD;
  text-decoration: none;
}

body[a="dark"] a:visited {
  color: #EA9AAD;
}

body[a="dark"] a:hover {
  color: #A79425;
}

body[a="dark"] figcaption {
  color: #119da4;
}

/* Light mode */
body[a="light"] {
  background-color: #F7F6F3;
  color: #495867;
}

body[a="light"] a {
  color: #C1666B;
  text-decoration: none;
}

body[a="light"] a:visited {
  color: #C1666B;
}

body[a="light"] a:hover {
  color: #A79425;
}

body[a="light"] figcaption {
  color: #666666;
}

/* Auto mode - defaults to dark */
@media (prefers-color-scheme: dark) {
  body[a="auto"] {
    background-color: #0D0F1C;
    color: #e3e2d8;
  }
  
  body[a="auto"] a {
    color: #EA9AAD;
    text-decoration: none;
  }
  
  body[a="auto"] a:visited {
    color: #EA9AAD;
  }
  
  body[a="auto"] a:hover {
    color: #A79425;
  }
  
  body[a="auto"] figcaption {
    color: #119da4;
  }
}

@media (prefers-color-scheme: light) {
  body[a="auto"] {
    background-color: #F7F6F3;
    color: #495867;
  }
  
  body[a="auto"] a {
    color: #C1666B;
    text-decoration: none;
  }
  
  body[a="auto"] a:visited {
    color: #C1666B;
  }
  
  body[a="auto"] a:hover {
    color: #A79425;
  }
  
  body[a="auto"] figcaption {
    color: #666666;
  }
}

/* Base styles */
html {
  height: 100%;
}

body {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  min-height: 100%;
  overflow-wrap: break-word;
}

.w {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Header and navigation */
header {
  text-align: center;
  margin-bottom: 50px;
}

h1 {
  font-family: 'Courier New', monospace;
  font-size: 2.5em;
  font-weight: normal;
  letter-spacing: -1px;
  margin-bottom: 30px;
}

nav {
  padding: 15px 0;
  margin-bottom: 40px;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 40px;
  list-style: none;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

nav li {
  display: inline;
}

nav a {
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
  transition: color 0.3s ease;
}

/* Main content layout */
.main-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 60px;
  align-items: start;
}

.left-column {
  text-align: left;
}

.profile-image {
  width: 100%;
  max-width: 700px;
  margin-bottom: 15px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.photo-credit {
  font-size: 0.9em;
  font-style: italic;
  line-height: 1.4;
  opacity: 0.7;
}

.right-column {
  line-height: 1.6;
  margin-top: 0;
}

.bio-text p {
  font-size: 20px;
  line-height: 1.7;
}

.bio-text p:first-child {
  margin-top: 0; /* Remove top margin from first paragraph */
}

/* Responsive Design */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .left-column {
    order: 1;
  }

  .right-column {
    order: 2;
    text-align: left;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 2.2em;
  }

  nav ul {
    gap: 20px;
    flex-direction: column;
    align-items: center;
  }

  nav a {
    font-size: 1em;
  }

  .bio-text p {
    font-size: 16px;
  }

  .w {
    padding: 2rem 1rem;
  }
}

/* Portfolio-specific styles to add to your main styles.css */

.back-link {
  margin-bottom: 30px;
}

.back-link a {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.back-link a::before {
  content: "← ";
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-top: 40px;
  padding: 0;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.portfolio-item:hover {
  transform: translateY(-8px);
}

.portfolio-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.portfolio-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.portfolio-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.portfolio-item h3 {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 1.3em;
  font-weight: normal;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.portfolio-item:hover h3 {
  color: #EA9AAD;
}

/* Light mode adjustments */
body[a="light"] .portfolio-item img {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

body[a="light"] .portfolio-item:hover img {
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

body[a="light"] .portfolio-item:hover h3 {
  color: #C1666B;
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .portfolio-item img {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  }

  body[a="auto"] .portfolio-item:hover img {
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  }

  body[a="auto"] .portfolio-item:hover h3 {
    color: #C1666B;
  }
}

/* Responsive design */
@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
  }

  .portfolio-item img {
    height: 240px;
  }
}

@media (max-width: 600px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .portfolio-item img {
    height: 220px;
  }

  .portfolio-item h3 {
    font-size: 1.2em;
  }
}

/* Article-specific reader-friendly styling - Add to your main styles.css */

.article-container {
  max-width: 650px;
  margin: 0 auto;
  padding: 4rem 2rem;
  line-height: 1.8;
}

.article-back-link {
  margin-bottom: 40px;
  display: block;
}

.article-back-link a {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.article-back-link a::before {
  content: "← ";
}

.article-header {
  margin-bottom: 50px;
  text-align: left;
}

.article-title {
  font-size: 2.4em;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.article-subtitle {
  font-size: 1.3em;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 25px;
  opacity: 0.7;
  font-style: italic;
  letter-spacing: 0;
}

.article-meta {
  font-size: 0.95em;
  opacity: 0.6;
  font-style: italic;
  margin-bottom: 10px;
}

.article-date {
  font-size: 0.9em;
  opacity: 0.5;
}

.article-content {
  font-size: 1.1em;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1.8em;
}

.article-content p:last-child {
  margin-bottom: 0;
}

/* Image styling with captions */
.article-image {
  margin: 3em 0;
  text-align: center;
}

.article-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.article-image img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

/* Light mode image shadows */
body[a="light"] .article-image img {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

body[a="light"] .article-image img:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .article-image img {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  }

  body[a="auto"] .article-image img:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  }
}

.article-caption {
  margin-top: 15px;
  font-size: 0.9em;
  font-style: italic;
  opacity: 0.7;
  text-align: center;
  line-height: 1.4;
}

/* Full-width images for dramatic effect */
.article-image.full-width {
  margin-left: -2rem;
  margin-right: -2rem;
  max-width: calc(100% + 4rem);
}

/* Small images that flow with text */
.article-image.small {
  max-width: 400px;
  margin: 2em auto;
}

/* Side-by-side images */
.image-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 3em 0;
}

.image-gallery .article-image {
  margin: 0;
}

/* Pullquote styling */
.pullquote {
  font-size: 1.3em;
  font-style: italic;
  text-align: center;
  margin: 3em 0;
  padding: 2em 1em;
  position: relative;
  opacity: 0.8;
  line-height: 1.5;
}

.pullquote::before,
.pullquote::after {
  content: '"';
  font-size: 3em;
  opacity: 0.3;
  position: absolute;
}

.pullquote::before {
  top: 0;
  left: 0;
}

.pullquote::after {
  bottom: 0;
  right: 0;
}

/* External link styling */
.external-link {
  display: inline-block;
  margin-top: 2em;
  padding: 12px 20px;
  border: 1px solid;
  border-color: rgba(227, 226, 216, 0.3);
  border-radius: 6px;
  font-size: 0.95em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.external-link:hover {
  background-color: rgba(227, 226, 216, 0.05);
  border-color: #EA9AAD;
}

/* Light mode external link */
body[a="light"] .external-link {
  border-color: rgba(73, 88, 103, 0.3);
}

body[a="light"] .external-link:hover {
  background-color: rgba(73, 88, 103, 0.05);
  border-color: #C1666B;
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .external-link {
    border-color: rgba(73, 88, 103, 0.3);
  }

  body[a="auto"] .external-link:hover {
    background-color: rgba(73, 88, 103, 0.05);
    border-color: #C1666B;
  }
}

/* Written Works Landing Page Styles */
.works-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.works-back-link {
  margin-bottom: 40px;
  display: block;
}

.works-back-link a {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.works-back-link a::before {
  content: "← ";
}

.works-title {
  font-size: 2.2em;
  margin-bottom: 60px;
  text-align: left;
  font-weight: normal;
  letter-spacing: -0.5px;
}

.year-section {
  margin-bottom: 50px;
}

.year-header {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 30px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.work-item {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid;
  border-color: rgba(227, 226, 216, 0.15);
}

.work-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Light mode border */
body[a="light"] .work-item {
  border-color: rgba(73, 88, 103, 0.15);
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .work-item {
    border-color: rgba(73, 88, 103, 0.15);
  }
}

.work-title {
  font-size: 1.3em;
  line-height: 1.4;
  margin-bottom: 12px;
  font-weight: normal;
}

.work-title a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.work-title a:hover {
  color: #A79425;
}

.work-description {
  font-size: 1em;
  line-height: 1.6;
  opacity: 0.8;
  margin-bottom: 8px;
}

.work-meta {
  font-size: 0.9em;
  opacity: 0.6;
  font-style: italic;
}

/* Responsive design for articles and works */
@media (max-width: 600px) {
  .article-container,
  .works-container {
    padding: 2rem 1rem;
  }

  .article-title {
    font-size: 2em;
  }

  .works-title {
    font-size: 1.8em;
    margin-bottom: 40px;
  }

  .article-content {
    font-size: 1.05em;
  }

  .work-title {
    font-size: 1.2em;
  }

  .article-image.full-width {
    margin-left: -1rem;
    margin-right: -1rem;
    max-width: calc(100% + 2rem);
  }

  .image-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .pullquote {
    font-size: 1.2em;
    padding: 1.5em 0.5em;
  }
}


/* CV-specific styling - Add to your main styles.css */

.cv-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.cv-back-link {
  margin-bottom: 30px;
  display: block;
}

.cv-back-link a {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.cv-back-link a::before {
  content: "← ";
}

.cv-header {
  margin-bottom: 60px;
  text-align: center;
}

.cv-name {
  font-size: 2.8em;
  font-weight: normal;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

.cv-tagline {
  font-size: 1.2em;
  opacity: 0.7;
  margin-bottom: 30px;
  font-style: italic;
}

.cv-section {
  margin-bottom: 50px;
}

.section-title {
  font-size: 1.8em;
  font-weight: normal;
  margin-bottom: 30px;
  padding-bottom: 10px;
}

/* Light mode section title border */
body[a="light"] .section-title {
  border-color: rgba(73, 88, 103, 0.2);
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .section-title {
    border-color: rgba(73, 88, 103, 0.2);
  }
}

/* TABLE-BASED CV ITEMS */
.cv-item {
  margin-bottom: 25px;
  display: table;
  width: 100%;
}

.cv-period {
  display: table-cell;
  width: 200px;
  font-size: 0.9em;
  font-weight: bold;
  color: #A79425;
  text-align: right;
  vertical-align: top;
  padding-right: 30px;
  padding-top: 2px;
}

.cv-content {
  display: table-cell;
  vertical-align: top;
}

.cv-position {
  font-size: 1.1em;
  font-weight: normal;
  margin-bottom: 5px;
  line-height: 1.3;
}

.cv-organization {
  font-size: 1em;
  margin-bottom: 8px;
}

.cv-organization a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.cv-organization a:hover {
  color: #A79425;
}

.cv-description {
  font-size: 0.95em;
  line-height: 1.5;
  opacity: 0.8;
}

/* Two-column layout for certain sections */
.cv-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* Skills section styling */
.skills-category {
  margin-bottom: 25px;
}

.skills-category-title {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 10px;
  opacity: 0.8;
}

.skills-list {
  font-size: 0.95em;
  line-height: 1.6;
}

/* Contact section */
.contact-section {
  text-align: center;
  background-color: rgba(227, 226, 216, 0.05);
  padding: 30px;
  border-radius: 12px;
  margin-top: 40px;
}

/* Light mode contact section */
body[a="light"] .contact-section {
  background-color: rgba(73, 88, 103, 0.05);
}

@media (prefers-color-scheme: light) {
  body[a="auto"] .contact-section {
    background-color: rgba(73, 88, 103, 0.05);
  }
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.contact-link {
  text-decoration: none;
  font-size: 1em;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: #A79425;
}

/* Subsection styling for CV */
.cv-subsection {
  font-size: 1.3em;
  margin: 40px 0 20px 0;
  opacity: 0.8;
  font-weight: normal;
}

.cv-subsection:first-of-type {
  margin-top: 0;
}

/* CV responsive design */
@media (max-width: 900px) {
  .cv-two-columns {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-links {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 600px) {
  .cv-container {
    padding: 2rem 1rem;
  }

  .cv-name {
    font-size: 2.2em;
  }

  .section-title {
    font-size: 1.5em;
  }

  .cv-tagline {
    font-size: 1.1em;
  }

  .cv-item {
    display: block;
  }

  .cv-period {
    display: block;
    width: auto;
    text-align: left;
    padding-right: 0;
    margin-bottom: 5px;
  }

  .cv-content {
    display: block;
  }
}