/*
Theme Name: Eduardo Portfolio
Theme URI: https://eduardolemos.com
Author: Eduardo Lemos
Version: 5.15.3
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: eduardo-portfolio
*/

/* =========================================
   CUSTOM PROPERTIES
   ========================================= */
:root {
  --bg:           #f8f7f8;
  --surface:      #ffffff;
  --border:       #e6e0d4;
  --text:         #1e1a14;
  --muted:        #7d7060;

  --gold:         #c8a84b;
  --gold-light:   #fdf8ec;
  --gold-border:  #e8d898;
  --gold-shadow:  rgba(200,168,75,.18);

  --green:        #4e7a5c;
  --green-light:  #eef5f0;
  --green-border: #c5dece;
  --green-shadow: rgba(78,122,92,.18);

  --sidebar-w:    280px;
  --page-max:     1200px;
  --page-gutter:  32px;

  --radius:       10px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.06);
  --shadow-md:    0 6px 24px rgba(0,0,0,.08);
  --transition:   .18s ease;
}

/* =========================================
   BASE RESET
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: .72; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: #fff; }

/* =========================================
   SIDEBAR FLOWER ACCENTS
   ========================================= */
.sidebar-flower {
  position: absolute;
  pointer-events: none;
  opacity: .45;
}

.sidebar-flower--top {
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
}

.sidebar-flower--bottom {
  bottom: 0;
  left: 0;
  width: 90px;
  height: 90px;
}

.sidebar-flower svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================
   PAGE LAYOUT
   ========================================= */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  max-width: var(--page-max);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(170,155,130,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(170,155,130,.05) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 40px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.sidebar-identity {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.2px;
}

.sidebar-title {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-location {
  font-size: .74rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.sidebar-location svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 500;
  color: var(--green);
  background: var(--green-light);
  border: 1px solid var(--green-border);
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 8px;
  width: fit-content;
}

.avail-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: .6; }
}

