/* ESTILOS DEL SISTEMA DOCUMENTAL Y ESTATUTARIO - CONDOMINIO LA ILUMINADA */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

:root {
  --bg-page: #0a110d;
  --bg-sidebar: #0f1a14;
  --bg-card: #14241b;
  --bg-card-hover: #192d22;
  --bg-comment: #101c15;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  
  --primary: #10b981;
  --primary-light: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.2);
  --accent-gold: #f59e0b;
  --accent-blue: #38bdf8;
  --accent-red: #ef4444;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-article: #e2e8f0;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --font-serif: 'Merriweather', Georgia, serif;
}

body.light-theme {
  --bg-page: #f8faf9;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f2;
  --bg-comment: #f4f7f5;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(16, 185, 129, 0.35);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-article: #1e293b;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  overflow-wrap: anywhere;
}

img,
video,
iframe {
  max-width: 100%;
}

/* LAYOUT CON SIDEBAR Y CONTENIDO */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR DE DOCUMENTOS */
.docs-sidebar {
  width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  display: block;
  width: min(100%, 245px);
  height: auto;
}

.sidebar-header.brand-ready .brand-badge,
.sidebar-header.brand-ready .sidebar-title {
  display: none;
}

.sidebar-menu-toggle {
  display: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.brand-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.sidebar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.sidebar-title span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.sidebar-link.active {
  background: var(--bg-card);
  color: var(--primary-light);
  font-weight: 600;
  border-color: var(--border-accent);
}

.sidebar-link .doc-icon {
  font-size: 1.15rem;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ÁREA DE CONTENIDO PRINCIPAL */
.docs-main {
  margin-left: 320px;
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* BARRA SUPERIOR STICKY */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.header-alert-pill {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.header-alert-pill.normal {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.header-alert-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  transition: all 0.2s ease;
  text-decoration: none;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.btn-top:hover {
  border-color: var(--border-accent);
}

.btn-top.primary {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  border: none;
}

/* CUERPO DEL DOCUMENTO */
.doc-article-container {
  max-width: 900px;
  margin: 2.5rem auto 5rem;
  padding: 0 2rem;
  width: 100%;
}

.doc-cover-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.doc-badge-type {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.doc-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.doc-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.legal-notice-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* BUSCADOR DE ARTÍCULOS EN PÁGINA */
.page-search-bar {
  margin-bottom: 2rem;
}

.page-search-input {
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.page-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* ARTÍCULOS */
.doc-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  position: relative;
}

.doc-article:hover {
  border-color: var(--border-accent);
}

.doc-article h2, .doc-article h3, .doc-article h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--primary-light);
  margin-bottom: 0.85rem;
  font-size: 1.25rem;
}

.doc-article p {
  color: var(--text-article);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.doc-article ul, .doc-article ol {
  color: var(--text-article);
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.doc-article li {
  margin-bottom: 0.35rem;
}

/* OBSERVACIONES Y COMENTARIOS DE ACCIONISTAS */
.art-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-art-action {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-art-action:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-light);
  border-color: var(--primary);
}

.art-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.art-status-badge.modificado {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

.art-status-badge.pendiente {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
}

.art-status-badge.aprobado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-light);
}

.art-comment-box {
  background: var(--bg-comment);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-selector {
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
}

.status-selector label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.comment-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  resize: vertical;
}

.comment-textarea:focus {
  border-color: var(--primary);
}

/* CAJA DE NOTAS GENERALES */
.general-notes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.general-notes-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-light);
}

@media (max-width: 900px) {
  .docs-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    overflow: visible;
    z-index: 120;
  }

  .sidebar-header {
    padding: 1rem 1.25rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .brand-logo {
    width: min(68vw, 210px);
  }

  .sidebar-menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
  }

  .menu-toggle-icon {
    width: 1rem;
    font-size: 1rem;
    line-height: 1;
  }

  .sidebar-nav {
    display: none;
    max-height: min(70vh, 34rem);
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .docs-sidebar.menu-open .sidebar-nav {
    display: flex;
  }

  .sidebar-footer {
    display: none;
  }

  .sidebar-link {
    width: 100%;
    max-width: none;
  }

  .docs-layout {
    flex-direction: column;
  }
  .docs-main {
    margin-left: 0;
  }

  .docs-topbar {
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .doc-article-container {
    margin-top: 2rem;
    padding-inline: 1.25rem;
  }
}

@media (max-width: 620px) {
  .docs-topbar {
    align-items: stretch;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
  }

  .topbar-right {
    justify-content: stretch;
  }

  .topbar-right .btn-top {
    flex: 1 1 auto;
    justify-content: center;
  }

  .header-alert-pill {
    width: 100%;
    text-align: center;
  }

  .doc-article-container {
    margin: 1.5rem auto 3rem;
    padding-inline: 0.85rem;
  }

  .doc-cover-header {
    padding-bottom: 1.35rem;
    margin-bottom: 1.5rem;
  }

  .doc-title {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
  }

  .doc-subtitle {
    font-size: 0.95rem;
  }

  .doc-article,
  .general-notes-card,
  .legal-notice-box {
    padding: 1rem;
  }

  .doc-article h2,
  .doc-article h3,
  .doc-article h4 {
    font-size: 1.08rem;
  }

  .doc-article ul,
  .doc-article ol {
    margin-left: 1.1rem;
  }

  .art-actions,
  .comment-header,
  .status-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .art-actions {
    gap: 0.65rem;
  }

  .btn-art-action,
  .art-status-badge {
    width: 100%;
    text-align: center;
  }

  .page-search-input,
  .comment-textarea {
    font-size: 16px;
  }

  .visual-section {
    margin-block: 1.75rem 2.25rem;
  }

  .visual-section-heading h2 {
    font-size: 1.25rem;
  }
}

/* Galería de borradores visuales */
.visual-section {
  margin: 2.5rem 0 3rem;
}

.visual-section-heading {
  max-width: 760px;
  margin-bottom: 1.25rem;
}

.visual-section-heading h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.45rem;
  color: var(--text-main);
}

.visual-section-heading p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.visual-kicker {
  color: var(--primary-light);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

.gallery-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
}

.gallery-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1412;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 180ms ease;
}

.gallery-item a:hover img {
  transform: scale(1.02);
}

.gallery-item a {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.92);
}

