/* Contenedor para las cards */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 2%;
    margin-top: 5%;
}

/* Cards */
.card {
    padding: 20px;
    background-color: var(--bg-accent);
    border-radius: 25px;
    box-shadow: 0 8px 10px 0 rgba(0, 0, 0, 0.5);
    min-width: min-content;
    margin: 1vh;
    text-align: center;
}

.medium-logo {
    width: 25vw;
    height: auto;
    margin: 25px auto;
}

.small-logo {
    max-width: 150px;
    min-width: 15vw;
    height: auto;
    margin: 25px auto;
}

#main-footer {
    display: flex;
}

#main-footer a {
    color: var(--accent);
}

#main-footer a:hover {
    color: var(--active);
}

#main-footer svg:hover {
    fill: var(--active);
}

#main-footer p {
    text-align: left;
}

/*Estilos del boton de cambio de tema*/
.theme-toggle {
    position: relative;
    display: block;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 60px;
    height: 30px;
    background-color: var(--bg-accent, #ccc);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.theme-toggle .toggle-circle {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 0;
    left: 0;
    background-color: var(--accent, #fff);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-toggle[data-theme="dark"] {
    background-color: var(--default, #333);
}

.theme-toggle[data-theme="dark"] .toggle-circle {
    transform: translateX(30px);
}

.theme-toggle .theme-icon {
    position: absolute;
    font-size: 16px;
    top: 7px;
    pointer-events: none;
}

.theme-toggle .theme-icon.sun {
    right: 10px;
    color: var(--attention, #f39c12);
}

.theme-toggle .theme-icon.moon {
    left: 10px;
    color: var(--attention, #f5f5f5);
}

/* Project mode tweaks */
.in-project .header { background-color: var(--bg-muted); }
.in-project .sidebar-left { background-color: rgba(255,255,255,0.03); }
.menu .project-link { color: var(--accent); }
.menu .project-link:hover { color: var(--active); }

/* Estilos generales */
.checkbox-label {
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}

.price-column {
    flex-wrap: nowrap;
    white-space: nowrap;
}

img {
    /*min-width: 20vw;*/
    /*max-width: 100%;*/
    height: auto;
}

section {
    display: flex;
    /*flex-wrap: wrap;*/
    gap: 1rem;
}

article {
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

article img {
    /*display: block;*/
    margin: 0 auto 1rem; /* Centrar la imagen y agregar espacio inferior */
    /*max-width: min(100%, 300px);*/
}

article h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

ul li {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* Ajustes de artículos para pantallas pequeñas */
@media (max-width: 768px) {
    section {
        flex-direction: column; /* Cambiar la orientación de los artículos */
    }

    article {
        flex: 1 1 100%;
    }

    article ul {
        padding-left: 0; /* Quitar sangría */
    }

    article ul li {
        font-size: 0.9rem; /* Ajustar el tamaño del texto */
    }
}

/* Ajustes de menú de base.html para pantallas pequeñas */
.menu {
    display: flex;
    z-index: 1;
    justify-content: center;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--default);
    cursor: pointer;
}

/* Responsive menu */
@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--bg-default);
        padding: 10px;
    }

    .menu.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* In-project: show hamburger menu when sidebar moves down (1024px) */
@media (max-width: 1024px) {
    .in-project .header .menu {
        display: none !important;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--bg-default);
        padding: 10px;
        z-index: 100;
    }

    .in-project .header .menu.show {
        display: flex !important;
    }

    .in-project .menu-toggle {
        display: block;
    }
}

/* Mobile sidebar menu - shown only in collapsed menu on small screens */
.mobile-sidebar-menu {
    display: none !important;
}

.mobile-sidebar-menu * {
    display: none !important;
}

/* In-project: show mobile sidebar menu at 1024px (when sidebar moves down) */
@media (max-width: 1024px) {
    .in-project .mobile-sidebar-menu {
        display: block !important;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .in-project .mobile-sidebar-menu * {
        display: revert !important;
    }

    .in-project .mobile-sidebar-menu li {
        display: list-item !important;
    }

    .in-project .mobile-sidebar-menu .sidebar-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--bd-radius);
        text-decoration: none;
        color: var(--default);
        background: var(--bg-muted);
        border: 1px solid var(--bd-muted);
        transition: background var(--tr-duration), border-color var(--tr-duration);
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .in-project .mobile-sidebar-menu .sidebar-btn:hover {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
    }

    .in-project .mobile-sidebar-menu .sidebar-btn.active {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

    .in-project .mobile-sidebar-menu .sidebar-icon {
        font-size: 1.1em;
    }
}

/* Non-project pages: show mobile sidebar menu at 768px */
@media (max-width: 768px) {
    .mobile-sidebar-menu {
        display: block !important;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .mobile-sidebar-menu * {
        display: revert !important;
    }

    .mobile-sidebar-menu li {
        display: list-item !important;
    }

    .mobile-sidebar-menu .sidebar-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--bd-radius);
        text-decoration: none;
        color: var(--default);
        background: var(--bg-muted);
        border: 1px solid var(--bd-muted);
        transition: background var(--tr-duration), border-color var(--tr-duration);
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .mobile-sidebar-menu .sidebar-btn:hover {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
    }

    .mobile-sidebar-menu .sidebar-btn.active {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

    .mobile-sidebar-menu .sidebar-icon {
        font-size: 1.1em;
    }
}

/* Overwrite matcha.css para convertir en 3 columnas.*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    max-width: 100vw;
    padding: 0;
    margin: 0;
    font-family: var(--ft), sans-serif;
    font-size: 16px;
    line-height: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.header, .footer {
    width: 100%;
    padding: 10px;
    text-align: center;
}

/* New header layout */
.header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}
.header-left { justify-self: start; }
.header-right { justify-self: end; display: flex; align-items: center; }
.header .menu { justify-content: center; }
.header-utilities { display: flex; gap: 10px; align-items: center; }

.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
}

/* User dropdown */
.user-dropdown { position: relative; }
.user-button { background: none; border: 1px solid var(--bd-muted); border-radius: 16px; padding: 4px 8px; color: var(--default); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.user-icon { font-size: 16px; }
.username { font-size: 0.9rem; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-default); border: 1px solid var(--bd-muted); border-radius: 6px; padding: 8px; display: none; z-index: 10; min-width: 140px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.dropdown-menu.open { display: block; }
.dropdown-menu a { text-decoration: none; }

.footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    border-top: 2px solid var(--bd-muted);
}

.contact-footer {
    width: 20%;
    border-right: 2px solid var(--bd-muted);
    margin-left: -1px;
}

.menu-footer {
    align-items: flex-end;
}

.aside-language {
    border-left: 0;
    width: 35%;
    margin-left: 0;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.5rem;
}

.language-switcher button.lang-btn {
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    opacity: 0.6;
}

.language-switcher button.lang-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

.language-switcher button.lang-btn--active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    opacity: 1;
}

.aside-climate-clock {
    border-left: 2px solid var(--bd-muted);
    /*width: 25%;*/
    /*width: 258px; Minimo para que se vea sin distorciones, mas pequeño ya no muestra el tamaño normal.*/
    width: 400px; /* A este tamaño se ven bien las letras en un monitor 2K.*/
    margin-left: 0;
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: 100vw;
}

.sidebar-left {
    flex-shrink: 0;
    width: 20%;
    padding: 0;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
}

.sidebar-right {
    width: 10%;
    padding: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 10px;
}

.main-content {
    order: 2;
}

.sidebar-left {
    order: 1;
    border-left: 0;
    /* El borde se dibuja con ::after para que el botón circular lo interrumpa */
}

/* Línea divisora interrumpida: empieza justo debajo del botón de colapso */
.sidebar-left::after {
    content: '';
    position: absolute;
    top: calc(1rem + 26px + 0.6rem); /* btn_top + btn_height + gap */
    right: -1px;
    bottom: 0;
    width: 2px;
    background-color: var(--bd-muted);
    pointer-events: none;
}

/* En móvil el sidebar apila verticalmente — no se necesita la línea vertical */
@media (max-width: 896px) {
    .sidebar-left::after { display: none; }
}

/* ── Sidebar toggle (círculo estilo Reddit, a caballo del borde sidebar/contenido) ── */
.sidebar-toggle {
    position: absolute;
    top: 1rem;
    left: calc(100% - 13px);
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    background: var(--background);
    border: 2px solid var(--bd-muted);
    border-radius: 50%;
    cursor: pointer;
    color: var(--muted);
    z-index: 20;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.sidebar-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-accent);
}

.sidebar-inner {
    flex: 1;
    padding: 0.75rem 0.5rem 0.75rem 0.75rem;
    overflow-y: auto;
    transition: opacity 0.15s ease;
}

/* ── Collapsed state ─────────────────────────────────────────────── */
body.sidebar-collapsed .sidebar-left {
    width: 1.75rem;
}

body.sidebar-collapsed .sidebar-inner {
    visibility: hidden;
    overflow: hidden;
    height: 0;
    padding: 0;
    pointer-events: none;
    flex: 0;
}

/* On mobile: hide toggle, always show full sidebar */
@media (max-width: 896px) {
    .sidebar-toggle { display: none; }
    body.sidebar-collapsed .sidebar-left { width: 100%; }
    body.sidebar-collapsed .sidebar-inner {
        visibility: visible;
        overflow: visible;
        height: auto;
        padding: 0.75rem;
        pointer-events: auto;
        flex: 1;
    }
}

/* ── Secciones contraíbles del sidebar ───────────────────────────── */
.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group .sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
    box-shadow: none;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-group .sidebar-group-toggle:hover {
    color: var(--text);
    background: var(--bg-accent);
    box-shadow: none;
}

.sidebar-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.sidebar-group.collapsed .sidebar-group-toggle .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-group-content {
    max-height: 800px;
    overflow: hidden;
    padding-right: 0.75rem;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}

.sidebar-group.collapsed .sidebar-group-content {
    max-height: 0;
    opacity: 0;
}

.sidebar-right {
    border-left: 2px solid var(--bd-muted);
    order: 3;
    padding-right: .2rem;
}

@media (max-width: 896px) {
    .content-wrapper {
        flex-direction: column;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .sidebar-left {
        order: 2;
        width: 100%;
        border-top: 4px solid var(--bd-muted);
        border-bottom: 1px solid var(--bd-muted);
        border-right: 1px solid var(--bd-muted);
    }

    .sidebar-right {
        order: 3;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        border-left: 1px solid transparent;
    }
}

/* Pinz mobile adjustments - ensure sidebar doesn't overlap content */
@media (max-width: 1024px) {
    .in-project .content-wrapper {
        flex-direction: column;
    }

    .in-project .main-content {
        order: 1;
        width: 100%;
    }

    .in-project .sidebar-left {
        order: 2;
        width: 100%;
        border-top: 4px solid var(--bd-muted);
        border-right: none;
    }
}

/* Fix: Sidebar menu should NOT inherit header menu's absolute positioning */
@media (max-width: 768px) {
    .sidebar-left .menu {
        display: block;
        position: static;
        width: auto;
        background: transparent;
        padding: 0;
        flex-direction: column;
    }

    .sidebar-left .sidebar-section {
        margin-bottom: 1rem;
    }
}

@media (max-width: 1080px) {
    #main-footer {
        flex-direction: column;
    }

    .contact-footer {
        width: 100%;
    }

    .aside-language {
        width: 100%;
    }

    /*.aside-climate-clock {*/
    /*    width: 50%;*/
    /*}*/
}

@media (max-width: 546px) {
    /*.aside-climate-clock {*/
    /*    width: 100%;*/
    /*}*/
    .menu-footer {
        align-items: flex-start;
    }
}

button {
    word-break: normal;
}

section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

/* Style the iframe */
.pure-image-iframe {
    border: none; /* Remove border */
    overflow: hidden; /* Hide scrollbars */
    width: 100%; /* Make it responsive */
    height: 90%; /* Maintain aspect ratio */
    aspect-ratio: 16 / 9; /* Adjust aspect ratio as needed */
    display: block;
    margin-bottom: 1rem;
}

.climate-clock-container {
    bottom: 0;
}

.article-image-file {
    max-width: 50%;
    height: auto;
}

/* Authentication buttons styles */
.auth-buttons {
}

.auth-item {
    margin: 0;
    padding: 0;
}

.auth-menu {
    flex-direction: row-reverse;
    display: flex;
}

.logout-form {
    margin: 0;
    padding: 0;
}

/* Project Inquiry Form Styles - More Compact Version */
.project-inquiry-form-container {
    background-color: var(--bg-accent);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-inquiry-form-container h2 {
    color: var(--accent);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.project-inquiry-form-container p {
    margin-bottom: 10px;
    color: var(--default);
    font-size: 0.8rem;
}

.project-inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-inquiry-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.project-inquiry-form label {
    margin-bottom: 2px;
    font-weight: bold;
    color: var(--default);
    font-size: 0.9rem;
}

.project-inquiry-form input[type="text"],
.project-inquiry-form input[type="email"] {
    padding: 6px 8px;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    font-size: 0.9rem;
}

.project-inquiry-form .project-textarea {
    padding: 6px 8px;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    min-height: 80px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.project-inquiry-form .form-error {
    color: var(--danger);
    font-size: 0.7rem;
    margin-top: 2px;
}

.project-inquiry-form .form-actions {
    margin-top: 8px;
}

.project-inquiry-form .btn-submit {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

/* Responsive styles for the form */
@media (min-width: 768px) {
    .project-inquiry-form-container {
        padding: 15px 20px;
    }
    
    /* Create a two-column layout for wider screens */
    .project-inquiry-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 10px;
    }
    
    .project-inquiry-form .message-group {
        grid-column: span 2;
    }
    
    .project-inquiry-form .form-actions {
        grid-column: span 2;
        display: flex;
        justify-content: flex-end;
    }
}

/* Project Inquiry Button Styles */
.sidebar-section {
    margin: 20px 0;
    padding: 10px;
    text-align: center;
}

.inquiry-button {
    display: block;
    text-decoration: none;
    margin-bottom: 15px;
}

.inquiry-button button {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.inquiry-button button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Make sure the button is visible on all screen sizes */
@media (max-width: 896px) {
    .sidebar-section {
        margin: 15px 0;
    }
    
    .inquiry-button button {
        padding: 10px;
        font-size: 0.9rem;
    }
}

.bitcoin-symbol {
    font-size: 1.5rem;
    color: orange;
}

/* Spacing for donation labels and addresses to avoid collision */
/* Spacing and layout for donation addresses */
.donation-section .address-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.donation-section strong {
    margin-right: 0.35em;
}

.donation-section code {
    margin-left: 0.1em;
}

/* Copy button styling */
.donation-section .copy-btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    cursor: pointer;
}

.donation-section .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.donation-section .copy-btn.copied {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Override reemplazar fondo de tablas en matcha */
tbody > tr:nth-child(2n) {
    background: var(--bg-muted)
}

th {
    background-color: var(--bg-accent);
}

td {
    padding: .375rem .8125rem;
    border: 1px solid var(--bd-muted);
    background-color: var(--bg-default);
}

/* Styles to override matcha.css forms with background and borders */
.mini-form {
    background-color: var(--bg-default);
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* Styles to override matcha.css labels margin */
label {
    margin: 0;
}

.form-row {
    margin-bottom: 1rem;
}

/* =============================================
   BITCOIN / LIGHTNING ADDRESS CARDS
   ============================================= */

.donation-section {
    border: 1px solid var(--bd-muted);
    border-radius: 9px;
    padding: 12px;
    background: var(--bg-accent);
}

.btc-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f7931a;   /* Bitcoin orange */
    margin: 0 0 2px;
    font-family: monospace;
}

.btc-section-sub {
    font-size: 0.75rem;
    opacity: 0.65;
    margin: 0 0 10px;
    line-height: 1.4;
}

.btc-address-card {
    border: 1px solid var(--bd-muted);
    border-radius: 7px;
    padding: 10px;
    margin: 6px 0 0;
    background: var(--bg-default);
    transition: border-color 0.18s;
}
.btc-address-card:hover {
    border-color: rgba(247, 147, 26, 0.35);
}

.btc-addr-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.btc-addr-icon {
    font-size: 0.95rem;
    color: #38bdf8;   /* Lightning = cyan */
}
.btc-addr-icon.btc-orange { color: #f7931a; }

.btc-addr-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
    font-family: monospace;
}

.btc-addr-value {
    display: block;
    font-size: 0.72rem;
    word-break: break-all;
    line-height: 1.45;
    margin-bottom: 8px;
    opacity: 0.8;
}

.btc-addr-actions {
    display: flex;
    gap: 5px;
}

.btc-qr-btn,
.btc-addr-actions .copy-btn {
    flex: 1;
    padding: 4px 6px;
    font-size: 0.72rem;
    border: 1px solid var(--bd-muted);
    border-radius: 5px;
    background: var(--bg-muted);
    color: var(--default);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-align: center;
}

.btc-qr-btn:hover {
    border-color: rgba(247, 147, 26, 0.5);
    background: rgba(247, 147, 26, 0.07);
    color: #f7931a;
}

.btc-addr-actions .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btc-addr-actions .copy-btn.copied {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* =============================================
   QR CODE MODAL
   ============================================= */

.qr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.qr-modal-overlay.active {
    display: flex;
}

.qr-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 20px;
    text-align: center;
    max-width: 270px;
    width: 88%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    animation: qr-modal-in 0.18s ease;
}
@keyframes qr-modal-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.qr-modal-close {
    position: absolute;
    top: 8px; right: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #555;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}
.qr-modal-close:hover { background: rgba(0,0,0,0.1); }

.qr-modal-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #222;
    margin: 0 0 14px;
}

#qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
#qr-container canvas,
#qr-container img {
    display: block;
    border-radius: 6px;
}

.qr-modal-addr {
    font-size: 0.58rem;
    word-break: break-all;
    color: #777;
    margin: 10px 0 0;
    font-family: monospace;
    line-height: 1.5;
}

/* ── Pinned Apps sidebar section ──────────────────── */
.pinned-apps-section {
    padding-bottom: 0.25rem;
}
.pinned-apps-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #38bdf8;
    font-family: monospace;
    margin: 0 0 0.6rem 0;
    opacity: 0.85;
}
.pinned-apps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pinned-app-item {
    margin: 0;
}
.pinned-app-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--default);
    transition: background 0.15s;
    overflow: hidden;
}
.pinned-app-link:hover {
    background: rgba(56, 189, 248, 0.08);
    text-decoration: none;
    color: #38bdf8;
}
.pinned-app-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.pinned-app-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.pinned-app-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ── Pin project button ─────────────────────────── */
.pin-project-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 6px;
    color: inherit;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 2px;
}
.pin-project-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}
.pin-project-btn.pinned {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   NAVIGATION — Glass-pill redesign
   ═══════════════════════════════════════════════════ */

/* Container — structural only, no theme colors here */
header #menu {
    display: flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.28rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 100px;
    list-style: none;
    margin: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Each nav item */
header #menu > li:not(.mobile-only):not(.project-nav-intro) {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav link — structural base, no color defined here */
header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    display: inline-flex;
    align-items: center;
    padding: 0.36rem 0.88rem;
    border-radius: 100px;
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: color 0.18s, background 0.18s, border-color 0.18s,
                box-shadow 0.18s, transform 0.15s;
    white-space: nowrap;
    position: relative;
}

