:root {
    --primary: #5F4B8B;
    --secondary: #45B8AC;
    --accent: #FF6F61;
    --background: #F5F3F7;
    --text: #3D3D3D;
    --gradient: linear-gradient(135deg, #5F4B8B 0%, #45B8AC 100%);
    --shadow: 0 8px 32px rgba(95, 75, 139, 0.1);
}


body {
    background: var(--background);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    margin: 0;
}


.main-header {
background: var(--gradient);
padding: 1.5rem 2rem;
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 1000;
}

.header-content {
max-width: 1400px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 1.5rem;
}

.brand-logo {
display: flex;
align-items: center;
gap: 1rem;
text-decoration: none;
}

.logo-icon {
width: 60px;
height: 60px;
border-radius: 80%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow);
overflow: hidden;
}

.logo-icon img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}

.logo-text {
color: white;
font-size: 1.8rem;
font-weight: 600;
margin: 0;
display: flex;
align-items: center;
gap: 0.5rem;
}

.header-divider {
font-weight: 400;
opacity: 0.8;
}


.wiki-container {
display: grid;
grid-template-columns: 300px 1fr;
gap: 40px;
max-width: 1400px;
margin: 0 auto;
padding: 40px 20px;
}


.search-wrapper {
    position: relative;
    margin: 2rem 0;
}

.search-input {
    width: 70%;
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
}


.wiki-nav {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 120px;
    height: fit-content;
}

.nav-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.nav-title {
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 1rem 0;
    position: relative;
}

.nav-link {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: rgba(69, 184, 172, 0.1);
    transform: translateX(10px);
}

.nav-link.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow);
}
.nav-menu > .nav-item[data-hidden="true"] {
    display: none !important;
}

.load-more {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.load-more:hover {
    transform: translateY(3px);
    background: var(--accent);
}

.load-more.hidden {
    display: none;
}

.main-content {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
}


.info-card {
    background: rgba(245, 243, 247, 0.8);
    border-left: 4px solid var(--secondary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.info-card:hover {
    transform: translateY(-3px);
}

.warning-box {
    background: #FFF3F0;
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.content-item {
    background: var(--background);
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.content-item:hover {
    transform: translateY(-5px);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

.grid-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}


.tab-container {
    margin: 2rem 0;
}

.tab-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--primary);
}

.tab-button {
    padding: 1rem 2rem;
    border: none;
    background: none;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.tab-content {
    display: none;
    padding: 2rem 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.styled-table th,
.styled-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(95, 75, 139, 0.1);
}

.styled-table th {
    background: var(--primary);
    color: white;
}


.timeline {
    position: relative;
    margin: 2rem 0;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--secondary);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid white;
}


.feature-highlight {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.feature-highlight::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 25%,
        rgba(95, 75, 139, 0.05) 50%,
        transparent 75%);
    animation: shine 6s infinite linear;
}

@keyframes shine {
    from { transform: translateX(-50%) rotate(45deg); }
    to { transform: translateX(50%) rotate(45deg); }
}

.contributors-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.contributor-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.contributor-card:hover {
    transform: translateY(-5px);
}

.contributor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 3px solid var(--secondary);
}

.code-snippet {
    background: var(--primary);
    color: white;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    position: relative;
    margin: 2rem 0;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    background: #efe8ff;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 45px rgba(95, 75, 139, 0.2);
}

.gallery-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1rem 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.image-caption {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.image-description {
    font-size: 0.9rem;
    opacity: 0.8;
}


@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.image-loading {
    background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear;
}


.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}


   .large-gallery-item {
    grid-column: span 3;
  }
  

.large-gallery-item .gallery-image {
    height: 200px;           
    object-fit: contain;      
    transition: transform 0.5s ease;
  }
  

  .large-gallery-item:hover .gallery-image {
    transform: scale(1.02);   
  }
  

  .large-gallery-item .image-overlay {
    padding: 1.5rem 1rem 0.5rem;
  }
  
  

.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-lightbox:hover {
    transform: rotate(90deg);
}


.tab-content .content-item ul li a {
color: var(--primary);
text-decoration: none;
list-style: none;
font-weight: 500;
transition: 
color 0.3s ease, 
transform 0.2s ease;
}


.tab-content .content-item ul li a:hover {
color: var(--accent);
text-decoration: underline;
transform: translateX(4px);
}


.tab-content .content-item ul li a:focus {
outline: none;
box-shadow: 0 0 0 3px var(--secondary);
border-radius: 4px;
}


.tab-content .content-item ul li a:visited {
color: var(--secondary);
}


.tab-content .content-item ul li a::before {
content: "\f0ed"; 
font-family: "Font Awesome 5 Free";
font-weight: 900;
margin-right: 0.5rem;
color: var(--secondary);
transition: color 0.3s ease;
}
.tab-content .content-item ul li a:hover::before {
color: var(--accent);
}












/* ─── Index Main ─────────────────────────────────────────────────────────── */
.index-main {
    display: flex;
    flex-direction: column;
    gap: 4rem;
  }
  
  /* Hero */
  .hero {
    background: var(--gradient);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
  }
  .hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  .hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }
  .hero .btn-primary {
    background: white;
    color: var(--primary);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
  }
  .hero .btn-primary:hover {
    background: var(--accent);
    color: white;
  }
  
  /* Features */
  .features {
    text-align: center;
  }
  .features h3 {
    color: var(--primary);
    margin-bottom: 2rem;
    font-size: 2rem;
  }
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
  }
  .feature-item {
    background: white;
    border: 1px solid rgba(95,75,139,0.1);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .feature-item i {
    color: var(--secondary);
    margin-bottom: 1rem;
  }
  .feature-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
  }
  .feature-item p {
    font-size: 0.95rem;
    opacity: 0.8;
  }
  .feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(69,184,172,0.1);
  }
  
  /* Trending */
  .trending {
    background: var(--background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
  }
  .trending h3 {
    color: var(--primary);
    margin-bottom: 1rem;
  }
  .trending-list {
    list-style: none;
    padding: 0;
  }
  .trending-list li {
    margin: 0.75rem 0;
  }
  .trending-list a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
  }
  .trending-list a:hover {
    color: var(--accent);
    transform: translateX(4px);
  }
  
  /* Join (Sign-Up) */
  .join-section {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
  }
  .join-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
  }
  .join-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
  }
  .join-form input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--secondary);
    border-radius: 50px;
    width: 200px;
  }
  .join-form .btn-secondary {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  .join-form .btn-secondary:hover {
    background: var(--accent);
  }
  
  /* Newsletter */
  .newsletter {
    background: var(--background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
  }
  .newsletter h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
  }
  .newsletter-form {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  .newsletter-form input {
    padding: 0.8rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 50px;
    width: 250px;
  }
  .newsletter-form .btn-primary {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
  }
  
  /* Footer CTA */
  .footer-cta {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
  }
  .footer-cta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
  }
  .footer-cta a:hover {
    text-decoration: underline;
  }

  





















  /* ─── Upload Form ─────────────────────────────────────────────────────────── */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border: 1px solid rgba(95,75,139,0.1);
    border-radius: 1rem;
    box-shadow: var(--shadow);
  }
  
  .upload-form .form-group {
    display: flex;
    flex-direction: column;
  }
  
  .upload-form label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
  }
  
  .upload-form input,
  .upload-form select,
  .upload-form textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--secondary);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  
  .upload-form input:focus,
  .upload-form select:focus,
  .upload-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,111,97,0.2);
  }
  
  .upload-form button.btn-primary {
    align-self: flex-start;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
  }
  
  .upload-form button.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
  }
  
  /* ─── Your Uploads Table ─────────────────────────────────────────────────── */
  .your-uploads {
    margin-top: 1rem;
    overflow-x: auto;
  }
  
  .your-uploads .styled-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  
  .your-uploads th,
  .your-uploads td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(95,75,139,0.1);
  }
  
  .your-uploads th {
    background: var(--primary);
    color: white;
    font-weight: 600;
  }
  
  .your-uploads tbody tr:nth-child(even) {
    background: var(--background);
  }
  
  .your-uploads tbody tr:hover {
    background: rgba(69,184,172,0.1);
  }
  
  .your-uploads .btn-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary);
    font-size: 1rem;
    transition: color 0.3s ease;
  }
  
  .your-uploads .btn-action:hover {
    color: var(--accent);
  }

  
  /* ─── Header: subtitle & responsive ───────────────────────────────────────── */