.image-lightbox.is-open {
  display: grid;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.lightbox-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lightbox-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(15, 26, 20, 0.94);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  cursor: pointer;
}

.lightbox-button:hover,
.lightbox-button:focus-visible {
  border-color: #34d399;
  outline: none;
}

.lightbox-reset {
  min-width: 4.5rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.lightbox-close {
  margin-left: 0.35rem;
}

.lightbox-stage {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.lightbox-stage.is-zoomed {
  cursor: grab;
}

.lightbox-stage.is-dragging {
  cursor: grabbing;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
  transition: transform 120ms ease;
}

.lightbox-stage.is-dragging .lightbox-image {
  transition: none;
}

.lightbox-caption {
  min-height: 1.5rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  text-align: center;
}

.gallery-item figcaption {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
}

.gallery-item figcaption strong {
  color: var(--text-main);
  font-size: 1rem;
}

.gallery-item figcaption p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.visual-status {
  width: fit-content;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.visual-status.source {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.15);
}

.visual-status.draft {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
}

.visual-status.demo {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
}

@media (max-width: 980px) {
  .gallery-grid,
  .gallery-grid-source {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .gallery-grid,
  .gallery-grid-source {
    grid-template-columns: 1fr;
  }

  .image-lightbox {
    gap: 0.5rem;
    padding: 0.65rem;
  }

  .lightbox-toolbar {
    justify-content: space-between;
  }

  .lightbox-button {
    min-width: 2.6rem;
    height: 2.6rem;
    padding-inline: 0.65rem;
  }
}