/*
 * Theme-specific link colors — explicit [data-color-scheme] selectors.
 * Specificity: (1,3,3) — beats any broad article CSS without needing !important.
 */
[data-color-scheme="dark"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    color: rgba(238, 244, 251, 0.87);
}
[data-color-scheme="light"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    color: rgba(10, 20, 40, 0.80);
}

/* Hover — shared geometry */
header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    background: rgba(56, 189, 248, 0.09);
    border-color: rgba(56, 189, 248, 0.26);
    text-decoration: none;
    transform: translateY(-1px);
}
/* Hover — dark mode color */
[data-color-scheme="dark"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    color: #38bdf8;
}
/* Hover — light mode color and tint */
[data-color-scheme="light"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.22);
}

/* Active / selected — gradient fill, same in both themes */
header #menu > li.selected > a,
header #menu > li.selected > a:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    color: #05101c;
    font-weight: 700;
    border-color: transparent;
    transform: none;
    text-decoration: none;
    box-shadow:
        0 0 20px rgba(56, 189, 248, 0.5),
        0 2px 14px rgba(129, 140, 248, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Light mode — container and selected glow adjustments */
[data-color-scheme="light"] header #menu {
    background: rgba(10, 20, 35, 0.04);
    border-color: rgba(10, 20, 35, 0.1);
}
[data-color-scheme="light"] header #menu > li.selected > a {
    box-shadow:
        0 0 16px rgba(56, 189, 248, 0.35),
        0 2px 10px rgba(129, 140, 248, 0.25);
}