.logo-text {
    font-size: 1.6rem;              
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  
  .logo-text small.logo-subtitle {
    font-size: 1rem;                
    font-weight: 400;
    opacity: 0.8;
    display: block;
  }
  
 
  @media (max-width: 600px) {
    .logo-text {
      font-size: 1.3rem;
    }
    .logo-text small.logo-subtitle {
      font-size: 0.85rem;
    }
  }
  
  
  .main-header .header-content {
    align-items: center;
  }
  
  
  .brand-logo {
    gap: 0.75rem;
  }
  











/* ─── Modal Overlay & Content ───────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;               /* se activa con .active o inline style */
    align-items: center;
    justify-content: center;
    z-index: 2000;
  }
  .modal-content {
    background: white;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    animation: fadeIn 0.3s ease;
  }
  .close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
  }
  .close-button:hover {
    color: var(--accent);
    transform: rotate(90deg);
  }
  
  /* ─── Modal Form ──────────────────────────────────────────────────────────── */
  #edit-form .form-group {
    margin-bottom: 1rem;
  }
  #edit-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
  }
  #edit-form input,
  #edit-form select,
  #edit-form textarea {
    width: 90%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--secondary);
    border-radius: 0.5rem;
    background: var(--background);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  #edit-form input:focus,
  #edit-form select:focus,
  #edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,111,97,0.2);
  }
  #edit-form button.btn-success {
    background: var(--secondary);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
  }
  #edit-form button.btn-success:hover {
    background: var(--accent);
    transform: translateY(-2px);
  }
  
  /* ─── Table Action Buttons ───────────────────────────────────────────────── */
  .your-uploads .btn-action {
    background: var(--background);
    border: 1px solid var(--secondary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  }
  .your-uploads .btn-action:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
  }
  .your-uploads .btn-action + .btn-action {
    margin-left: 0.5rem;
  }
  


  /* Confirm / Alert Modal overrides */