.sidebar-divider { height: 1px; background: var(--border); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav a {
  font-size: .84rem;
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .65;
  transition: opacity var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--surface);
  color: var(--gold);
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-social {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
}

.sidebar-social a {
  font-size: .77rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-social a:hover {
  background: var(--surface);
  color: var(--gold);
}

.sidebar-social svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-social .si-fill {
  fill: currentColor;
}

.sidebar-social .si-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.content {
  padding: 52px 58px 80px;
  max-width: 740px;
  background-image: url(images/flowers.png);
  background-size: contain;
  background-repeat: repeat;
}

.content > section {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  padding: 28px 32px 36px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  border: 1px solid rgba(230, 224, 212, 0.6);
}

.content > section:last-child { margin-bottom: 0; }

.section-heading {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.section-heading::after {
  content: '';
  height: 1px;
  background: var(--border);
  flex: 1;
  max-width: 70px;
}

/* =========================================
   ABOUT
   ========================================= */
.about-greeting {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
  letter-spacing: -.3px;
}

.about-body {
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.78;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.about-body a      { color: var(--gold); font-weight: 500; }
.about-body strong { color: var(--text); font-weight: 600; }

/* =========================================
   LATEST WORK (featured)
   ========================================= */
.latest-project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.latest-project-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  height: 200px;
  min-height: 200px;
  background: var(--surface);
  overflow: hidden;
}

.latest-project-cell {
  overflow: hidden;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
}
.latest-project-cell .latest-project-snippet {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.latest-project-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.latest-project-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

.latest-project-meta-sep {
  opacity: .4;
}

.latest-project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
  margin: 0;
  line-height: 1.2;
}

.latest-project-desc {
  font-size: .855rem;
  color: var(--muted);
  line-height: 1.68;
  margin: 0;
}

.latest-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.latest-project-tags .tag {
  font-size: .7rem;
  padding: 2px 9px;
}

.latest-project-links {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.latest-project-links a {
  font-size: .78rem;
  color: var(--gold);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.latest-project-links a:hover { opacity: .8; }

.latest-project-links svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================
   SKILLS
   ========================================= */
.skills-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  font-size: .75rem;
  font-family: var(--font-mono);
  background: #f5f0e8;
  color: #6a5d45;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #ddd5c2;
  white-space: nowrap;
  cursor: default;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
}

.tag:hover {
  background: var(--surface);
  color: var(--gold);
  border-color: var(--gold-border);
  transform: translateY(-1px);
}

.skills-tags .tag--h1 { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.skills-tags .tag--h1:hover { background: #bbdefb; color: #0d47a1; border-color: #42a5f5; }
.skills-tags .tag--h2 { background: #e0f7fa; color: #00838f; border-color: #80deea; }
.skills-tags .tag--h2:hover { background: #b2ebf2; color: #006064; border-color: #26c6da; }
.skills-tags .tag--h3 { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.skills-tags .tag--h3:hover { background: #c8e6c9; color: #1b5e20; border-color: #66bb6a; }
.skills-tags .tag--h4 { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.skills-tags .tag--h4:hover { background: #e1bee7; color: #4a148c; border-color: #ab47bc; }
.skills-tags .tag--h5 { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.skills-tags .tag--h5:hover { background: #ffe0b2; color: #bf360c; border-color: #ff9800; }

/* =========================================
   EXPERIENCE (project cards)
   ========================================= */
.projects-intro {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.65;
}

.projects-grid { display: flex; flex-direction: column; gap: 12px; }

.project-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition);
}

.project-media {
  min-height: 140px;
  height: 100%;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
}
#experience .project-media img.project-snippet {
  pointer-events: auto;
}

.project-snippet {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.project-media img:not([src]),
.project-media img[src=""] {
  display: none;
}

.project-media--placeholder { position: relative; }

.project-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .8rem;
  font-family: var(--font-mono);
  pointer-events: none;
}

.project-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}

.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  background: transparent;
  border-radius: 0 2px 2px 0;
  transition: background var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d8ceba;
  transform: translateX(3px);
}

.project-card:hover::before { background: var(--gold); }

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.project-name {
  font-size: .96rem;
  font-weight: 600;
  color: var(--text);
}

.project-date {
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-desc {
  font-size: .845rem;
  color: var(--muted);
  line-height: 1.68;
  margin-bottom: 14px;
}

.project-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.project-tags      { display: flex; flex-wrap: wrap; gap: 5px; }
.project-tags .tag { font-size: .7rem; padding: 2px 9px; }
.project-links     { display: flex; gap: 12px; flex-shrink: 0; }

.project-links a {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: color var(--transition);
}

.project-links a:hover { color: var(--gold); }

.project-links svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "View more" row */
.projects-more {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.projects-more::before,
.projects-more::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
}

.projects-more::after {
  background: linear-gradient(to left, transparent, var(--border));
}

.projects-more-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.7);
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), transform var(--transition);
}

.projects-more-link:hover {
  color: var(--gold);
  border-color: var(--gold-border);
  background: var(--surface);
  transform: translateY(-1px);
  opacity: 1;
}

.projects-more-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -.2px;
}

.contact-body {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.75;
  margin-bottom: 26px;
  max-width: 480px;
}

a.contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 500;
  box-shadow: 0 4px 14px var(--green-shadow);
  transition: opacity var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

a.contact-email-btn:hover {
  opacity: .86;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--green-shadow);
}

a.contact-email-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================
   FOOTER
   ========================================= */
#site-footer {
  font-size: .74rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding: 20px 0 0;
  margin-top: 48px;
}

/* =========================================
   MOBILE HEADER
   ========================================= */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.drawer-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.drawer-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.drawer-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}

.drawer-title {
  font-size: .74rem;
  color: var(--muted);
}

.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* =========================================
   MOBILE DRAWER
   ========================================= */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.mobile-drawer.open { pointer-events: all; }

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s;
}

.mobile-drawer.open .drawer-overlay { opacity: 1; }

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(80vw, 272px);
  background: var(--surface);
  padding: 28px 20px;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.mobile-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-panel .sidebar-nav a      { font-size: .9rem; }
.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}
.drawer-panel .drawer-social     { margin-top: 4px; }
.drawer-panel .drawer-social a  { font-size: .9rem; }

/* =========================================
   BLOG
   ========================================= */
.post-list { display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow var(--transition);
}

.post-card:hover         { box-shadow: var(--shadow-md); }
.post-card-date          { font-size: .72rem; color: var(--muted); margin-bottom: 5px; font-family: var(--font-mono); }
.post-card-title         { font-size: .98rem; font-weight: 600; margin-bottom: 7px; }
.post-card-title a       { color: var(--text); }
.post-card-excerpt       { font-size: .84rem; color: var(--muted); line-height: 1.65; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .layout .sidebar {
    display: none;
    visibility: hidden;
  }
  .layout {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }
  .mobile-header { display: flex; }
  .mobile-drawer { display: block; }
  .content       { padding: 28px 22px 60px; }
}

@media (max-width: 640px) {
  .latest-project-top {
    height: 180px;
    min-height: 180px;
  }
  .latest-project-body {
    padding: 22px 20px 26px;
  }
}

@media (max-width: 500px) {
  .content > section   { padding: 22px 20px 28px; }
  .content             { padding: 20px 16px 50px; }
  .about-greeting      { font-size: 1.4rem; }
  .project-card        { grid-template-columns: 1fr; }
  .project-media       { min-height: 160px; }
  .project-footer      { flex-direction: column; align-items: flex-start; }
  .section-heading::after { display: none; }
}


/* =========================================
   IMAGE MODAL (Latest Work expand)
   ========================================= */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}
.image-modal.is-open {
  visibility: visible;
  opacity: 1;
}
.image-modal[hidden] { display: none; }
.image-modal.is-open[hidden] { display: flex; }

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.image-modal-content .image-modal-img {
  pointer-events: auto;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =========================================
   ADMIN BAR OFFSETS (desktop only)
   ========================================= */
@media (min-width: 1025px) {
  .admin-bar .sidebar { top: 32px; height: calc(100vh - 32px); }
}

.admin-bar .mobile-header { top: 32px; }

@media screen and (max-width: 782px) {
  .admin-bar .mobile-header { top: 46px; }
}