/* Mobile — vertical layout */
@media (max-width: 768px) {
    header #menu {
        display: none;           /* Oculto por defecto en móvil */
        border-radius: 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.45rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(6, 12, 24, 0.96);
        border-color: rgba(56, 189, 248, 0.18);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    header #menu.show {
        display: flex;           /* Visible cuando JS añade .show */
    }
    header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
        border-radius: 9px;
        padding: 0.58rem 1rem;
        font-size: 0.92rem;
        justify-content: flex-start;
    }
    header #menu > li.selected > a {
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
    }
    [data-color-scheme="light"] header #menu {
        background: rgba(245, 248, 255, 0.97);
    }
}


/* =========================================================
   BLOG SYSTEM STYLES
   ========================================================= */

/* --- Tag chips --- */
.tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    border: 2px solid var(--tag-color, #6c757d);
    color: var(--tag-color, #6c757d);
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}
.tag-chip:hover,
.tag-chip--active {
    background: var(--tag-color, #6c757d);
    color: #fff;
}
.tag-chip--small {
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
}
.tag-chip--manage {
    border-color: #888;
    color: #888;
}

/* --- Blog section — stack everything vertically --- */
.blog-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- Blog header --- */
.blog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* --- Tag chip nav bar --- */
.blog-tag-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.blog-tag-description {
    opacity: 0.75;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* --- Blog grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* --- Blog card --- */
.blog-card {
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.blog-card:hover {
    box-shadow: 0 4px 24px rgba(124,58,237,0.15);
    transform: translateY(-2px);
}
.blog-card__thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.blog-card__thumbnail-iframe {
    height: 180px;
    overflow: hidden;
}
.blog-card__thumbnail-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}
.blog-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}
.blog-card__title {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.3;
}
.blog-card__title a {
    text-decoration: none;
    color: inherit;
}
.blog-card__title a:hover {
    color: var(--accent, #7c3aed);
}
.blog-card__desc {
    font-size: 0.88rem;
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}
.blog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
}
.blog-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    opacity: 0.7;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}
.blog-card__read-more {
    color: var(--accent, #7c3aed);
    text-decoration: none;
    font-weight: 500;
}

/* --- Blog empty --- */
.blog-empty {
    width: 100%;
    text-align: center;
    opacity: 0.6;
    padding: 3rem 0;
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}
.pagination-link {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.pagination-link:hover {
    background: var(--accent, #7c3aed);
    color: #fff;
    border-color: transparent;
}
.pagination-info {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* --- Article detail --- */
.article-section {
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}
/* Override matcha.css article card styles within article detail */
.article-section article.article-body {
    flex: none;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
}
.article-section article.article-body > header:first-child {
    padding: 0;
    border-bottom: none;
    margin: 0 0 1rem;
}
.article-section article.article-body > footer:last-child {
    padding: 0;
    border-top: none;
    margin: 0;
}
.article-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.article-header {
    margin-bottom: 1.5rem;
}
.article-header h1 {
    margin-bottom: 0.5rem;
}
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.article-figure {
    margin: 1rem 0;
}
.article-image {
    max-width: 100%;
    border-radius: 8px;
}
.article-content {
    line-height: 1.8;
}
.article-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, rgba(255,255,255,0.12));
    font-size: 0.9rem;
    opacity: 0.8;
}
.back-link {
    text-decoration: none;
    color: inherit;
}
.back-link:hover {
    color: var(--accent, #7c3aed);
}

/* --- Code block copy button --- */
.article-content pre {
    position: relative;
    padding-right: 3.5rem; /* reserve space so code text doesn't slide under the copy button */
}

/*
 * Base = dark mode default. Specificity (0,1,0) beats matcha's `button` (0,0,1)
 * so no !important needed — class selector always wins over element selector.
 */
.code-copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-family: inherit;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    z-index: 2;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}
.code-copy-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.5);
}
.code-copy-btn.copied {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.15);
}

