/* ============================================================
   PORTFOLIO — MANUEL RUZ AZCORRA
   Paleta: azul petróleo #2d4a5a + crema #f8f7f4
   Tipografía: Montserrat
   ============================================================ */

:root {
  --navy:      #2d4a5a;
  --navy-light:#3d5e70;
  --navy-pale: #e8eef1;
  --cream:     #f8f7f4;
  --ink:       #1c1c1c;
  --ink-mid:   #6b6b6b;
  --ink-soft:  #b0b0b0;
  --rule:      #e2dfd9;
  --white:     #ffffff;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }

img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   NAV SUPERIOR
   ============================================================ */
.pg-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--rule);
}

.pg-nav-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pg-nav-links {
  display: flex;
  gap: 28px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pg-nav-links a { transition: color 0.15s; }
.pg-nav-links a:hover { color: var(--navy); }
.pg-nav-links a.active {
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 2px;
}

/* ============================================================
   LAYOUT PRINCIPAL: SIDEBAR + MAIN
   ============================================================ */
.pg-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  min-height: calc(100vh - 53px - 48px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.pg-sidebar {
  background: var(--navy);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
}

.pg-sidebar-eyebrow {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pg-sidebar-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.pg-sidebar-role {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-top: 5px;
  line-height: 1.7;
}

.pg-rule { height: 1px; background: rgba(255,255,255,0.1); flex-shrink: 0; }

/* Nav de categorías en sidebar */
.pg-cat-nav { display: flex; flex-direction: column; gap: 2px; }

.pg-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.pg-cat-item i {
  width: 14px;
  font-size: 11px;
  opacity: 0.7;
  text-align: center;
}

.pg-cat-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
}

.pg-cat-item.active {
  background: rgba(255,255,255,0.13);
  color: #fff;
  font-weight: 600;
}

.pg-cat-item.active i { opacity: 1; }

/* Contacto en sidebar */
.pg-sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pg-sidebar-contact a,
.pg-sidebar-contact span {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.pg-sidebar-contact a:hover { color: rgba(255,255,255,0.8); }
.pg-sidebar-contact i { font-size: 11px; width: 13px; text-align: center; opacity: 0.6; }

/* ============================================================
   MAIN
   ============================================================ */
.pg-main {
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   HERO DE PÁGINA
   ============================================================ */
.pg-hero {
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--rule);
}

.pg-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.pg-breadcrumb a { color: var(--ink-soft); transition: color 0.15s; }
.pg-breadcrumb a:hover { color: var(--navy); }
.pg-breadcrumb span { color: var(--navy); }

.pg-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.pg-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-pale);
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.pg-hero-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.pg-hero-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-mid);
  line-height: 1.85;
  max-width: 480px;
}

.pg-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 100px;
  align-items: flex-end;
  flex-shrink: 0;
}

.pg-stat { text-align: right; }
.pg-stat-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1;
}
.pg-stat-lbl {
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.pg-stat-rule {
  width: 1px;
  height: 20px;
  background: var(--rule);
  align-self: flex-end;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.pg-content {
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pg-section-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ============================================================
   IMAGEN PRINCIPAL
   ============================================================ */
.pg-img-main-real {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
}

.pg-img-placeholder {
  border-radius: 8px;
  border: 1px dashed var(--rule);
  background: var(--cream);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.pg-img-placeholder i { font-size: 28px; color: var(--navy-pale); }
.pg-img-placeholder span { font-size: 10px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; }
.pg-img-placeholder sub { font-size: 9px; color: var(--ink-soft); opacity: 0.5; }

/* ============================================================
   VIDEO EMBED
   ============================================================ */
.pg-video-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.pg-video-wrap iframe {
  display: block;
  width: 100%;
  height: 340px;
  border: none;
}

.pg-video-placeholder {
  height: 220px;
  background: #111820;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pg-video-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.pg-video-label { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; }
.pg-video-url   { font-size: 9px; color: rgba(255,255,255,0.2); font-style: italic; }

/* ============================================================
   GALERÍA
   ============================================================ */
.pg-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

.pg-gallery-item {
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--cream);
  height: 120px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.pg-gallery-item img { border-radius: 0; }

.pg-gallery-item:hover { border-color: var(--navy); opacity: 0.9; }

.pg-gallery-item > i   { font-size: 20px; color: var(--navy-pale); }
.pg-gallery-item > span { font-size: 8px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================================================
   STACK DE HERRAMIENTAS
   ============================================================ */
.pg-stack-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.pg-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s;
}

.pg-tool:hover { border-color: var(--navy); }
.pg-tool i { color: var(--navy); font-size: 12px; width: 14px; text-align: center; }

/* ============================================================
   PROYECTOS — CARDS
   ============================================================ */
.pg-projects { display: flex; flex-direction: column; gap: 10px; }

.pg-proj-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--cream);
  transition: border-color 0.15s, background 0.15s;
}

.pg-proj-card:hover { border-color: var(--navy); background: var(--white); }

.pg-proj-thumb {
  width: 80px;
  height: 58px;
  border-radius: 5px;
  background: var(--navy-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--navy);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.pg-proj-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.pg-proj-meta {
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.pg-proj-stack {
  color: var(--navy);
  font-weight: 600;
  font-size: 9px;
}

.pg-proj-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  flex-shrink: 0;
}

.pg-btn-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--navy);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.pg-btn-live:hover { background: var(--navy-light); }

.pg-btn-live.btn-disabled {
  background: var(--rule);
  color: var(--ink-soft);
  cursor: default;
}

.pg-tag-year {
  font-size: 8px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 3px 7px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}

/* ============================================================
   GRID DE CATEGORÍAS (index.php)
   ============================================================ */
.pg-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.pg-cat {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px;
  background: var(--cream);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}

.pg-cat:hover { border-color: var(--navy); background: var(--white); }

.pg-cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--navy-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.pg-cat-icon i { font-size: 14px; color: var(--navy); }

.pg-cat-name  { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.pg-cat-desc  { font-size: 10px; font-weight: 400; color: var(--ink-soft); line-height: 1.6; margin-bottom: 10px; }

.pg-cat-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.pg-cat-tool  {
  font-size: 8px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--white);
  border: 1px solid var(--rule);
  color: var(--ink-mid);
  letter-spacing: 0.03em;
}

.pg-cat-count {
  font-size: 9px;
  font-weight: 500;
  color: var(--navy);
  margin-top: 10px;
  letter-spacing: 0.01em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.pg-footer {
  background: var(--navy);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pg-footer-txt {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
}

.pg-footer-nav {
  display: flex;
  gap: 20px;
}

.pg-footer-nav a {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}

.pg-footer-nav a:hover { color: rgba(255,255,255,0.85); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .pg-layout { grid-template-columns: 1fr; }

  .pg-sidebar {
    display: none; /* Activar con JS si se quiere menu mobile */
  }

  .pg-hero-head { flex-direction: column; }
  .pg-hero-stats { flex-direction: row; align-items: center; }

  .pg-gallery { grid-template-columns: repeat(2, 1fr); }

  .pg-proj-card { grid-template-columns: 60px 1fr; }
  .pg-proj-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-end; }

  .pg-cats { grid-template-columns: 1fr; }

  .pg-nav-links { gap: 14px; }
}