#confirm-modal .btn-primary,
#alert-modal   .btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}
#confirm-modal .btn-primary:hover,
#alert-modal   .btn-primary:hover {
  background: var(--primary);
}

#confirm-modal .btn-secondary {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.3s ease;
}
#confirm-modal .btn-secondary:hover {
  background: rgba(69,184,172,0.1);
}

/* -----------------------------------
   MEDIA QUERIES COMPLETAS
   • XL (≤1200px)
   • L  (≤992px)
   • M  (≤768px)
   • “LOGO” (≤600px)
   • S  (≤576px)
   • XS (≤400px)
----------------------------------- */

/* ── XL (≤1200px) ───────────────────────────────────────── */
@media (max-width: 1200px) {
  .wiki-container {
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    padding: 30px 15px;
  }
  .header-content {
    padding: 1rem;
  }
  .logo-icon {
    width: 50px;
    height: 50px;
  }
  .logo-text {
    font-size: 1.6rem;
  }
  .search-input {
    width: 80%;
  }
}

/* ── L (≤992px) ────────────────────────────────────────── */
@media (max-width: 992px) {
  .wiki-container {
    display: flex;
    flex-direction: column;
  }
  .wiki-nav {
    display: block;
    position: relative;
    top: 0;
    margin: 1rem auto 2rem;
    width: 95%;
    max-width: 600px;
  }
  .main-header {
    padding: 1rem;
  }
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-link {
    padding: 0.8rem 1rem;
  }
  .search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
  }
  .hero h2 {
    font-size: 2.2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* ── M (≤768px) ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* evitar overflow horizontal */
  html, body {
    overflow-x: hidden;
  }
  /* contenedores full width */
  *, *::before, *::after {
    box-sizing: border-box;
  }
  .wrapper,
  .main-content,
  .tab-container,
  .tab-content {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  /* navegación compacta vertical fija bajo el header */
  .main-header + .wiki-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(1.5rem + var(--header-height, 0));
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 360px;
    padding: 0.5rem;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow-y: auto;
    max-height: 40vh;
  }
  .wiki-nav .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
  }
  .wiki-nav .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
    white-space: normal;
  }

  /* contenedor principal compacto */
  .wiki-container {
    width: 95%;
    max-width: 360px;
    margin: 4rem auto 1rem;
    padding: 0;
  }
  .main-content {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 2rem;
  }

  /* listas como tarjetas verticales */
  .trending-list li,
  .tab-content .content-item ul li {
    background: white;
    margin-bottom: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    list-style: none;
  }
  .trending-list a,
  .tab-content .content-item ul li a {
    display: block;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
  }
  .trending-list a:hover,
  .tab-content .content-item ul li a:hover {
    color: var(--accent);
    transform: translateX(3px);
  }

  /* tabs en columna y contenido con scroll */
  .tab-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    border-bottom: none;
    margin-bottom: 1rem;
    padding: 0 1rem;
  }
  .tab-button {
    width: 100%;
    text-align: left;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(245,243,247,0.8);
    transition: background 0.3s ease;
  }
  .tab-button:not(.active):hover {
    background: rgba(69,184,172,0.1);
  }
  .tab-button.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow);
  }
  .tab-content {
    display: block !important;
    padding: 1rem;
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
    max-height: 60vh;
    overflow-y: auto;
    margin: 0 1rem;
  }
  .tab-content:not(.active) {
    display: none !important;
  }
}

/* ── “LOGO” (≤600px) ─────────────────────────────────────── */
@media (max-width: 600px) {
  .logo-text {
    font-size: 1.3rem;
  }
  .logo-text small.logo-subtitle {
    font-size: 0.85rem;
  }
}

/* ── S (≤576px) ────────────────────────────────────────── */
@media (max-width: 576px) {
  body {
    font-size: 0.9rem;
  }
  .hero h2 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 0.9rem;
  }
  .hero .btn-primary {
    padding: 0.6rem 1.5rem;
  }
  .features h3,
  .trending h3,
  .join-section h3,
  .newsletter h3 {
    font-size: 1.5rem;
  }
  .upload-form input,
  .upload-form select,
  .upload-form textarea {
    width: 100%;
  }
  .your-uploads .styled-table {
    font-size: 0.85rem;
  }
  .gallery-image,
  .grid-item img {
    height: 150px;
  }
  .info-card,
  .feature-item,
  .content-item {
    padding: 1rem;
  }
  .load-more {
    padding: 0.6rem;
    font-size: 0.85rem;
  }
}

/* ── XS (≤400px) ───────────────────────────────────────── */
@media (max-width: 400px) {
  :root {
    --primary: #6A57A0;
    --secondary: #3EA29F;
    --accent: #FF7F69;
  }
  .main-header {
    padding: 0.5rem;
  }
  .logo-text {
    font-size: 1.2rem;
  }
  .logo-text small.logo-subtitle {
    font-size: 0.75rem;
  }
  .search-input {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
  }
  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  .copy-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}