/* Light mode — specificity (0,2,0), beats matcha's [data-color-scheme] + element */
[data-color-scheme="light"] .code-copy-btn {
    background: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}
[data-color-scheme="light"] .code-copy-btn:hover {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.4);
}

/* --- Attribution footer --- */
.swd-attribution-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
}
.swd-attribution-footer hr {
    margin-bottom: 0.75rem;
}

/* --- Create/Edit article --- */
.create-article-section {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Tag manage --- */
.tag-manage-section { max-width: 860px; margin: 0 auto; }
.tag-manage-section table th,
.tag-manage-section table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    font-size: 0.9rem;
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
    /* Hide navigation, sidebar, header, footer */
    header, aside, .sidebar-left, footer,
    .article-actions, .blog-tag-chips, .back-link,
    #menu-toggle, .header-utilities,
    .blog-card__read-more, .blog-pagination {
        display: none !important;
    }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }

    .swd-attribution-footer {
        display: block !important;
        border-top: 2px solid #000;
        padding-top: 1rem;
        page-break-inside: avoid;
        opacity: 1;
        color: #000;
    }

    .article-content {
        max-width: 100%;
    }

    body::after {
        content: "Source: smart-web-dev.com";
        display: block;
        text-align: center;
        font-size: 9pt;
        color: #666;
        margin-top: 2rem;
    }

    a[href]::after {
        content: none;
    }
}
