:root {
  --bg: #fafafa;
  --panel-bg: #ffffff;
  --text: #121212;
  --muted: #737373;
  --border: #dbdbdb;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.page-container {
  max-width: 935px;
  margin: 0 auto;
  background: var(--panel-bg);
  min-height: 100vh;
  box-sizing: border-box;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.profile-header {
  display: flex;
  align-items: center;
  padding: 40px 20px;
  gap: 50px;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  background: #262626;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: bold;
  flex-shrink: 0;
}

.profile-meta h1 {
  font-size: 1.75rem;
  font-weight: 300;
  margin: 0 0 15px 0;
}

.profile-meta .bio {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text);
}

/* ==========================================================================
   NAVIGATION FEED TABS
   ========================================================================== */
#feed-container {
  margin-top: 25px;
}

.feed-tabs {
  display: flex;
  justify-content: center;
  gap: 40px;
  border-top: 1px solid #dbdbdb;
  padding: 10px 0;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #8e8e8e;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.tab-btn:hover {
  color: #000;
}

.tab-btn.active {
  color: var(--text);
}

/* ==========================================================================
   VIEW TOGGLE MANAGEMENT
   ========================================================================== */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* ==========================================================================
   VIEW 1: GALLERY GRID LAYOUT
   ========================================================================== */
#grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0;
}

.grid-item {
  aspect-ratio: 1 / 1;
  position: relative;
  background: #efefef;
  overflow: hidden;
  display: block;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}

.grid-item img:hover {
  filter: brightness(0.85);
}

.text-fallback-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}

.text-fallback-card span {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   VIEW 2: CLASSIC INSTAGRAM FULL-WIDTH SCROLL LAYOUT
   ========================================================================== */
#scroll-view {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 0;
}

.scroll-post-wrapper {
  margin-bottom: 60px;
  display: block;
  text-decoration: none;
  color: var(--text);
}

.scroll-post-image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #efefef;
  overflow: hidden;
}

.scroll-post-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scroll-post-caption-area {
  padding: 16px 4px 0 4px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.scroll-post-username {
  font-weight: 700;
  margin-right: 6px;
}

.scroll-post-title {
  font-weight: 700;
}

.scroll-post-description {
  display: block;
  margin-top: 6px;
  color: #262626;
}

/* ==========================================================================
   VIEW 3: ALPHABETICAL TITLES LAYOUT
   ========================================================================== */
#list-view {
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

.alpha-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px 30px;
}

.alpha-recipe-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid #efefef;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.alpha-recipe-link:hover {
  color: var(--muted);
}

/* ==========================================================================
   RECIPE SINGLE VIEW AND UTILITIES
   ========================================================================== */
.minimal-nav {
  max-width: 600px;
  margin: 20px auto 0 auto;
  padding: 0 20px;
}

.minimal-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.single-recipe-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.recipe-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 10px 0 5px 0;
  letter-spacing: -1px;
}

.recipe-category-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
}

.vanity-hero-shot img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.step-number {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 12px 0 2px 0;
  padding: 0;
}

.action-bold {
  font-weight: 600;
  color: #000;
}

.arrow-instruction {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

.flow-text {
  font-size: 1.1rem;
  margin: 0;
  padding: 0;
}

.ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredient-list li {
  font-size: 1.1rem;
  padding: 0;
  margin: 0;
}

.ingredient-list li::before {
  content: "• ";
  color: var(--muted);
  margin-right: 5px;
}

.blueprint-gallery-section {
  margin-top: 40px;
  padding-top: 20px;
}

.blueprint-gallery-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.gallery-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 4px;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 2px;
}

.gallery-caption {
  font-size: 0.9rem;
  margin: 8px 0 0 0;
  color: #262626;
  line-height: 1.4;
}

/* ==========================================================================
   LIGHTBOX OVERLAY
   ========================================================================== */
.clickable-trigger {
  cursor: pointer;
  transition: opacity 0.2s;
}

.clickable-trigger:hover {
  opacity: 0.9;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* ==========================================================================
   ADMIN PANEL STYLES
   ========================================================================== */
.admin-wrapper {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.admin-form label {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-form input[type="text"],
.admin-form textarea,
.admin-form select,
.admin-form input[type="password"] {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.file-reference-box {
  background: #f4f4f5;
  padding: 15px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.btn-submit {
  background: #000;
  color: #fff;
  padding: 15px;
  border: none;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 10px;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
footer {
  text-align: center;
  max-width: 935px;
  margin: 60px auto 0 auto;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ==========================================================================
   MOBILE MEDIA CONTROLS
   ========================================================================== */
@media (max-width: 768px) {
  .profile-header {
    padding: 20px;
    gap: 20px;
  }
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
  .feed-tabs {
    gap: 40px;
  }
  .tab-btn {
    font-size: 1.3rem;
    padding: 10px 15px;
  }
  #grid-view {
    gap: 3px;
  }
  #scroll-view {
    padding: 0;
  }
  .scroll-post-wrapper {
    margin-bottom: 40px;
  }
  .scroll-post-caption-area {
    padding: 12px 15px 0 15px;
  }
  .alpha-links-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}
