/* ProGramatica - Instagram-like dark theme */
:root {
  --bg: #0b0b0d; /* page background */
  --panel: #0f1113; /* sidebar and panels */
  --muted: #9aa0a6; /* secondary text */
  --text: #f5f6f7; /* main text */
  --border: rgba(255, 255, 255, 0.04);
  --accent-gradient: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4);
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  display: flex;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  background: var(--bg);
  color: var(--text);
}

.container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.015)
  );
  width: 280px;
  padding: 20px;
  border-right: 1px solid var(--border);
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  margin-bottom: 18px;
}

.site-title {
  font-family: "Pacifico", "Dancing Script", cursive;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 400;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.2px;
}

/* small brand subtitle if needed */
.site-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.profile-link {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  transition:
    background-color 0.14s ease,
    transform 0.08s ease;
}

.profile-text {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

/* Avatar styles */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex: 0 0 44px;
  font-size: 0.875rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  background: var(--accent-gradient);
}

/* allow variations by using modifiers if desired */
.avatar--morfologic {
  background: var(--accent-gradient);
}
.avatar--lexical {
  background: linear-gradient(45deg, #ff9a9e, #fecfef, #a18cd1);
}
.avatar--ortografic {
  background: linear-gradient(45deg, #ffc371, #ff5f6d);
}
.avatar--syntactic {
  background: linear-gradient(45deg, #fddb92, #d1fdff);
  color: #111;
}
.avatar--punctuation {
  background: linear-gradient(45deg, #00c6ff, #0072ff);
}

/* Main content */
.profile-content {
  padding: 28px;
  flex: 1;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.profile-header .avatar {
  width: 96px;
  height: 96px;
  font-size: 2.125rem;
  flex: 0 0 96px;
}

.profile-meta h2 {
  margin: 0 0 6px 0;
  color: var(--text);
  font-size: 1.5rem;
}
.profile-meta .bio {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 780px;
}

/* larger space between header and images */
.images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.images img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}
.images img:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

/* Modal - improved layout: image left, description right on desktop */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.86);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  overflow-x: hidden;
}
.modal.show {
  display: flex;
}

.modal-content {
  max-height: calc(100vh - 48px);
  width: min(1100px, calc(100vw - 48px));
  display: flex;
  gap: 0;
  align-items: stretch;
  box-sizing: border-box;
  justify-content: center;
  overflow: hidden;
}

/* wrapper for the image column - align image to left edge */
.modal-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* image column */
.modal-image {
  width: auto;
  height: 100%;
  max-height: calc(100vh - 160px);
  max-width: 100%;
  object-fit: contain;
  border-radius: 10px 0 0 10px;
  display: block;
}

/* modal nav arrows */
.modal-image-wrapper {
  position: relative;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
}
.modal-prev {
  left: 8px;
}
.modal-next {
  right: 8px;
}
/* info column (right side) */
.modal-info {
  align-self: stretch;
  width: 360px;
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 0 10px 10px 0;
  background: var(--panel);
  margin: 0;
}

.modal-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.15rem;
  line-height: 1.45;
}

/* prevent background scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* responsiveness */
@media (max-width: 980px) {
  .modal-content {
    width: min(900px, calc(100vw - 32px));
  }
  .modal-info {
    width: 300px;
  }
}

@media (max-width: 880px) {
  .sidebar {
    display: none;
  }
  .profile-content {
    padding: 16px;
  }
  .profile-header {
    position: relative;
    padding-top: 48px; /* space for the burger so it doesn't overlap avatar/title */
  }
  .modal {
    padding: 16px;
  }
  .modal-content {
    flex-direction: column;
    gap: 12px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    align-items: center;
    overflow: auto;
    position: absolute;
    left: 50%;
    transform: translate(-54%);
  }
  .modal-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-image {
    max-height: 55vh;
    height: auto;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
  }
  .modal-info {
    width: 100%;
    max-height: calc(100vh - 55vh - 32px);
    overflow: auto;
    background: var(--panel);
    padding: 16px;
    box-sizing: border-box;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
  }
  .modal-description {
    max-width: 680px;
  }
  .images img {
    height: 180px;
  }
}

/* small tweaks for accessibility */
.profile-link:focus {
  outline: 2px solid rgba(255, 255, 255, 0.06);
  outline-offset: 2px;
}

/* Mobile burger + drawer */
.burger-button {
  display: none;
  background: transparent;
  border: 0;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.burger-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.burger-icon::before,
.burger-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--text);
}
.burger-icon::before {
  top: -7px;
}
.burger-icon::after {
  top: 7px;
}

/* drawer overlay */
.mobile-drawer {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  align-items: flex-start;
  justify-content: flex-end;
}
.mobile-drawer.show {
  display: flex;
}
.mobile-drawer-content {
  width: 320px;
  max-width: 90vw;
  height: 100%;
  background: var(--panel);
  padding: 20px;
  box-sizing: border-box;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 220ms ease;
}
.mobile-drawer.show .mobile-drawer-content {
  transform: translateX(0%);
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.mobile-nav .profile-link {
  padding: 12px;
  border-radius: 8px;
}
.drawer-close {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  padding: 0;
  margin: 0 0 12px 0;
  cursor: pointer;
}

/* prevent body scroll when drawer open */
body.drawer-open {
  overflow: hidden;
}

/* show burger on small screens */
@media (max-width: 880px) {
  .burger-button {
    display: flex;
    position: absolute;
    right: 16px;
    top: 8px;
    z-index: 1200;
  }
}

/* Ensure no link appears selected */
.profile-link,
.profile-link:visited {
  color: var(--text);
}
.profile-link.active,
.profile-link[aria-current],
.profile-link[aria-current="true"] {
  background: transparent !important;
  transform: none !important;
}

/* Mobile brand inside drawer */
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  margin-top: 12px;
}
.mobile-drawer-content .site-title {
  font-size: 1.375rem;
}
